/* Local fonts eliminate third-party CSS/font connection waterfalls. */
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.a0d054c4af55.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-regular.60c06664b5a9.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic.6ee678c33f38.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Scroll coda with a reversible handoff to the original, live footer. */
.scroll-ending {
  --ending-bg: #080705;
  position: relative;
  z-index: 1;
  isolation: isolate;
  background: var(--ending-bg);
  color: var(--footer-text);
}

.scroll-ending__stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 240px;
  width: 100%;
  overflow: hidden;
  background: var(--ending-bg);
}

.scroll-ending.is-enhanced {
  /* The loop recycles well before this invisible native-scroll runway ends.
     Keep spare room for mobile momentum while canvas drawing catches up. */
  height: max(1440px, 600vh);
  height: max(1440px, 600dvh);
}

.scroll-ending.is-enhanced .scroll-ending__stage {
  position: sticky;
  top: 0;
  overflow: visible;
}

/* Native touch scrolling has room in both directions. Only its deltas drive
   the artwork; recycling this runway never moves the rendered scene. */
.scroll-ending.is-enhanced.is-touch-loop {
  height: 2400vh;
  height: 2400lvh;
}
.scroll-ending.is-touch-loop .scroll-ending__stage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

/* Measure the stable artwork height independently of the visible scroll stage. */
.scroll-ending.is-enhanced .scroll-ending__stage::before {
  content: "";
  position: absolute;
  width: 0;
  height: 100vh;
  height: 100lvh;
  visibility: hidden;
  pointer-events: none;
}

.scroll-ending__canvas {
  display: none;
  width: 100%;
  height: 100%;
}

.scroll-ending.is-enhanced .scroll-ending__canvas {
  display: block;
}

/* The exit reverses the original footer/ending scene using the live footer. */
.contact-plane.is-ending-return,
.site-shell.is-ending-return {
  z-index: 2;
  transform: translate3d(0, var(--ending-return-y, 0px), 0);
  will-change: transform;
}

/* The fixed ripple canvas cannot travel with a transformed footer. Use its
   original, identically sized text/SVG while moving; restore WebGL at rest. */
body.ending-returning #fw-curtains-wrap {
  visibility: hidden;
}

.contact-plane.is-ending-return .contact-plane__name {
  opacity: 1 !important;
  color: var(--footer-text) !important;
  -webkit-text-fill-color: var(--footer-text) !important;
  background: none !important;
}

.contact-plane.is-ending-return .contact-plane__wordmark {
  opacity: 1 !important;
}

.scroll-ending.is-returning {
  z-index: 3;
  background: transparent;
  pointer-events: none;
}

.scroll-ending.is-returning .scroll-ending__stage {
  background: transparent;
}

.scroll-ending.is-returning .scroll-ending__canvas {
  transform: translate3d(0, var(--ending-return-top, 0px), 0);
  pointer-events: auto;
}

.scroll-ending.is-returning .scroll-ending__toolbar {
  pointer-events: auto;
}

.scroll-ending__fallback {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.55em;
  height: 100%;
  padding: 2rem 1rem;
  font-family: var(--font-ui);
  font-size: clamp(1.6rem, 6.5vw, 6.5rem);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.scroll-ending__fallback p {
  margin: 0;
  color: var(--footer-text);
}

.scroll-ending__fallback p:not(:first-child) {
  opacity: 0.6;
}

.scroll-ending.is-enhanced .scroll-ending__fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.scroll-ending__toolbar {
  position: absolute;
  z-index: 2;
  top: max(0.5rem, env(safe-area-inset-top));
  left: max(0.5rem, env(safe-area-inset-left));
  max-width: calc(100% - 1rem);
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--footer-text);
  font: 500 12px/1.2 var(--font-ui);
}

.scroll-ending__identity,
.scroll-ending__nav a,
.scroll-ending__sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 2px;
  background: var(--ending-bg);
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

.scroll-ending__identity {
  font-weight: 700;
  color: var(--footer-muted);
}
.scroll-ending__nav { display: flex; gap: 4px; }
.scroll-ending__nav a { text-decoration: none; }
.scroll-ending__sound {
  min-width: 44px;
  padding: 0;
  cursor: pointer;
}

.scroll-ending.is-enhanced .scroll-ending__toolbar {
  visibility: hidden;
}

.scroll-ending.is-enhanced.is-handoff .scroll-ending__toolbar {
  visibility: visible;
}

.scroll-ending.is-enhanced .scroll-ending__identity {
  transform-origin: left center;
}

.scroll-ending.is-enhanced .scroll-ending__nav,
.scroll-ending.is-enhanced .scroll-ending__sound {
  opacity: var(--ending-controls, 0);
  transform: translateX(calc((1 - var(--ending-controls, 0)) * -12px));
  transition: opacity 420ms ease, transform 420ms ease;
}

.ending-copyright-source {
  opacity: 0;
}

.ending-credit-source { opacity: 0; }
.scroll-ending__credit { display: none; }
.scroll-ending.is-stationary-handoff .scroll-ending__toolbar {
  right: max(0.5rem, env(safe-area-inset-right));
  max-width: none;
}
.scroll-ending.is-stationary-handoff .scroll-ending__identity {
  flex-shrink: 0;
  margin-left: calc(var(--identity-offset, 0px) * var(--ending-extras, 1));
}
.scroll-ending.is-stationary-handoff .scroll-ending__sound { flex-shrink: 0; }
.scroll-ending__extra,
.scroll-ending.is-stationary-handoff .scroll-ending__credit {
  opacity: var(--ending-extras, 1);
}
.scroll-ending__extra {
  display: inline-block;
  min-width: 0;
  max-width: calc(var(--extra-width, 160px) * var(--ending-extras, 1));
  overflow: hidden;
  white-space: pre;
}
.scroll-ending.is-stationary-handoff .scroll-ending__credit:not([hidden]) {
  position: absolute;
  display: inline-flex;
  align-items: center;
  height: 44px;
  white-space: nowrap;
  pointer-events: none;
  color: var(--footer-muted);
}

/* A native end-of-page bounce must not expose the site's light body surface. */
html.ending-active,
body.ending-active:not(.ending-returning) {
  background: var(--ending-scroll-bg, #080705);
}

html.ending-active,
body.ending-active {
  overscroll-behavior-y: none;
}

html.ending-active { scroll-behavior: auto; }

.scroll-ending__sound[hidden] {
  display: none;
}

.scroll-ending__sound svg {
  width: 18px;
  height: 18px;
}

.scroll-ending__sound:hover,
.scroll-ending__nav a:hover {
  color: var(--signal);
}

.scroll-ending__sound:focus-visible,
.scroll-ending__nav a:focus-visible {
  outline: 2px solid var(--footer-text);
  outline-offset: -2px;
}

.scroll-ending__sound-waves,
.scroll-ending__sound[aria-pressed="true"] .scroll-ending__sound-mute {
  display: none;
}

.scroll-ending__sound[aria-pressed="true"] .scroll-ending__sound-waves {
  display: block;
}

@media (max-width: 620px) {
  .scroll-ending__toolbar {
    top: max(4px, env(safe-area-inset-top));
    left: max(4px, env(safe-area-inset-left));
    max-width: calc(100% - 8px);
    gap: 2px;
    font-size: 11px;
  }
  .scroll-ending.is-stationary-handoff .scroll-ending__toolbar {
    right: max(4px, env(safe-area-inset-right));
  }
  .scroll-ending__nav { gap: 2px; }
  .scroll-ending__identity,
  .scroll-ending__nav a,
  .scroll-ending__sound {
    position: relative;
    min-height: 28px;
    padding: 0 6px;
  }
  .scroll-ending__sound { min-width: 32px; }
  .scroll-ending.is-stationary-handoff .scroll-ending__credit:not([hidden]) { height: 28px; }
  /* Small separate painted chips, with transparent 44px-tall tap targets. */
  .scroll-ending__nav a::after,
  .scroll-ending__sound::after {
    content: '';
    position: absolute;
    inset: 0 0 -16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-ending.is-enhanced {
    height: auto;
  }
}

:root {
  /* ── Light-mode surface colours (body/cards) ── */
  --bg: #f3ede4;
  --bg-strong: #ece1d1;
  --panel: rgba(255, 251, 245, 0.78);
  --panel-strong: #fffaf2;
  --ink: #172228;
  --muted: #5d676c;
  --line: rgba(23, 34, 40, 0.12);
  --line-strong: rgba(23, 34, 40, 0.22);

  /* ── Site accent → warm orange / amber ── */
  --accent: #c95e18;
  --accent-soft: rgba(201, 94, 24, 0.10);
  --signal: #d4a853;

  /* ── Footer dark palette ── */
  --footer-bg: #31251d;
  --footer-bg-mid: #31251d;
  --footer-bg-strong: #31251d;
  --footer-accent: #f5ede3;
  --footer-text: #f5ede3;
  --footer-muted: #d0b292;
  --footer-amber: #d4a853;
  --footer-line: rgba(245, 237, 227, 0.08);
  --footer-ring: rgba(245, 237, 227, 0.08);

  --shadow: 0 22px 60px rgba(23, 34, 40, 0.08);
  --shadow-soft: 0 10px 28px rgba(23, 34, 40, 0.06);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1160px;
  --reading-width: 820px;
  --home-footer-overlap: 11.5rem;
  --font-ui: "Space Grotesk", "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* curtains.js WebGL container — must be truly invisible */
#fw-curtains-wrap,
#fw-curtains-wrap canvas {
  border: none !important;
  outline: none !important;
  background: transparent !important;
}


html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.6;
  background:
    radial-gradient(circle at 12% 18%, rgba(201, 94, 24, 0.10), transparent 30rem),
    radial-gradient(circle at 85% 10%, rgba(212, 168, 83, 0.14), transparent 22rem),
    linear-gradient(180deg, #f7f0e6 0%, #f2e8dc 52%, #ede3d7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(23, 34, 40, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 34, 40, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 28%, transparent 88%);
}

body::after {
  content: "";
  position: fixed;
  right: -10rem;
  bottom: -10rem;
  width: 28rem;
  height: 28rem;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(201, 94, 24, 0.12), transparent 72%);
  filter: blur(18px);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
li {
  color: var(--muted);
}

strong {
  color: var(--ink);
}

main {
  padding: 2rem 0 4rem;
}

.site-shell {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
}

/* ═══════════════════════════════════════
   TOPBAR — centred island nav
═══════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0 0;
  background: transparent;
  pointer-events: none;
  /* let clicks fall through the empty area */
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

body.nav-hidden .topbar,
body.nav-idle-hidden .topbar {
  opacity: 0;
  transform: translateY(calc(-100% - 1rem));
}

body.nav-hidden .topbar:focus-within,
body.nav-idle-hidden .topbar:focus-within {
  opacity: 1;
  transform: none;
}

body.ending-active .topbar,
body.ending-active .topbar:focus-within {
  visibility: hidden;
  opacity: 0;
  transform: translateY(calc(-100% - 1rem));
}

/* the pill itself remains clickable */
.nav-pill {
  pointer-events: all;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.35rem;
  padding: 0.82rem 1.5rem;
  border: 1px solid rgba(23, 34, 40, 0.10);
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 14px 36px rgba(23, 34, 40, 0.10), 0 2px 6px rgba(23, 34, 40, 0.06);
}

/* when scrolled, add a subtle outline */
body.is-scrolled .nav-pill {
  background: rgba(255, 251, 245, 0.88);
  border-color: rgba(23, 34, 40, 0.15);
  box-shadow: 0 18px 44px rgba(23, 34, 40, 0.14), 0 2px 8px rgba(23, 34, 40, 0.08);
}

.nav-pill a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0.25rem 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 160ms ease;
}

.nav-pill a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.nav-pill a:hover,
.nav-pill a:focus-visible {
  color: var(--ink);
  outline: none;
}

.nav-pill a:hover::after,
.nav-pill a:focus-visible::after,
.nav-pill a.is-active::after {
  transform: scaleX(1);
}

.nav-pill a.is-active {
  color: var(--ink);
}

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
.hero {
  /* min-height: 100vh; */
  display: grid;
  align-items: center;
  padding: 6rem 0 2rem;
  /* top padding accounts for fixed nav */
}

.home-page main {
  min-height: calc(100dvh + var(--home-footer-overlap));
  padding-top: 0;
  padding-bottom: 0;
}

.home-page .hero {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: clamp(5.5rem, 11vh, 7rem) 0 clamp(1.25rem, 4vh, 2.5rem);
}

.home-page .hero__grid {
  min-height: 0;
}

.hero__grid,
.intro-card,
.project-card,
.project-card--reverse,
.project-hero__layout,
.article-layout,
.gallery-row {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.hero__grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
}

.intro-card {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
}

.project-card {
  grid-template-columns: minmax(0, 1fr) minmax(290px, 390px);
  align-items: center;
}

.project-card--reverse {
  grid-template-columns: minmax(290px, 390px) minmax(0, 1fr);
}

.project-hero__layout,
.article-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(250px, 0.52fr);
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 2.3rem;
  height: 1px;
  background: currentColor;
}

.hero h1,
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 8vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero p.lead,
.page-intro {
  max-width: 45rem;
  margin: 1.25rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.cta-row,
.button-row,
.social-list,
.tag-list,
.contact-plane__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.cta-row,
.button-row {
  margin-top: 1.75rem;
}

.hero-name--mobile,
.hero-cta--mobile {
  display: none;
}

.button,
.social-list a,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.95rem;
  padding: 0.76rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 180ms ease;
}

.button:hover,
.button:focus-visible,
.social-list a:hover,
.social-list a:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(23, 34, 40, 0.12);
  outline: none;
}

.button--primary {
  background: var(--ink);
  color: #fffaf3;
  box-shadow: var(--shadow-soft);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffaf3;
}

.button--secondary,
.social-list a {
  background: rgba(255, 251, 245, 0.72);
  border-color: var(--line-strong);
}

.button--secondary:hover,
.button--secondary:focus-visible,
.social-list a:hover,
.social-list a:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: #fffaf3;
}

.social-list,
.tag-list {
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}

.tag {
  min-height: 2.6rem;
  padding: 0.62rem 0.9rem;
  background: rgba(255, 251, 245, 0.72);
  border-color: rgba(23, 34, 40, 0.1);
  font-size: 0.88rem;
  font-weight: 500;
}

.portrait-wrap img {
  width: 100%;
  object-fit: cover;
}

.portrait-wrap picture {
  display: block;
  height: 100%;
}

.gallery-card picture { display: block; }

.portrait-wrap {
  position: relative;
  width: min(100%, 22.5rem);
  justify-self: end;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(241, 234, 223, 0.62));
  box-shadow: var(--shadow);
}

.portrait-wrap img {
  aspect-ratio: 4 / 5;
  object-position: center 18%;
}

.about-page .intro-card {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(1.35rem, 3vw, 2.35rem);
}

.about-page .page-title {
  font-size: clamp(2.7rem, 6.2vw, 4.75rem);
}

.about-page .page-intro {
  max-width: 39rem;
  font-size: clamp(1rem, 1.55vw, 1.1rem);
}

.about-page .portrait-wrap {
  width: min(100%, 18rem);
  aspect-ratio: 4 / 4.75;
}

.about-page .portrait-wrap img {
  height: 100%;
  transform: scale(1.08);
  transform-origin: center 18%;
  object-position: center 15%;
}

/* ═══════════════════════════════════════
   HERO ORBIT
═══════════════════════════════════════ */
.hero-orbit {
  position: relative;
  min-height: 32rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-orbit__ring,
.hero-orbit__ring::before,
.hero-orbit__ring::after {
  position: absolute;
  inset: 50%;
  border-radius: 50%;
  pointer-events: none;
}

.hero-orbit__ring {
  width: 18rem;
  height: 18rem;
  margin-left: -9rem;
  margin-top: -9rem;
  border: 1px dashed rgba(201, 94, 24, 0.2);
}

.hero-orbit__ring::before,
.hero-orbit__ring::after {
  content: "";
  border: 1px dashed rgba(201, 94, 24, 0.14);
}

.hero-orbit__ring::before {
  inset: -2.7rem;
}

.hero-orbit__ring::after {
  inset: 2.6rem;
}

.hero-orbit__photo {
  position: relative;
  width: 12.5rem;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(241, 234, 223, 0.64));
  box-shadow: var(--shadow);
}

.hero-orbit__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.hero-orbit__label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.92);
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.hero-orbit__label--a {
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.hero-orbit__label--b {
  right: 0.5rem;
  top: 9rem;
}

.hero-orbit__label--c {
  right: 2rem;
  bottom: 4rem;
}

.hero-orbit__label--d {
  left: 0;
  bottom: 5rem;
}

.hero-orbit__label--e {
  left: 0.7rem;
  top: 9rem;
}

.hero-orbit__label--f {
  left: 50%;
  bottom: 0.8rem;
  transform: translateX(-50%);
}

/* ═══════════════════════════════════════
   SECTIONS & CARDS
═══════════════════════════════════════ */
.section {
  margin-top: 3rem;
  /* Keep real heights and painted content when returning from the footer.
     Placeholder heights here shifted the native ending's scroll origin. */
}

.section__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 0.95;
}

.card,
.timeline-item,
.stack-card,
.project-card,
.fact-card,
.gallery-card,
.diagram-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.card,
.timeline-item,
.stack-card,
.fact-card {
  padding: 1.45rem;
}

.card p,
.timeline-item p,
.stack-card p,
.fact-card p {
  margin: 0.7rem 0 0;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  display: grid;
  gap: 0.7rem;
}

.timeline-item__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.94rem;
  color: var(--muted);
}

.timeline-item__meta--stack {
  display: grid;
  justify-content: start;
  gap: 0.25rem;
}

.about-page .timeline-item {
  gap: 0.45rem;
  padding: 1.4rem 1.45rem 1.3rem;
}

.about-page .section__header {
  margin-bottom: 0.9rem;
}

.about-page .section__title {
  font-size: clamp(1.9rem, 3vw, 2.35rem);
}

.about-page .timeline-item__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.12rem 1rem;
  align-items: end;
}

.about-page .timeline-item__meta strong,
.about-page .hackathon-spotlight__copy h3 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(1.35rem, 1.6vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}

.about-page .timeline-item__date {
  align-self: center;
  justify-self: end;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.about-page .timeline-item__role {
  grid-column: 1 / 2;
  margin-top: 0.15rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.24;
  color: var(--ink);
}

.about-page .timeline-item__meta--stack {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.18rem;
}

.about-page .timeline-item__meta--stack .timeline-item__role {
  grid-column: 1 / -1;
}

.about-page .timeline-item p {
  margin: 0.35rem 0 0;
}

.about-page .timeline-item p+p {
  margin-top: 0.25rem;
}

.education-card {
  grid-template-columns: minmax(0, 1fr) 4.5rem;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: start;
  padding: 1.25rem 1.35rem;
}

.education-card .timeline-item__meta strong {
  font-size: clamp(1.12rem, 1.35vw, 1.3rem);
}

.education-card .timeline-item__role {
  font-size: 0.91rem;
  font-weight: 600;
}

.education-card p {
  font-size: 0.92rem;
}

.education-card__content {
  min-width: 0;
}

.education-card__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  aspect-ratio: 1;
  padding: 0;
  justify-self: end;
  overflow: hidden;
  border: 1px solid rgba(23, 34, 40, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(23, 34, 40, 0.08);
}

.education-card__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.education-card__mark--icon .education-card__logo {
  transform: scale(1.4);
}

.experience-list {
  display: grid;
  gap: 1rem;
}

.experience-entry {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
  padding: 1.4rem 1.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.experience-entry__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  aspect-ratio: 1;
  padding: 0.65rem;
  border-radius: 17px;
  border: 1px solid rgba(23, 34, 40, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(23, 34, 40, 0.08);
}

.experience-entry__mark img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.experience-entry__mark--icon {
  padding: 0;
  overflow: hidden;
}

.experience-entry__mark--icon img {
  aspect-ratio: 1;
  height: 100%;
  object-fit: cover;
  transform: scale(1.4);
}

.experience-entry__mark--wordmark {
  padding: 0.45rem;
}

.experience-entry__body {
  min-width: 0;
}

.experience-entry__body h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.14rem, 1.5vw, 1.3rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.experience-entry__company,
.experience-entry__date,
.experience-entry__focus {
  margin: 0;
}

.experience-entry__company {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
  color: var(--ink);
  font-size: 0.96rem;
}

.experience-entry__company span,
.experience-entry__date {
  color: var(--muted);
}

.experience-entry__date {
  margin-top: 0.12rem;
  font-size: 0.88rem;
}

.experience-entry__focus {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 1rem;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.55;
}

.experience-entry__emoji {
  flex: 0 0 auto;
  line-height: 1.45;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.about-page .grid--four {
  align-items: stretch;
}

.about-page .stack-card {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  height: 100%;
  padding: 1.5rem 1.45rem 1.8rem;
}

.about-page .stack-card h3 {
  margin: 0;
  font-size: 1rem;
}

.about-page .stack-card p {
  margin: 0;
}

.project-list {
  display: grid;
  gap: 1.35rem;
}

.project-card {
  padding: clamp(1.35rem, 3vw, 1.8rem);
}

.project-card__body {
  display: grid;
  gap: 0.9rem;
}

.project-card h2,
.article-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.8rem);
  line-height: 0.96;
}

.project-card__visual,
.diagram-frame {
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(rgba(23, 34, 40, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 34, 40, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(239, 231, 220, 0.78));
  background-size: 22px 22px, 22px 22px, auto;
  border: 1px solid rgba(23, 34, 40, 0.1);
}

.diagram-frame {
  aspect-ratio: 920 / 520;
}

.project-card__visual {
  min-height: 290px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card__visual img,
.diagram-frame img {
  width: 100%;
  height: auto;
  max-width: 100%;
}

.diagram-frame img {
  aspect-ratio: 920 / 520;
  object-fit: contain;
}

.project-card__visual--screenshot,
.project-screenshot {
  padding: 0.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(239, 231, 220, 0.88));
}

.project-screenshot {
  aspect-ratio: auto;
}

.project-card__visual--screenshot img,
.project-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(23, 34, 40, 0.08);
}

.project-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.work-page .tag-list,
.project-page .tag-list {
  gap: 0.55rem 0.95rem;
  margin-top: 0.25rem;
}

.work-page .tag,
.project-page .tag {
  justify-content: flex-start;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: none;
}

.project-hero,
.page-hero,
.article-hero {
  padding-top: 2rem;
}

.project-hero__meta,
.article-side {
  display: grid;
  gap: 1rem;
}

.fact-card h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.project-page .fact-card {
  padding: 1.6rem;
}

.fact-card dl {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.project-page .fact-card dl>div {
  padding: 0 0 0.85rem;
  border-bottom: 1px solid var(--line);
}

.project-page .fact-card dl>div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.fact-card dt {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fact-card dd {
  margin: 0.15rem 0 0;
  color: var(--ink);
  font-weight: 600;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric-card {
  min-width: 0;
  padding: 1.25rem 1rem 1.3rem;
  border-right: 1px solid var(--line);
}

.metric-card:first-child {
  padding-left: 0;
}

.metric-card:last-child {
  padding-right: 0;
  border-right: 0;
}

.metric-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.metric-card p {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.case-card {
  padding: 1.35rem;
}

.case-card h3 {
  margin: 0;
  font-size: 1rem;
}

.case-card p {
  margin: 0.6rem 0 0;
}

.project-page .story-block.card {
  padding: clamp(1.3rem, 3vw, 1.8rem);
}

.stat-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.stat-card p {
  margin: 0.55rem 0 0;
}

.step-grid {
  display: grid;
  gap: 1rem;
}

.step-card {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.25rem 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.step-card:first-child {
  padding-top: 0;
  border-top: 0;
}

.step-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  grid-row: span 2;
}

.step-card h3 {
  margin: 0;
  font-size: 1rem;
}

.step-card p {
  margin: 0;
}

.feature-card {
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
}

.feature-card h3 {
  margin: 0;
  font-size: 1rem;
}

.feature-card p {
  margin: 0.55rem 0 0;
}

.story-block {
  max-width: var(--reading-width);
}

.story-block p {
  margin: 0;
  font-size: 1.03rem;
}

.story-block p+p {
  margin-top: 1rem;
}

.story-block h2 {
  margin: 2rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.98;
}

.hackathon-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 1.25rem;
  align-items: start;
}

.hackathon-spotlight__copy {
  max-width: 38rem;
}

.hackathon-spotlight__copy h3 {
  margin: 0;
  font-size: 1.08rem;
}

.hackathon-spotlight__copy p {
  margin: 0.75rem 0 0;
}

.about-page .hackathon-spotlight__copy p {
  margin-top: 0.45rem;
}

.hackathon-spotlight__gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.hackathon-spotlight__gallery .gallery-card {
  min-height: 132px;
}

.hackathon-spotlight__gallery img {
  aspect-ratio: 4 / 3;
}

.gallery-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-card {
  overflow: hidden;
  padding: 0;
  min-height: 220px;
  aspect-ratio: 4 / 3;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-plane {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--footer-bg);
  color: var(--footer-text);
}

/* A single local font keeps native and canvas footer glyphs in sync. */
@font-face {
  font-family: "Footer Instrument Serif";
  src: url("../fonts/instrument-serif-regular.60c06664b5a9.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.contact-plane {
  --font-display: "Footer Instrument Serif", "Instrument Serif", serif;
}

.contact-plane::before,
.contact-plane::after {
  display: none;
}

.contact-plane__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 4rem 2.5rem 2.2rem;
}

.contact-plane__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.8rem;
}

.contact-plane__email {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--footer-muted);
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.contact-plane__email:hover,
.contact-plane__email:focus-visible {
  color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

.contact-plane__center {
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0.2rem 0 1.8rem;
}

.contact-plane__name {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(3.8rem, 11vw, 8rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--footer-text);
  text-transform: none;
}

.contact-plane__name.has-hover-reveal {
  color: transparent;
  background-image: radial-gradient(circle at var(--footer-reveal-x, 50%) var(--footer-reveal-y, 50%),
      var(--accent) 0,
      var(--accent) var(--footer-reveal-size, 0px),
      var(--footer-text) calc(var(--footer-reveal-size, 0px) + 1px),
      var(--footer-text) 100%);
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* WebGL water effect state
   When curtains.js takes over, .has-webgl-water is set on the element.
   Text is hidden; the WebGL plane renders name as a canvas texture
   with water ripple distortion on hover. */
.contact-plane__name.has-webgl-water {
  position: relative;
  opacity: 0 !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
}

.contact-plane__wordmark.has-webgl-water-svg {
  opacity: 0 !important;
}

.contact-plane__wordmark.has-native-water .contact-plane__wordmark-text--accent {
  opacity: 0;
}


.contact-plane__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.contact-plane__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--footer-muted);
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.contact-plane__links a .link-arrow {
  display: inline-block;
  font-style: normal;
  transition: transform 200ms ease;
}

.contact-plane__links a:hover,
.contact-plane__links a:focus-visible {
  color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

.contact-plane__links a:hover .link-arrow,
.contact-plane__links a:focus-visible .link-arrow {
  transform: translate(2px, -2px);
}

.contact-plane__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 0 0;
  margin-top: auto;
  border-top: 0;
}

.contact-plane__bottom span {
  color: var(--footer-muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.contact-plane:not(.contact-plane--home) {
  background: #080705;
}

.contact-plane:not(.contact-plane--home) .contact-plane__inner {
  padding: 3rem 2.5rem 2rem;
}

.contact-plane:not(.contact-plane--home) .contact-plane__top {
  align-items: flex-start;
  padding-bottom: 1.3rem;
}

.contact-plane:not(.contact-plane--home) .contact-plane__email {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  text-transform: none;
}

.contact-plane:not(.contact-plane--home) .contact-plane__links a,
.contact-plane:not(.contact-plane--home) .contact-plane__bottom span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-plane:not(.contact-plane--home) .contact-plane__links a {
  font-size: 0.82rem;
}

.contact-plane:not(.contact-plane--home) .contact-plane__center {
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0 0 1rem;
}

.contact-plane:not(.contact-plane--home) .contact-plane__name {
  width: auto;
  max-width: none;
  font-family: var(--font-display);
  font-size: clamp(7rem, min(28vw, 38vh), 24rem);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.05em;
  text-align: left;
}

.contact-plane:not(.contact-plane--home) .contact-plane__name span {
  display: block;
}

.contact-plane:not(.contact-plane--home) .contact-plane__bottom {
  padding-top: 1rem;
}

.contact-plane--home {
  background: #080705;
}

.contact-plane--home .contact-plane__inner {
  min-height: 100dvh;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(8.8rem, 15vw, 12rem) 1rem 2.4rem;
}

.contact-plane__crest {
  position: absolute;
  top: -11.5rem;
  left: 0;
  width: 100%;
  height: 15rem;
  color: #080705;
  pointer-events: none;
}

.contact-plane__crest svg {
  display: block;
  width: 100%;
  height: 100%;
}

.contact-plane--home .contact-plane__center {
  width: min(1440px, calc(100% + 4rem));
  flex: 0 0 auto;
  justify-content: center;
  padding: 0;
  overflow: visible;
  margin-inline: -2rem;
}

.contact-plane__wordmark {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1400 / 430;
  overflow: visible;
}

.contact-plane__wordmark,
.contact-plane__wordmark *,
.contact-plane__name,
.contact-plane__name * {
  -webkit-user-select: none;
  user-select: none;
}

.contact-plane__wordmark-text {
  fill: var(--footer-text);
  font-family: var(--font-display);
  font-size: 204px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.contact-plane__wordmark-text--accent {
  fill: var(--accent);
}

.contact-plane__middle-socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.72rem;
  margin-top: -3rem;
}

.contact-plane__middle-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(2.5rem, 4.2vw, 3rem);
  height: clamp(2.5rem, 4.2vw, 3rem);
  color: var(--footer-text);
  opacity: 0.82;
  transition:
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.contact-plane__middle-socials a:hover,
.contact-plane__middle-socials a:focus-visible {
  color: var(--accent);
  opacity: 1;
  transform: translateY(-1px);
  outline: none;
}

.contact-plane__middle-socials svg {
  width: clamp(1.18rem, 2vw, 1.4rem);
  height: clamp(1.18rem, 2vw, 1.4rem);
  fill: currentColor;
}

[data-wordmark] {
  cursor: default;
}

.contact-plane--home .contact-plane__bottom {
  justify-content: center;
  width: 100%;
  padding-top: 2.2rem;
}

.contact-plane--home .contact-plane__top {
  display: none;
}

.contact-plane__mobile-footer {
  display: none;
}

/* ═══════════════════════════════════════
   PROJECT PAGE
═══════════════════════════════════════ */
.project-page .grid--three {
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.project-page .feature-card {
  max-width: var(--reading-width);
}

/* ═══════════════════════════════════════
   REVEAL ANIMATION
═══════════════════════════════════════ */
.reveal {
  opacity: 1;
  transform: none;
}

.reveal.is-reveal-ready:not(.is-visible) {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.is-reveal-ready {
  transition:
    opacity 480ms ease,
    transform 480ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero.reveal,
.page-hero.reveal,
.project-hero.reveal,
.article-hero.reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal.is-reveal-ready:not(.is-visible),
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1080px) {

  .hero__grid,
  .intro-card,
  .project-card,
  .project-card--reverse,
  .project-hero__layout,
  .article-layout,
  .grid--four {
    grid-template-columns: 1fr;
  }

  .home-page .hero__grid {
    height: 100%;
  }

  .grid--three {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card,
  .metric-card:first-child,
  .metric-card:last-child {
    padding: 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-card:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .case-grid {
    grid-template-columns: 1fr;
  }

  .portrait-wrap {
    justify-self: start;
  }

  .about-page .intro-card {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: clamp(1.35rem, 3vw, 2.35rem);
  }

  .about-page .portrait-wrap {
    width: min(100%, 17rem);
    aspect-ratio: 4 / 4.85;
    justify-self: end;
  }

  .about-page .hackathon-spotlight {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 1.1rem;
  }

  .about-page .hackathon-spotlight__gallery,
  .post-page .gallery-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  :root {
    --home-footer-overlap: 8.4rem;
  }

  .topbar {
    padding: 0.75rem 0 0;
  }

  .hero {
    min-height: auto;
    padding-top: 5rem;
    /* make room for the fixed centre pill */
  }

  .home-page .hero {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 4.8rem 0 0.8rem;
  }

  .home-page .hero__grid {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.4rem;
    align-items: stretch;
    align-content: stretch;
  }

  .home-page .hero-orbit {
    width: min(100%, 34rem);
    height: 100%;
    min-height: 0;
    margin-inline: auto;
  }

  .home-page .hero-orbit__photo {
    width: clamp(6.5rem, 18dvh, 8.75rem);
  }

  .home-page .hero-orbit__ring {
    width: clamp(9.5rem, 26dvh, 13rem);
    height: clamp(9.5rem, 26dvh, 13rem);
    margin-left: clamp(-6.5rem, -13dvh, -4.75rem);
    margin-top: clamp(-6.5rem, -13dvh, -4.75rem);
  }

  .home-page .hero-orbit__label {
    min-height: 2.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  .home-page .hero-orbit__label--a {
    top: 1%;
  }

  .home-page .hero-orbit__label--b,
  .home-page .hero-orbit__label--e {
    top: 27%;
  }

  .home-page .hero-orbit__label--c,
  .home-page .hero-orbit__label--d {
    bottom: 12%;
  }

  .home-page .hero-orbit__label--f {
    bottom: 0;
  }

  .section__header {
    flex-direction: column;
    align-items: start;
  }

  .contact-plane__crest {
    top: -8.4rem;
    height: 11rem;
  }

  .contact-plane__wordmark-text {
    font-size: 158px;
  }

  .contact-plane__middle-socials {
    margin-top: -1.9rem;
    gap: 0.68rem;
  }

  .work-page .project-card,
  .work-page .project-card--reverse {
    gap: 0.95rem;
  }

  .work-page .project-card__body {
    display: contents;
  }

  .work-page .project-card h2 {
    order: 1;
  }

  .work-page .project-card__visual {
    order: 2;
  }

  .work-page .project-card__body>p {
    order: 3;
    margin: 0;
  }

  .work-page .project-card .tag-list {
    order: 4;
  }

  .work-page .project-card__actions {
    order: 5;
  }
}

@media (max-width: 620px) {
  :root {
    --home-footer-overlap: 0rem;
  }

  .site-shell {
    width: min(var(--max-width), calc(100% - 1rem));
  }

  .contact-plane__inner {
    width: min(var(--max-width), calc(100% - 1rem));
  }

  .nav-pill {
    gap: 0.95rem;
    padding: 0.72rem 0.95rem;
  }

  .hero {
    padding-top: 5rem;
  }

  .home-page .hero {
    padding: 4.6rem 0 0.65rem;
  }

  .home-page .eyebrow,
  .hero-name--desktop,
  .hero-cta--desktop {
    display: none;
  }

  .hero-name--mobile {
    display: inline;
  }

  .home-page .hero-visual {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
  }

  .home-page .hero-cta--mobile {
    display: flex;
    justify-content: center;
    margin: 0.55rem 0 1.1rem;
  }

  .home-page .hero p.lead {
    margin-top: 0.65rem;
    font-size: clamp(0.92rem, 4.2vw, 1.05rem);
    line-height: 1.45;
  }

  .home-page .cta-row {
    margin-top: 0.9rem;
  }

  .home-page .button {
    min-height: 2.65rem;
    padding-block: 0.62rem;
  }

  .hero h1,
  .page-title {
    font-size: clamp(2.7rem, 15vw, 4.2rem);
  }

  .about-page .page-title {
    font-size: clamp(2.45rem, 12vw, 3.55rem);
  }

  .about-page .page-intro {
    max-width: 100%;
    font-size: 0.98rem;
  }

  .about-page .social-list {
    justify-content: center;
  }

  .about-page .intro-card {
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
  }

  .about-page .portrait-wrap {
    width: min(100%, 15.5rem);
    aspect-ratio: 1 / 1;
    justify-self: center;
  }

  .about-page .portrait-wrap img {
    object-position: center 12%;
  }

  .about-page .hackathon-spotlight,
  .gallery-row {
    grid-template-columns: 1fr;
  }

  .post-page .gallery-card {
    min-height: 0;
    aspect-ratio: auto;
  }

  /* WebKit transfers the desktop minimum height through the 4:3 ratio,
     making two cards wider than a narrow phone's grid tracks. */
  .about-page .hackathon-spotlight__gallery .gallery-card {
    min-width: 0;
    min-height: 0;
  }

  .post-page .gallery-card img {
    height: auto;
  }

  .about-page .timeline-item__meta {
    grid-template-columns: 1fr;
    gap: 0.18rem;
  }

  .experience-entry {
    grid-template-columns: 3.75rem minmax(0, 1fr);
    gap: 0.9rem;
    padding: 1.05rem 0.95rem;
  }

  .experience-entry__mark {
    width: 3.75rem;
    padding: 0.4rem;
    border-radius: 14px;
  }

  .experience-entry__mark--icon {
    padding: 0;
  }

  .experience-entry__company {
    font-size: 0.95rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .metric-card:first-child,
  .metric-card:last-child,
  .metric-card:nth-last-child(-n + 2) {
    grid-column: auto;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-card:last-child {
    border-bottom: 0;
  }

  .about-page .timeline-item__date {
    justify-self: start;
  }

  .about-page .timeline-item__role {
    grid-column: 1 / -1;
  }

  .education-card {
    grid-template-columns: 3.75rem minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    padding: 1.05rem 0.95rem;
  }

  .education-card__content {
    grid-column: 2;
  }

  .education-card__mark {
    grid-column: 1;
    grid-row: 1;
    width: 3.75rem;
    padding: 0;
    border-radius: 14px;
  }

  .hero-orbit__label--a,
  .hero-orbit__label--f,
  .hero-orbit__label--b,
  .hero-orbit__label--c,
  .hero-orbit__label--d,
  .hero-orbit__label--e {
    transform: none;
  }

  .contact-plane__middle-socials {
    margin-top: -1.35rem;
    gap: 0.6rem;
  }

  .contact-plane__middle-socials a {
    width: 2.35rem;
    height: 2.35rem;
  }

  .contact-plane__middle-socials svg {
    width: 1.1rem;
    height: 1.1rem;
  }

  .hero-orbit {
    min-height: 0;
  }

  .hero-orbit__photo {
    width: clamp(6rem, 17dvh, 8rem);
  }

  .hero-orbit__ring {
    width: clamp(9rem, 24dvh, 11.75rem);
    height: clamp(9rem, 24dvh, 11.75rem);
    margin-left: clamp(-5.875rem, -12dvh, -4.5rem);
    margin-top: clamp(-5.875rem, -12dvh, -4.5rem);
  }

  .hero-orbit__label {
    font-size: clamp(0.66rem, 2.8vw, 0.76rem);
    min-height: 2.2rem;
    padding: 0.42rem 0.65rem;
  }

  .hero-orbit__label--a {
    top: 1%;
    left: 50%;
    transform: translateX(-50%);
  }

  .hero-orbit__label--b {
    right: 0;
    top: 27%;
  }

  .hero-orbit__label--c {
    right: 0.5rem;
    bottom: 12%;
  }

  .hero-orbit__label--d {
    left: 0;
    bottom: 12%;
  }

  .home-page .hero-orbit__label--e {
    left: 0;
    top: 14%;
  }

  .hero-orbit__label--f {
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
  }

  .contact-plane__top,
  .contact-plane__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-plane__name {
    font-size: clamp(3.8rem, 18vw, 6rem);
  }

  .contact-plane:not(.contact-plane--home) .contact-plane__inner {
    padding: 2.9rem 1rem 1.8rem;
  }

  .contact-plane:not(.contact-plane--home) .contact-plane__center {
    order: 1;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0 0 1.1rem;
  }

  .contact-plane:not(.contact-plane--home) .contact-plane__top {
    order: 2;
    gap: 0.9rem;
    padding-bottom: 0;
  }

  .contact-plane:not(.contact-plane--home) .contact-plane__links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .contact-plane:not(.contact-plane--home) .contact-plane__name {
    max-width: 100%;
    font-size: clamp(6.5rem, min(27vw, 29vh), 10.2rem);
    line-height: 0.82;
  }

  .contact-plane:not(.contact-plane--home) .contact-plane__email,
  .contact-plane:not(.contact-plane--home) .contact-plane__links a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
  }

  .contact-plane:not(.contact-plane--home) .contact-plane__email::after {
    content: "\2197";
    font-size: 0.82em;
    line-height: 1;
  }

  .contact-plane:not(.contact-plane--home) .contact-plane__bottom {
    order: 3;
    margin-top: auto;
    padding-top: 1.2rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
    width: 100%;
  }

  .contact-plane--home .contact-plane__inner {
    min-height: auto;
    align-items: stretch;
    padding: 5.5rem 1rem 1.8rem;
  }

  .contact-plane__crest {
    top: -5.8rem;
    height: 7.8rem;
  }

  .contact-plane__wordmark-text {
    font-size: 102px;
  }

  .contact-plane--home .contact-plane__bottom {
    padding-top: 1.5rem;
  }

  .contact-plane--home .contact-plane__crest,
  .contact-plane--home .contact-plane__center--home,
  .contact-plane--home .contact-plane__middle-socials,
  .contact-plane--home .contact-plane__bottom--home {
    display: none;
  }

  .contact-plane--home .contact-plane__mobile-footer {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 100%;
    width: 100%;
  }

  .contact-plane--home .contact-plane__mobile-footer .contact-plane__center {
    order: 1;
    flex: 1 1 auto;
    width: 100%;
    margin-inline: 0;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0 0 1.1rem 0.3rem;
    overflow: hidden;
  }

  .contact-plane--home .contact-plane__mobile-footer .contact-plane__top {
    display: flex;
    order: 2;
    gap: 0.65rem;
    margin-top: auto;
    padding-bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .contact-plane--home .contact-plane__mobile-footer .contact-plane__links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
  }

  .contact-plane--home .contact-plane__mobile-footer .contact-plane__name {
    width: auto;
    max-width: 100%;
    font-family: var(--font-display);
    font-size: clamp(6.5rem, min(27vw, 29vh), 10.2rem);
    font-weight: 400;
    line-height: 0.82;
    letter-spacing: -0.05em;
    text-align: left;
  }

  .contact-plane--home .contact-plane__mobile-footer .contact-plane__name span {
    display: block;
  }

  .contact-plane--home .contact-plane__mobile-footer .contact-plane__email {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
  }

  .contact-plane--home .contact-plane__mobile-footer .contact-plane__email::after {
    content: "\2197";
    font-size: 0.82em;
    line-height: 1;
  }

  .contact-plane--home .contact-plane__mobile-footer .contact-plane__links a,
  .contact-plane--home .contact-plane__mobile-footer .contact-plane__bottom span {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .contact-plane--home .contact-plane__mobile-footer .contact-plane__links a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
  }

  .contact-plane--home .contact-plane__mobile-footer .contact-plane__bottom {
    display: flex;
    order: 3;
    margin-top: 0;
    padding-top: 1.2rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
    width: 100%;
  }
}

/* Split metadata retains exactly the original inherited text treatment. */
footer.contact-plane .contact-plane__inner .contact-plane__bottom .footer-identity > span {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

/* Mobile footer metadata uses the same type as the ending navigation. */
@media (max-width: 860px) {
  footer.contact-plane :is(.contact-plane__inner, .contact-plane__mobile-footer)
    :is(.contact-plane__email, .contact-plane__links a, .contact-plane__bottom span) {
    font: 500 12px/1.2 var(--font-ui);
    letter-spacing: normal;
    text-transform: none;
  }

  footer.contact-plane :is(.contact-plane__inner, .contact-plane__mobile-footer)
    .contact-plane__bottom > span:first-child {
    font-weight: 700;
  }
}

@media (max-width: 480px) {
  footer.contact-plane :is(.contact-plane__inner, .contact-plane__mobile-footer)
    :is(.contact-plane__email, .contact-plane__links a, .contact-plane__bottom span) {
    font-size: 11px;
  }
}

.footer-heart-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
  --heart-scale: 1;
}

.footer-heart-text {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.footer-heart-emoji {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(var(--heart-scale));
  transform-origin: center center;
}

@media (hover: hover) and (pointer: fine) {
  .footer-heart-wrap:hover .footer-heart-text {
    transform: translateX(-10px);
  }
  .footer-heart-wrap:hover .footer-heart-emoji {
    transform: scale(calc(var(--heart-scale) + 0.3));
  }
}
