/* =========================================================================
   Purushottam Nardewad: portfolio
   Paper & ink, one signal-orange accent, Space Grotesk + JetBrains Mono.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --canvas: #f6f3ee;
  --surface: #edeae4;
  --surface-strong: #e2ded6;
  --ink: #141413;
  --ink-soft: #5f5d58;
  --accent: #ff4f1a;
  --accent-text: #c4360b;
  --line: color-mix(in oklab, var(--ink) 13%, transparent);
  --line-strong: color-mix(in oklab, var(--ink) 26%, transparent);
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 18px 40px -22px rgb(0 0 0 / .28);
  --grain-opacity: .085;
  --card-hi: #ece8e1;
  --card-lo: #d6d1c7;

  --font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --header-h: 80px;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1360px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #141413;
    --surface: #1c1c1a;
    --surface-strong: #282825;
    --ink: #f3f1ec;
    --ink-soft: #a6a49d;
    --accent: #ff6b35;
    --accent-text: #ff8a5c;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 18px 40px -20px rgb(0 0 0 / .7);
    --grain-opacity: .06;
    --card-hi: #45453f;
    --card-lo: #242422;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #141413;
  --surface: #1c1c1a;
  --surface-strong: #282825;
  --ink: #f3f1ec;
  --ink-soft: #a6a49d;
  --accent: #ff6b35;
  --accent-text: #ff8a5c;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 18px 40px -20px rgb(0 0 0 / .7);
  --grain-opacity: .06;
  --card-hi: #45453f;
  --card-lo: #242422;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
html.no-scroll { overflow: hidden; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color .4s, color .4s;
}

/* Film grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-weight: 600; }

::selection { background: var(--accent); color: #141413; }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .01em;
}
.soft { color: var(--ink-soft); }

.sr-only {
  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: fixed;
  top: 12px; left: 12px;
  z-index: 400;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--canvas);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .3s var(--ease);
}
.skip-link:focus { transform: none; }

/* Rolling text on hover: duplicate slides up from below */
.roll {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.25;
}
.roll > span {
  display: inline-block;
  transition: transform .5s var(--ease);
}
.roll::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 100%;
  white-space: nowrap;
  transition: transform .5s var(--ease);
}
a:hover .roll > span, button:hover .roll > span,
a:focus-visible .roll > span, button:focus-visible .roll > span,
a:hover .roll::after, button:hover .roll::after,
a:focus-visible .roll::after, button:focus-visible .roll::after {
  transform: translateY(-100%);
}

/* Shared type */
.eyebrow {
  display: flex;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.eyebrow span { color: var(--ink); }

.display {
  margin: 0;
  font-size: clamp(38px, 5vw, 78px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.045em;
}

.section {
  --sec-pad: clamp(64px, 7vw, 104px);
  padding-block: var(--sec-pad);
  /* When jumping to a section, land its heading just below the floating header */
  scroll-margin-top: calc(var(--header-h) + 20px - var(--sec-pad));
}
.section-head { margin-bottom: clamp(36px, 4.5vw, 64px); }
.section-head-split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 48px;
}
.section-aside {
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.section-aside p { margin: 0; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: .98rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .3s, color .3s, border-color .3s, transform .3s var(--ease);
}
.btn svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .4s var(--ease);
}
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(.98); }
.btn-solid { background: var(--ink); color: var(--canvas); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-wide { width: 100%; justify-content: center; height: 58px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 14px 0 auto;
  z-index: 60;
  pointer-events: none;
  transition: transform .5s var(--ease);
}
.site-header.is-hidden { transform: translateY(calc(-100% - 20px)); }

/* Floating pill */
.header-inner {
  pointer-events: auto;
  width: min(620px, calc(100% - 2 * var(--gutter)));
  max-width: none;
  height: 58px;
  margin-inline: auto;
  padding: 7px 7px 7px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--canvas);
  box-shadow: 0 14px 34px -14px rgb(0 0 0 / .45);
  transition: box-shadow .35s;
}
.site-header.is-scrolled .header-inner { box-shadow: 0 18px 40px -14px rgb(0 0 0 / .55); }

.wordmark {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.04em;
  text-decoration: none;
}
.wordmark-dot { color: var(--accent); }
.wordmark { display: inline-block; transform-origin: 50% 55%; }
.wordmark.swing { animation: swing 1.8s cubic-bezier(.3,.7,.2,1); }
@keyframes swing {
  0% { transform: none; }
  18% { transform: rotate(-22deg); }
  50% { transform: rotate(190deg); }
  72% { transform: rotate(372deg); }
  86% { transform: rotate(356deg); }
  100% { transform: rotate(360deg); }
}

.header-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: color-mix(in oklab, var(--canvas) 62%, transparent);
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 55%, transparent); }
  80%, 100% { box-shadow: 0 0 0 9px transparent; }
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background-color .3s;
}
.icon-btn:hover { background: color-mix(in oklab, var(--canvas) 12%, transparent); }
.icon-btn svg {
  grid-area: 1 / 1;
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .5s var(--ease), opacity .3s;
}
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: none; }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(.6); }

.menu-btn {
  width: 52px; height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  transition: transform .3s var(--ease);
}
.menu-btn:active { transform: scale(.95); }
.menu-dots { display: flex; gap: 4px; }
.menu-dots i {
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  transition: transform .4s var(--ease);
}
.menu-btn:hover .menu-dots i:nth-child(1) { transform: translateY(-3px); }
.menu-btn:hover .menu-dots i:nth-child(2) { transform: translateY(0); transition-delay: .05s; }
.menu-btn:hover .menu-dots i:nth-child(3) { transform: translateY(3px); transition-delay: .1s; }

/* ---------- Navigation dialog (side sheet) ---------- */
.nav-dialog {
  width: 100%; max-width: none;
  height: 100%; max-height: none;
  margin: 0; padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.nav-dialog::backdrop { background: transparent; }
/* Dim + blur the page behind the sheet */
.nav-dialog::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgb(12 12 11 / .42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.nav-dialog.is-open::before { opacity: 1; }

.nav-panel {
  position: fixed;
  top: 14px; right: 14px; bottom: 14px;
  width: min(620px, calc(100% - 28px));
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 40px);
  border-radius: 28px;
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 40px 90px -30px rgb(0 0 0 / .55);
  opacity: 0;
  transform: translateX(40px) scale(.98);
  transform-origin: right center;
  transition: opacity .45s var(--ease), transform .6s var(--ease);
}
.nav-dialog.is-open .nav-panel { opacity: 1; transform: none; }
[data-theme="dark"] .nav-panel { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 40px 90px -30px rgb(0 0 0 / .8); }

.nav-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
}

.nav-close {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 1.05rem;
  cursor: pointer;
}
.nav-close-x {
  position: relative;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink);
}
.nav-close .nav-close-x { width: 54px; height: 54px; transition: transform .4s var(--ease); }
.nav-close:hover .nav-close-x { transform: scale(1.06); }
.nav-close-x::before, .nav-close-x::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 1.6px;
  background: var(--canvas);
  transform: translate(-50%, -50%) rotate(45deg);
  transition: transform .4s var(--ease);
}
.nav-close .nav-close-x::before, .nav-close .nav-close-x::after { width: 18px; height: 2px; }
.nav-close-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.nav-close:hover .nav-close-x::before,
.sheet-close:hover .nav-close-x::before { transform: translate(-50%, -50%) rotate(135deg); }
.nav-close:hover .nav-close-x::after,
.sheet-close:hover .nav-close-x::after { transform: translate(-50%, -50%) rotate(45deg); }

.nav-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: clamp(28px, 5vh, 52px); }
.nav-links { display: flex; flex-direction: column; }
.nav-links a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  font-size: clamp(48px, min(11vh, 13vw), 104px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.04;
  text-decoration: none;
  transition: opacity .35s, transform .45s var(--ease);
}
.nav-links:has(a:hover) a:not(:hover) { opacity: .3; }
.nav-links a:hover { transform: translateX(10px); }
.nav-word { position: relative; display: inline-block; overflow: hidden; padding-bottom: .06em; white-space: nowrap; }
.nav-word .ch {
  display: inline-block;
  transform: translateY(110%);
  transition: transform .8s var(--ease);
  transition-delay: calc(var(--d, 0ms) + var(--i, 0) * 18ms);
}
.nav-dialog.is-open .nav-word .ch { transform: none; }
/* Current section marker: small orange dot after the word */
.nav-links a[aria-current="true"]::after {
  content: "";
  align-self: center;
  width: .14em; height: .14em;
  margin-top: .1em;
  border-radius: 50%;
  background: var(--accent);
}

.nav-sub { display: flex; flex-wrap: wrap; gap: 10px 28px; opacity: 0; transition: opacity .5s .3s; }
.nav-dialog.is-open .nav-sub { opacity: 1; }
.nav-sub a {
  font-size: 1.12rem;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  transition: background-size .45s var(--ease);
}
.nav-sub a:hover, .nav-sub a[aria-current="true"] { background-size: 100% 1.5px; }

.nav-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  opacity: 0;
  transition: opacity .5s .4s;
}
.nav-dialog.is-open .nav-foot { opacity: 1; }
.nav-mail { font-size: 1rem; text-decoration: none; overflow-wrap: anywhere; }
.nav-mail:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav-socials { display: flex; gap: 10px; }
.nav-icon {
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--canvas);
  transition: transform .35s var(--ease), background-color .25s;
}
.nav-icon:hover { transform: translateY(-3px) rotate(-6deg); background: var(--accent); color: #141413; }
.nav-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon svg.fill { fill: currentColor; stroke: none; }

@media (max-width: 560px) {
  .nav-panel { top: 10px; right: 10px; bottom: 10px; width: calc(100% - 20px); border-radius: 22px; }
  .nav-close-label { display: none; }
  .nav-icon { width: 46px; height: 46px; }
}

/* ---------- Hero ---------- */
.hero {
  --title-size: min(10.6vw, 17svh, 188px);
  --card-w: clamp(180px, min(46svh, 32vw), 420px);
  --card-h: calc(var(--card-w) * 1.15);
  --card-bottom: 28px;
  --overlap: calc(var(--title-size) * .22);
  position: relative;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
}

/* Background code with a cursor spotlight */
.hero-code {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: clamp(10.5px, .9vw, 13.5px);
  line-height: 1.6;
}
.code-layer {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5vw;
  padding: calc(var(--header-h) + 22px) var(--gutter) 0;
  overflow: hidden;
}
.code-layer pre { margin: 0; font: inherit; white-space: pre; overflow: hidden; }
.code-layer b { font-weight: 600; }
.code-base { color: color-mix(in oklab, var(--ink) 10%, transparent); }
.code-base b { color: color-mix(in oklab, var(--ink) 26%, transparent); }
.code-lit {
  opacity: .6;
  -webkit-mask-image: radial-gradient(230px circle at var(--mx, -999px) var(--my, -999px), #000 0%, rgb(0 0 0 / .45) 45%, transparent 72%);
  mask-image: radial-gradient(230px circle at var(--mx, -999px) var(--my, -999px), #000 0%, rgb(0 0 0 / .45) 45%, transparent 72%);
}

.hero-stage { position: absolute; inset: 0; }

.hero-title {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--card-bottom) + var(--card-h) - var(--overlap));
  z-index: 3; /* type sits in front of the photo card */
  pointer-events: none;
  margin: 0;
  font-size: var(--title-size);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.032em;
  text-align: center;
  text-transform: uppercase;
}
.hero-line {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-inline: .04em;
  white-space: nowrap;
}
.hero-word { display: inline-block; }
.hero-word .ch { display: inline-block; }

/* Code-tag marks around the title: ‹SOFTWARE  ENGINEER/› */
.hero-mark { display: inline-flex; flex: none; }
.hero-mark svg {
  height: .5em;
  width: auto;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 5.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
  filter: drop-shadow(.035em .035em 0 color-mix(in oklab, var(--ink) 16%, transparent));
}
.mark-open { margin-right: .1em; }
.mark-close { margin-left: .1em; }

/* Entrance: SOFTWARE drops from above, ENGINEER rises from below.
   Replays every time the hero comes back into view. */
.word-top { --from: -108%; --base: 80ms; margin-right: .26em; }
.word-bottom { --from: 108%; --base: 220ms; }
.js .hero-word .ch {
  transform: translateY(var(--from));
  transition: transform .5s var(--ease-in-out);
}
.js .hero.is-in .hero-word .ch {
  transform: none;
  transition: transform 1s var(--ease);
  transition-delay: calc(var(--base) + var(--i) * 42ms);
}
.js .hero-mark {
  opacity: 0;
  transition: opacity .3s, transform .5s var(--ease-in-out);
}
.js .mark-open { transform: translateX(-60%) scale(.7); }
.js .mark-close { transform: translateX(60%) scale(.7); }
.js .hero.is-in .hero-mark {
  opacity: 1;
  transform: none;
  transition: opacity .6s .55s, transform .9s var(--ease) .55s;
}

.hero-card {
  position: absolute;
  left: 50%;
  bottom: var(--card-bottom);
  z-index: 2;
  width: var(--card-w);
  height: var(--card-h);
  margin: 0;
  transform: translateX(-50%);
}
.hero-card .pc-front { position: absolute; inset: 0; }

/* Front face of the portrait card (hero) */
.pc-front {
  overflow: hidden;
  border-radius: 14px;
  background: radial-gradient(75% 60% at 50% 30%, var(--card-hi) 0%, var(--card-lo) 100%);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
}
.pc-front img {
  position: absolute;
  left: 50%;
  top: 8%;
  width: 94%;
  height: auto;
  max-width: none;
  transform: translateX(-50%);
}

/* Portrait that travels from the hero to the About section while scrolling */
.portrait-traveler {
  position: absolute;
  top: 0; left: 0;
  z-index: 2;
  perspective: 1600px;
  pointer-events: none;
  will-change: transform, width, height;
  opacity: 0;
  animation: fadeUp 1.2s var(--ease) .45s forwards;
}
@keyframes fadeUp { from { opacity: 0; margin-top: 40px; } to { opacity: 1; margin-top: 0; } }
.pt-inner { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.pt-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.pt-back { transform: rotateY(180deg); }
.has-traveler .hero-card,
.has-traveler .chalk-board { visibility: hidden; }
.has-traveler .chalk-board { transform: none; }

.hero-meta {
  position: absolute;
  left: 0; right: 0;
  bottom: 30px;
  margin-inline: auto;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.js .hero-meta { opacity: 0; animation: fadeIn 1s var(--ease) .9s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

.hero-loc { display: flex; flex-direction: column; gap: 10px; }
.hero-loc-line { display: flex; align-items: center; gap: 10px; margin: 0; }
.hero-loc-line .scope { width: 64px; height: 22px; border-radius: 6px; }
.hero-year {
  margin: 0;
  font-size: clamp(40px, 6.4svh, 66px);
  font-weight: 600;
  line-height: .9;
  letter-spacing: -.045em;
}
.scope {
  width: 96px; height: 30px;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: color-mix(in oklab, var(--surface) 60%, transparent);
}
.scope-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.scope-trace path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.scope-trace { animation: scope 1.4s linear infinite; }
@keyframes scope { to { transform: translateX(-30px); } }

.hero-focus {
  margin: 0;
  padding-bottom: 4px;
  font-size: clamp(15px, 1.5vw, 24px);
  font-weight: 500;
  letter-spacing: -.01em;
  text-align: right;
  white-space: nowrap;
}
.hero-focus .brace { font-weight: 600; }
.hero-focus .typed { margin-left: .2em; }
.hero-focus .caret { margin-right: .25em; }
.caret {
  display: inline-block;
  width: .6em; height: 1.15em;
  margin-left: 3px;
  vertical-align: -.22em;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr .78fr 1fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.about-role {
  margin: 26px 0 0;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.about-role span { color: var(--ink-soft); }

.about-now {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.about-now .mono { padding-top: 4px; text-transform: uppercase; letter-spacing: .08em; }
.about-now p { margin: 0; line-height: 1.5; }
.about-now a { text-decoration: none; }
.about-now a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Chalkboard portrait card */
.chalk-card { margin: 0; }
.chalk-board { position: relative; aspect-ratio: 4 / 5; transform: rotate(-1.6deg); }
.chalk-surface {
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(58% 46% at 52% 40%, #3d3d39 0%, #2a2a27 52%, #1b1b19 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06), inset 0 0 70px rgb(0 0 0 / .5), var(--shadow);
}
.chalk-surface::after {
  /* chalk dust smudges */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 18% at 20% 85%, rgb(255 255 255 / .05), transparent 70%),
    radial-gradient(30% 14% at 82% 12%, rgb(255 255 255 / .045), transparent 70%);
}
.chalk-doodles { position: absolute; inset: 0; width: 100%; height: 100%; }
.chalk {
  fill: none;
  stroke: rgb(241 239 233 / .8);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chalk.thin { stroke-width: 1.3; stroke: rgb(241 239 233 / .55); }
.chalk.dash { stroke-dasharray: 3 6; }
.chalk-surface > img {
  position: absolute;
  left: 50%;
  bottom: -42%;
  height: 122%;
  width: auto;
  max-width: none;
  transform: translateX(-50%);
  filter:
    drop-shadow(2px 0 0 rgb(241 239 233 / .85))
    drop-shadow(-2px 0 0 rgb(241 239 233 / .85))
    drop-shadow(0 -2px 0 rgb(241 239 233 / .85));
}
.chalk-card figcaption { margin-top: 18px; text-align: center; }

.about-copy p { margin: 0 0 18px; color: var(--ink-soft); }
.about-copy .ink { color: var(--ink); font-weight: 600; }
.about-copy .lead {
  margin-bottom: 24px;
  color: var(--ink);
  font-size: clamp(20px, 1.7vw, 25px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.lead strong {
  font-weight: 600;
  background: linear-gradient(transparent 64%, color-mix(in oklab, var(--accent) 32%, transparent) 64%);
}
.about-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.about-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.icon-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  color: var(--ink-soft);
  transition: color .25s, background-color .25s, transform .35s var(--ease);
}
.icon-link svg {
  width: 26px; height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-link svg.fill { fill: currentColor; stroke: none; }
.icon-link:hover, .icon-link:focus-visible {
  color: var(--canvas);
  background: var(--ink);
  transform: translateY(-3px);
}
/* Label tooltip */
.icon-link::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--canvas);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity .25s, transform .35s var(--ease);
}
.icon-link:hover::after, .icon-link:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Skills ---------- */
.stack-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 48px;
  margin-bottom: clamp(36px, 5vw, 72px);
}
.stack-title {
  margin: 0;
  font-size: clamp(52px, 7.4vw, 112px);
  font-weight: 600;
  line-height: .92;
  letter-spacing: -.045em;
}
.stack-tagline {
  margin: 0 0 .4em;
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.45;
}

.stack-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3.6vw, 56px);
  align-items: start;
}
/* Staircase offset, like a specimen sheet */
.stack-col:nth-child(2) { margin-top: clamp(40px, 6vw, 90px); }
.stack-col:nth-child(3) { margin-top: clamp(80px, 12vw, 180px); }

.stack-col { padding-top: clamp(28px, 3vw, 44px); border-top: 2px solid var(--ink); }
.stack-col h3 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(30px, 2.9vw, 44px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.035em;
}
.stack-note {
  max-width: 30ch;
  margin: 18px 0 28px;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.5;
}

.chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips-grid li {
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: color-mix(in oklab, var(--surface-strong) 55%, transparent);
  font-size: clamp(15px, 1.15vw, 18px);
  font-weight: 500;
  line-height: 1.2;
  cursor: default;
  transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--ease);
}
.chips-grid li.key { border-color: var(--ink); background: var(--ink); color: var(--canvas); }
.chips-grid li:hover { transform: translateY(-2px); border-color: var(--ink); }
.chips-grid li:not(.key):hover { background: var(--surface-strong); }

/* ---------- Work: folders ---------- */
.folders {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 48px) clamp(16px, 2vw, 28px);
}
.folder {
  all: unset;
  display: block;
  align-self: start; /* buttons centre their content when stretched */
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.folder:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: 18px; }

.folder-scene {
  position: relative;
  display: block;
  height: 300px;
  perspective: 1100px;
  transform: rotateY(var(--lean, 0deg));
  transition: transform .35s var(--ease);
}
.folder-back {
  position: absolute;
  inset: 58px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}
.folder-back::before {
  content: "";
  position: absolute;
  left: -1px; top: -22px;
  width: 44%; height: 24px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 16px 0 0;
  background: var(--surface-strong);
}

.paper {
  position: absolute;
  left: 11%; right: 11%;
  top: 20px;
  height: 184px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
  box-shadow: 0 1px 2px rgb(0 0 0 / .06);
  transform-origin: 50% 100%;
  transition: transform .6s var(--ease);
}
.paper-1 { z-index: 1; transform: translate(-10px, 14px) rotate(-7deg); }
.paper-3 { z-index: 2; transform: translate(4px, 18px) rotate(4deg); }
.paper-2 { z-index: 3; left: 9%; right: 9%; padding: 7px; transform: translate(2px, 4px) rotate(-1.5deg); }
.folder:hover .paper-1, .folder:focus-visible .paper-1 { transform: translate(-30px, -22px) rotate(-13deg); }
.folder:hover .paper-3, .folder:focus-visible .paper-3 { transform: translate(28px, -18px) rotate(10deg); }
.folder:hover .paper-2, .folder:focus-visible .paper-2 { transform: translate(0, -46px) rotate(-2deg); }

.paper-label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.paper-lines {
  display: block;
  height: 46px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 11px);
}

.folder-front {
  position: absolute;
  z-index: 4;
  inset: 124px 0 6px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 22px 30px -26px rgb(0 0 0 / .55);
  transform-origin: 50% 100%;
  transition: transform .6s var(--ease), background-color .4s;
}
.folder:hover .folder-front, .folder:focus-visible .folder-front { transform: rotateX(-24deg); }
.folder-title { font-size: clamp(22px, 1.9vw, 27px); font-weight: 600; line-height: 1.1; letter-spacing: -.035em; }
.folder-open {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--canvas);
  transition: transform .5s var(--ease);
}
.folder:hover .folder-open { transform: rotate(45deg); }
.folder-open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.folder-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 14px 4px 0;
  color: var(--ink-soft);
  font-size: .88rem;
}
.folder-action { color: var(--ink); font-weight: 500; }
.folder-action::after { content: "→"; display: inline-block; margin-left: .35em; transition: transform .4s var(--ease); }
.folder:hover .folder-action::after { transform: translateX(4px); }

/* Mini previews on the folder papers */
.mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 10px;
  border-radius: 6px;
  background: var(--surface);
  font-size: 10px;
  line-height: 1.3;
}
.mini-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.mini-top b { font-size: 12.5px; letter-spacing: -.02em; }
.mini-top em { font-style: normal; color: var(--ink-soft); }
.mini-ecg { width: 100%; height: 34px; }
.mini-ecg path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: ecg 2.6s linear infinite;
}
@keyframes ecg { 70%, 100% { stroke-dashoffset: 0; } }
.mini-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mini-tiles > span { display: flex; flex-direction: column; gap: 7px; padding: 7px; border-radius: 5px; background: var(--canvas); }
.mini-tiles em { font-style: normal; color: var(--ink-soft); }
.mini-tiles i, .flow-progress i {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--ink) var(--w), var(--line) var(--w));
}

.mini-code {
  display: block;
  height: 100%;
  padding: 10px 11px;
  overflow: hidden;
  border-radius: 6px;
  background: #171716;
  color: #e9e6df;
  font-size: 9.4px;
  line-height: 1.6;
  white-space: pre;
}
.mini-code .k { color: #ff9a70; }
.mini-code .ok { color: #a6e88a; }

.mini-flow { gap: 0; }
.flow-row { display: flex; align-items: center; }
.flow-row i { flex: 1; min-width: 6px; height: 1px; background: var(--ink-soft); }
.flow-row-2 { margin-top: 10px; padding-left: 18%; }
.node {
  padding: 4px 6px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--canvas);
  font-size: 9.5px;
  white-space: nowrap;
}
.node.is-on { background: var(--ink); color: var(--canvas); }
.node.ghost { border-style: dashed; border-color: var(--ink-soft); color: var(--ink-soft); }
.flow-progress { display: flex; flex-direction: column; gap: 5px; margin-top: auto; }
.flow-progress em { font-style: normal; font-size: 9px; color: var(--ink-soft); }
.flow-progress i { background: linear-gradient(to right, var(--accent) var(--w), var(--line) var(--w)); }

.mini-phone { align-items: center; padding: 8px 10px 0; }
.phone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 112px;
  height: 100%;
  padding: 16px 9px 0;
  border: 1.5px solid var(--ink);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: var(--canvas);
  position: relative;
}
.phone-notch { position: absolute; top: 6px; left: 50%; width: 30px; height: 5px; border-radius: 3px; background: var(--ink); transform: translateX(-50%); }
.phone b { font-size: 11px; letter-spacing: -.02em; }
.phone .field { padding: 5px 6px; border: 1px solid var(--line-strong); border-radius: 5px; }
.phone .field em { font-style: normal; color: var(--ink-soft); font-size: 8.5px; }
.phone-btn { padding: 5px; border-radius: 5px; background: var(--accent); color: #141413; font-size: 8.5px; font-weight: 600; text-align: center; }

/* ---------- Project sheet dialog ---------- */
.sheet {
  width: min(780px, calc(100% - 24px));
  max-height: min(90svh, 920px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 24px;
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 50px 100px -30px rgb(0 0 0 / .55);
}
.sheet[open] { animation: sheetIn .55s var(--ease); }
.sheet::backdrop {
  background: rgb(10 10 9 / .5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fadeIn .4s ease both;
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(28px) scale(.97); } }

.sheet-inner { padding: clamp(20px, 4vw, 44px); }
.sheet-tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
}
.sheet-tab::before {
  content: "";
  width: 16px; height: 12px;
  border-radius: 2px 3px 3px 3px;
  background: var(--ink);
  clip-path: polygon(0 0, 42% 0, 52% 18%, 100% 18%, 100% 100%, 0 100%);
}
.sheet-close {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.sheet-close .nav-close-x { width: 28px; height: 28px; }

.project-meta { margin: 0; text-transform: uppercase; letter-spacing: .08em; }
.project-title {
  margin: 10px 0 18px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 700;
  line-height: .94;
  letter-spacing: -.055em;
}
.project-lead { margin: 0 0 28px; font-size: clamp(18px, 1.8vw, 22px); line-height: 1.38; letter-spacing: -.012em; }
.project-metric {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 6px 16px;
  margin-bottom: 32px;
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--surface);
}
.project-metric strong { font-size: clamp(26px, 3vw, 34px); line-height: 1; letter-spacing: -.045em; }
.project-metric span { color: var(--ink-soft); }
.project h4 { margin: 0; text-transform: uppercase; letter-spacing: .1em; font-weight: 500; }
.project-points { margin: 12px 0 28px; padding-left: 1.15em; color: var(--ink-soft); }
.project-points li + li { margin-top: 9px; }
.project-points li::marker { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; padding: 0; list-style: none; }
.chips li { padding: 6px 13px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .86rem; }
.project-links { display: flex; flex-wrap: wrap; gap: 10px; }
.sheet-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.sheet-nav .text-link { color: var(--ink-soft); transition: color .25s; }
.sheet-nav .text-link:hover { color: var(--ink); }

/* ---------- Résumé viewer ---------- */
.cv {
  width: min(980px, calc(100% - 32px));
  height: min(92svh, 1100px);
  max-width: none; max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: transparent;
  overflow: hidden;
  color: var(--ink);
}
.cv::backdrop {
  background: rgb(10 10 9 / .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.cv[open] { animation: cvIn .6s var(--ease); }
.cv[open]::backdrop { animation: fadeIn .4s ease both; }
.cv.is-closing { animation: cvOut .32s var(--ease-in-out) forwards; }
.cv.is-closing::backdrop { animation: fadeOut .32s ease forwards; }
@keyframes cvIn { from { opacity: 0; transform: translateY(40px) scale(.97); } }
@keyframes cvOut { to { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fadeOut { to { opacity: 0; } }

.cv-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), 0 60px 120px -30px rgb(0 0 0 / .6);
  border-radius: inherit;
}
.cv-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 14px 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}
.cv-file { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cv-file > div { min-width: 0; }
.cv-icon {
  flex: none;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--canvas);
}
.cv-icon svg, .cv-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cv-title { margin: 0; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-meta { margin: 2px 0 0; color: var(--ink-soft); }
.cv-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.cv-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 500; text-decoration: none;
  transition: border-color .25s, background-color .25s, color .25s, transform .3s var(--ease);
}
.cv-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.cv-btn-solid { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.cv-btn-solid:hover svg { animation: dl .6s var(--ease); }
@keyframes dl { 50% { transform: translateY(3px); } }
.cv-close {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer;
}
.cv-close .nav-close-x { width: 38px; height: 38px; }
.cv-close:hover .nav-close-x::before { transform: translate(-50%, -50%) rotate(135deg); }
.cv-close:hover .nav-close-x::after { transform: translate(-50%, -50%) rotate(45deg); }

.cv-scroll {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 1px 1px, color-mix(in oklab, var(--ink) 10%, transparent) 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--surface);
}
.cv-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: clamp(18px, 3vw, 36px) clamp(12px, 3vw, 36px) 48px;
}
.cv-page {
  width: 100%;
  max-width: 820px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 24px 50px -22px rgb(0 0 0 / .35);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  animation: pageIn .6s var(--ease) forwards;
  animation-delay: calc(var(--n, 0) * 90ms);
}
@keyframes pageIn { to { opacity: 1; transform: none; } }
.cv-page canvas { display: block; width: 100%; height: auto; }
.cv-page iframe { display: block; width: 100%; height: 78svh; border: 0; }
.cv-loading { display: flex; align-items: center; gap: 10px; padding: 60px 0; color: var(--ink-soft); }
.cv-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .cv { width: 100%; height: 94svh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .cv[open] { animation-name: cvSheet; }
  @keyframes cvSheet { from { transform: translateY(100%); } }
  .cv-title { font-size: .95rem; }
  .cv-btn { padding: 0 12px; }
  .cv-btn span, .cv-btn-label { display: none; }
  .cv-meta { display: none; }
  .cv-title-name { display: none; }
  .cv-bar { padding: 12px 12px 12px 14px; }
  .cv-icon { width: 38px; height: 38px; }
}

/* ---------- Ask AI chat ---------- */
.ask-head-btn {
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px 0 12px;
  border: 1px solid color-mix(in oklab, var(--canvas) 22%, transparent);
  border-radius: 12px;
  background: transparent;
  color: var(--canvas);
  font: 500 14px/1 var(--font-sans);
  cursor: pointer;
  transition: background-color .3s, border-color .3s;
}
.ask-head-btn svg { width: 16px; height: 16px; fill: var(--accent); transition: transform .45s var(--ease); }
.ask-head-btn:hover { background: color-mix(in oklab, var(--canvas) 12%, transparent); border-color: color-mix(in oklab, var(--canvas) 34%, transparent); }
.ask-head-btn:hover svg { transform: rotate(90deg) scale(1.1); }
.ask-head-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  .ask-head-btn { display: none; } /* the floating button is always there on small screens */
}

.ask-launch {
  position: fixed;
  right: max(20px, calc(env(safe-area-inset-right) + 16px));
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--canvas);
  font: 500 15px/1 var(--font-sans);
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / .45), 0 2px 6px rgb(0 0 0 / .12);
  transition: transform .35s var(--ease), opacity .3s var(--ease), box-shadow .35s var(--ease);
  animation: askLaunchIn .7s var(--ease) 1.1s both;
}
.ask-launch::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1.5px solid var(--accent);
  opacity: 0;
  pointer-events: none;
  animation: askRing 2.4s var(--ease) 2s 2;
}
.ask-launch:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgb(0 0 0 / .5), 0 2px 6px rgb(0 0 0 / .12); }
.ask-launch:hover .ask-launch-spark { transform: rotate(90deg) scale(1.12); }
.ask-launch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ask-launch.is-hidden, .ask-launch.is-tucked { opacity: 0; transform: translateY(14px) scale(.94); pointer-events: none; }
.ask-launch-face {
  width: 34px; height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: #f4f2ed;
  flex: none;
}
.ask-launch-face img, .ask-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ask-launch-spark { width: 16px; height: 16px; fill: var(--accent); margin-left: -2px; transition: transform .45s var(--ease); }
@keyframes askLaunchIn { from { opacity: 0; transform: translateY(18px) scale(.9); } }
@keyframes askRing {
  0% { opacity: .9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.18, 1.5); }
}

.ask {
  position: fixed;
  right: max(20px, calc(env(safe-area-inset-right) + 16px));
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 80;
  width: min(410px, calc(100vw - 32px));
  height: min(660px, calc(100svh - 40px));
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 30px 80px -24px rgb(0 0 0 / .45), 0 4px 14px rgb(0 0 0 / .08);
  overflow: hidden;
  transform-origin: 100% 100%;
  opacity: 0;
  transform: translateY(18px) scale(.95);
  transition: opacity .28s var(--ease), transform .4s var(--ease);
}
.ask[hidden] { display: none; }
.ask.is-open { opacity: 1; transform: none; }

.ask-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.ask-face {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #f4f2ed;
  border: 1px solid var(--line);
  flex: none;
}
.ask-id { flex: 1; min-width: 0; }
.ask-title { margin: 0; font: 600 17px/1.15 var(--font-sans); letter-spacing: -.02em; }
.ask-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ask-status i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgb(34 197 94 / .5);
  animation: askLive 2.2s ease-out infinite;
  flex: none;
}
.ask.is-busy .ask-status i { background: var(--accent); box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 50%, transparent); }
@keyframes askLive { 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.ask-icon-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .2s, color .2s, transform .3s var(--ease);
}
.ask-icon-btn:hover { background: var(--surface-strong); color: var(--ink); }
.ask-icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#askReset:hover svg { transform: rotate(-60deg); }
.ask-icon-btn svg, .ask-send svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .4s var(--ease);
}

.ask-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}
.ask-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 88%;
  animation: askMsgIn .38s var(--ease) both;
}
.ask-msg.is-user { align-self: flex-end; align-items: flex-end; }
@keyframes askMsgIn { from { opacity: 0; transform: translateY(8px); } }
.ask-bubble {
  padding: 10px 14px;
  border-radius: 18px 18px 18px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.ask-msg.is-user .ask-bubble {
  border-radius: 18px 18px 6px 18px;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--canvas);
}
.ask-bubble p { margin: 0 0 .55em; }
.ask-bubble p:last-child, .ask-bubble ul:last-child { margin-bottom: 0; }
.ask-bubble ul { margin: .2em 0 .55em; padding-left: 1.1em; }
.ask-bubble li { margin: .2em 0; }
.ask-bubble li::marker { color: var(--accent); }
.ask-bubble strong { font-weight: 600; }
.ask-bubble a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.ask-caret {
  display: inline-block;
  width: 7px; height: 1.05em;
  margin-left: 2px;
  vertical-align: -.18em;
  border-radius: 2px;
  background: var(--accent);
  animation: askBlink 1s steps(2, start) infinite;
}
@keyframes askBlink { to { visibility: hidden; } }
.ask-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.ask-dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-soft);
  animation: askDot 1.1s var(--ease-in-out) infinite;
}
.ask-dots i:nth-child(2) { animation-delay: .15s; }
.ask-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes askDot { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

.ask-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ask-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink);
  font: 500 13px/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  animation: askMsgIn .4s var(--ease) both;
  transition: background .2s, color .2s, border-color .2s, transform .3s var(--ease);
}
.ask-act:nth-child(2) { animation-delay: .06s; }
.ask-act span { color: var(--accent); transition: transform .3s var(--ease); }
.ask-act:hover { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.ask-act:hover span { transform: translate(2px, -1px); }

.ask-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 16px 12px;
}
.ask-suggest:empty { display: none; }
.ask-chip {
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 13px/1.2 var(--font-sans);
  cursor: pointer;
  animation: askMsgIn .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: border-color .2s, color .2s, background .2s;
}
.ask-chip:hover { border-color: var(--accent); color: var(--accent-text); background: color-mix(in oklab, var(--accent) 7%, transparent); }
.ask-chip:focus-visible, .ask-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ask-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 12px 8px;
  padding: 5px 5px 5px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.ask-form:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent); }
.ask-form textarea {
  flex: 1;
  min-width: 0;
  max-height: 120px;
  padding: 9px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font: 15px/1.4 var(--font-sans);
}
.ask-form textarea::placeholder { color: var(--ink-soft); }
.ask-send {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--canvas);
  cursor: pointer;
  transition: background .2s, opacity .2s, transform .3s var(--ease);
}
.ask-send:not(:disabled):hover { background: var(--accent); color: #fff; }
.ask-send:not(:disabled):hover svg { transform: translateY(-2px); }
.ask-send:disabled { opacity: .3; cursor: default; }
.ask-note {
  margin: 0;
  padding: 0 16px 12px;
  font-size: 10.5px;
  color: var(--ink-soft);
  text-align: center;
}

@media (max-width: 639px) {
  .ask-launch { padding: 5px 15px 5px 5px; font-size: 14px; gap: 8px; }
  .ask-launch-face { width: 30px; height: 30px; }
  .ask {
    right: 0; left: 0; bottom: 0;
    width: 100%;
    height: min(86svh, calc(100svh - 48px));
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    transform: translateY(100%);
    box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0), 0 -20px 60px -20px rgb(0 0 0 / .4);
    transition: opacity .28s var(--ease), transform .45s var(--ease), box-shadow .35s;
  }
  .ask.is-open { box-shadow: 0 0 0 100vmax rgb(0 0 0 / .38), 0 -20px 60px -20px rgb(0 0 0 / .4); }
  .ask-form textarea { font-size: 16px; }
  .ask-note { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .ask, .ask-launch, .ask-msg, .ask-act, .ask-chip { animation: none; transition: opacity .15s; }
  .ask-launch::after, .ask-status i { animation: none; }
  .ask, .ask.is-open { transform: none; }
}

/* ---------- Experience: signal-wave timeline ---------- */
.exp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 48px;
  margin-bottom: clamp(36px, 5vw, 72px);
}
.exp-title {
  margin: 0;
  font-size: clamp(52px, 7.4vw, 112px);
  font-weight: 600;
  line-height: .92;
  letter-spacing: -.045em;
}
.exp-tagline { margin: 0 0 .4em; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.45; }

.wave-tl { position: relative; }
.wave-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.wave-base, .wave-draw { fill: none; stroke-linecap: round; }
.wave-base { stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 2 7; }
.wave-draw { stroke: var(--ink); stroke-width: 2; }

.wave-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Stops alternate high / low so the line becomes a wave */
.wave-list { --dip: clamp(80px, 8vw, 120px); }
/* Cards ride the curve: text sits just under its own node, so high stops
   start higher and low stops lower. Nodes sit mid-column so the curve
   clears the text on both sides. */
.wave-list .trace-item:nth-child(even) .trace-node { margin-top: var(--dip); margin-bottom: 30px; }

.trace-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  margin: 0 0 54px calc(46% - 23px);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--canvas);
  transition: background-color .45s, border-color .45s, transform .45s var(--ease);
}
.trace-node i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--ink-soft);
  transition: background-color .45s, box-shadow .45s;
}
.trace-item.is-lit .trace-node { background: var(--ink); transform: scale(1.06); }
.trace-item.is-lit .trace-node i {
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent) 28%, transparent);
}
.trace-item:first-child.is-lit .trace-node i { animation: pulse 2.2s var(--ease) infinite; }

.trace-when { margin: 12px 0 8px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
.trace-body h3 {
  margin: 0 0 8px;
  font-size: clamp(20px, 1.75vw, 27px);
  line-height: 1.1;
  letter-spacing: -.035em;
}
.trace-org { margin: 0; color: var(--ink); font-weight: 500; font-size: .95rem; }
.trace-org a { text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.trace-org a:hover { text-decoration-color: var(--ink); }
.trace-sum { margin: 12px 0 0; color: var(--ink-soft); font-size: .93rem; line-height: 1.5; }
.trace-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tag-live { border-color: var(--ink); background: var(--ink); color: var(--canvas); }
.tag-live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s var(--ease) infinite;
}
.js .trace-item .trace-body { opacity: .3; transform: translateY(10px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .trace-item.is-lit .trace-body { opacity: 1; transform: none; }

/* Hover / focus: highlight the stop under the cursor */
.trace-item { position: relative; cursor: default; }
.trace-body { position: relative; }
.trace-body::before {
  content: "";
  position: absolute;
  inset: -18px -16px -20px;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: scale(.96);
  transition: opacity .35s var(--ease), transform .45s var(--ease);
}
.trace-body h3 {
  display: inline;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size .5s var(--ease);
}
.trace-body h3 + .trace-org { margin-top: 8px; }
.wave-list .trace-item:is(:hover, :focus-within) .trace-body::before { opacity: 1; transform: none; }
.wave-list .trace-item:is(:hover, :focus-within) .trace-body h3 { background-size: 100% 2px; }
.wave-list .trace-item:is(:hover, :focus-within) .trace-node {
  background: var(--ink);
  transform: scale(1.18);
  box-shadow: 0 0 0 7px color-mix(in oklab, var(--accent) 22%, transparent);
}
.wave-list .trace-item:is(:hover, :focus-within) .trace-node i { background: var(--accent); }
.wave-list .trace-item:is(:hover, :focus-within) .trace-body { opacity: 1; transform: translateY(-4px); }
.wave-list:has(.trace-item:hover) .trace-item:not(:hover) .trace-body { opacity: .35; }
.wave-list:has(.trace-item:hover) .trace-item:not(:hover) .trace-node { transform: scale(.92); }
.trace-node { transition: background-color .45s, border-color .45s, transform .45s var(--ease), box-shadow .45s; }

/* Tablets & phones: vertical timeline */
@media (max-width: 1023px) {
  .wave-list { grid-template-columns: 1fr; gap: 44px; }
  .wave-list .trace-item:nth-child(n) .trace-node { margin: 0; }
  .trace-item { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .trace-node { margin: 0; }
  .trace-tags { margin-top: 10px; }
  .trace-item:not(:has(.trace-tags)) .trace-when { margin-top: 14px; }
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(44px, 6vw, 110px);
  align-items: start;
}
.contact-sub { max-width: 32ch; margin: 26px 0 44px; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.45; }
.mail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.big-mail {
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.035em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .55s var(--ease);
}
.big-mail:hover { background-size: 100% 2px; }
.copy-btn {
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: border-color .25s, background-color .25s, color .25s;
}
.copy-btn:hover { border-color: var(--ink); }
.copy-btn.is-done { background: var(--ink); color: var(--canvas); border-color: var(--ink); }

.contact-list { margin: 0; padding: 0; list-style: none; }
.contact-list li {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: baseline;
  gap: 12px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.contact-list .mono { text-transform: uppercase; letter-spacing: .08em; }
.contact-list a { text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { text-decoration: underline; text-underline-offset: 4px; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(22px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
}
.field-row { display: flex; flex-direction: column; gap: 8px; }
.field-row label { font-size: .92rem; font-weight: 500; }
.field-row input, .field-row textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color .25s, box-shadow .25s;
}
.field-row textarea { min-height: 140px; resize: vertical; }
.field-row input::placeholder, .field-row textarea::placeholder { color: color-mix(in oklab, var(--ink-soft) 75%, transparent); }
.field-row input:focus, .field-row textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent);
}
.field-row [aria-invalid="true"] { border-color: var(--accent-text); }
.form-error { margin: -8px 0 0; color: var(--accent-text); font-size: .92rem; }
.form-error:empty { display: none; }
.form-note { margin: -6px 0 0; text-align: center; }

/* ---------- Footer ---------- */
.site-footer { overflow: hidden; }
.foot-top {
  padding-top: clamp(64px, 8vw, 110px);
  background: #0f0f0e;
  color: #f3f1ec;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1fr;
  gap: 40px clamp(32px, 5vw, 80px);
}
.foot-mark {
  font-size: clamp(30px, 2.8vw, 42px);
  font-weight: 700;
  letter-spacing: -.04em;
  text-decoration: none;
}
.foot-mark span { color: var(--accent); }
.foot-brand p { margin: 18px 0 0; color: #a6a49d; line-height: 1.5; }
.foot-label { margin: 6px 0 22px; color: #a6a49d; }
.foot-links { display: flex; flex-wrap: wrap; gap: 14px 30px; max-width: 420px; }
.foot-links a, .foot-mail { color: #f3f1ec; text-decoration: none; font-size: 1.05rem; }
.foot-links a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .45s var(--ease); }
.foot-links a:hover { background-size: 100% 1.5px; }
.foot-mail { display: inline-flex; gap: 8px; overflow-wrap: anywhere; }
.foot-mail:hover { color: var(--accent); }
.foot-icons { display: flex; gap: 8px; margin-top: 20px; }
.foot-icons a {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 1px solid #3a3a36;
  border-radius: 50%;
  color: #f3f1ec;
  transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--ease);
}
.foot-icons a:hover { background: var(--accent); border-color: var(--accent); color: #141413; transform: translateY(-2px); }
.foot-icons svg { width: 18px; height: 18px; fill: currentColor; }
.foot-copy { margin: 22px 0 0; color: #a6a49d; font-size: .88rem; }
.foot-bye {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-block: clamp(48px, 6vw, 80px) 26px;
}
.foot-bye-text { margin: 0; font-size: clamp(36px, 4.4vw, 64px); font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.foot-top-link { color: #f3f1ec; text-decoration: none; }
.foot-top-link span { display: inline-block; margin-left: 6px; transition: transform .35s var(--ease); }
.foot-top-link:hover span { transform: translateY(-4px); }

/* The crowd: you stand still in the middle, everyone else walks past in front of you */
.crowd {
  --scene-h: clamp(380px, 44vw, 640px);
  --paper: #f4f2ed;
  position: relative;
  height: var(--scene-h);
  overflow: hidden;
  background: var(--paper);
  isolation: isolate;
}
.crowd-name {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--scene-h) * .05);
  z-index: 0;
  display: flex;
  justify-content: center;
  margin: 0;
  color: #e3e0d9;
  font-size: 200px;
  font-weight: 700;
  line-height: .82;
  text-transform: uppercase;
  white-space: nowrap;
}
.crowd-name span { display: block; line-height: .82; letter-spacing: -.045em; }

/* You */
.crowd-me {
  position: absolute;
  left: 50%;
  bottom: calc(var(--scene-h) * .02);
  z-index: 2;
  height: calc(var(--scene-h) * .9);
  width: auto;
  max-width: none;
  transform: translateX(-50%);
}

/* Rows */
.crowd-row { position: absolute; left: 0; right: 0; }
.crowd-track { display: flex; align-items: flex-end; width: max-content; height: 100%; }
/* Back row: busts cut off flat at a line, walking left */
.crowd-back {
  --h: calc(var(--scene-h) * .5);
  z-index: 1;
  top: calc(var(--scene-h) * .1);
  height: calc(var(--scene-h) * .6);
  overflow: hidden;
}
.crowd-back .crowd-track { animation: crowd-right var(--loop, 60s) linear infinite; }
/* Front row: closer and bigger, walking right */
.crowd-front {
  --h: calc(var(--scene-h) * .64);
  z-index: 3;
  bottom: 0;
  height: calc(var(--scene-h) * .62);
}
.crowd-front .crowd-track { animation: crowd-left var(--loop, 90s) linear infinite; }
@keyframes crowd-left { to { transform: translateX(-50%); } }
@keyframes crowd-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }

.pp {
  flex: none;
  position: relative;
  height: calc(var(--h) * var(--sc));
  margin-right: calc(var(--h) * -.17);
  margin-bottom: calc(var(--dy, 0px) * -1);
  animation: bob var(--dur) ease-in-out var(--del) infinite alternate;
}
.pp img { display: block; height: 100%; width: auto; max-width: none; }
.pp-flip img { transform: scaleX(-1); }
.pp-gap { flex: none; width: calc(var(--h) * var(--gw, 1)); }
.pp-last { margin-right: 0; }
@keyframes bob { to { transform: translateY(calc(var(--h) * -.022)); } }

.foot-bar { background: #0f0f0e; color: #8d8b85; font-size: .82rem; }
.foot-bar .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px; }
.foot-bar p { margin: 0; }

@media (max-width: 900px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; }
  .crowd { --scene-h: 440px; }
}
@media (prefers-reduced-motion: reduce) {
  .crowd-track, .pp { animation: none !important; }
}

/* Desktop: the whole footer fits in exactly one screen */
@media (min-width: 761px) and (min-height: 560px) {
  .site-footer { height: 100svh; display: flex; flex-direction: column; }
  .foot-top { flex: none; padding-top: clamp(28px, 6svh, 64px); }
  .foot-bye { padding-block: clamp(16px, 4svh, 44px) clamp(14px, 2.4svh, 24px); }
  .foot-bye-text { font-size: clamp(32px, min(4.2vw, 6.4svh), 64px); }
  .crowd { flex: 1 1 auto; height: auto; min-height: 0; }
  .foot-bar { flex: none; }
  .foot-bar .wrap { padding-block: 14px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 350;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--canvas);
  pointer-events: none;
  visibility: hidden;
  transform: translate(-50%, calc(100% + 40px));
  transition: transform .5s var(--ease), visibility 0s linear .5s;
}
.toast.show {
  visibility: visible;
  transform: translate(-50%, 0);
  transition: transform .5s var(--ease), visibility 0s;
}

/* ---------- Reveal on scroll ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--rd, 0ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Theme switch (View Transitions) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stack-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack-col:nth-child(3) { margin-top: 0; }
  .folders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr minmax(240px, .8fr); }
  .about-intro { grid-column: 1; grid-row: 1; }
  .chalk-card { grid-column: 2; grid-row: 1 / span 2; }
  .about-copy { grid-column: 1; grid-row: 2; }
}

@media (max-width: 900px) {
  .hero {
    --title-size: min(10.8vw, 13svh);
    --card-w: min(56vw, 38svh, 400px);
    --card-bottom: 5svh;
  }
  .hero-code { font-size: 10px; }
  .code-base { color: color-mix(in oklab, var(--ink) 7%, transparent); }
  .code-base b { color: color-mix(in oklab, var(--ink) 16%, transparent); }
  .code-layer { grid-template-columns: 1fr; padding-top: calc(var(--header-h) + 140px); }
  .hero-meta {
    top: calc(var(--header-h) + 10px);
    bottom: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .hero-focus { text-align: left; }
  .hero-year { font-size: 40px; }
  .code-b, .code-c { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: 76px; }
  body { font-size: 16px; }
  .header-clock { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-intro, .chalk-card, .about-copy { grid-column: auto; grid-row: auto; }
  .chalk-card { width: min(100%, 360px); justify-self: center; }
  .stack-cols { grid-template-columns: 1fr; gap: 48px; }
  .stack-col:nth-child(n) { margin-top: 0; }
  .stack-col h3 { max-width: none; }


}

@media (max-width: 560px) {
  .hero {
    --title-size: min(10.9vw, 11svh);
    --card-w: min(68vw, 40svh);
  }
  .folders { grid-template-columns: 1fr; }
  .folder-scene { height: 290px; }
  .contact-list li { grid-template-columns: 1fr; gap: 4px; }
  .menu-btn { padding-left: 14px; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }
}
