:root {
  --color-1: #14213d;
  --color-2: #f5efe0;
  --color-1-rgb: 20, 33, 61;
  --color-2-rgb: 245, 239, 224;
  --page-max-width: 1060px;
  --page-gutter: clamp(12px, 2.4vw, 28px);
  --control-size: clamp(32px, 3.2vw, 38px);
  --code-block-bg: #f8f8f6;
  --code-block-border: #d9dbde;
  --code-block-fg: #111317;
  --hover-fade-duration: 180ms;
  --hover-fade-ease: ease;
  --reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --section-reveal-duration: 300ms;
  --section-reveal-step: 85ms;
  --card-reveal-duration: 280ms;
  --card-reveal-step: 45ms;
  --content-reveal-duration: 240ms;
  --chunk-reveal-duration: 150ms;
  --page-enter-duration: 200ms;
  --theme-swap-duration: 260ms;
  --theme-swap-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme-mode="night"] {
  --code-block-bg: #101216;
  --code-block-border: #2f343e;
  --code-block-fg: #f3f5f8;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--color-2);
  background: var(--color-2);
}

::selection {
  background: var(--color-1);
  color: var(--color-2);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: clamp(0.96rem, 0.26vw + 0.9rem, 1.02rem);
  color: var(--color-1);
  line-height: 1.65;
  background-color: var(--color-2);
  background: var(--color-2);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--color-2);
  background: var(--color-2);
}

/*
  Safari 26 (macOS/iOS/iPadOS 26) ignores <meta name="theme-color"> and instead
  samples the browser chrome from a position:fixed, full-width, ≥6px-tall
  element pinned to the top of the viewport (falling back to the body
  background otherwise). This strip provides that sample. It sits behind the
  sticky site header (z-index:1 < .site-header z-index:10) so it is visually
  invisible at scroll-top, and a scroll-driven animation slides it offscreen
  once the user scrolls so it never covers content.
  See: https://grooovinger.com/notes/2026-02-27-safari-26-header-background
*/
.safari-theme-color {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background-color: var(--color-2);
  pointer-events: none;
  z-index: 1;
  animation-name: safari-theme-color-hide;
  animation-timeline: scroll();
  animation-fill-mode: both;
  animation-range-start: 10px;
  animation-range-end: 11px;
  animation-duration: 0.1s;
}

@keyframes safari-theme-color-hide {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100px);
  }
}

/*
  Pin the View Transitions root crossfade to the SAME duration and easing as
  our theme-swap CSS transition (`--theme-swap-duration` / `--theme-swap-ease`).
  Without this, the browser uses its own default timing (~250ms ease) for the
  snapshot crossfade while `.safari-theme-color` (and every other element under
  `body.theme-animating *`) fades its background-color over 260ms with our
  custom cubic-bezier — producing a small visible drift between the page
  background the user sees and the Safari 26 chrome color sampled from the
  live strip. Matching timings keeps the chrome 1:1 with the page throughout
  the swap.

  Scoped via :has(body.theme-animating) so it ONLY affects the theme-swap
  view transition, not the page-navigation view transitions started from
  js/transitions.js.
*/
:root:has(body.theme-animating)::view-transition-old(root),
:root:has(body.theme-animating)::view-transition-new(root) {
  animation-duration: var(--theme-swap-duration);
  animation-timing-function: var(--theme-swap-ease);
}

a {
  color: inherit;
  overflow-wrap: anywhere;
}

img,
svg,
video,
iframe,
canvas {
  max-width: 100%;
}

img,
video,
iframe {
  height: auto;
}

h1,
h2,
h3 {
  line-height: 1.22;
}

h1 {
  font-size: clamp(1.5rem, 3.6vw, 2.2rem);
}

h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.72rem);
}

h3 {
  font-size: clamp(1.08rem, 1.6vw, 1.32rem);
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 8px;
  z-index: 100;
  padding: 6px 10px;
  border: 1px solid var(--color-1);
  background: var(--color-2);
  color: var(--color-1);
  text-decoration: none;
  transition: top var(--hover-fade-duration) var(--hover-fade-ease), background-color var(--hover-fade-duration) var(--hover-fade-ease), color var(--hover-fade-duration) var(--hover-fade-ease);
}

.skip-link:focus-visible {
  top: 8px;
  background: var(--color-1);
  color: var(--color-2);
}

.wrap {
  width: min(var(--page-max-width), calc(100vw - (2 * var(--page-gutter))));
  max-width: 100%;
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--color-2);
  background: var(--color-2);
}

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: clamp(6px, 1.2vw, 10px) 0;
  min-height: 44px;
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 540px;
  min-width: 0;
  gap: 7px 10px;
  flex-wrap: wrap;
}

.theme-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
}

.nav-toggle {
  display: none;
  font-size: 1.08rem;
  line-height: 1;
}

.brand {
  display: inline-block;
  padding: 3px 5px;
  background: var(--color-1);
  color: var(--color-2);
  border: 1px solid var(--color-1);
  font-weight: 700;
  font-size: inherit;
  text-decoration: none;
  transition: background-color var(--hover-fade-duration) var(--hover-fade-ease), color var(--hover-fade-duration) var(--hover-fade-ease), border-color var(--hover-fade-duration) var(--hover-fade-ease), box-shadow var(--hover-fade-duration) var(--hover-fade-ease);
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
  gap: 8px;
}


.site-nav a {
  text-decoration: none;
  padding: 3px 5px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 0;
  transition: background-color var(--hover-fade-duration) var(--hover-fade-ease), color var(--hover-fade-duration) var(--hover-fade-ease), border-color var(--hover-fade-duration) var(--hover-fade-ease), box-shadow var(--hover-fade-duration) var(--hover-fade-ease);
}

.site-nav a[aria-current="page"],
.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--color-1);
  color: var(--color-2);
  border-color: var(--color-1);
}

.theme-toggle {
  width: var(--control-size);
  height: var(--control-size);
  padding: 0;
  border: 1px solid rgba(var(--color-1-rgb), 0.36);
  border-radius: 0;
  background: rgba(var(--color-2-rgb), 0.9);
  color: var(--color-1);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--hover-fade-duration) var(--hover-fade-ease), color var(--hover-fade-duration) var(--hover-fade-ease), border-color var(--hover-fade-duration) var(--hover-fade-ease), box-shadow var(--hover-fade-duration) var(--hover-fade-ease);
}

.theme-toggle:hover {
  background: var(--color-1);
  color: var(--color-2);
  border-color: var(--color-1);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-1);
  outline-offset: 2px;
}

.nav-toggle[aria-expanded="true"] {
  background: var(--color-1);
  color: var(--color-2);
  border-color: var(--color-1);
}

.theme-reroll {
  font-size: 0.95rem;
}

body.theme-animating,
body.theme-animating *,
body.theme-animating *::before,
body.theme-animating *::after {
  transition:
    background-color var(--theme-swap-duration) var(--theme-swap-ease) !important,
    color var(--theme-swap-duration) var(--theme-swap-ease) !important,
    border-color var(--theme-swap-duration) var(--theme-swap-ease) !important,
    box-shadow var(--theme-swap-duration) var(--theme-swap-ease) !important,
    outline-color var(--theme-swap-duration) var(--theme-swap-ease) !important,
    text-decoration-color var(--theme-swap-duration) var(--theme-swap-ease) !important,
    fill var(--theme-swap-duration) var(--theme-swap-ease) !important,
    stroke var(--theme-swap-duration) var(--theme-swap-ease) !important;
}

body.theme-animating {
  transition:
    color var(--theme-swap-duration) var(--theme-swap-ease) !important,
    border-color var(--theme-swap-duration) var(--theme-swap-ease) !important,
    box-shadow var(--theme-swap-duration) var(--theme-swap-ease) !important,
    outline-color var(--theme-swap-duration) var(--theme-swap-ease) !important,
    text-decoration-color var(--theme-swap-duration) var(--theme-swap-ease) !important,
    fill var(--theme-swap-duration) var(--theme-swap-ease) !important,
    stroke var(--theme-swap-duration) var(--theme-swap-ease) !important;
}

main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(22px, 4vw, 36px) 0;
}

.home-main,
.page-main.prose,
.page-main.center-grow {
  justify-content: center;
}

.home-main {
  --home-viewport-reserve: clamp(220px, 28vh, 320px);
  width: min(
    var(--page-max-width),
    calc(100vw - (2 * var(--page-gutter))),
    max(320px, calc(100vh - var(--home-viewport-reserve)))
  );
  width: min(
    var(--page-max-width),
    calc(100vw - (2 * var(--page-gutter))),
    max(320px, calc(100svh - var(--home-viewport-reserve)))
  );
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  gap: clamp(14px, 2.4vw, 24px);
  align-items: stretch;
  align-content: center;
}

.home-main > .home-section-reveal {
  min-width: 0;
  margin-bottom: 0;
}

.home-main > .home-section-reveal:first-child {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

.home-main > .home-section-reveal:nth-child(2) {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

.home-main > .home-section-reveal:nth-child(3) {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

.hero,
.page-hero {
  background: rgba(var(--color-2-rgb), 0.8);
  border: 1px solid rgba(var(--color-1-rgb), 0.35);
  border-radius: 0;
  padding: clamp(16px, 2.8vw, 28px);
  margin-bottom: clamp(14px, 2.8vw, 28px);
}

.home-main .hero {
  position: relative;
  padding: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.home-main .hero .demo {
  flex: 1 1 auto;
  height: 100%;
  min-height: clamp(320px, 52vh, 760px);
  min-height: clamp(320px, 52svh, 760px);
}

.page-hero-tight {
  margin-bottom: clamp(10px, 2vw, 18px);
}

.home-main > .home-section-reveal {
  opacity: 0;
  transform: none;
  animation: home-section-fade-enter var(--section-reveal-duration) var(--reveal-ease) forwards;
  animation-delay: calc((var(--home-section-index, 0) * var(--section-reveal-step)) + 35ms);
}

.page-main > .page-section-reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: home-section-enter var(--section-reveal-duration) var(--reveal-ease) forwards;
  animation-delay: calc((var(--page-section-index, 0) * var(--section-reveal-step)) + 35ms);
}

.resume-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-size);
  padding: 4px 12px;
  border: 1px solid rgba(var(--color-1-rgb), 0.36);
  background: rgba(var(--color-2-rgb), 0.88);
  color: var(--color-1);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.2;
  transition: background-color var(--hover-fade-duration) var(--hover-fade-ease), color var(--hover-fade-duration) var(--hover-fade-ease), border-color var(--hover-fade-duration) var(--hover-fade-ease), box-shadow var(--hover-fade-duration) var(--hover-fade-ease);
}

.button-link:hover {
  background: var(--color-1);
  color: var(--color-2);
  border-color: var(--color-1);
}

.button-link:focus-visible {
  background: var(--color-1);
  color: var(--color-2);
  border-color: var(--color-1);
}

.search-form {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.search-label {
  font-size: 0.9rem;
  color: rgba(var(--color-1-rgb), 0.78);
}

.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-row .button-link {
  flex: 0 0 auto;
}

.search-input {
  flex: 1 1 280px;
  min-width: 0;
  min-height: var(--control-size);
  padding: 4px 10px;
  border: 1px solid rgba(var(--color-1-rgb), 0.36);
  background: rgba(var(--color-2-rgb), 0.88);
  color: var(--color-1);
  font: inherit;
  line-height: 1.2;
  border-radius: 0;
}

.search-input::placeholder {
  color: rgba(var(--color-1-rgb), 0.56);
}

.search-input:focus-visible {
  outline: 2px solid var(--color-1);
  outline-offset: 2px;
}

.search-summary {
  min-height: 1.1rem;
}

.theme-search {
  font-size: 0.95rem;
}

body.search-modal-open {
  overflow: hidden;
}

.search-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(var(--color-2-rgb), 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms var(--reveal-ease), visibility 0ms linear 220ms;
}

.search-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms var(--reveal-ease);
}

.search-modal-panel {
  width: min(980px, calc(100vw - (2 * var(--page-gutter))));
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(var(--color-1-rgb), 0.35);
  background: rgba(var(--color-2-rgb), 0.94);
  padding: clamp(14px, 2.4vw, 20px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 220ms var(--reveal-ease), transform 220ms var(--reveal-ease), height 240ms ease;
  will-change: opacity, transform, height;
}

.search-modal-backdrop.is-open .search-modal-panel {
  opacity: 1;
  transform: translateY(0);
}

.search-modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.search-modal-title {
  margin: 6px 0 0;
}

.search-modal-results {
  margin-top: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: rgba(var(--color-1-rgb), 0.76);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  padding: 3px 5px;
  background: var(--color-1);
  color: var(--color-2);
  border-color: var(--color-1);
  margin: 0;
}

.text-link {
  text-decoration: none;
  border-radius: 0;
  padding: 1px 4px;
  border-bottom: 1px solid rgba(var(--color-1-rgb), 0.35);
  transition: background-color var(--hover-fade-duration) var(--hover-fade-ease), color var(--hover-fade-duration) var(--hover-fade-ease), border-color var(--hover-fade-duration) var(--hover-fade-ease), box-shadow var(--hover-fade-duration) var(--hover-fade-ease);
}

.home-main .section-head .text-link {
  line-height: 1.2;
  padding-top: 0;
  padding-bottom: 0;
}

.text-link:hover {
  background: var(--color-1);
  color: var(--color-2);
  box-shadow: none;
}

.text-link:focus-visible {
  background: var(--color-1);
  color: var(--color-2);
  box-shadow: none;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 14px;
}

#latest-projects {
  min-height: 220px;
}

.home-main #latest-projects {
  min-height: 0;
}

.home-main .home-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 12px);
  aspect-ratio: 1 / 1;
  min-height: 0;
  align-items: stretch;
}

.home-main .home-bento-grid > * {
  min-width: 0;
  min-height: 0;
}

.home-main .home-bento-grid > .post-card,
.home-main .home-bento-grid > .empty-state {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-main .home-bento-grid > .post-card p {
  margin-top: 0;
}

.home-main .home-bento-grid > .post-card p:last-of-type {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.home-main .home-bento-grid > .post-card .tags {
  margin-top: auto;
}

.home-main .home-bento-grid[data-bento-count="0"] > .empty-state {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: grid;
  place-content: center;
}

.home-main .home-bento-grid[data-bento-count="1"] > :first-child {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}

.home-main .home-bento-grid[data-bento-count="2"] > :nth-child(1) {
  grid-column: 1 / 2;
  grid-row: 1 / -1;
}

.home-main .home-bento-grid[data-bento-count="2"] > :nth-child(2) {
  grid-column: 2 / 3;
  grid-row: 1 / -1;
}

.home-main .home-bento-grid[data-bento-count="3"] > :nth-child(1) {
  grid-column: 1 / 2;
  grid-row: 1 / -1;
}

.home-main .home-bento-grid[data-bento-count="3"] > :nth-child(2) {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

.home-main .home-bento-grid[data-bento-count="3"] > :nth-child(3) {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

.post-list {
  display: grid;
  gap: 12px;
}


.post-card,
.post-item,
.post-shell,
.comments-shell {
  border: 1px solid rgba(var(--color-1-rgb), 0.35);
  border-radius: 0;
  background: rgba(var(--color-2-rgb), 0.78);
  padding: clamp(14px, 2.1vw, 20px);
}

.post-card-clickable {
  cursor: pointer;
  transition:
    transform var(--hover-fade-duration) var(--hover-fade-ease),
    border-color var(--hover-fade-duration) var(--hover-fade-ease),
    background-color var(--hover-fade-duration) var(--hover-fade-ease);
}

.post-card-clickable:hover {
  transform: translateY(-2px);
  border-color: var(--color-1);
  background: rgba(var(--color-2-rgb), 0.9);
}

.post-card-clickable.post-card-tag-hover {
  transform: none;
  border-color: rgba(var(--color-1-rgb), 0.35);
  background: rgba(var(--color-2-rgb), 0.78);
}

.post-card-clickable:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-1);
  background: rgba(var(--color-2-rgb), 0.9);
  outline: 2px solid var(--color-1);
  outline-offset: 2px;
}

.post-item + .post-item {
  margin-top: 12px;
}

.post-list .post-item + .post-item {
  margin-top: 0;
}

.post-date,
.post-meta,
.small-note {
  margin: 0;
  color: rgba(var(--color-1-rgb), 0.76);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.post-card h3,
.post-item h2 {
  margin-top: 8px;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.post-card a,
.post-item a {
  position: relative;
  z-index: 0;
  display: inline-block;
  text-decoration: none;
  transition: color var(--hover-fade-duration) var(--hover-fade-ease), border-color var(--hover-fade-duration) var(--hover-fade-ease), box-shadow var(--hover-fade-duration) var(--hover-fade-ease);
}

.post-card a::before,
.post-item a::before {
  content: "";
  position: absolute;
  inset: -3px -5px;
  background: var(--color-1);
  opacity: 0;
  z-index: -1;
  pointer-events: none;
  transition: opacity var(--hover-fade-duration) var(--hover-fade-ease);
}

.post-card a:hover,
.post-item a:hover {
  color: var(--color-2);
}

.post-card a:focus-visible,
.post-item a:focus-visible {
  color: var(--color-2);
}

.post-card a:hover::before,
.post-item a:hover::before,
.post-card a:focus-visible::before,
.post-item a:focus-visible::before {
  opacity: 1;
}

.brand:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-1);
  outline-offset: 2px;
}

.tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--color-1-rgb), 0.36);
  background: rgba(var(--color-1-rgb), 0.14);
  color: var(--color-1);
  border-radius: 0;
  font-size: 0.8rem;
  line-height: 1.2;
  padding: 4px 10px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

button.tag {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}

.tag-search {
  cursor: pointer;
  transition: background-color var(--hover-fade-duration) var(--hover-fade-ease), color var(--hover-fade-duration) var(--hover-fade-ease), border-color var(--hover-fade-duration) var(--hover-fade-ease), box-shadow var(--hover-fade-duration) var(--hover-fade-ease);
}

.tag-search:hover,
.tag-search:focus-visible {
  background: var(--color-1);
  color: var(--color-2);
  border-color: var(--color-1);
}

.prose h1,
.prose h2,
.prose h3 {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.prose p,
.prose li,
.prose blockquote {
  overflow-wrap: anywhere;
}

.prose code {
  background: rgba(var(--color-1-rgb), 0.12);
  border: 1px solid rgba(var(--color-1-rgb), 0.26);
  border-radius: 0;
  padding: 2px 6px;
}

.prose pre,
.prose pre.code-block {
  margin: 14px 0;
  border: 1px solid var(--code-block-border);
  border-radius: 0;
  background: var(--code-block-bg);
  padding: 10px 12px;
  overflow-x: auto;
  display: block;
  max-width: 100%;
}

.prose pre code,
.prose pre.code-block code {
  display: block;
  background: transparent;
  border: 0;
  padding: 0;
  white-space: pre;
  tab-size: 2;
  color: var(--code-block-fg);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.45;
}

.prose pre code.hljs,
.prose pre.code-block code.hljs {
  background: transparent !important;
  color: var(--code-block-fg);
}

.comments-shell {
  margin-top: 16px;
}

#job-meta {
  display: block;
  white-space: normal;
  font-family: inherit;
}

.empty-state {
  border: 1px dashed rgba(var(--color-1-rgb), 0.4);
  border-radius: 0;
  background: rgba(var(--color-2-rgb), 0.62);
  padding: 14px;
}

.site-footer {
  margin-top: 8px;
  padding: 3px 0 4px;
  color: rgba(var(--color-1-rgb), 0.78);
}

.site-footer .wrap {
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.72rem;
}

@media (max-width: 1024px) {
  .site-header .wrap {
    align-items: flex-start;
  }

  .header-controls {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .site-nav {
    justify-content: flex-start;
    flex: 1 1 auto;
  }

  .search-modal-backdrop {
    padding: 12px;
  }

  .search-modal-panel {
    max-height: 88vh;
  }
}

@media (max-width: 760px) {
  .home-main {
    width: 100%;
    margin-inline: auto;
    padding: clamp(10px, 3vw, 16px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: clamp(12px, 2.6vw, 18px);
    min-height: 0;
    place-content: start center;
  }

  .home-main > .home-section-reveal {
    min-width: 0;
    min-height: 0;
  }

  .home-main > .home-section-reveal:first-child {
    grid-column: 1 / -1;
    grid-row: 1 / 2;
  }

  .home-main > .home-section-reveal:nth-child(2) {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
  }

  .home-main > .home-section-reveal:nth-child(3) {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
  }

  .home-main > .home-section-reveal:first-child .hero {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0;
  }

  .home-main .hero {
    height: auto;
  }

  .home-main .hero .demo {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .home-main > .home-section-reveal:nth-child(2) .section-head,
  .home-main > .home-section-reveal:nth-child(3) .section-head {
    display: none;
  }

  .home-main #latest-posts,
  .home-main #latest-projects,
  .home-main .home-bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    gap: 0;
    aspect-ratio: 1 / 1;
    height: 100%;
    min-height: 0;
    margin: 0;
    width: 100%;
  }

  .home-main #latest-posts > :nth-child(n + 2),
  .home-main #latest-projects > :nth-child(n + 2) {
    display: none;
  }

  .home-main .home-bento-grid > .post-card,
  .home-main .home-bento-grid > .empty-state {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    height: 100%;
    aspect-ratio: auto;
    padding: clamp(10px, 2.4vw, 14px);
  }

  .home-main .home-bento-grid > .post-card p:last-of-type {
    -webkit-line-clamp: 3;
    font-size: 0.85rem;
  }

  .home-main #latest-posts .post-card .tags,
  .home-main #latest-projects .post-card .tags {
    display: none;
  }

  .site-header .wrap {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .header-controls {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
    flex-direction: row;
    align-items: center;
    width: auto;
    justify-content: flex-end;
    gap: 0 8px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(290px, calc(100vw - (2 * var(--page-gutter))));
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(var(--color-1-rgb), 0.36);
    background: rgba(var(--color-2-rgb), 0.97);
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-7px);
    transform-origin: top right;
    transition:
      opacity var(--content-reveal-duration) var(--reveal-ease),
      transform var(--content-reveal-duration) var(--reveal-ease),
      visibility 0s linear var(--content-reveal-duration);
    z-index: 12;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s, 0s, 0s;
  }

  .site-nav a {
    text-align: left;
    opacity: 0;
    transform: translateX(10px);
    transition:
      opacity var(--content-reveal-duration) var(--reveal-ease),
      transform var(--content-reveal-duration) var(--reveal-ease),
      background-color var(--hover-fade-duration) var(--hover-fade-ease),
      color var(--hover-fade-duration) var(--hover-fade-ease),
      border-color var(--hover-fade-duration) var(--hover-fade-ease),
      box-shadow var(--hover-fade-duration) var(--hover-fade-ease);
    transition-delay: 0s;
  }

  .site-nav.is-open a {
    opacity: 1;
    transform: translateX(0);
  }

  .site-nav.is-open a:nth-child(1) {
    transition-delay: 35ms;
  }

  .site-nav.is-open a:nth-child(2) {
    transition-delay: 65ms;
  }

  .site-nav.is-open a:nth-child(3) {
    transition-delay: 95ms;
  }

  .site-nav.is-open a:nth-child(4) {
    transition-delay: 125ms;
  }

  .site-nav.is-open a:nth-child(5) {
    transition-delay: 155ms;
  }

  .theme-actions {
    width: auto;
    justify-content: flex-end;
  }

  .section-head {
    align-items: flex-start;
  }

  .resume-hero-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-modal-backdrop {
    padding: 10px;
  }

  .search-modal-panel {
    width: 100%;
    max-height: 90vh;
    padding: 14px;
  }

  .search-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-row .button-link {
    width: 100%;
  }

  .search-input {
    width: 100%;
    flex-basis: auto;
  }

  .post-grid {
    gap: 12px;
  }

  .demo {
    height: clamp(170px, 34vh, 230px);
  }

  .hero-demo-reroll {
    right: 10px;
    bottom: 10px;
  }
}

@media (max-width: 480px) {
  :root {
    --page-gutter: 10px;
    --control-size: 34px;
  }

  .site-nav {
    width: calc(100vw - (2 * var(--page-gutter)));
  }

  .theme-actions {
    gap: 4px;
  }

  .search-modal-backdrop {
    padding: 8px;
  }

  .search-modal-panel {
    max-height: 92vh;
    padding: 12px;
  }

  .search-modal-top {
    flex-wrap: wrap;
    gap: 8px;
  }

  .search-modal-top .theme-toggle {
    margin-left: auto;
  }

  .hero,
  .page-hero {
    padding: 14px;
  }

  .post-grid {
    gap: 10px;
  }

  .tags {
    gap: 6px;
  }

  .tag {
    padding: 4px 8px;
  }

  .prose pre,
  .prose pre.code-block {
    padding: 8px 10px;
  }
}

.post-reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: post-reveal-enter var(--card-reveal-duration) var(--reveal-ease) forwards;
  animation-delay: calc((var(--reveal-index, 0) * var(--card-reveal-step)) + 35ms);
}

.post-card.post-reveal {
  transform: none;
  animation-name: post-card-reveal-enter;
}

@keyframes post-reveal-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes post-card-reveal-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.post-content-reveal {
  animation: post-content-enter var(--content-reveal-duration) var(--reveal-ease);
}

.post-loading {
  display: grid;
  gap: 12px;
}

.post-loading-line {
  height: 0.95rem;
  border: 1px solid rgba(var(--color-1-rgb), 0.24);
  background: rgba(var(--color-1-rgb), 0.12);
}

.loading-item {
  pointer-events: none;
}

.post-chunk-reveal {
  opacity: 0;
  transform: translateY(6px);
  animation: post-chunk-enter var(--chunk-reveal-duration) var(--reveal-ease) forwards;
}

@keyframes post-content-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes post-chunk-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes home-section-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes home-section-fade-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

main.page-enter {
  animation: page-enter var(--page-enter-duration) var(--reveal-ease);
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-reveal,
  .post-content-reveal,
  .post-chunk-reveal,
  .home-main > .home-section-reveal,
  .page-main > .page-section-reveal,
  main.page-enter {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .demo-canvas {
    transition: none;
  }

  .site-nav {
    transition: none;
  }

  .site-nav a {
    transition: none;
  }

  .demo.is-demo-transitioning-out .demo-canvas {
    opacity: 1;
    transform: none;
    filter: none;
  }

  body.theme-animating,
  body.theme-animating *,
  body.theme-animating *::before,
  body.theme-animating *::after {
    transition: none !important;
  }
}

.demo {
  position: relative;
  background: var(--color-1);
  height: clamp(180px, 32vh, 250px);
  overflow: hidden;
}

.demo-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  touch-action: none;
  transition: opacity 180ms var(--reveal-ease), transform 220ms var(--reveal-ease), filter 220ms var(--reveal-ease);
}

.demo.is-demo-mounted .demo-canvas {
  opacity: 1;
}

.demo.is-demo-transitioning-out .demo-canvas {
  opacity: 0.08;
  transform: none;
  filter: none;
}

.hero-demo-reroll {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
}

