/* Layout: one left-aligned column on a 12-col grid. Light only. The hero is a live canvas; everything after it stays calm and readable. */
:root {
  --bg: #fbfbfc;
  --paper: #ffffff;
  --surface: #f2f3f7;
  --fg: #101116;
  --muted: #61646f;
  --faint: #c4c7d1;
  --line: #e5e6ec;
  --accent: #2b39e6;
  --accent-deep: #1b228f;
  --accent-ink: #ffffff;
  --accent-soft: #eceefe;
  --todo: #e0177c;

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --step--1: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.1875rem, 1.12rem + 0.35vw, 1.375rem);
  --step-2: clamp(1.5rem, 1.35rem + 0.75vw, 2rem);
  --step-3: clamp(2rem, 1.5rem + 2.4vw, 3.5rem);
  --step-4: clamp(2.75rem, 1.6rem + 5.6vw, 6.75rem);
  --step-5: clamp(3.5rem, 1.5rem + 10vw, 12rem);

  --page: 1280px;
  --read: 42rem;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--fg); color: #fff; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Chrome: progress, cursor label, curtain ─────────────── */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); pointer-events: none; }
.cursor-tag {
  position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none;
  padding: 10px 16px; border-radius: 999px; background: var(--fg); color: #fff;
  font: 500 0.875rem/1 var(--font-sans); white-space: nowrap;
  transform: translate3d(var(--x, -200px), var(--y, -200px), 0) translate(-50%, -50%) scale(var(--s, 0));
  transition: transform 0.25s var(--ease);
}

/* ── Header ─────────────────────────────────────────────── */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; pointer-events: none; }
body::before { content: ''; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 41; background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px; }
.site-header a, .site-header button { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 8px 24px -12px rgb(16 17 22 / 0.18); }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; background: var(--fg); color: #fff; display: grid; place-items: center; font: 600 0.6875rem/1 var(--font-sans); letter-spacing: 0; transition: transform 0.5s var(--spring); }
.brand:hover { color: var(--fg); }
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.08); }
.nav {
  display: flex; align-items: center; gap: 2px; padding: 5px;
  border-radius: 999px; background: color-mix(in srgb, var(--paper) 82%, transparent);
  border: 1px solid var(--line); box-shadow: 0 8px 24px -12px rgb(16 17 22 / 0.18);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.nav a { position: relative; text-decoration: none; color: var(--muted); font-size: 0.9375rem; padding: 8px 14px; border-radius: 999px; transition: color 0.2s, background 0.2s; }
.nav a:hover { color: var(--fg); background: var(--surface); }
.nav a[aria-current='page'] { color: #fff; background: var(--fg); }
.nav a.cta { background: var(--fg); color: #fff; }
.nav a.cta:hover { background: #2c2e38; color: #fff; }
@media (max-width: 600px) { .brand-name { display: none; } .brand { padding: 6px; } .nav a { padding: 8px 11px; font-size: 0.875rem; } }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 24px; border-radius: 999px; overflow: hidden; isolation: isolate;
  font: 500 0.9375rem/1 var(--font-sans); text-decoration: none; cursor: pointer;
  border: 1px solid var(--fg); background: var(--fg); color: #fff;
  transition: color 0.3s, border-color 0.3s;
}
.btn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--accent); border-radius: inherit; transform: translateY(101%); transition: transform 0.45s var(--ease); }
.btn:hover { color: #fff; border-color: var(--accent); }
.btn:hover::before { transform: none; }
.btn.ghost { background: var(--paper); color: var(--fg); border-color: var(--line); }
.btn.ghost::before { background: var(--fg); }
.btn.ghost:hover { color: #fff; border-color: var(--fg); }
.btn .arrow { display: inline-block; transition: transform 0.35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.magnetic { transition: transform 0.35s var(--ease); will-change: transform; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { position: relative; margin-top: -76px; padding-top: 76px; min-height: min(100svh, 980px); display: grid; align-items: center; overflow: hidden; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; -webkit-mask-image: linear-gradient(to right, transparent 30%, #000 68%); mask-image: linear-gradient(to right, transparent 30%, #000 68%); }
@media (max-width: 899px) { .hero-canvas { -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 45%); mask-image: linear-gradient(to bottom, #000 0%, transparent 45%); opacity: 0.6; } }
.hero::after { content: ''; position: absolute; inset: auto 0 0; height: 140px; background: linear-gradient(to bottom, transparent, var(--bg)); z-index: 1; pointer-events: none; }
.hero-inner { position: relative; z-index: 2; padding-block: clamp(48px, 6vw, 96px) clamp(96px, 12vw, 160px); pointer-events: none; }
.hero-inner a, .hero-inner button, .hero-inner [role='switch'] { pointer-events: auto; }
/* "Hi, I'm Nare" as a live Figma-style cursor label */
.hello { position: relative; display: inline-flex; align-items: flex-start; margin: 0 0 28px; padding: 0 0 0 4px; animation: hello-in 1s var(--spring) 0.15s backwards; }
.hello-arrow { width: 26px; height: 26px; flex: none; filter: drop-shadow(0 2px 4px rgb(43 57 230 / 0.35)); animation: hello-nudge 4.5s ease-in-out 1.6s infinite; }
.hello-tag {
  display: inline-flex; align-items: center; gap: 2px; margin: 22px 0 0 -6px;
  padding: 10px 18px 10px 16px; border-radius: 6px 999px 999px 999px;
  background: var(--accent); color: #fff;
  font: 500 clamp(1rem, 0.9rem + 0.4vw, 1.25rem)/1 var(--font-sans); letter-spacing: -0.01em; white-space: nowrap;
  box-shadow: 0 12px 28px -12px rgb(43 57 230 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.25);
}
.hello-text { font-variant-numeric: tabular-nums; }
.hello-caret { width: 2px; height: 1.1em; margin-left: 3px; background: currentColor; border-radius: 1px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
@keyframes hello-in { from { opacity: 0; transform: translate(60px, 24px) rotate(6deg) scale(0.8); } }
@keyframes hello-nudge { 0%, 70%, 100% { transform: none; } 78% { transform: translate(-3px, -3px) rotate(-6deg); } 86% { transform: translate(1px, 1px); } }

.hero-title { font-size: var(--step-4); line-height: 0.98; letter-spacing: -0.045em; font-weight: 600; }
.hero-title .ln { display: block; overflow: hidden; padding: 0.06em 0.15em 0.24em 0.12em; margin: -0.06em -0.15em -0.24em -0.12em; }
.hero-title .ln > span { display: inline-block; transform: translateY(135%); animation: rise 1s var(--ease) forwards; }
.hero-title .ln:nth-child(2) > span { animation-delay: 0.12s; }
.hero-title .ln:nth-child(3) > span { animation-delay: 0.24s; }
@keyframes rise { to { transform: none; } }
.hero-title em { font-style: normal; transition: color 0.5s var(--ease); }

/* The "o" in Product is a working switch */
/* The wrapper holds the line position: an inline-block with no in-flow content sits its bottom edge on the
   baseline in every browser (Safari gives an empty <button> its own baseline, which pushed the toggle down). */
.sw { display: inline-block; position: relative; width: 1.8ex; height: 1ex; margin: 0 0.04em; vertical-align: baseline; }
.switch {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: 1ex; /* ex = height of r and c */
  background: var(--faint); cursor: pointer; border: 0; padding: 0; margin: 0; font: inherit; font-size: inherit; color: inherit; line-height: 1;
  transition: background 0.45s var(--ease);
  box-shadow: inset 0 0.03em 0.08em rgb(0 0 0 / 0.18); -webkit-appearance: none; appearance: none;
}
.switch::after {
  content: ''; position: absolute; top: 0.1ex; left: 0.1ex; width: 0.8ex; height: 0.8ex; border-radius: 50%;
  background: #fff; box-shadow: 0 0.04em 0.1em rgb(0 0 0 / 0.25);
  transition: transform 0.55s var(--spring), width 0.25s var(--ease);
}
.switch:active::after { width: 0.95ex; }
.is-on .switch { background: var(--accent); }
.is-on .switch::after { transform: translateX(0.8ex); }
.is-on .switch:active::after { transform: translateX(0.65ex); }

.cycler { display: inline-grid; vertical-align: bottom; overflow: hidden; padding: 0.08em 0.14em 0.22em 0.12em; margin: -0.08em -0.14em -0.22em -0.12em; color: var(--fg); }
.cycler > span { grid-area: 1 / 1; font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; transform: translateY(170%); transition: transform 0.7s var(--ease); white-space: nowrap; padding-right: 0.08em; }
.cycler > span.on { transform: none; }
.cycler > span.out { transform: translateY(-170%); }
@media (max-width: 700px) { .cycler { display: inline-grid; } }
/* the rotating phrase has its own line; on small screens long phrases wrap inside it */
.hero-title .ln-cyc > span { max-width: 100%; }
.hero-title .ln:nth-child(4) > span { animation-delay: 0.36s; }
@media (max-width: 900px) { .ln-cyc .cycler { font-size: 0.9em; } }
@media (max-width: 600px) { .hero-title { font-size: min(var(--step-4), 11vw); } .ln-cyc .cycler { max-width: 100%; font-size: 0.68em; } }

.hero-sub { margin-top: clamp(32px, 4vw, 48px); display: grid; gap: 28px; justify-items: start; max-width: 40rem; }
.hero .intro { max-width: 37rem; text-wrap: balance; font-size: var(--step-1); line-height: 1.5; color: #4a4d58; }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { white-space: nowrap; }
.hero-sub, .status { opacity: 0; animation: fade 0.9s 0.6s var(--ease) forwards; }
.status { display: flex; align-items: center; gap: 10px; margin-top: clamp(48px, 6vw, 72px); font-size: 0.875rem; color: var(--muted); animation-delay: 0.8s; }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #1f9d63; }
.pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #1f9d63; animation: ping 1.8s infinite; }
@keyframes ping { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.8); opacity: 0; } }

/* Draggable design-system stickers */
.stickers { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.sticker {
  position: absolute; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  border-radius: 16px; background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 18px 40px -20px rgb(16 17 22 / 0.35), 0 2px 6px -2px rgb(16 17 22 / 0.08);
  padding: 12px 14px; font-size: 0.8125rem; line-height: 1.3;
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--r, 0deg)) scale(var(--sc, 1));
  transition: box-shadow 0.3s, scale 0.3s;
  animation: pop 0.8s var(--spring) backwards;
}
.sticker:active { cursor: grabbing; }
.sticker.dragging { --sc: 1.06; box-shadow: 0 30px 60px -20px rgb(16 17 22 / 0.4); z-index: 5; transition: none; }
@keyframes pop { from { opacity: 0; scale: 0.4; } }
.sticker .float { animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -6px; } }
.st-policy { width: 220px; padding: 16px; }
.st-policy .st-k { font: 500 0.6875rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; opacity: 1; }
.st-policy b { display: block; font-size: 0.9375rem; }
.st-policy small { display: block; color: var(--muted); }
.st-policy .chip { display: inline-block; margin-top: 16px; padding: 4px 10px; border-radius: 999px; background: #e3f6ec; color: #13814f; font-weight: 600; font-size: 0.75rem; }
.st-swatch { display: flex; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 0.75rem; }
.st-swatch i { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: block; }
.st-type { font-size: 2.6rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; padding: 14px 18px; }
.st-type small { display: block; font: 500 0.6875rem/1.4 var(--font-mono); letter-spacing: 0.04em; color: var(--muted); margin-top: 6px; }
.st-button { padding: 8px; }
.st-button span { display: block; padding: 11px 26px; border-radius: 999px; background: var(--fg); color: #fff; font-weight: 600; }
.st-toast { display: flex; gap: 10px; align-items: center; padding: 10px 14px; }
.st-toast i { width: 22px; height: 22px; border-radius: 50%; background: #1f9d63; display: grid; place-items: center; color: #fff; font-style: normal; font-size: 0.75rem; }
@media (max-width: 1199px) { .stickers { display: none; } }

/* Figma-style collaborator cursors */
.collab { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0); }
.collab svg { width: 18px; height: 18px; }
.collab span { position: absolute; left: 14px; top: 16px; padding: 3px 8px; border-radius: 6px 999px 999px 999px; font: 600 0.75rem/1.3 var(--font-sans); color: #fff; white-space: nowrap; }
@media (max-width: 700px) { .collab { display: none; } }

/* ── Marquee ────────────────────────────────────────────── */
.marquee { position: relative; overflow: hidden; padding-block: clamp(20px, 3vw, 32px); border-block: 1px solid var(--line); background: var(--paper); }
.marquee-track { display: flex; width: max-content; will-change: transform; backface-visibility: hidden; transform: translateZ(0); }
.marquee-group { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); padding-right: clamp(20px, 3vw, 40px); font-size: var(--step-3); font-weight: 600; letter-spacing: -0.035em; line-height: 1; white-space: nowrap; }
.marquee-group .serif { color: var(--muted); font-weight: 400; }
.marquee-group .star { color: var(--faint); font-size: 0.6em; }

/* ── Statement with scroll-filled words ─────────────────── */
.statement { padding-block: clamp(140px, 20vw, 300px); }
.fill-text { font-size: var(--step-3); line-height: 1.12; letter-spacing: -0.03em; font-weight: 500; max-width: 22ch; }
.js .fill-text .w { color: var(--faint); transition: color 0.25s; }
.js .fill-text .w.lit { color: var(--fg); }
.fill-text .w.serif { color: var(--accent); font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.js .fill-text .w.serif:not(.lit) { color: var(--faint); }
.js .fill-text .w.serif.lit { color: var(--accent); }
.reduce .fill-text .w { color: var(--fg) !important; }
.reduce .fill-text .w.serif { color: var(--accent) !important; }

/* ── Section head ───────────────────────────────────────── */
.section { padding-block: clamp(112px, 15vw, 220px); }
.big-head { display: flex; flex-direction: column; align-items: stretch; gap: clamp(14px, 1.6vw, 22px); margin-bottom: clamp(48px, 7vw, 96px); } /* subtitle sits under the title, full width */
.big-head h2 { font-size: var(--step-4); letter-spacing: -0.045em; line-height: 0.95; }
.big-head h2 .serif { color: var(--fg); }
.big-head p { color: var(--muted); max-width: none; font-size: var(--step-1); }

/* ── Glass folder of case studies ───────────────────────── */
.works { position: relative; }
.folder-scroll { position: relative; height: 320vh; }
@media (min-width: 900px) { html.js:not(.reduce) .folder-scroll { margin-top: min(0px, calc(min(54svh, 500px) + var(--fpad, max(5svh, 96px)) + 96px - max(100svh, 640px))); } }
.folder-stage { position: sticky; top: 0; height: 100svh; min-height: 640px; overflow: hidden; display: grid; align-items: end; justify-items: center; padding-bottom: var(--fpad, max(5svh, 96px)); perspective: 1600px; }
.folder { position: relative; width: min(1180px, 92vw); height: min(54svh, 500px); transform: scale(var(--fs, 1)); transform-origin: 50% 100%; }
.folder-back {
  position: absolute; inset: 0; border-radius: 0 32px 32px 32px;
  background: linear-gradient(180deg, #eff0f4, #e7e9ef);
  box-shadow: inset 0 1px 0 #fff, 0 40px 80px -40px rgb(16 17 22 / 0.28);
}
.folder-back::before { content: ''; position: absolute; left: 0; bottom: 100%; width: 260px; height: 44px; background: #eff0f4; border-radius: 22px 22px 0 0; box-shadow: inset 0 1px 0 #fff; }
.folder-back::after { content: ''; position: absolute; left: 252px; bottom: calc(100% - 1px); width: 46px; height: 44px; background: radial-gradient(circle at 100% 0, transparent 44px, #eef0f4 45px) ; clip-path: inset(0 0 0 0); }
.folder-tab { position: absolute; left: 22px; bottom: calc(100% + 12px); z-index: 1; color: var(--fg); font: 500 0.875rem/1 var(--font-sans); display: inline-flex; gap: 8px; align-items: center; }
.folder-tab b { font-weight: 600; padding: 4px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.files { position: absolute; inset: 0; }
.folder-front {
  position: absolute; left: -1px; right: -1px; bottom: -1px; height: 64%; z-index: 2;
  border-radius: 28px 28px 32px 32px; padding: clamp(20px, 3vw, 36px);
  display: grid; align-content: space-between;
  background: linear-gradient(170deg, rgb(255 255 255 / 0.86), rgb(255 255 255 / 0.7));
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgb(255 255 255 / 0.95);
  outline: 1px solid rgb(16 17 22 / 0.06); outline-offset: 0;
  box-shadow: inset 0 1px 0 #fff, 0 -8px 30px -24px rgb(16 17 22 / 0.16);
  transform-origin: 50% 100%; transform: rotateX(var(--fr, 0deg)); transition: none;
}
.folder-front::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.55) 45%, transparent 60%); background-size: 250% 100%; background-position: var(--sheen, 100%) 0; mix-blend-mode: soft-light; }
.ff-row { display: flex; justify-content: space-between; gap: 12px; }
.ff-row .label { color: var(--muted); }
.ff-title { font-size: var(--step-4); font-weight: 600; letter-spacing: -0.045em; line-height: 0.95; color: var(--fg); }
.ff-title .serif { color: var(--muted); }
.ff-hint { justify-self: end; display: inline-flex; gap: 8px; align-items: center; font-size: 0.875rem; color: #343747; opacity: var(--hint, 1); }
.ff-hint span { display: inline-block; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* Files (case cards) */
.file { display: block; text-decoration: none; color: var(--fg); border-radius: 20px; perspective: 900px; }
.file:hover { color: var(--fg); }
.file-in {
  position: relative; height: 100%; display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  border-radius: 20px; background: rgb(255 255 255 / 0.92); border: 1px solid rgb(255 255 255 / 0.9);
  backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 24px 48px -30px rgb(16 17 22 / 0.3), 0 2px 6px rgb(16 17 22 / 0.05);
  transform: rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg)) translateY(var(--lift, 0px));
  transition: transform 0.5s var(--ease), box-shadow 0.4s;
}
.file:hover .file-in { --lift: -10px; box-shadow: 0 40px 70px -30px rgb(16 17 22 / 0.4), 0 2px 6px rgb(16 17 22 / 0.06); }
.file-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); }
.file-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.file:hover .file-media img { transform: scale(1.06); }
.file-body { display: grid; gap: 6px; align-content: start; padding: 14px 16px 16px; }
.file-body h3 { font-size: 1.0625rem; letter-spacing: -0.015em; }
.file-body .serif { font-size: 1.125rem; line-height: 1.2; color: #3a3d4a; }
.file-go { justify-self: start; margin-top: 6px; display: inline-flex; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--fg); color: #fff; font-size: 0.8125rem; font-weight: 500; transition: background 0.3s, gap 0.3s var(--ease); }
.file:hover .file-go { background: var(--accent); gap: 10px; }
.shine { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgb(255 255 255 / 0.55), transparent 45%); mix-blend-mode: soft-light; }
.file:hover .shine { opacity: 1; }
.lock { position: absolute; top: 10px; left: 10px; z-index: 1; display: inline-flex; gap: 5px; align-items: center; padding: 5px 9px; border-radius: 999px; background: rgb(255 255 255 / 0.85); backdrop-filter: blur(8px); font: 600 0.6875rem/1 var(--font-sans); }
.lock svg { width: 11px; height: 11px; }

/* Desktop: files are placed by the scroll script */
@media (min-width: 900px) {
  .js .file { position: absolute; left: 50%; top: 50%; width: var(--cw, 270px); height: var(--ch, 360px); margin: calc(var(--ch, 360px) / -2) 0 0 calc(var(--cw, 270px) / -2); will-change: transform; }
  html:not(.js) .files { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 24px; inset: auto 0 100% 0; }
}
/* Phone and tablet: a shorter folder, then the files slide out below it */
@media (max-width: 899px) {
  .folder-scroll { height: auto; }
  .folder-stage { position: relative; height: auto; min-height: 0; overflow: visible; display: block; padding: 0 0 24px; }
  .folder { height: auto; margin: 56px auto 0; transform: none; }
  .folder-back { inset: 0 0 auto 0; height: 220px; }
  .folder-back::before { width: 150px; }
  .folder-back::after { left: 142px; }
  .folder-front { top: 64px; bottom: auto; height: 158px; }
  .ff-title { font-size: clamp(2.25rem, 10vw, 3.5rem); }
  .ff-hint { display: none; }
  .files { position: relative; inset: auto; z-index: 3; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding-top: 244px; }
}
/* Phone and tablet with motion: the same scroll-driven folder. Files come out one by one into a row you can swipe through */
@media (max-width: 899px) {
  html.js:not(.reduce) .folder-scroll { height: 240svh; margin-top: min(0px, calc(236px + var(--fpad, max(4svh, 24px)) + 72px - max(100svh, 560px))); }
  html.js:not(.reduce) .folder-stage { touch-action: pan-y; }
  html.js:not(.reduce) .folder-stage { position: sticky; top: 0; height: 100svh; min-height: 560px; overflow: hidden; display: grid; align-items: end; justify-items: center; padding: 0 0 var(--fpad, max(4svh, 24px)); }
  html.js:not(.reduce) .folder { width: min(560px, 100%); height: 236px; margin: 0; transform: scale(var(--fs, 1)); }
  html.js:not(.reduce) .folder-back { inset: 0; height: auto; }
  html.js:not(.reduce) .folder-front { top: auto; bottom: -1px; height: 64%; }
  html.js:not(.reduce) .ff-hint { display: inline-flex; }
  html.js:not(.reduce) .files { position: absolute; inset: 0; display: block; padding: 0; z-index: auto; }
  html.js:not(.reduce) .file { position: absolute; left: 50%; top: 50%; width: var(--cw, 260px); height: var(--ch, 330px); margin: calc(var(--ch, 330px) / -2) 0 0 calc(var(--cw, 260px) / -2); will-change: transform; }
  html.js:not(.reduce) .file .file-in { height: 100%; }
}

/* ── Physics skills pit ─────────────────────────────────── */
.pit { position: relative; height: clamp(300px, 32vw, 400px); border-radius: 28px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; touch-action: pan-y; }
.pit .hint { position: absolute; top: 20px; left: 24px; z-index: 0; }
.pills { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-content: flex-end; justify-content: center; gap: 10px; padding: 64px 24px 24px; }
.pill {
  display: inline-block; padding: 0.55em 1.1em; border-radius: 999px; white-space: nowrap; user-select: none; -webkit-user-select: none;
  font-size: clamp(0.9375rem, 0.8rem + 0.6vw, 1.375rem); font-weight: 500; letter-spacing: -0.01em; line-height: 1.2;
  border: 1.5px solid var(--fg); background: var(--paper); color: var(--fg);
}
.pill.dark { background: var(--fg); color: #fff; }
.pill.blue { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.blue-soft { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-deep); }
.pill.blue-line { border-color: var(--accent); color: var(--accent); }
.pill.soft { background: var(--surface); border-color: var(--surface); color: var(--fg); }
.pill.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: clamp(1.0625rem, 0.9rem + 0.7vw, 1.5rem); }
.pit.live .pills { display: block; padding: 0; }
.pit.live .pill { position: absolute; left: 0; top: 0; cursor: grab; will-change: transform; touch-action: none; }
.pit.live.grabbing .pill { cursor: grabbing; }

/* ── Principles ─────────────────────────────────────────── */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
@media (max-width: 900px) { .principles { grid-template-columns: minmax(0, 1fr); } }
.principle { padding: 28px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); transition: transform 0.5s var(--spring), box-shadow 0.4s, border-color 0.4s; }
.principle:hover { transform: translateY(-6px) rotate(-0.6deg); box-shadow: 0 30px 50px -30px rgb(16 17 22 / 0.3); border-color: transparent; }
.principle .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); color: var(--fg); display: grid; place-items: center; margin-bottom: 40px; transition: transform 0.6s var(--spring), background 0.3s, color 0.3s; }
.principle:hover .ico { transform: rotate(-12deg) scale(1.1); background: var(--fg); color: #fff; }
.principle .ico svg { width: 22px; height: 22px; }
.principle h3 { font-size: var(--step-1); margin-bottom: 10px; letter-spacing: -0.015em; }
.principle p { color: var(--muted); }

/* ── Experience ─────────────────────────────────────────── */
.exp { display: grid; border-top: 1px solid var(--line); }
.exp-row { position: relative; display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: 8px 24px; padding: 26px 12px; border-bottom: 1px solid var(--line); align-items: baseline; isolation: isolate; }
.exp-row::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--surface); transform: scaleY(0); transform-origin: 50% 100%; transition: transform 0.45s var(--ease); border-radius: 12px; }
.exp-row:hover::before { transform: none; }
.exp-row .years { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.exp-row h3 { font-size: var(--step-2); letter-spacing: -0.025em; transition: transform 0.45s var(--ease); }
.exp-row:hover h3 { transform: translateX(8px); }
.exp-row .what { color: var(--muted); font-size: 0.9375rem; margin-top: 6px; }
.exp-row .dom { color: var(--muted); font-size: 0.875rem; text-align: right; }
@media (max-width: 640px) { .exp-row { grid-template-columns: minmax(0, 1fr); } .exp-row .dom { text-align: left; } }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { position: relative; margin-top: clamp(120px, 16vw, 240px); background: var(--fg); color: #fff; border-radius: 36px 36px 0 0; overflow: hidden; }
.site-footer .wrap { padding-block: clamp(56px, 9vw, 112px) 28px; display: grid; gap: clamp(40px, 6vw, 72px); }
.footer-kicker { color: #9a9daa; }
.talk { font-size: var(--step-5); font-weight: 600; letter-spacing: -0.06em; line-height: 0.88; margin-top: 18px; display: flex; flex-wrap: wrap; }
.talk .ch { display: inline-block; transition: transform 0.5s var(--spring), color 0.3s; }
.talk .ch:hover { transform: translateY(-0.12em) rotate(-6deg); color: var(--accent); }
.talk .serif { font-weight: 400; color: #c9cbd6; padding-right: 0.06em; }
.footer-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.email-pill { display: inline-flex; align-items: center; gap: 14px; padding: 18px 26px; border-radius: 999px; background: #fff; color: var(--fg); text-decoration: none; font-size: var(--step-1); font-weight: 500; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.email-pill:hover { color: #fff; background: var(--accent); }
.copy-btn { border: 1px solid rgb(255 255 255 / 0.25); background: transparent; color: #fff; border-radius: 999px; padding: 18px 22px; font: 500 0.9375rem/1 var(--font-sans); cursor: pointer; }
.copy-btn:hover { border-color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; font-size: 0.875rem; color: #9a9daa; padding-top: 24px; border-top: 1px solid rgb(255 255 255 / 0.12); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: #fff; }
.clock { font-variant-numeric: tabular-nums; color: #fff; }

/* ── Inner pages ────────────────────────────────────────── */
.page-head { padding-block: clamp(72px, 12vw, 180px) clamp(48px, 7vw, 96px); }
.page-head h1, .cs-head h1 { font-size: var(--step-4); letter-spacing: -0.045em; line-height: 0.98; max-width: 16ch; }
.page-head .lede, .cs-head .lede { margin-top: 28px; font-size: var(--step-1); color: var(--muted); max-width: 40rem; }
.split .wd { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.split .wd > span { display: inline-block; transform: translateY(105%); animation: rise 0.9s var(--ease) forwards; animation-delay: calc(var(--d) * 45ms); }
.fade-up { opacity: 0; animation: fade 0.9s var(--ease) forwards; animation-delay: var(--delay, 0.35s); }

.cs-head { padding-block: clamp(40px, 8vw, 96px) clamp(28px, 4vw, 48px); }
.back { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; color: var(--muted); font-size: 0.9375rem; margin-bottom: 36px; padding: 8px 14px 8px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); transition: gap 0.3s var(--ease); }
.back:hover { color: var(--fg); gap: 12px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; padding: 0; list-style: none; }
.tags li { padding: 6px 12px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; font-size: 0.8125rem; color: var(--muted); }
.cs-cover { border-radius: 28px; overflow: hidden; background: var(--surface); transform: scale(var(--cs, 1)); transform-origin: 50% 0; will-change: transform; }
.cs-cover img { width: 100%; }
.facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; padding-block: clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--line); margin: 0; }
.facts div { min-width: 0; }
.facts dt { margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 0.9375rem; }
@media (max-width: 900px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.cs-body { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); padding-top: clamp(72px, 10vw, 140px); }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 100px); align-self: start; }
.toc ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); font-size: 0.875rem; line-height: 1.35; transition: color 0.2s, border-color 0.2s, padding 0.3s var(--ease); }
.toc a:hover { color: var(--fg); }
.toc a.active { color: var(--fg); border-left-color: var(--accent); padding-left: 20px; }
@media (max-width: 1000px) { .cs-body { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

.prose { max-width: var(--read); min-width: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: var(--step-3); letter-spacing: -0.035em; margin-top: 3em; scroll-margin-top: 100px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--step-1); margin-top: 2em; letter-spacing: -0.015em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose p, .prose li { color: #2b2d35; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); font-family: var(--font-serif); font-style: italic; font-size: var(--step-2); line-height: 1.25; color: var(--fg); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5em; }
.prose code { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.prose figure { margin: 3.2em 0; }
.prose figure.wide { width: min(100vw - 2 * var(--gutter), calc(var(--read) + 19rem)); max-width: none; }
@media (max-width: 1000px) { .prose figure.wide { width: 100%; } }
.prose figure img { border-radius: var(--radius); background: var(--surface); width: 100%; }
.js .prose figure.wipe img { clip-path: inset(0 0 100% 0 round var(--radius)); transition: clip-path 1.1s var(--ease); }
.js .prose figure.wipe.in img { clip-path: inset(0 0 0 0 round var(--radius)); }
.prose figcaption { margin-top: 12px; font-size: 0.875rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.prose th, .prose td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 500; color: var(--muted); font-size: 0.8125rem; }
.prose .decision { padding: 22px 24px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--fg); }
.prose .decision > * + * { margin-top: 0.6em; }
.prose .decision .label { display: block; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 12px; }
.metric { padding: 22px; border-radius: var(--radius); background: var(--surface); }
.metric b { display: block; font-size: var(--step-3); font-weight: 600; letter-spacing: -0.04em; line-height: 1; color: var(--fg); }
.metric > span { display: block; margin-top: 10px; font-size: 0.875rem; color: var(--muted); }
.todo { color: var(--todo); background: color-mix(in srgb, var(--todo) 12%, transparent); border-radius: 4px; padding: 0 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.next { margin-top: clamp(120px, 15vw, 220px); }
.next a { position: relative; display: block; padding: clamp(32px, 5vw, 64px); border-radius: 28px; background: var(--tint, var(--accent-soft)); text-decoration: none; overflow: hidden; }
.next a:hover { color: var(--fg); }
.next h2 { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: var(--step-4); letter-spacing: -0.03em; margin-top: 12px; max-width: 14ch; }
.next .go { position: absolute; right: clamp(24px, 4vw, 56px); bottom: clamp(24px, 4vw, 56px); width: clamp(56px, 7vw, 88px); height: clamp(56px, 7vw, 88px); border-radius: 50%; background: var(--fg); color: #fff; display: grid; place-items: center; font-size: 1.5rem; transition: transform 0.5s var(--spring), background 0.3s; }
.next a:hover .go { transform: rotate(-45deg) scale(1.1); background: var(--accent); }
.next-peek { position: fixed; left: 0; top: 0; z-index: 30; width: 280px; border-radius: 16px; overflow: hidden; pointer-events: none; box-shadow: 0 30px 60px -20px rgb(16 17 22 / 0.4); transform: translate3d(var(--x, 0), var(--y, 0), 0) translate(-50%, -50%) rotate(var(--r, 0deg)) scale(var(--s, 0)); transition: transform 0.35s var(--ease); }

/* Password gate */
.gate { max-width: 32rem; padding: clamp(24px, 4vw, 40px); border-radius: 24px; background: var(--paper); border: 1px solid var(--line); }
.gate h2 { font-size: var(--step-2); margin-bottom: 12px; }
.gate p { color: var(--muted); }
.gate form { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.gate input { flex: 1 1 14rem; min-width: 0; padding: 14px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 0.9375rem; }
.gate input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.gate .error { margin-top: 12px; color: #c2410c; font-size: 0.875rem; min-height: 1.4em; }
.gate .hint { margin-top: 12px; font-size: 0.875rem; }
.gate.shake { animation: shake 0.45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .about-grid { grid-template-columns: minmax(0, 1fr); } }
.side-list { display: grid; gap: 32px; position: sticky; top: 100px; }
@media (max-width: 860px) { .side-list { position: static; } }
.side-list ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.side-list li { padding: 7px 13px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 0.875rem; transition: background 0.2s, color 0.2s, transform 0.3s var(--spring); }
.side-list li:hover { background: var(--fg); color: #fff; transform: translateY(-2px) rotate(-2deg); }
.portrait { border-radius: 24px; overflow: hidden; aspect-ratio: 4 / 5; max-width: 100%; background: var(--surface); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }

/* Contact */
.contact-list { display: grid; border-top: 1px solid var(--line); }
.contact-row { position: relative; display: grid; grid-template-columns: 10rem minmax(0, 1fr) auto; gap: 8px 24px; align-items: center; padding: 26px 12px; border-bottom: 1px solid var(--line); isolation: isolate; }
.contact-row::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--surface); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.5s var(--ease); border-radius: 12px; }
.contact-row:hover::before { transform: none; }
.contact-row .big { font-size: var(--step-2); font-weight: 500; letter-spacing: -0.02em; text-decoration: none; overflow-wrap: anywhere; }
@media (max-width: 640px) { .contact-row { grid-template-columns: minmax(0, 1fr) auto; } .contact-row .label { grid-column: 1 / -1; } }
.contact-row .copy-btn { color: var(--fg); border-color: var(--line); padding: 10px 16px; font-size: 0.8125rem; }
.contact-row .copy-btn:hover { border-color: var(--fg); }
.contact-row .clock { color: var(--muted); }

/* Scroll reveal: only content that starts below the first screen */
.reveal.pre { opacity: 0; transform: translateY(28px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--stagger, 0) * 80ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal.pre { opacity: 1; transform: none; }
  .hero-title .ln > span, .split .wd > span { transform: none; }
  .hello-caret { display: none; }
  .cs-cover { transform: none; }
  .fill-text .w { color: var(--fg); }
}

/* ── How I work: interactive panel ─────────────────────── */
.how-section { padding-block: clamp(24px, 3.4vw, 56px) 0; }
.how {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 80px); align-items: center; color: var(--fg);
}
.how-left { position: relative; min-width: 0; }
.how-list { list-style: none; margin: 0; padding: 0; }
.how-item { position: relative; border-top: 1px solid var(--line); }
.how-item:last-child { border-bottom: 1px solid var(--line); }
.how-btn { all: unset; box-sizing: border-box; display: flex; align-items: baseline; gap: 18px; width: 100%; padding: 22px 0; cursor: pointer; color: #7c808e; transition: color 0.35s; }
.how-btn:hover { color: var(--muted); }
.how-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.is-active .how-btn { color: var(--fg); }
.how-num { font: 500 0.8125rem/1 var(--font-mono); letter-spacing: 0.04em; transition: color 0.35s; }
.is-active .how-num { color: var(--accent); }
.how-title { font-size: var(--step-2); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.how-text { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s var(--ease); }
.how-text > p { overflow: hidden; color: var(--muted); max-width: 30rem; padding-left: calc(18px + 2ch); }
.is-active .how-text { grid-template-rows: 1fr; }
.is-active .how-text > p { padding-bottom: 24px; }
.how-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.how-bar i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.how.auto .is-active .how-bar i { animation: howbar var(--how-dur, 5.5s) linear forwards; }
@keyframes howbar { to { transform: scaleX(1); } }

.how-stage { position: relative; aspect-ratio: 1 / 0.86; max-width: 100%; border-radius: 26px; overflow: hidden; background: radial-gradient(circle at 1px 1px, rgb(16 17 22 / 0.09) 1px, transparent 0) 0 0 / 18px 18px, var(--surface); border: 1px solid var(--line); }
.hv { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.45s, visibility 0s 0.45s; }
.hv.is-active { opacity: 1; visibility: visible; transition: opacity 0.45s; }
.hv * { box-sizing: border-box; }
@keyframes hv-pop { from { opacity: 0; transform: translateY(14px) scale(0.92); } }
@keyframes hv-pulse { 0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0.9; } 100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }

/* 1 · problem */
.hv-rings i { position: absolute; left: 50%; top: 50%; width: 46%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgb(43 57 230 / 0.35); transform: translate(-50%, -50%); }
.hv-problem.is-active .hv-rings i { animation: hv-pulse 3s ease-out infinite; }
.hv-problem.is-active .hv-rings i:nth-child(2) { animation-delay: 1s; }
.hv-problem.is-active .hv-rings i:nth-child(3) { animation-delay: 2s; }
.hv-chip { position: absolute; padding: 9px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--fg); box-shadow: 0 8px 20px -12px rgb(16 17 22 / 0.3); font-size: 0.875rem; white-space: nowrap; }
.hv-chip.c1 { left: 9%; top: 16%; } .hv-chip.c2 { right: 8%; top: 30%; } .hv-chip.c3 { left: 16%; bottom: 14%; }
.hv-problem.is-active .hv-chip { animation: hv-in 1.1s var(--spring) backwards; }
.hv-problem.is-active .c1 { --fx: -60px; --fy: -40px; } .hv-problem.is-active .c2 { --fx: 70px; --fy: -10px; animation-delay: 0.15s; } .hv-problem.is-active .c3 { --fx: -40px; --fy: 60px; animation-delay: 0.3s; }
@keyframes hv-in { from { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(0.8); } }
.hv-core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 14px 22px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; white-space: nowrap; box-shadow: 0 0 0 8px rgb(43 57 230 / 0.15), 0 20px 50px -14px rgb(43 57 230 / 0.6); }
.hv-problem.is-active .hv-core { animation: hv-core 0.9s var(--spring) 0.7s backwards; }
@keyframes hv-core { from { opacity: 0; transform: translate(-50%, -50%) scale(0.3); } }

/* 2 · system */
.hv-system { display: grid; grid-template-columns: 0.9fr 1.1fr; align-items: center; gap: 6%; padding: 9%; }
.hv-tokens { display: grid; gap: 10px; }
.tk { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); color: var(--fg); font: 500 0.75rem/1 var(--font-mono); }
.tk i { width: 22px; height: 22px; border-radius: 7px; flex: none; }
.tk b { width: 22px; text-align: center; font: 600 0.9375rem/1 var(--font-sans); color: var(--fg); }
.tk .sp { background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 6px); border-radius: 3px; height: 10px; }
.hv-system.is-active .tk { animation: hv-tk 0.7s var(--ease) backwards; }
.hv-system.is-active .t2 { animation-delay: 0.12s; } .hv-system.is-active .t3 { animation-delay: 0.24s; } .hv-system.is-active .t4 { animation-delay: 0.36s; }
@keyframes hv-tk { from { opacity: 0; transform: translateX(-30px); } }
.cp-card { display: grid; gap: 10px; padding: 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 30px 60px -24px rgb(16 17 22 / 0.35); }
.cp-l { height: 12px; width: 80%; border-radius: 6px; background: #e5e6ec; }
.cp-l.s { width: 55%; background: #f2f3f7; }
.cp-btn { margin-top: 8px; padding: 11px 16px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.875rem; font-weight: 600; text-align: center; }
.hv-system.is-active .cp-card { animation: hv-pop 0.8s var(--spring) 0.6s backwards; }
.hv-system.is-active .cp-l { animation: hv-grow 0.7s var(--ease) 1s backwards; transform-origin: 0 50%; }
.hv-system.is-active .cp-l.s { animation-delay: 1.15s; }
.hv-system.is-active .cp-btn { animation: hv-pop 0.7s var(--spring) 1.4s backwards; }
@keyframes hv-grow { from { transform: scaleX(0); } }

/* 3 · open */
.hv-open { display: grid; align-content: center; gap: 12px; padding: 8%; }
.msg { justify-self: start; max-width: 88%; padding: 12px 16px 12px 12px; border-radius: 6px 18px 18px 18px; background: var(--paper); border: 1px solid var(--line); color: var(--fg); box-shadow: 0 8px 20px -14px rgb(16 17 22 / 0.3); font-size: 0.9375rem; display: flex; gap: 10px; align-items: center; }
.msg .who { flex: none; padding: 3px 8px; border-radius: 6px 999px 999px 999px; color: #fff; font: 600 0.6875rem/1.3 var(--font-sans); }
.msg.me { justify-self: end; border-radius: 18px 6px 18px 18px; background: var(--accent-soft); border-color: rgb(43 57 230 / 0.2); }
.hv-open.is-active .msg { animation: hv-pop 0.6s var(--spring) backwards; }
.hv-open.is-active .m2 { animation-delay: 0.7s; } .hv-open.is-active .m3 { animation-delay: 1.4s; } .hv-open.is-active .m4 { animation-delay: 2.2s; }

/* 4 · learn */
.hv-chart { position: absolute; left: 7%; right: 7%; top: 20%; width: 86%; height: auto; overflow: visible; }
.hv-chart .grid { stroke: rgb(16 17 22 / 0.08); stroke-width: 1; fill: none; }
.hv-chart .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 0; }
.hv-chart .dot { fill: #fff; stroke: var(--accent); stroke-width: 4; }
.hv-learn.is-active .line { animation: hv-draw 1.8s var(--ease) 0.2s backwards; }
.hv-learn.is-active .dot { animation: hv-dot 0.6s var(--spring) 1.9s backwards; transform-origin: 310px 28px; }
@keyframes hv-draw { from { stroke-dashoffset: 420; } }
@keyframes hv-dot { from { transform: scale(0); } }
.hv-tag { position: absolute; padding: 7px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--fg); box-shadow: 0 8px 20px -14px rgb(16 17 22 / 0.3); font-size: 0.8125rem; white-space: nowrap; }
.hv-tag.k1 { left: 9%; bottom: 16%; } .hv-tag.k2 { left: 38%; bottom: 30%; } .hv-tag.k3 { right: 7%; top: 9%; }
.hv-tag.up { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.hv-learn.is-active .hv-tag { animation: hv-pop 0.6s var(--spring) backwards; }
.hv-learn.is-active .k1 { animation-delay: 0.4s; } .hv-learn.is-active .k2 { animation-delay: 1s; } .hv-learn.is-active .k3 { animation-delay: 1.9s; }

@media (max-width: 899px) {
  .how { grid-template-columns: minmax(0, 1fr); }
  .how-stage { order: -1; aspect-ratio: 4 / 3.4; }
  .how-text > p { padding-left: 0; }
  .hv-chip, .msg, .tk { font-size: 0.75rem; }
  .hv-system { padding: 7%; }
  .hv-core { padding: 10px 16px; font-size: 0.875rem; }
  .hv-chip.c1 { left: 6%; top: 10%; } .hv-chip.c2 { right: 5%; top: 24%; } .hv-chip.c3 { left: 8%; bottom: 10%; }
}

.how-more { display: inline-flex; gap: 8px; margin-top: 28px; color: var(--fg); text-decoration: none; font-weight: 500; }
.how-more:hover { color: var(--accent); gap: 12px; }

/* Separate CV button next to the menu */
.site-header .wrap { justify-content: flex-start; }
.site-header .nav { margin-left: auto; }
.cv-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px 0 16px; border-radius: 999px;
  background: var(--paper); color: var(--fg); border: 1px solid var(--line); text-decoration: none; font-weight: 500; font-size: 0.9375rem;
  box-shadow: 0 8px 24px -12px rgb(16 17 22 / 0.18); transition: transform 0.35s var(--spring), background 0.25s, color 0.25s, border-color 0.25s;
}
.cv-btn svg { width: 16px; height: 16px; transition: transform 0.35s var(--spring); }
.cv-btn:hover { color: #fff; background: var(--fg); border-color: var(--fg); transform: translateY(-2px); }
.cv-btn:hover svg { transform: translateY(2px); }
@media (max-width: 600px) { .cv-btn { height: 44px; padding: 0 14px 0 12px; } }

/* Folder front: title sits at the bottom so the opened files never cover it */
.folder-front { display: flex; align-items: flex-end; }
.ff-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; width: 100%; flex-wrap: wrap; }
.ff-meta { display: grid; justify-items: end; gap: 6px; text-align: right; }
.ff-meta .label { color: var(--muted); }
.ff-meta .ff-hint { margin-top: 6px; }
@media (max-width: 899px) { .ff-meta { justify-items: start; text-align: left; } }

/* While typing, the caret stays solid (like a real text cursor) */
.hello.typing .hello-caret { animation: none; opacity: 1; }
.hello-tag { min-height: calc(1.25rem + 20px); }

/* ── Off the clock: Instax cards on a fridge door ───────────── */
.fridge {
  position: relative; height: clamp(630px, 56vw, 810px); border-radius: 28px; overflow: hidden;
  background: linear-gradient(180deg, #f6f7f9, #eceef2); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 #fff, inset 0 -30px 60px -40px rgb(16 17 22 / 0.12);
  display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 28px; padding: 40px 24px;
}
.fridge .hint { position: absolute; left: 20px; top: 18px; z-index: 0; }
.instax {
  --x: 0px; --y: 0px; --r: 0deg; --s: 1;
  position: relative; margin: 0; width: clamp(160px, 14vw, 206px); padding: 12px 12px 0; background: #fff; border-radius: 4px;
  box-shadow: 0 1px 2px rgb(16 17 22 / 0.08), 0 14px 28px -14px rgb(16 17 22 / 0.35);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transform: rotate(var(--r));
}
.js .fridge { display: block; padding: 0; }
.js .fridge .instax { position: absolute; left: 0; top: 0; transform: translate3d(var(--x), var(--y), 0) rotate(var(--r)) scale(var(--s)); transition: transform 0.45s var(--spring), box-shadow 0.3s, opacity 0.5s var(--ease) var(--d, 0s), scale 0.6s var(--spring) var(--d, 0s); will-change: transform; }
.js .fridge.is-placing .instax { transition: none !important; }
.js .fridge .instax.is-dragging { cursor: grabbing; transition: box-shadow 0.3s; box-shadow: 0 2px 4px rgb(16 17 22 / 0.1), 0 34px 50px -20px rgb(16 17 22 / 0.45); }
.js .fridge:not(.is-ready) .instax { opacity: 0; scale: 1.15; }
.instax:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.instax-photo { aspect-ratio: 3 / 4; overflow: hidden; background: var(--surface); border-radius: 2px; }
.instax-photo img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.instax figcaption { /* handwritten in ballpoint-pen ink */
  font-family: var(--font-hand); font-weight: 600; font-size: clamp(1.2rem, 1.4vw, 1.55rem); line-height: 1.02; letter-spacing: 0.005em;
  text-align: center; color: #2a2b33; padding: 0.45em 0.25em 0.6em; min-height: 2.6em; display: grid; place-items: center; rotate: var(--cr, 0deg);
  text-shadow: 0 0 0.4px rgb(42 43 51 / 0.5); }
@media (max-width: 600px) {
  .fridge { height: 710px; border-radius: 22px; }
  .instax { width: 120px; padding: 7px 7px 0; }
  .instax figcaption { font-size: 1rem; }
}
.reduce .js .fridge .instax, .reduce .fridge .instax { transition: none; }
.section.life { padding-bottom: 0; } /* footer brings its own spacing */
body:has(.life) .site-footer { margin-top: clamp(72px, 8vw, 128px); }

/* Swipe dots under the folder title (phones) */
.ff-dots { display: none; gap: 6px; align-items: center; }
.ff-dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--faint); transition: width 0.3s var(--ease), background 0.3s; }
.ff-dots i.on { width: 18px; background: var(--fg); }
@media (max-width: 899px) { html.js:not(.reduce) .folder-scroll.swipe .ff-dots { display: inline-flex; } }

/* Handwritten titles traced from Nare's handwriting. One scale for all words keeps the pen size consistent. */
.instax figcaption .hand { --k: 0.17; display: block; width: calc(var(--w) * var(--k) * 1px); max-width: 100%; height: auto; color: #2a2b33; overflow: visible; }
.instax figcaption:has(.hand) { text-shadow: none; padding: 0.4em 0.2em 0.55em; }
/* the traced line is thin at card size: a hairline outline in the same ink gives it a real pen weight */
.instax figcaption .hand path { stroke: currentColor; stroke-width: 1.15px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
@media (max-width: 600px) { .instax figcaption .hand { --k: 0.095; } .instax figcaption .hand path { stroke-width: 0.8px; } }

/* Coming-soon case cards */
.file.is-soon { cursor: default; }
.file.is-soon .file-media { overflow: hidden; }
.file.is-soon .file-media img { filter: grayscale(0.35) blur(7px); opacity: 0.7; transform: scale(1.08); }
.soon-badge { background: var(--fg); color: #fff; }
.file.is-soon .serif { color: var(--muted); }
/* Phones/tablets: folder texts stay put - no bouncing arrow, no fade, dots don't push the text */
@media (max-width: 899px) {
  .ff-hint span { animation: none; }
  html.js:not(.reduce) .ff-hint { opacity: 1; }
  html.js:not(.reduce) .folder-scroll.swipe .ff-dots { position: absolute; right: 20px; bottom: 20px; }
}
/* Email pill: always one line - text shrinks a little on narrow phones */
.email-pill { white-space: nowrap; overflow-wrap: normal; max-width: 100%; }
@media (max-width: 560px) { .email-pill { font-size: clamp(0.95rem, 4.6vw, 1.25rem); padding: 16px 20px; gap: 10px; } }
/* GOIN card: under NDA */
.nda-badge { color: var(--fg); }
/* Narrow screens and touch devices (phones, iPads in any orientation): lighter cards so swiping stays at 60 fps
   (plain white card, no live glass blur, no hover tilt or shine) */
@media (max-width: 899px), (hover: none), (pointer: coarse) {
  html.js:not(.reduce) .file-in { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; transform: none; transition: box-shadow 0.4s; }
  html.js:not(.reduce) .file { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
  html.js:not(.reduce) .file .shine { display: none; }
  html.js:not(.reduce) .file .lock { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
}
