/* ==========================================================================
   johnha.info — design system + components
   Tokens first (see DESIGN.md). Mobile-first: base styles target 360px,
   media queries enhance upward.
   ========================================================================== */

/* ---------- Fonts (self-hosted so every device renders the same type) ---- */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-vietnamese.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens: dark (default) ---------------------------------------- */
:root {
  color-scheme: dark;

  --bg: #0a0a0b;
  --bg-elev: #121215;
  --surface: rgb(255 255 255 / 0.035);
  --surface-2: rgb(255 255 255 / 0.065);
  --surface-hover: rgb(255 255 255 / 0.09);
  --border: rgb(255 255 255 / 0.09);
  --border-strong: rgb(255 255 255 / 0.16);
  --text: #f4f4f5;
  --text-muted: #a8a8b1;
  --text-faint: #8a8a93;
  --accent: #34d399;
  --accent-strong: #10b981;
  --accent-2: #bef264;
  --accent-ink: #0a0a0b;
  --crema: #e9a35b;
  --success: #4ade80;
  --glass: rgb(14 14 17 / 0.62);
  --glass-border: rgb(255 255 255 / 0.08);
  --glow-a: rgb(16 185 129 / 0.16);
  --glow-b: rgb(233 163 91 / 0.13);
  --ring-photo: rgb(255 255 255 / 0.10);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 30px 80px -30px rgb(0 0 0 / 0.75);
  --grain-opacity: 0.05;

  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --fs-2xl: clamp(1.75rem, 1.35rem + 2vw, 2.75rem);
  --fs-3xl: clamp(2.25rem, 1.5rem + 3.6vw, 4rem);
  --fs-display: clamp(2.75rem, 1.4rem + 6.4vw, 6.25rem);
  --lh-tight: 1.04;
  --lh-snug: 1.25;
  --lh-body: 1.65;
  --tracking-display: -0.035em;
  --tracking-tight: -0.02em;
  --tracking-label: 0.14em;

  /* Space (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  --content: 72rem;
  --prose: 42rem;

  /* Radii — scaled up when the browser can draw true squircles */
  --sq: 1;
  --r-xs: calc(8px * var(--sq));
  --r-sm: calc(12px * var(--sq));
  --r-md: calc(18px * var(--sq));
  --r-lg: calc(26px * var(--sq));
  --r-xl: calc(36px * var(--sq));
  --r-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 160ms;
  --dur: 280ms;
  --dur-slow: 700ms;

  --nav-h: 64px;
}

/* ---------- Tokens: light -------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f5f3;
  --bg-elev: #ffffff;
  --surface: rgb(0 0 0 / 0.025);
  --surface-2: rgb(0 0 0 / 0.045);
  --surface-hover: rgb(0 0 0 / 0.065);
  --border: rgb(0 0 0 / 0.08);
  --border-strong: rgb(0 0 0 / 0.14);
  --text: #111113;
  --text-muted: #4f4f57;
  --text-faint: #66666e;
  --accent: #047857;
  --accent-strong: #059669;
  --accent-2: #4d7c0f;
  --accent-ink: #ffffff;
  --crema: #a3561a;
  --success: #15803d;
  --glass: rgb(246 245 243 / 0.72);
  --glass-border: rgb(0 0 0 / 0.07);
  --glow-a: rgb(16 185 129 / 0.13);
  --glow-b: rgb(233 163 91 / 0.16);
  --ring-photo: rgb(0 0 0 / 0.08);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 30px 70px -34px rgb(0 0 0 / 0.28);
  --grain-opacity: 0.035;
}

/* Smooth "Apple-style" corners where supported (Chromium 139+); everyone else
   keeps ordinary rounded corners. */
@supports (corner-shape: squircle) {
  :root { --sq: 1.65; }
  .sq { corner-shape: squircle; }
}

/* ---------- Reset / base --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + var(--space-4));
}
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4 { line-height: var(--lh-snug); letter-spacing: var(--tracking-tight); font-weight: 600; text-wrap: balance; }
p, li { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }

/* ---------- Ambient background: soft aurora + film grain ------------------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 36rem at 12% -8%, var(--glow-a), transparent 60%),
    radial-gradient(50rem 30rem at 95% 4%, var(--glow-b), transparent 62%);
}
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout --------------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--content));
  margin-inline: auto;
}
.container--narrow { width: min(100% - 2 * var(--gutter), var(--prose)); }
main { flex: 1; padding-top: var(--nav-h); }
.section { padding-block: var(--space-8); }
.section--tight { padding-block: var(--space-6); }

.page-head { padding-top: var(--space-8); padding-bottom: var(--space-6); }
.page-head__title {
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  font-weight: 600;
}
.page-head__lede {
  margin-top: var(--space-4);
  max-width: 38rem;
  color: var(--text-muted);
  font-size: var(--fs-lg);
  line-height: 1.55;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}
.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
}

.section-title {
  font-size: var(--fs-2xl);
  letter-spacing: var(--tracking-display);
  margin-bottom: var(--space-5);
}

/* ---------- Navigation (sticky glass) -------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
}
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
}
.brand__logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  transition:
    background-color 320ms var(--ease-out),
    color 320ms var(--ease-out),
    transform 320ms var(--ease-spring);
}
.brand__mark {
  width: 34px;
  height: 34px;
  background: currentColor;
  -webkit-mask: url("/assets/img/logo-mark-96.png") center / contain no-repeat;
  mask: url("/assets/img/logo-mark-96.png") center / contain no-repeat;
}
/* Accent ring that draws itself clockwise around the avatar */
@property --ring {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.brand__logo::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--accent) var(--ring), transparent var(--ring));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  transition: --ring 560ms var(--ease-out);
  pointer-events: none;
}
.brand:hover .brand__logo,
.brand:focus-visible .brand__logo { background: var(--text); color: var(--bg); }
.brand:hover .brand__logo::after,
.brand:focus-visible .brand__logo::after { --ring: 360deg; }
.brand:active .brand__logo { transform: scale(0.92); }
.brand__name { font-size: 0.95rem; }

.nav__links { display: none; }
.nav__links > ul,
.submenu { list-style: none; padding: 0; }
.nav__links a,
.submenu-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-3);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-fast), background-color var(--dur-fast);
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--text); }
.nav__links a[aria-current="page"] { background: var(--surface-2); }

.nav__actions { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  transition: color var(--dur-fast), background-color var(--dur-fast);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* Theme toggle: shows the theme it switches to */
[data-theme-toggle] svg { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .icon-sun,
:root[data-theme="light"] [data-theme-toggle] .icon-moon { display: block; }

/* Burger: sits left of the logo; negative margin lines the bars up with the page gutter */
.burger { margin-left: -13px; }
.burger__bars { position: relative; width: 18px; height: 12px; }
.burger__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease-out), top var(--dur) var(--ease-out), opacity var(--dur-fast);
}
.burger__bars span:nth-child(1) { top: 0; }
.burger__bars span:nth-child(2) { top: 5.25px; }
.burger__bars span:nth-child(3) { top: 10.5px; }
.nav[data-open] .burger__bars span:nth-child(1) { top: 5.25px; transform: rotate(45deg); }
.nav[data-open] .burger__bars span:nth-child(2) { opacity: 0; }
.nav[data-open] .burger__bars span:nth-child(3) { top: 5.25px; transform: rotate(-45deg); }

/* Mobile menu sheet */
@media (max-width: 59.99rem) {
  .brand__name { font-size: 0.9rem; }
  .nav[data-open] { height: 100dvh; background: var(--bg); }
  .nav[data-open] .nav__inner { height: var(--nav-h); }
  .nav[data-open] .nav__links {
    display: block;
    position: fixed;
    inset: var(--nav-h) 0 0;
    overflow-y: auto;
    padding: var(--space-5) var(--gutter) var(--space-8);
  }
  .nav__links > ul > li { border-bottom: 1px solid var(--border); }
  .nav__links a {
    width: 100%;
    min-height: 60px;
    padding-inline: 0;
    border-radius: 0;
    background: none !important;
    color: var(--text);
    font-size: var(--fs-xl);
    font-weight: 500;
    letter-spacing: var(--tracking-tight);
  }
  .nav__links a[aria-current="page"] { color: var(--accent); }
  .has-menu { display: grid; grid-template-columns: 1fr auto; }
  .submenu-toggle { justify-content: center; width: 60px; min-height: 60px; padding: 0; color: var(--text); }
  .submenu-toggle svg { width: 22px; height: 22px; transition: transform var(--dur) var(--ease-out); }
  .has-menu[data-open] .submenu-toggle svg { transform: rotate(180deg); }
  .submenu { display: none; grid-column: 1 / -1; padding-bottom: var(--space-3); }
  .has-menu[data-open] .submenu { display: block; }
  .submenu a {
    min-height: 48px;
    padding-left: var(--space-4);
    font-size: var(--fs-base);
    color: var(--text-muted);
  }
  .nav[data-open] .nav__links > ul > li {
    animation: menu-in var(--dur-slow) var(--ease-out) both;
  }
  .nav[data-open] .nav__links > ul > li:nth-child(2) { animation-delay: 40ms; }
  .nav[data-open] .nav__links > ul > li:nth-child(3) { animation-delay: 80ms; }
  .nav[data-open] .nav__links > ul > li:nth-child(4) { animation-delay: 120ms; }
  .nav[data-open] .nav__links > ul > li:nth-child(5) { animation-delay: 160ms; }
  .nav[data-open] .nav__links > ul > li:nth-child(6) { animation-delay: 200ms; }
  .nav[data-open] .nav__links > ul > li:nth-child(7) { animation-delay: 240ms; }
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(12px); }
}

@media (min-width: 60rem) {
  .burger { display: none; }
  .brand__name { font-size: 1rem; }
  .nav__links { display: block; }
  .nav__links > ul { display: flex; align-items: center; gap: var(--space-1); }
  .has-menu { position: relative; display: flex; align-items: center; }
  .has-menu > a { padding-right: var(--space-1); }
  .submenu-toggle { padding-inline: var(--space-1) var(--space-2); }
  .submenu-toggle svg { width: 14px; height: 14px; transition: transform var(--dur) var(--ease-out); }
  .has-menu[data-open] .submenu-toggle svg { transform: rotate(180deg); }
  .submenu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    min-width: 15rem;
    padding: var(--space-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    background: var(--bg-elev);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -6px);
    transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), visibility 0s linear var(--dur);
  }
  /* invisible bridge so the pointer can travel from link to panel */
  .submenu::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; }
  .has-menu:hover .submenu,
  .has-menu:focus-within .submenu,
  .has-menu[data-open] .submenu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition-delay: 0s;
  }
  .submenu a {
    display: flex;
    width: 100%;
    border-radius: var(--r-sm);
    padding-inline: var(--space-3);
    color: var(--text-muted);
  }
  .submenu a:hover { background: var(--surface-2); color: var(--text); }
}

/* ---------- Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-5);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease-spring), background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:hover { background: color-mix(in oklab, var(--text) 86%, var(--accent)); }
.btn--ghost { border-color: var(--border-strong); background: var(--surface); }
.btn--ghost:hover { background: var(--surface-hover); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }
.text-link svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease-out); }
.text-link:hover svg { transform: translate(2px, -2px); }

/* ---------- Pills, chips, status ------------------------------------------ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
}
.pill--status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crema);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--crema) 25%, transparent);
}
.pill--live::before {
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 25%, transparent);
  animation: pulse 2.4s var(--ease-out) infinite;
}
@keyframes pulse {
  50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--success) 0%, transparent); }
}
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; }
.chip {
  padding: 0.28rem 0.65rem;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ---------- Photo frames (squircle + hairline ring) ------------------------ */
.frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  isolation: isolate;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--ring-photo);
  pointer-events: none;
}

/* ---------- Card ----------------------------------------------------------- */
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: var(--space-5);
}

/* ==========================================================================
   HOME
   ========================================================================== */
.hero {
  padding-top: var(--space-7);
  padding-bottom: var(--space-6);
  text-align: center;
}
.hero__portrait {
  position: relative;
  width: clamp(168px, 44vw, 228px);
  margin: 0 auto var(--space-6);
}
.hero__portrait .frame { aspect-ratio: 4 / 5; border-radius: var(--r-xl); }
.hero__portrait::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: calc(var(--r-xl) + 10px);
  background: conic-gradient(from var(--angle, 0deg), var(--accent-strong), var(--accent-2), var(--accent-strong));
  filter: blur(26px);
  opacity: 0.32;
  animation: halo 12s linear infinite;
}
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes halo { to { --angle: 360deg; } }

.hero__title {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  font-weight: 600;
}
.hero__title span { display: block; }
.hero__title .muted { color: var(--text-faint); font-weight: 500; }
.gradient-text {
  background: linear-gradient(100deg, var(--text) 8%, var(--accent) 52%, var(--accent-2) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__subtitle {
  margin-top: var(--space-5);
  color: var(--text-muted);
  font-size: clamp(0.95rem, 0.88rem + 0.4vw, 1.125rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.6em;
}
.hero__subtitle span:not(.dot) { white-space: nowrap; }
.hero__subtitle .dot { color: var(--text-faint); }

.socials {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  list-style: none;
  padding: 0;
}
.social {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: transform var(--dur) var(--ease-spring), background-color var(--dur-fast), border-color var(--dur-fast);
}
.social svg { width: 20px; height: 20px; }
.social:hover { transform: translateY(-3px); background: var(--surface-hover); border-color: var(--text-faint); }

/* The signature element: the section button stack */
.stack {
  display: grid;
  gap: var(--space-3);
  width: min(100%, 40rem);
  margin: var(--space-7) auto var(--space-8);
  padding: 0;
  list-style: none;
}
.stack__btn {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-4);
  min-height: 76px;
  padding: var(--space-4) var(--space-5);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: left;
  text-decoration: none;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur), background-color var(--dur);
}
.stack__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(22rem circle at var(--mx) var(--my), color-mix(in oklab, var(--accent) 16%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur);
}
.stack__btn:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-2px); }
.stack__btn:hover::before { opacity: 1; }
.stack__label { display: grid; gap: 2px; }
.stack__title {
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
}
.stack__desc { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.4; }
.stack__arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  transition: background-color var(--dur), color var(--dur);
}
.stack__arrow svg { width: 18px; height: 18px; transition: transform var(--dur) var(--ease-spring); }
.stack__arrow.is-ext svg { transform: rotate(-45deg); }
.stack__btn:hover .stack__arrow { background: var(--accent); color: var(--accent-ink); }
.stack__btn:hover .stack__arrow svg { transform: translateX(3px); }
.stack__btn:hover .stack__arrow.is-ext svg { transform: rotate(-45deg) translateX(3px); }

/* ==========================================================================
   ABOUT
   ========================================================================== */
.collage {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-3);
}
/* Phones: the presentation photo (first on desktop) spans the row below the two squares */
.collage .frame:nth-child(1) { grid-column: 1 / -1; grid-row: 2; aspect-ratio: 16 / 10; }
.collage .frame:nth-child(2),
.collage .frame:nth-child(3) { grid-column: span 3; aspect-ratio: 1; }
.collage .frame:nth-child(1) img { object-position: 50% 45%; }
.collage .frame:nth-child(2) img { object-position: 90% 30%; }
.collage .frame:nth-child(3) img { object-position: 5% 50%; }
@media (min-width: 48rem) {
  .collage { gap: var(--space-4); }
  .collage .frame:nth-child(n) { grid-column: span 2; grid-row: auto; aspect-ratio: 4 / 5; }
}

.intro {
  margin-top: var(--space-8);
  font-size: clamp(1.15rem, 1.02rem + 0.6vw, 1.45rem);
  line-height: 1.6;
  color: var(--text-muted);
}
.intro strong { color: var(--text); font-weight: 600; }

.journey {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.journey li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text);
  font-weight: 500;
}
.journey li::before {
  counter-increment: step;
  content: "0" counter(step);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
.journey li:last-child::before { border-color: var(--accent); color: var(--accent); }
@media (min-width: 48rem) {
  .journey { grid-template-columns: repeat(3, 1fr); }
}

.two-col { display: grid; gap: var(--space-7); }
@media (min-width: 60rem) {
  .two-col { grid-template-columns: 1.25fr 1fr; gap: var(--space-8); }
}

.timeline { list-style: none; padding: 0; }
.timeline li {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 0 0 var(--space-6) var(--space-6);
  border-left: 1px solid var(--border-strong);
}
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.45rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--text-faint);
}
.timeline li:first-child::before { border-color: var(--accent); background: var(--accent); }
.timeline__date { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-faint); letter-spacing: 0.04em; }
.timeline__school { font-weight: 600; font-size: var(--fs-lg); letter-spacing: var(--tracking-tight); }
.timeline__degree { color: var(--text-muted); }

.link-list { display: grid; gap: var(--space-3); list-style: none; padding: 0; }
.link-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-4);
  min-height: 64px;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), transform var(--dur) var(--ease-out);
}
.link-card:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-2px); }
.link-card__meta { font-size: var(--fs-xs); color: var(--text-faint); font-family: var(--font-mono); letter-spacing: 0.04em; }
.link-card__title { font-weight: 600; line-height: 1.35; }
.link-card svg { width: 18px; height: 18px; color: var(--text-faint); transition: transform var(--dur) var(--ease-out), color var(--dur-fast); }
.link-card:hover svg { color: var(--text); transform: translate(2px, -2px); }
.sub-title {
  margin: var(--space-6) 0 var(--space-4);
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}
.sub-title:first-child { margin-top: 0; }

.callout {
  display: grid;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background:
    radial-gradient(40rem 20rem at 0% 0%, var(--glow-a), transparent 70%),
    radial-gradient(30rem 20rem at 100% 100%, var(--glow-b), transparent 70%),
    var(--surface);
}
.callout h2 { font-size: var(--fs-2xl); letter-spacing: var(--tracking-display); line-height: 1.1; }
.callout p { margin-top: var(--space-3); color: var(--text-muted); max-width: 34rem; }
@media (min-width: 48rem) {
  .callout { grid-template-columns: 1fr auto; padding: var(--space-7); }
}

/* ==========================================================================
   TECH — bento
   ========================================================================== */
.bento { display: grid; gap: var(--space-4); }
@media (min-width: 60rem) {
  .bento { grid-template-columns: repeat(12, 1fr); }
  .bento__feature { grid-column: span 12; }
  .bento__half { grid-column: span 6; }
}

.project {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  transition: border-color var(--dur);
}
.project:hover { border-color: var(--border-strong); }
@media (min-width: 48rem) { .project { padding: var(--space-7); } }
@media (min-width: 60rem) {
  .project--wide { grid-template-columns: 1fr 1.1fr; align-items: center; gap: var(--space-7); }
}
.project__top { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.project__title {
  font-size: var(--fs-2xl);
  line-height: 1.08;
  letter-spacing: var(--tracking-display);
  margin-top: var(--space-4);
}
.project__desc { margin-top: var(--space-4); color: var(--text-muted); }
.project .chips { margin-top: var(--space-5); }
.project__foot { margin-top: var(--space-5); }

/* Pipeline diagram: real architecture from the brief, drawn as a flow */
.flow {
  position: relative;
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background:
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--bg-elev);
  background-blend-mode: normal;
}
.flow__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--space-2);
}
.flow__steps { display: grid; gap: var(--space-2); list-style: none; padding: 0; }
.flow__step {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.flow__step small {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  font-weight: 400;
}
.flow__step::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 2px;
  background: var(--accent);
}
.flow__step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(var(--space-4) + 3.5px);
  top: 100%;
  width: 1px;
  height: var(--space-2);
  background: var(--accent);
  opacity: 0.6;
}
.flow__rail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.skills { display: grid; gap: var(--space-4); }
@media (min-width: 40rem) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .skills { grid-template-columns: repeat(4, 1fr); } }
.skill-group h3 { font-size: var(--fs-base); margin-bottom: var(--space-3); }
.skill-group .chips .chip { font-size: 0.78rem; }

.earlier {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
@media (min-width: 48rem) {
  .earlier { grid-template-columns: 1fr auto; align-items: end; padding: var(--space-6); }
}
.earlier h3 { font-size: var(--fs-xl); letter-spacing: var(--tracking-tight); }
.earlier p { color: var(--text-muted); margin-top: var(--space-2); max-width: 44rem; }
.earlier-list { display: grid; gap: var(--space-4); }
.earlier .earlier__meta {
  margin: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.earlier .earlier__stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-3);
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.earlier__stat strong {
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.earlier .chips { margin-top: var(--space-4); }

/* ==========================================================================
   COFFEE
   ========================================================================== */
.brew-grid { display: grid; gap: var(--space-4); }
@media (min-width: 40rem) { .brew-grid { grid-template-columns: repeat(2, 1fr); } }

.brew-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  text-decoration: none;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur);
}
.brew-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.brew-card__art {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  margin: var(--space-2);
  border-radius: calc(var(--r-xl) - var(--space-2));
  background:
    radial-gradient(70% 90% at 50% 100%, color-mix(in oklab, var(--crema) 34%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface-2), transparent);
  color: var(--text);
}
.brew-card__art svg {
  width: 44%;
  height: auto;
  transition: transform var(--dur-slow) var(--ease-spring);
}
.brew-card:hover .brew-card__art svg { transform: translateY(-6px) rotate(-3deg); }
.brew-card:hover .stack__arrow { background: var(--accent); color: var(--accent-ink); }
.brew-card:hover .stack__arrow svg { transform: translateX(3px); }
.brew-card__body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-5);
}
.brew-card__title { font-size: var(--fs-xl); letter-spacing: var(--tracking-tight); line-height: 1.2; }
.brew-card__desc { color: var(--text-muted); font-size: var(--fs-sm); margin-top: var(--space-1); }

/* Article */
.article-head { padding-top: var(--space-7); padding-bottom: var(--space-5); }
.article-head .page-head__title { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem); line-height: 1.08; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; font-size: var(--fs-sm); color: var(--text-faint); margin-bottom: var(--space-5); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb li + li::before { content: "/"; margin-right: var(--space-2); color: var(--text-faint); }
.byline { margin-top: var(--space-3); font-size: var(--fs-sm); color: var(--text-faint); }
.byline a { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.byline a:hover { color: var(--text); }

.glance {
  padding: var(--space-5);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--border));
  border-radius: var(--r-lg);
  background: color-mix(in oklab, var(--accent) 6%, var(--surface));
}
.glance__title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs) !important;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent) !important;
}
.glance dl { display: grid; gap: var(--space-2) var(--space-5); margin-top: var(--space-3); }
@media (min-width: 40rem) { .glance dl { grid-template-columns: 1fr 1fr; } }
.glance div { display: grid; grid-template-columns: 5.5rem 1fr; gap: var(--space-3); align-items: baseline; }
.glance dt { font-size: var(--fs-sm); color: var(--text-faint); }
.glance dd { margin: 0; font-weight: 600; color: var(--text); font-size: var(--fs-sm); }

.faq h3 { margin-top: var(--space-5); font-size: var(--fs-lg); letter-spacing: var(--tracking-tight); }
.faq h3 + p { margin-top: var(--space-2); }

.article-hero-art {
  display: grid;
  place-items: center;
  aspect-ratio: 21 / 9;
  margin-top: var(--space-6);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background:
    radial-gradient(60% 100% at 50% 100%, color-mix(in oklab, var(--crema) 30%, transparent), transparent 70%),
    var(--surface);
}
.article-hero-art svg { height: 70%; width: auto; }
.credit { display: block; margin-top: var(--space-2); font-size: var(--fs-xs); line-height: 1.5; color: var(--text-faint); }
.credit a, .prose .credit a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); }
.credit a:hover { color: var(--text-muted); }

.prose-figure { margin-block: var(--space-6) !important; }
.prose-figure figcaption { margin-top: var(--space-3); font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.5; }
.prose-figure--portrait { max-width: 26rem; margin-inline: auto; }

/* Chart figure (Plotly renders into .chart) */
.chart-figure {
  margin-block: var(--space-6) !important;
  padding: var(--space-5) var(--space-4) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
}
@media (min-width: 48rem) { .chart-figure { padding: var(--space-6); } }
.chart-figure__title { font-size: var(--fs-lg); font-weight: 600; color: var(--text) !important; letter-spacing: var(--tracking-tight); }
.chart-figure__sub { margin-top: var(--space-1); font-size: var(--fs-sm); color: var(--text-muted); }
.chart { min-height: 360px; margin-top: var(--space-4); }
@media (min-width: 48rem) { .chart { min-height: 440px; } }
.chart-figure__source { margin-top: var(--space-4); font-size: var(--fs-xs); color: var(--text-faint) !important; }
.chart-table { margin-top: var(--space-4); font-size: var(--fs-sm); }
.chart-table summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--text-muted); font-weight: 500; }
.chart-table summary:hover { color: var(--text); }
.chart-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: var(--space-2) var(--space-3); text-align: right; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.chart-table th:first-child { text-align: left; color: var(--text); }
.chart-table thead th { color: var(--text-faint); font-weight: 500; font-size: var(--fs-xs); }

.prose { font-size: 1.075rem; }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 {
  margin-top: var(--space-8);
  font-size: var(--fs-2xl);
  letter-spacing: var(--tracking-display);
  line-height: 1.12;
}
.prose h3 { margin-top: var(--space-6); font-size: var(--fs-xl); }
.prose p, .prose li { color: var(--text-muted); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: var(--space-2); }
.prose a { color: var(--accent); }

.profile {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-2);
  margin-top: var(--space-5) !important;
}
.profile div {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.profile dt { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-faint); }
.profile dd { margin-top: var(--space-1); font-weight: 600; line-height: 1.4; color: var(--text); }
.profile dd small { display: block; font-weight: 400; color: var(--text-muted); font-size: var(--fs-sm); }

.steps { list-style: none; padding: 0 !important; counter-reset: s; }
.steps > li {
  position: relative;
  padding: 0 0 var(--space-5) 3.25rem;
  counter-increment: s;
}
.steps > li + li { margin-top: 0; }
.steps > li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.05rem - 0.5px);
  top: 2.2rem;
  bottom: 0.3rem;
  width: 1px;
  background: var(--border-strong);
}
.steps strong { display: block; color: var(--text); }
.steps .note { display: block; margin-top: var(--space-1); font-size: var(--fs-sm); color: var(--text-faint); }

.tip {
  padding: var(--space-5);
  border: 1px solid color-mix(in oklab, var(--crema) 35%, var(--border));
  border-radius: var(--r-lg);
  background: color-mix(in oklab, var(--crema) 7%, transparent);
}
.tip > * + * { margin-top: var(--space-3); }

.references {
  margin-top: var(--space-8) !important;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.references h2 { margin-top: 0; font-size: var(--fs-sm); font-family: var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-faint); font-weight: 500; }
.references ol { margin-top: var(--space-4); padding-left: 1.25rem; }
.references li { font-size: var(--fs-sm); color: var(--text-faint); overflow-wrap: anywhere; }
.references a { color: var(--text-muted); }

.pager {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
@media (min-width: 40rem) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a:last-child { text-align: right; }
.pager .link-card { grid-template-columns: 1fr; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-hero { text-align: center; padding-top: var(--space-8); padding-bottom: var(--space-6); }
.contact-hero .page-head__lede { margin-inline: auto; }
.mail-cta {
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  margin-top: var(--space-7);
}
.mail-cta .btn { min-height: 60px; padding-inline: var(--space-7); font-size: var(--fs-base); }
.mail-cta__addr { display: flex; align-items: center; gap: var(--space-2); color: var(--text-muted); font-family: var(--font-mono); font-size: var(--fs-sm); }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding-inline: var(--space-3);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.copy-btn:hover { background: var(--surface-2); color: var(--text); }
.copy-btn svg { width: 16px; height: 16px; }
.social-cards {
  display: grid;
  gap: var(--space-3);
  max-width: 48rem;
  margin: var(--space-7) auto 0;
  list-style: none;
  padding: 0;
  text-align: left;
}
@media (min-width: 40rem) { .social-cards { grid-template-columns: repeat(3, 1fr); } }
.social-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  min-height: 9rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-decoration: none;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur), background-color var(--dur);
}
.social-card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--surface-2); }
.social-card svg { width: 24px; height: 24px; }
.social-card__name { font-weight: 600; align-self: end; }
.social-card__handle { color: var(--text-faint); font-size: var(--fs-sm); font-family: var(--font-mono); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding-block: var(--space-6) var(--space-7);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-faint);
}
.footer__inner { display: grid; justify-items: center; gap: var(--space-4); }
.to-top {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.to-top svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease-spring); }
.to-top:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.to-top:hover svg { transform: translateY(-3px); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
.footer__links {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: calc(-1 * var(--space-2));
  padding: 0;
  list-style: none;
}
.footer__links a,
.footer__links button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-3);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
}
.footer__links a:hover,
.footer__links button:hover { color: var(--text); background: var(--surface-2); }

/* ==========================================================================
   Cookie consent banner
   ========================================================================== */
.consent {
  position: fixed;
  inset: auto 0 0;
  z-index: 70;
  padding: var(--space-3);
  pointer-events: none;
}
.consent[hidden],
.consent [hidden] { display: none !important; }
.consent__card {
  pointer-events: auto;
  width: min(100%, 40rem);
  margin-inline: auto;
  padding: var(--space-5);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  background: color-mix(in oklab, var(--bg-elev) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 60rem) {
  .consent { inset: auto auto 0 0; padding: var(--space-5); }
  .consent__card { width: 30rem; margin: 0; }
}
.consent__head { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: start; }
.consent__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--accent);
}
.consent__icon svg { width: 22px; height: 22px; }
.consent__title { font-size: var(--fs-base); font-weight: 600; letter-spacing: var(--tracking-tight); }
.consent__desc { margin-top: var(--space-2); font-size: var(--fs-sm); line-height: 1.55; color: var(--text-muted); }
.consent__desc a { color: var(--text); font-weight: 500; }
.consent__prefs {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.consent__prefs[hidden] { display: none; }
.consent__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
}
.consent__opt strong { display: block; font-size: var(--fs-sm); color: var(--text); }
.consent__opt small { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-faint); line-height: 1.45; }
.consent__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
}
.consent__actions .btn { flex: 1 1 8rem; min-height: 44px; }
.consent__link {
  margin-right: auto;
  min-height: 44px;
  padding-inline: var(--space-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.consent__link:hover { color: var(--text); }
.consent__link[hidden] { display: none; }
@media (max-width: 30rem) {
  .consent__link { flex-basis: 100%; order: 3; margin: 0; }
}

/* Switch (styled checkbox) */
.switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  transition: transform var(--dur) var(--ease-spring);
}
.switch:checked { background: var(--accent-strong); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: 0.55; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .consent .consent__card { transform: translateY(16px); opacity: 0; transition: transform 420ms var(--ease-out), opacity 420ms var(--ease-out); }
  .consent.is-open .consent__card { transform: none; opacity: 1; }
}

/* ==========================================================================
   Search dialog (command palette)
   ========================================================================== */
.search {
  width: min(100% - 2rem, 36rem);
  max-height: min(70dvh, 32rem);
  margin: 12dvh auto auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search[open] { display: flex; flex-direction: column; animation: pop var(--dur) var(--ease-out); }
.search::backdrop { background: rgb(0 0 0 / 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.search__bar { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4); border-bottom: 1px solid var(--border); }
.search__bar svg { width: 18px; height: 18px; color: var(--text-faint); flex: none; }
.search__input {
  flex: 1;
  min-width: 0;
  height: 56px;
  border: 0;
  background: none;
  font-size: var(--fs-base);
  outline: none;
}
.search__input::placeholder { color: var(--text-faint); }
.search__input::-webkit-search-cancel-button { appearance: none; }
.kbd {
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}
.search__results { overflow-y: auto; padding: var(--space-2); list-style: none; }
.search__results a {
  display: grid;
  gap: 2px;
  padding: var(--space-3);
  border-radius: var(--r-sm);
  text-decoration: none;
}
.search__results a:hover,
.search__results a[aria-selected="true"] { background: var(--surface-2); }
.search__results .r-title { font-weight: 500; }
.search__results .r-section { font-size: var(--fs-xs); color: var(--text-faint); font-family: var(--font-mono); }
.search__empty { padding: var(--space-5); color: var(--text-faint); text-align: center; font-size: var(--fs-sm); }

/* ==========================================================================
   404
   ========================================================================== */
.notfound { text-align: center; padding-block: var(--space-10); }
.notfound__code { font-size: clamp(5rem, 3rem + 14vw, 12rem); font-weight: 700; letter-spacing: -0.06em; line-height: 1; }

/* ==========================================================================
   Motion: scroll reveal + view transitions (all gated on reduced motion)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }

  .hero__portrait { animation: rise 900ms var(--ease-out) both; }
  .hero__title span { animation: rise 900ms var(--ease-out) both; }
  .hero__title span:nth-child(2) { animation-delay: 90ms; }
  .hero__subtitle { animation: rise 900ms 180ms var(--ease-out) both; }
  .socials { animation: rise 900ms 260ms var(--ease-out) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
