/* ==========================================================================
   itsabbyshake.com — site styles
   Design language: single 720px "graph paper" column, dotted/dashed rules,
   dot-grid bands, serif + grotesk + mono, grayscale palette.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #fdfdfc;
  --fg: #0a0a0a;
  --fg-2: #404040;
  --muted: #737373;
  --dim: #8a8a8a;
  --soft: #a3a3a3;
  --line: #e9e9e7;
  --line-2: #dcdcd9;
  --edge: #e6e6e4;
  --card: #ffffff;
  --hover: #f5f5f3;
  --live: #22c55e;
  --read: #60a5fa;

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'Instrument Serif', Georgia, serif;
  --hand: 'Architects Daughter', 'Segoe Print', cursive;

  --col: 720px;
  --pad: 24px;
  --nav-h: 56px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  /* damped spring, ~12% overshoot (generated: zeta .56, omega 10.5) */
  --spring: linear(0, 0.0327, 0.117, 0.2343, 0.3687, 0.5074, 0.6406, 0.7615, 0.8657, 0.9512, 1.0175, 1.0654, 1.0968, 1.114, 1.1196, 1.1163, 1.1067, 1.0929, 1.0769, 1.0603, 1.0443, 1.0297, 1.017, 1.0066, 0.9985, 0.9926, 0.9887, 0.9865, 0.9857, 0.986, 0.9871, 0.9887, 0.9906, 0.9926, 0.9945, 0.9963, 0.9978, 0.9991, 1.0001, 1);

  color-scheme: light;
}

html.dark {
  --bg: #0a0a0a;
  --fg: #ededed;
  --fg-2: #c4c4c4;
  --muted: #8f8f8f;
  --dim: #767676;
  --soft: #5f5f5f;
  --line: #1e1e1e;
  --line-2: #2c2c2c;
  --edge: #252525;
  --card: #111111;
  --hover: #161616;
  --read: #2563eb;
  color-scheme: dark;
}

@supports not (transition-timing-function: linear(0, 1)) {
  :root { --spring: cubic-bezier(0.34, 1.4, 0.64, 1); }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { text-wrap: balance; }
p, li, blockquote { text-wrap: pretty; }
a, button { -webkit-tap-highlight-color: transparent; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  overflow-x: clip;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
::selection { background: color-mix(in srgb, var(--fg) 14%, transparent); color: var(--fg); }
:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 2px; border-radius: 6px; }

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

/* Film grain */
body::after {
  content: '';
  position: fixed; inset: -80px; z-index: 9999; pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
  animation: grain 1.4s steps(5) infinite;
}
html.dark body::after { opacity: .05; }
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-28px, 18px); }
  50% { transform: translate(22px, -36px); }
  75% { transform: translate(-14px, 30px); }
}

/* ---------- Graph-paper structure ---------- */
.page {
  position: relative;
  max-width: var(--col);
  margin: 0 auto;
  min-height: 100vh;
}
/* dotted column rules */
.page::before, .page::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, var(--soft) 1px, transparent 1px) 0 0 / 1px 4px repeat-y;
  pointer-events: none;
}
.page::before { left: -1px; }
.page::after { right: -1px; }

/* full-bleed dashed horizontal */
.rule { position: relative; }
.rule::after {
  content: '';
  position: absolute; bottom: 0; height: 1px;
  left: calc(50% - 50vw); right: calc(50% - 50vw);
  background: linear-gradient(to right, var(--soft) 1px, transparent 1px) 0 0 / 4px 1px repeat-x;
  pointer-events: none;
}

/* dot-grid band between sections */
.band {
  position: relative;
  height: 32px;
  background: radial-gradient(circle, var(--line-2) .6px, transparent 1px) 0 0 / 8px 8px;
}
.band::before, .band::after {
  content: '';
  position: absolute; height: 1px;
  left: calc(50% - 50vw); right: calc(50% - 50vw);
  background: linear-gradient(to right, var(--soft) 1px, transparent 1px) 0 0 / 4px 1px repeat-x;
  pointer-events: none;
}
.band::before { top: 0; }
.band::after { bottom: 0; }

@media (max-width: 760px) {
  :root { --pad: 20px; }
  .page::before, .page::after { display: none; }
}

/* ---------- Icons ---------- */
.icon {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon.solid { fill: currentColor; stroke: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc(var(--pad) - 8px) 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
}
.mark {
  font: italic 400 24px/1 var(--serif);
  letter-spacing: -.01em;
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  transition: color .2s, background-color .2s;
}
.nav-link:hover { color: var(--fg); background: var(--hover); }
.nav-link.is-active { color: var(--fg); }
.nav-divider { width: 1px; height: 16px; margin: 0 6px; background: var(--line-2); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--muted);
  transition: color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--fg); background: var(--hover); }
.icon-btn .icon { width: 17px; height: 17px; }

.theme-btn .i-moon, html.dark .theme-btn .i-sun { display: none; }
html.dark .theme-btn .i-moon { display: block; }

.sound-btn .i-sound-on { display: none; }
html.sound-on .sound-btn .i-sound-on { display: block; }
html.sound-on .sound-btn .i-sound-off { display: none; }

.nav-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

@media (max-width: 520px) {
  .nav-link.optional { display: none; }
  .nav-link { padding: 5px 7px; }
}
/* the full "itsabbyshake." mark needs a tighter nav on small phones */
@media (max-width: 420px) {
  .nav { gap: 8px; }
  .mark { font-size: 21px; }
  .nav-link { padding: 5px 5px; font-size: 13.5px; }
  .nav-divider { margin: 0 3px; }
  .icon-btn { width: 30px; }
}
/* smallest phones: the footer still has the sound switch */
@media (max-width: 350px) {
  .nav .sound-btn, .nav-divider { display: none; }
}

/* ---------- Theme transition (circular reveal from the toggle) ---------- */
@property --reveal-r {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}
html.theme-switching::view-transition-old(root) { animation: none; }
html.theme-switching::view-transition-new(root) {
  mask-image: radial-gradient(circle at var(--vt-x, 100%) var(--vt-y, 0),
    #000 var(--reveal-r), transparent calc(var(--reveal-r) + 16vmax));
  animation: theme-reveal 1.1s both;
}
@keyframes theme-reveal {
  from { --reveal-r: -16vmax; }
  to { --reveal-r: 150vmax; }
}

/* page-to-page transitions */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-out .32s var(--ease-in-out) both; }
::view-transition-new(root) { animation: page-in .6s var(--ease-out) both; }
@keyframes page-out { to { opacity: 0; filter: blur(10px); transform: scale(.992); } }
@keyframes page-in { from { opacity: 0; filter: blur(10px); transform: scale(1.008); } }

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(var(--ty, 8px));
}
.reveal {
  transition:
    opacity .7s var(--ease-out),
    filter .7s var(--ease-out),
    transform .8s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms + var(--d, 0ms));
}
.js .reveal.is-in { opacity: 1; filter: none; transform: none; }
.reveal.is-done { transition-delay: 0s; }

/* word-by-word scrub */
.scrub .w { opacity: .22; transition: opacity .35s var(--ease-out); }
.scrub .w.lit { opacity: 1; }

/* ---------- Shared bits ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--edge);
  background: var(--card);
  font-size: 13px;
  color: var(--fg-2);
  transition: border-color .2s, background-color .2s, color .2s, transform .4s var(--spring);
}
.pill:hover { color: var(--fg); border-color: var(--line-2); background: var(--hover); }
.pill:active { transform: scale(.97); }
.pill .icon { width: 14px; height: 14px; }
.pill .arrow { width: 12px; height: 12px; margin-left: -2px; color: var(--soft); transition: transform .4s var(--spring), color .2s; }
.pill:hover .arrow { color: var(--fg); transform: translate(1px, -1px); }

.link {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--fg);
  border-bottom: 1px solid var(--line-2);
  transition: border-color .2s;
}
.link:hover { border-color: var(--fg); }
.link .icon { width: 11px; height: 11px; color: var(--soft); transition: transform .4s var(--spring); }
.link:hover .icon { transform: translate(1px, -1px); }

.text-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 12px/1 var(--mono);
  color: var(--muted);
  transition: color .2s;
}
.text-btn:hover { color: var(--fg); }
.text-btn .icon { width: 12px; height: 12px; transition: transform .4s var(--spring); }
.text-btn[aria-expanded="true"] .icon { transform: rotate(180deg); }

.live-dot {
  position: relative;
  width: 7px; height: 7px; flex: none;
  border-radius: 50%;
  background: var(--live);
}
.live-dot::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.6); opacity: .45; }
  80%, 100% { transform: scale(1.8); opacity: 0; }
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 8px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  font: 500 11px/1 var(--sans);
  color: var(--fg-2);
}
.badge .live-dot { width: 6px; height: 6px; }

kbd {
  display: inline-block;
  min-width: 1.7em; padding: 0 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--card);
  font: inherit;
  text-align: center;
  color: var(--fg-2);
}

.tok {
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--hover);
  font: .82em/1.6 var(--mono);
  color: var(--fg);
  white-space: nowrap;
}

.quote-line {
  margin: 22px 0;
  padding-left: 16px;
  border-left: 2px solid var(--line-2);
  font: italic 400 23px/1.35 var(--serif);
  color: var(--fg);
}

.margin-note {
  position: absolute;
  width: 160px;
  font: 400 15px/1.35 var(--hand);
  color: var(--muted);
  transform: rotate(-3deg);
  transform-origin: left top;
  transition: color .3s, transform .6s var(--spring);
}
.margin-note:hover { color: var(--fg); transform: rotate(0) scale(1.03); }
.margin-note svg { width: 48px; height: 30px; margin: 4px 0 0 -10px; overflow: visible; }
.margin-note path { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1239px) { .margin-note { display: none; } }

/* ---------- Section shell ---------- */
.sec { scroll-margin-top: var(--nav-h); }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 16px var(--pad) 12px;
}
.sec-head h2 {
  font: 400 30px/1.1 var(--serif);
  letter-spacing: -.01em;
}
.sec-head h2 em { font-style: italic; }
.sec-meta {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  white-space: nowrap;
  font: 12px/1 var(--mono);
  color: var(--soft);
}
.sec-body { padding: 22px var(--pad) 30px; }

.prose p { color: var(--fg-2); line-height: 1.75; }
.prose p + p { margin-top: 14px; }
.prose b, .prose strong { font-weight: 500; color: var(--fg); }
/* hover note on a phrase: same hand-drawn bubble as the avatar's .say, popping up from the word (home.js types it out) */
.tip {
  position: relative;
  cursor: default;
  text-decoration: underline dotted var(--muted);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.tip:focus { outline: none; }
.tip:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 2px; border-radius: 4px; }
.tip-say {
  position: absolute; left: 55%; bottom: calc(100% + 4px); z-index: 3;
  padding: 5px 13px 6px;
  border: 1.4px solid var(--fg);
  border-radius: 16px 16px 16px 4px;
  background: var(--bg);
  font: 400 15px/1.3 var(--hand);
  color: var(--fg);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  filter: blur(4px);
  transform: translate(-10px, 10px) scale(.6) rotate(2deg);
  transform-origin: 0 100%;
  transition: opacity .2s var(--ease-out), filter .3s var(--ease-out), transform .5s var(--spring);
}
.tip-say.is-on { opacity: 1; filter: none; transform: rotate(2deg); }

/* ---------- Cover ---------- */
.cover { position: relative; }
.cover-frame {
  position: relative;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  background: var(--hover);
}
.cover canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.cover-cap {
  position: absolute; right: 10px; bottom: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: 11px/1.5 var(--mono);
  color: var(--muted);
  pointer-events: none;
}
.cover-cap b { font-weight: 400; color: var(--fg-2); }
.cover .margin-note { left: calc(100% + 34px); top: 26%; }

/* ---------- Profile ---------- */
.profile {
  position: relative; z-index: 2;
  display: flex; align-items: flex-end; gap: 18px;
  margin-top: -34px;
  padding: 0 var(--pad) 18px;
}
.avatar-wrap { position: relative; flex: none; }
.avatar {
  position: relative; flex: none; cursor: pointer;
  width: 112px; height: 112px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--bg);
  display: grid; place-items: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar:focus-visible { outline-offset: 3px; border-radius: 22px; }

/* speech bubble that pops out to the upper right of the avatar */
.say {
  position: absolute; left: 96px; bottom: 88px; z-index: 3;
  padding: 5px 13px 6px;
  border: 1.4px solid var(--fg);
  border-radius: 16px 16px 16px 4px;
  background: var(--card);
  font: 400 15px/1.3 var(--hand);
  color: var(--fg);
  /* short lines stay on one line; long ones wrap instead of running off a phone screen */
  width: max-content;
  max-width: min(300px, calc(100vw - 150px));
  text-wrap: balance;
  pointer-events: none;
  opacity: 0;
  filter: blur(4px);
  transform: translate(-10px, 10px) scale(.6) rotate(2deg);
  transform-origin: 0 100%;
  transition: opacity .2s var(--ease-out), filter .3s var(--ease-out), transform .5s var(--spring);
}
.say.is-on { opacity: 1; filter: none; transform: rotate(2deg); }

/* line-art face */
.face { width: 100%; height: 100%; overflow: visible; cursor: pointer; }
.face .ln { fill: none; stroke: var(--fg); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.face .ln.thick { stroke-width: 2.2; }
.face .ln.skin { fill: var(--card); }
.face .ln.hair { fill: var(--card); stroke-width: 1.6; }
.face .ln.strand { stroke-width: 1; }
.face .ln.hatch { stroke-width: .8; opacity: .55; }
.face .ln.lid { stroke-width: 1.9; }
.face .ln.beard-edge { stroke-width: 1; opacity: .7; }
.face .ln.stache { stroke-width: 1.1; opacity: .75; }
.face .stubble { fill: var(--fg); opacity: .7; }
.face .ink.soft { opacity: .8; }
.face .main { filter: url(#thin); }
/* dark mode: solid areas (hair, chin shadow, headphones) become a white outline filled with the background */
html.dark .face .main { filter: url(#hollow); }
.face .dark-only { display: none; }
html.dark .face .dark-only { display: inline; }
html.dark .face .light-only { display: none; }
.face .no-glasses .cover { fill: none; stroke: var(--card); stroke-width: 15.5; stroke-linejoin: round; }
.face .no-glasses .cover-fill { fill: var(--card); }
.face .ink { fill: var(--fg); }
.face .white { fill: var(--card); }
.face .pupil { fill: var(--fg); }
.face .eye { transform-box: fill-box; transform-origin: center; }
.face .eyes.blink .eye { animation: face-blink .16s ease-in-out; }
@keyframes face-blink { 50% { transform: scaleY(.08); } }
.face .brows { transition: transform .5s var(--spring); }
.face .mouth { transform-box: fill-box; transform-origin: center; transition: opacity .18s ease, transform .45s var(--spring); }
.face .mouth.smile { opacity: 0; transform: scale(.6); }
.avatar[data-mood] .face .mouth.neutral { opacity: 0; transform: scale(.7); }
.avatar[data-mood="soft"] .face .mouth.soft,
.avatar[data-mood="smirk"] .face .mouth.smirk,
.avatar[data-mood="grin"] .face .mouth.grin { opacity: 1; transform: none; }
/* eyes narrow a touch while smiling */
.face .eye { transition: transform .45s var(--spring); }
.avatar[data-mood] .face .eye { transform: scaleY(.86); }
/* blush on click */
.face .blush { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.7); transition: opacity .3s var(--ease-out), transform .5s var(--spring); }
.face .blush { filter: blur(1.5px); }
.face .blush-grad stop { stop-color: #f4899f; }
html.dark .face .blush-grad stop { stop-color: #d9707f; }
.avatar.is-blushing .face .blush { opacity: 1; transform: none; }
/* smile for as long as the blush is showing (keeps the hover smile if one is up,
   otherwise falls back to the soft smile, so moving the cursor away doesn't drop it) */
.avatar.is-blushing .face .mouth.neutral { opacity: 0; transform: scale(.7); }
.avatar.is-blushing:not([data-mood]) .face .mouth.soft { opacity: 1; transform: none; }
.avatar.is-blushing .face .eye { transform: scaleY(.86); }
/* annoyed: after many quick clicks */
.face .mouth.frown { opacity: 0; transform: scale(.6); }
.avatar.is-angry .face .mouth.neutral,
.avatar.is-angry .face .mouth.smile { opacity: 0; transform: scale(.7); }
.avatar.is-angry .face .mouth.frown { opacity: 1; transform: none; }
.avatar.is-angry .face .eye { transform: scaleY(.72); }
.avatar.is-angry .face .blush { opacity: 0; }
.face .anger { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.4) rotate(-20deg); transition: opacity .2s var(--ease-out), transform .5s var(--spring); }
.face .anger path { fill: none; stroke: #ef4444; stroke-width: 6; stroke-linecap: round; }
.avatar.is-angry .face .anger { opacity: 1; transform: none; animation: anger-throb .9s ease-in-out .5s infinite; }
@keyframes anger-throb { 50% { transform: scale(1.15); } }
.avatar.is-angry .face { animation: avatar-shake .42s var(--ease-out); }
@keyframes avatar-shake { 20% { transform: translateX(-3px) rotate(-2deg); } 45% { transform: translateX(3px) rotate(2deg); } 70% { transform: translateX(-2px) rotate(-1deg); } }
/* asleep: after the visitor has been away a while (home.js) — eyes shut, head tilted, z's drifting up */
.face .sleep-eyes { opacity: 0; transition: opacity .2s; }
.face .sleep-eyes path { fill: none; stroke: var(--fg); stroke-width: 5; stroke-linecap: round; }
.face { transform-origin: 50% 88%; transition: transform .7s var(--spring); }
.avatar.is-asleep .face { transform: rotate(-8deg) translateY(2px); }
.stage .avatar.is-asleep .face { transform: rotate(-4deg); }
.avatar.is-asleep .face .eye { opacity: 0; }
.avatar.is-asleep .face .sleep-eyes { opacity: 1; }
.avatar.is-asleep .face .mouth.smile { opacity: 0; }
.avatar.is-asleep .face .mouth.neutral { opacity: 1; transform: none; }
.zzz {
  position: absolute; left: 92px; bottom: 92px; z-index: 3;
  width: 40px; height: 44px;
  font: 400 17px/1 var(--hand);
  color: var(--fg);
  text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s var(--ease-out);
}
.zzz.is-on { opacity: 1; }
.zzz i {
  position: absolute; left: 0; bottom: 0;
  font-style: normal;
  opacity: 0;
  animation: zzz-float 2.4s ease-in-out infinite;
}
.zzz i:nth-child(2) { font-size: 1.25em; animation-delay: .8s; }
.zzz i:nth-child(3) { font-size: 1.55em; animation-delay: 1.6s; }
@keyframes zzz-float {
  0% { opacity: 0; transform: translate(0, 0) scale(.6) rotate(-8deg); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(18px, -30px) scale(1) rotate(8deg); }
}
.stage .zzz { left: 62%; bottom: auto; top: -6%; }
@media (max-width: 560px) { .profile .zzz { left: 78px; bottom: 78px; } }
@media (prefers-reduced-motion: reduce) {
  .zzz i { animation: none !important; opacity: .8; }
  .zzz i:nth-child(2) { transform: translate(9px, -14px); }
  .zzz i:nth-child(3) { transform: translate(20px, -30px); }
}

.avatar-initial {
  font: italic 400 56px/1 var(--serif);
  color: var(--fg-2);
  transform: translateY(-2px);
}
.who { min-width: 0; padding-bottom: 4px; }
.name {
  font: 400 40px/1 var(--serif);
  letter-spacing: -.015em;
  white-space: nowrap;
}
.name .ch { display: inline-block; transition: transform .45s var(--spring); }
.name:hover .ch { transform: translateY(var(--lift, 0)); }
.tagline {
  margin-top: 8px;
  font: 13px/1.5 var(--mono);
  color: var(--muted);
}

.meta {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  padding: 6px var(--pad) 20px;
  font: 13px/1.5 var(--mono);
  color: var(--fg-2);
}
.meta li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.meta .icon { color: var(--soft); }
.meta a, .meta .copy-email {
  border-bottom: 1px solid transparent;
  transition: border-color .2s, color .2s;
}
.meta a:hover, .meta .copy-email:hover { color: var(--fg); border-bottom-color: var(--line-2); }
.meta .soft { color: var(--soft); white-space: nowrap; }
.copy-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.copy-note { color: var(--live); opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .4s var(--spring); }
.is-copied + .copy-note { opacity: 1; transform: none; }

.links { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 var(--pad) 24px; }

@media (max-width: 560px) {
  .cover-frame { aspect-ratio: 2 / 1; }
  .cover-cap { top: 10px; bottom: auto; }
  .profile { flex-direction: column; align-items: flex-start; gap: 14px; margin-top: -40px; }
  .avatar { width: 92px; height: 92px; border-radius: 18px; }
  .say { left: 78px; bottom: 70px; }
  .avatar-initial { font-size: 46px; }
  .who { padding-bottom: 0; }
  .name { font-size: 36px; }
  .tagline { font-size: 12.5px; }
  .meta { grid-template-columns: 1fr; }
}

/* ---------- Definition rows ("right now", specs) ---------- */
.rows > div {
  display: grid; grid-template-columns: 130px 1fr; gap: 16px;
  padding: 12px 0;
}
.rows > div + div { border-top: 1px dashed var(--line); }
.rows dt { font: 12px/1.9 var(--mono); color: var(--muted); }
.rows dd { color: var(--fg-2); line-height: 1.7; }
.rows.boxed > div { border-top: 1px dashed var(--line); }
.rows.boxed > div:last-child { border-bottom: 1px dashed var(--line); }
.rows.boxed dt { color: var(--fg); }
.rows.boxed dd { font-size: 14.5px; }
@media (max-width: 560px) {
  .rows > div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Experience ---------- */
.logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--card);
  object-fit: contain;
  padding: 3px;
}
.logo.fill { padding: 0; object-fit: cover; }
.logo.letter {
  display: grid; place-items: center;
  padding: 0;
  background: var(--hover);
  font: 400 20px/1 var(--serif);
  color: var(--fg-2);
}

.role-head {
  display: grid; grid-template-columns: 34px 1fr auto;
  align-items: center; gap: 14px;
  width: 100%;
  text-align: left;
}
.role-title h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500; line-height: 1.3;
}
.role-title p { font-size: 14px; line-height: 1.4; color: var(--muted); }
.role-when {
  font: 12px/1.5 var(--mono);
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.role-body { margin-top: 18px; }
.role-body > * + * { margin-top: 16px; }
.role-body > p { color: var(--fg-2); line-height: 1.75; }

.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; }
.stores .k { font: 12px/1 var(--mono); color: var(--muted); }

.points li {
  position: relative;
  padding-left: 16px;
  color: var(--fg-2);
  line-height: 1.7;
}
.points li + li { margin-top: 8px; }
.points li::before {
  content: '';
  position: absolute; left: 2px; top: .8em;
  width: 5px; height: 1px;
  background: var(--soft);
}
.points b { font-weight: 500; color: var(--fg); }
.points li.extra { display: none; }
.points.show-all li.extra { display: list-item; animation: rise .5s var(--ease-out) both; animation-delay: calc(var(--k) * 40ms); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); filter: blur(4px); } }

/* tl;dr chat */
.tldr-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--edge);
  background: var(--card);
  font: 500 12.5px/1 var(--sans);
  color: var(--fg-2);
  transition: border-color .2s, background-color .2s, color .2s, transform .4s var(--spring);
}
.tldr-btn:hover, .tldr-btn[aria-expanded="true"] { color: var(--fg); border-color: var(--line-2); background: var(--hover); }
.tldr-btn:active { transform: scale(.96); }
.tldr-btn .icon { width: 14px; height: 14px; }

.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease-out); }
.collapse.is-open { grid-template-rows: 1fr; }
.collapse > div { overflow: hidden; }

.chat {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.chat-head b { display: block; font-weight: 500; line-height: 1.2; }
.chat-status { display: block; font: 11px/1.4 var(--mono); color: var(--live); }
.chat-status.is-typing { color: var(--muted); }
.chat-msgs { display: flex; flex-direction: column; gap: 3px; padding: 14px 14px 16px; }
.chat .row { display: flex; align-items: flex-end; gap: 8px; }
.chat .row.out { justify-content: flex-end; }
.chat .row.first:not(:first-child) { margin-top: 10px; }
.chat .row.in:not(.last) .pic { visibility: hidden; }
.chat .pic {
  flex: none;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--card);
  font: italic 400 14px/1 var(--serif);
  color: var(--fg-2);
}
.chat-head .pic { width: 30px; height: 30px; font-size: 16px; }
.bubble {
  max-width: 80%;
  padding: 8px 12px 9px;
  border-radius: 18px;
  font-size: 14px; line-height: 1.5;
  transform-origin: 0 100%;
  animation: bubble-in .45s var(--spring) both;
}
.row.in .bubble { background: var(--hover); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.row.out .bubble { background: var(--fg); color: var(--bg); border-bottom-right-radius: 6px; transform-origin: 100% 100%; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(.9); } }
.bubble.typing { display: flex; gap: 4px; padding: 12px 14px; }
.bubble.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--soft); animation: dot .9s ease-in-out infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; }
.bubble.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { transform: none; opacity: .5; } 40% { transform: translateY(-3px); opacity: 1; } }
.ticks { display: inline-block; margin-left: 5px; line-height: 0; vertical-align: -1px; color: color-mix(in srgb, var(--bg) 45%, transparent); transition: color .3s; }
.ticks.read { color: var(--read); }
.ticks svg { width: 15px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* screenshot strip */
.strip {
  display: flex; gap: 10px;
  margin-inline: calc(var(--pad) * -1);
  padding: 4px var(--pad) 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  cursor: grab;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--pad), #000 calc(100% - var(--pad)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--pad), #000 calc(100% - var(--pad)), transparent);
}
.strip::-webkit-scrollbar { display: none; }
.strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.strip.is-dragging * { pointer-events: none; }
.shot {
  flex: none;
  width: 118px;
  aspect-ratio: 1 / 2;
  padding: 2px;
  border-radius: 14px;
  background: #111;
  scroll-snap-align: start;
  cursor: zoom-in;
  transition: transform .5s var(--spring);
}
.shot:hover { transform: translateY(-3px); }
.shot img, .shot .ph { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; object-position: top; user-select: none; -webkit-user-drag: none; }
.shot .ph {
  display: grid; place-items: center;
  background: linear-gradient(160deg, #2a2a2a, #161616);
  font: 10px/1.4 var(--mono);
  color: #777;
  text-align: center;
}
.strip-note { font: 12px/1 var(--mono); color: var(--soft); }
/* wide variant for desktop screens: each shot keeps its own shape (from the img's width/height) */
.strip.wide { align-items: flex-start; }
.strip.wide .shot {
  width: auto; height: 210px; aspect-ratio: auto;
  padding: 0;
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 6px 20px -12px rgba(0, 0, 0, .25);
}
.strip.wide .shot img { width: auto; height: 100%; border-radius: 10px; object-fit: contain; }
@media (max-width: 560px) { .strip.wide .shot { height: 170px; } }

.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0; pointer-events: none;
  cursor: zoom-out;
  transition: opacity .4s var(--ease-out);
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lb-item {
  position: fixed; z-index: 95;
  overflow: hidden;
  background: #111;
  transform-origin: 0 0;
  cursor: zoom-out;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .4);
}
.lb-item img, .lb-item .ph { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.lb-item img { background: var(--bg); }
/* prev / next beside an open screenshot */
.lb-nav {
  position: fixed; top: 50%; z-index: 96;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--bg); color: var(--fg);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .4);
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transform: translateY(-50%) scale(.85);
  transition: opacity .25s var(--ease-out), transform .45s var(--spring);
}
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-nav.is-open { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
.lb-nav.is-open:hover { transform: translateY(-50%) scale(1.08); }
.lb-nav.is-open:active { transform: translateY(-50%) scale(.94); }
.lb-nav:focus-visible { border-radius: 99px; }
.lb-nav .icon { width: 18px; height: 18px; }
/* phones: no room at the sides, so they sit together under the screen */
@media (max-width: 700px) {
  .lb-nav { top: auto; bottom: 28px; transform: scale(.85); }
  .lb-prev { left: calc(50% - 54px); }
  .lb-next { right: calc(50% - 54px); }
  .lb-nav.is-open { transform: none; }
  .lb-nav.is-open:hover { transform: scale(1.08); }
  .lb-nav.is-open:active { transform: scale(.94); }
}

/* case-study cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card {
  position: relative; display: block;
  padding: 14px 16px 16px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: var(--card);
  transition: border-color .2s, background-color .2s;
}
.card:hover { border-color: var(--line-2); }
.card-k { display: block; margin-bottom: 10px; font: 11px/1 var(--mono); color: var(--soft); }
.card strong { display: block; margin-bottom: 4px; font-size: 15px; font-weight: 500; }
.card-d { display: block; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.card > .icon { position: absolute; right: 14px; top: 14px; width: 14px; height: 14px; color: var(--soft); transition: transform .4s var(--spring), color .2s; }
.card:hover > .icon { color: var(--fg); transform: translate(2px, -2px); }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* past roles accordion */
.roles { margin-top: 28px; border-top: 1px solid var(--line); }
.role-row { border-bottom: 1px solid var(--line); }
.role-row > .role-head { grid-template-columns: 34px 1fr auto 28px; padding: 14px 0; cursor: pointer; }
/* company name links to their site; dotted underline like the about hover note */
.co-link {
  text-decoration: underline dotted var(--muted);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}
.co-link:hover { text-decoration-color: var(--fg); }
.co-arrow {
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 3px;
  vertical-align: -2px;
  color: var(--fg-2);
  transition: transform .35s var(--spring), color .2s;
}
.co-link:hover .co-arrow { color: var(--fg); transform: translate(1.5px, -1.5px); }
.chev-btn {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  justify-self: end;
  transition: background-color .2s;
}
.chev-btn:hover { background: var(--hover); }
.chev-btn:focus-visible { border-radius: 8px; }
.chev { width: 14px; height: 14px; color: var(--soft); transition: transform .45s var(--spring), color .2s; }
.role-row > .role-head:hover .chev { color: var(--fg); }
.role-row.is-open .chev { transform: rotate(180deg); }
.role-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease-out); }
.role-row.is-open .role-more { grid-template-rows: 1fr; }
.role-more > div { overflow: hidden; }
.role-more .inner {
  padding: 0 0 18px 48px;
  color: var(--fg-2);
  line-height: 1.7;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .3s, transform .45s var(--ease-out);
}
.role-row.is-open .role-more .inner { opacity: 1; transform: none; transition-delay: 80ms; }
.role-more .inner p + p { margin-top: 10px; }
.role-more .stores { margin-top: 12px; }

@media (max-width: 560px) {
  .role-head { grid-template-columns: 34px 1fr 14px; }
  .role-row > .role-head { grid-template-columns: 34px 1fr 28px; }
  .role-when { grid-column: 2; grid-row: 2; text-align: left; margin-top: -4px; }
  .role-main .role-head { grid-template-columns: 34px 1fr; }
  .role-row .chev-btn { grid-column: 3; grid-row: 1; }
  .role-more .inner { padding-left: 0; }
}

/* ---------- Projects ---------- */
#projects .sec-body { padding-block: 6px; }
.project {
  display: block;
  margin: 0 calc(var(--pad) * -1);
  padding: 18px var(--pad);
  transition: background-color .2s;
}
.project + .project { border-top: 1px solid var(--line); }
.project:hover { background: var(--hover); }
.project-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.project h3 { font-size: 15px; font-weight: 500; }
.project-where {
  display: inline-flex; align-items: center; gap: 4px;
  font: 12px/1 var(--mono);
  color: var(--soft);
  transition: color .2s;
}
.project-where .icon { width: 11px; height: 11px; transition: transform .4s var(--spring); }
.project:hover .project-where { color: var(--fg); }
.project:hover .project-where .icon { transform: translate(1px, -1px); }
.project p { color: var(--fg-2); line-height: 1.7; }
.project .stack { margin-top: 8px; font: 12px/1.5 var(--mono); color: var(--muted); }

/* ---------- Toolkit ---------- */
.kit { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.kit dt { font-size: 14.5px; font-weight: 500; }
.kit dd { margin-top: 2px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.kit-link {
  margin-left: 6px;
  font: 12px/1 var(--mono);
  color: var(--muted);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.kit-link::after { content: ' \2197'; }
.kit-link:hover { color: var(--fg); border-color: var(--fg); }
@media (max-width: 560px) { .kit { grid-template-columns: 1fr; gap: 14px; } }

/* ---------- Testimonials ---------- */
.quote { min-height: var(--q-h, 110px); cursor: grab; touch-action: pan-y; user-select: none; }
.quote:active { cursor: grabbing; }
.quote.nudge { animation: nudge .9s ease-in-out .4s; }
@keyframes nudge { 30% { transform: translateX(-10px); } 55% { transform: translateX(4px); } 75% { transform: translateX(-3px); } }
.quote blockquote {
  position: relative;
  font: 400 26px/1.38 var(--serif);
  letter-spacing: .005em;
  transition: opacity .25s, filter .3s;
}
.quote blockquote::before {
  content: '\201C';
  position: absolute; left: -.5em; top: -.12em;
  font-size: 2.4em; line-height: 1;
  color: var(--soft);
  pointer-events: none;
}
.quote figcaption { margin-top: 16px; font-size: 14px; color: var(--fg-2); transition: opacity .25s, filter .3s; }
.quote figcaption b { font-weight: 500; }
.quote figcaption span { margin-left: 8px; font: 12px/1 var(--mono); color: var(--muted); }
.quote.is-out blockquote, .quote.is-out figcaption { opacity: 0; filter: blur(5px); }
.q-nav { display: flex; align-items: center; gap: 6px; margin-top: 20px; }
.q-nav .link { margin-right: auto; font-size: 13px; }
.q-dots { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.q-dot { position: relative; display: grid; place-items: center; width: 14px; height: 24px; }
.q-dot::before { content: ''; width: 6px; height: 6px; border-radius: 99px; background: var(--line-2); transition: width .4s var(--spring), background-color .25s; }
.q-dot:hover::before { background: var(--soft); }
.q-dot.is-on { width: 22px; }
.q-dot.is-on::before { width: 16px; background: var(--fg-2); }
.q-dot::after {
  content: attr(data-name);
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--fg); color: var(--bg);
  font: 11px/1 var(--mono);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 3px);
  pointer-events: none;
  transition: opacity .2s, transform .3s var(--spring);
}
.q-dot:hover::after { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 560px) {
  .q-nav { flex-wrap: wrap; row-gap: 16px; }
  .q-dots { order: -1; width: 100%; justify-content: flex-start; }
  .quote blockquote::before { left: -.42em; font-size: 2em; }
}

/* ---------- Say hi ---------- */
.mail-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.mail {
  font: 400 32px/1.2 var(--serif);
  letter-spacing: -.01em;
  border-bottom: 1px solid var(--line-2);
  transition: border-color .2s;
  overflow-wrap: anywhere;
}
.mail:hover { border-color: var(--fg); }
.copy-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--edge);
  color: var(--muted);
  transition: color .2s, background-color .2s, border-color .2s, transform .4s var(--spring);
}
.copy-btn:hover { color: var(--fg); background: var(--hover); border-color: var(--line-2); }
.copy-btn:active { transform: scale(.94); }
.copy-btn svg { grid-area: 1 / 1; width: 15px; height: 15px; transition: opacity .2s, transform .4s var(--spring); }
.copy-btn .i-check { opacity: 0; transform: scale(.5); color: var(--live); }
.copy-btn.is-copied .i-copy { opacity: 0; transform: scale(.5); }
.copy-btn.is-copied .i-check { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.end {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: 10px 20px;
  padding: 26px var(--pad) 8px;
}
.end-hi { font: italic 400 24px/1.2 var(--serif); }
.end-sub { margin-top: 6px; font: 12px/1.5 var(--mono); color: var(--soft); }
.end-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.end a { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--muted); transition: color .2s; }
.end a:hover { color: var(--fg); }
.end a .icon { width: 13px; height: 13px; transition: transform .4s var(--spring); }
.end a:hover .icon { transform: translateX(2px); }
.end a.back:hover .icon { transform: translateX(-2px); }

.foot {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 22px var(--pad) calc(26px + env(safe-area-inset-bottom, 0px));
  font: 12px/1.5 var(--mono);
  color: var(--dim);
}
.foot p + p { margin-top: 4px; }
.foot .credit { color: var(--soft); }
.foot .credit a { border-bottom: 1px solid var(--line-2); transition: color .2s, border-color .2s; }
.foot .credit a:hover { color: var(--fg); border-color: var(--fg); }
.foot-switch {
  flex: none; white-space: nowrap;
  color: var(--fg-2);
  border-bottom: 1px solid var(--line-2);
  transition: border-color .2s, color .2s;
}
.foot-switch:hover { color: var(--fg); border-color: var(--fg); }
.clock { font-variant-numeric: tabular-nums; }
.clock-slot { display: inline-grid; height: 1lh; overflow: hidden; vertical-align: top; }
.clock-slot > span { grid-area: 1 / 1; }
@media (hover: none) { .keys-hint { display: none; } }
@media (max-width: 560px) { .foot { flex-direction: column; gap: 8px; } }

/* footer stage: the full drawing sits on a dashed floor, bottom-left */
.stage {
  position: relative;
  height: clamp(250px, 40vw, 320px);
  margin-top: 8px;
}
.stage-me {
  position: absolute; right: var(--pad); bottom: 0;
  width: clamp(170px, 32%, 240px);
}
.stage .avatar {
  --card: var(--bg); /* glasses cover + bubble blend into the page, not a card */
  width: 100%; height: auto;
  aspect-ratio: 523.69 / 562.27;
  overflow: visible;
  border: 0; border-radius: 0;
  background: none;
  box-shadow: none;
  display: block;
}
.stage .avatar:focus-visible { border-radius: 12px; }
.stage .face .main { filter: url(#thin-f); }
html.dark .stage .face .main { filter: url(#hollow-f); }
/* bubble pops out to the left of the head, tail pointing back at it */
.stage .say {
  left: auto; right: 70%; bottom: 76%;
  border-radius: 16px 16px 4px 16px;
  transform-origin: 100% 100%;
  transform: translate(10px, 10px) scale(.6) rotate(-2deg);
}
.stage .say.is-on { transform: rotate(-2deg); }
@media (max-width: 560px) {
  .stage { height: 230px; }
  .stage-me { width: 170px; }
  .stage .say { right: 66%; bottom: 74%; }
}

/* ---------- Subpage header ---------- */
.page-head { padding: 44px var(--pad) 30px; }
.crumb { font: 12px/1.5 var(--mono); color: var(--dim); }
.crumb a { color: var(--fg-2); border-bottom: 1px solid var(--line-2); transition: color .2s; }
.crumb a:hover { color: var(--fg); }
.page-title {
  margin-top: 14px;
  font: 400 clamp(38px, 7vw, 52px)/1.04 var(--serif);
  letter-spacing: -.015em;
}
.page-title .line { display: block; }
.page-title .soft { color: var(--soft); }
.lede { margin-top: 16px; max-width: 580px; font-size: 16px; line-height: 1.65; color: var(--fg-2); }

/* ---------- Work index ---------- */
.cs-item {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center; gap: 28px;
  padding: 30px var(--pad);
  transition: background-color .25s;
}
.cs-item:hover { background: var(--hover); }
.cs-item h2 { margin-top: 10px; font: 400 34px/1.05 var(--serif); letter-spacing: -.01em; }
.cs-item .cs-text > p:not(.crumb) { margin-top: 10px; color: var(--fg-2); line-height: 1.7; }
.cs-read { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font: 12px/1 var(--mono); color: var(--muted); transition: color .2s; }
.cs-read .icon { width: 13px; height: 13px; transition: transform .45s var(--spring); }
.cs-item:hover .cs-read { color: var(--fg); }
.cs-item:hover .cs-read .icon { transform: translateX(3px); }
.cs-thumb {
  position: relative;
  height: 164px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
  transition: border-color .2s;
}
.cs-item:hover .cs-thumb { border-color: var(--line-2); }
.cs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cs-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font: 11px/1.4 var(--mono); color: var(--soft); background: radial-gradient(circle, var(--line-2) .6px, transparent 1px) 0 0 / 8px 8px; }
@media (max-width: 600px) {
  .cs-item { grid-template-columns: 1fr; gap: 20px; }
  .cs-thumb { order: -1; }
}

/* ---------- Case study article ---------- */
.facts { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 14px 38px; margin-top: 28px; }
.facts dt { font: 11px/1.4 var(--mono); color: var(--muted); }
.facts dd { margin-top: 4px; font-size: 14px; color: var(--fg); }
.facts a { border-bottom: 1px solid var(--line-2); transition: border-color .2s; }
.facts a:hover { border-color: var(--fg); }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr 1fr; gap: 14px 20px; } }

.cs-article { padding-bottom: 18px; }
.cs { padding: 30px var(--pad) 6px; scroll-margin-top: 64px; }
.cs + .cs { border-top: 1px dashed var(--line); }
.cs-h2 { margin-bottom: 14px; font: 400 28px/1.15 var(--serif); letter-spacing: -.01em; }
.cs-body p { color: var(--fg-2); line-height: 1.8; }
.cs-body > * + * { margin-top: 14px; }
.cs-body strong { font-weight: 500; color: var(--fg); }
.cs-body > .quote-line:first-child { margin-top: 2px; }
.figure { margin: 22px 0; }
.figure .frame { border-radius: 12px; border: 1px solid var(--line-2); overflow: hidden; background: var(--hover); }
.figure .frame .ph { aspect-ratio: 16 / 9; display: grid; place-items: center; font: 12px/1.4 var(--mono); color: var(--soft); }
.figure figcaption { margin-top: 8px; font: 12px/1.5 var(--mono); color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.stat { padding: 16px 16px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); }
.stat-num { font: 400 46px/1 var(--serif); letter-spacing: -.02em; }
.stat-k { margin-top: 10px; font: 11.5px/1.45 var(--mono); color: var(--muted); }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
/* personal project (home) */
.proj-title { display: flex; align-items: center; gap: 10px; font: 400 34px/1.1 var(--serif); letter-spacing: -.01em; color: var(--fg); }
.proj-title { flex-wrap: wrap; row-gap: 2px; }
.proj-sub { font: 400 13px/1.4 var(--mono); letter-spacing: 0; color: var(--muted); }
.proj-line { margin-top: 6px; color: var(--fg-2) !important; } /* #c4c4c4 in dark mode, #404040 in light */
.proj-title .badge { letter-spacing: 0; }
.proj-k { margin-top: 30px !important; margin-bottom: 12px; font: 12px/1.5 var(--mono); color: var(--muted) !important; }
#raksha .stats { margin-bottom: 16px; }
#raksha .stat-num { font-size: 40px; }
.stat-note { display: block; margin-top: 6px; color: var(--fg-2); } /* #c4c4c4 in dark mode, #404040 in light */
.stat-unit { margin-left: 4px; font: 13px/1 var(--mono); letter-spacing: 0; color: var(--muted); }
#raksha .points { margin-top: 4px; }
#raksha .points li { color: var(--fg-2); line-height: 1.7; }

/* odometer */
.odo { display: inline-flex; }
.odo-d { display: inline-block; height: 1lh; overflow: hidden; vertical-align: top; }
.odo-strip { display: flex; flex-direction: column; transition: transform 1.6s var(--spring); transition-delay: calc(var(--k, 0) * 90ms); }
.odo-strip span { display: flex; justify-content: center; height: 1lh; }

/* ---------- Life (personal essay) ---------- */
.essay-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 22px; font: 12px/1.6 var(--mono); color: var(--muted); }
.essay-meta .sep { color: var(--line-2); }
.essay-meta .timer { display: inline-flex; align-items: center; gap: 6px; }
.essay-meta .live-dot { width: 6px; height: 6px; animation: blink 1s ease-in-out infinite; }
.essay-meta .live-dot::after { display: none; }
.essay-meta .clock-slot, .essay-meta .odo { font-variant-numeric: tabular-nums; }
@keyframes blink { 50% { opacity: .3; } }

/* music player */
.player-wrap { padding: 0 var(--pad) 30px; }
.player {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--card);
  transition: border-color .3s;
}
.player:hover { border-color: color-mix(in srgb, var(--fg) 22%, var(--line-2)); }
.player-btn {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  transition: transform .5s var(--spring);
}
.player-btn:hover { transform: scale(1.06); }
.player-btn:active { transform: scale(.92); }
.player-btn:focus-visible { border-radius: 50%; outline-offset: 3px; }
.player-btn svg { grid-area: 1 / 1; width: 17px; height: 17px; fill: currentColor; transition: opacity .2s, transform .45s var(--spring); }
.player-btn .i-play { transform: translateX(1px); }
.player-btn .i-pause, .is-playing .player-btn .i-play { opacity: 0; transform: scale(.4) rotate(-40deg); }
.is-playing .player-btn .i-pause { opacity: 1; transform: none; }
/* a ring that breathes while playing */
.player-btn::after {
  content: '';
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  opacity: 0; transform: scale(.9);
  transition: opacity .4s, transform .4s;
}
.is-playing .player-btn::after { opacity: 1; transform: none; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .4; } }
.player-body { flex: 1; min-width: 0; }
.player-top, .player-time { display: flex; justify-content: space-between; gap: 12px; font: 11.5px/1.4 var(--mono); color: var(--muted); }
.player-top .soft { color: var(--soft); }
.player-time { font-variant-numeric: tabular-nums; }
.player-wave {
  position: relative;
  display: flex; align-items: center; gap: 2px;
  height: 32px; margin: 8px 0 6px;
  cursor: pointer;
  touch-action: none;
}
.player-wave:focus-visible { outline-offset: 4px; }
.player-wave i { flex: 1; min-width: 1px; height: calc(var(--h, .3) * 100%); border-radius: 2px; background: var(--line-2); transition: background-color .25s; }
.player-wave i.is-on { background: var(--fg); }
.player-wave:hover i:not(.is-on) { background: color-mix(in srgb, var(--fg) 22%, var(--line-2)); }
.player.is-empty .player-wave { cursor: default; }
@media (max-width: 560px) { .player-top .soft { display: none; } }

/* essay */
.essay { padding: 34px var(--pad) 40px; font-size: 16px; line-height: 1.9; color: var(--fg-2); }
.essay > p { position: relative; }
.essay > * + * { margin-top: 22px; }
.essay em { font: italic 1.1em var(--serif); color: var(--fg); }
.essay > p > a { color: var(--fg); text-decoration: underline dotted var(--muted); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: text-decoration-color .2s; }
.essay > p > a:hover { text-decoration-color: var(--fg); }
.essay .soft { color: var(--soft); }
.essay .quote-line { margin: 34px 0; font-size: 24px; }
.essay .quote-line.scrub { color: var(--fg); }
.greeting { font: italic 400 30px/1.2 var(--serif); color: var(--fg); }
.sign { padding-top: 16px; font: italic 400 28px/1.2 var(--serif); color: var(--fg); }
.essay .margin-note { top: 2px; left: calc(100% + var(--pad) + 30px); width: 170px; font-size: 14px; transform: rotate(-2.5deg); }
/* notes arrive a beat after their paragraph */
.js .essay .reveal .margin-note { opacity: 0; filter: blur(5px); transition: opacity .8s var(--ease-out) .5s, filter .9s var(--ease-out) .5s, color .3s, transform .6s var(--spring); }
.js .essay .reveal.is-in .margin-note { opacity: 1; filter: none; }
@media (max-width: 1199px) { .essay .margin-note { display: none; } }

/* a word that rings a bell and floats up */
.pop-word {
  position: relative;
  display: inline;
  line-height: 1.2;
  color: var(--fg);
  background: linear-gradient(to right, var(--soft) 1px, transparent 1px) 0 100% / 3px 1px repeat-x;
}
.pop-word:hover { background-image: linear-gradient(to right, var(--fg) 1px, transparent 1px); }
.pop-word.is-ringing { display: inline-block; animation: ring .6s ease-in-out; }
@keyframes ring {
  15% { transform: rotate(-3deg); } 30% { transform: rotate(3deg); } 45% { transform: rotate(-2deg); }
  60% { transform: rotate(2deg); } 75% { transform: rotate(-1deg); }
}
.pop-float {
  position: absolute; left: 50%; bottom: 100%;
  font: 400 15px/1 var(--hand);
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  animation: float-up 1.1s ease-out forwards;
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(calc(-50% + var(--dx)), 6px) rotate(-5deg) scale(.9); }
  20% { opacity: 1; transform: translate(calc(-50% + var(--dx)), -2px) rotate(-5deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), -20px) rotate(-7deg); }
}

/* polaroid words: hover or tap for a fanned stack of photos */
.polaroid-trigger {
  position: relative;
  display: inline;
  line-height: 1.2;
  color: var(--fg);
  border-bottom: 1px dashed var(--line-2);
  cursor: default;
  transition: border-color .3s;
}
.polaroid-trigger::after {
  content: ' \2726';
  display: inline-block;
  font-size: 7px;
  vertical-align: super;
  color: var(--soft);
  transition: transform .6s var(--spring), color .3s;
}
.polaroid-trigger:hover, .polaroid-trigger:focus-visible { border-bottom-color: var(--fg); }
.polaroid-trigger:hover::after, .polaroid-trigger:focus-visible::after, .polaroid-trigger.is-tapped::after { color: var(--fg); transform: rotate(90deg) scale(1.4); }
.polaroid-stack {
  position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 50;
  display: block;
  width: 160px; height: 160px;
  pointer-events: none;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(14px) scale(.9) rotate(-3deg);
  transform-origin: 30% 100%;
  transition: opacity .25s var(--ease-out), filter .3s var(--ease-out), transform .6s var(--spring);
}
.polaroid-trigger:hover .polaroid-stack,
.polaroid-trigger:focus-visible .polaroid-stack,
.polaroid-trigger.is-tapped .polaroid-stack { opacity: 1; filter: none; transform: none; pointer-events: auto; }
@media (hover: none) { .polaroid-trigger:not(.is-tapped):hover .polaroid-stack { opacity: 0; pointer-events: none; } }
.polaroid {
  position: absolute; left: 0; bottom: 0;
  display: block;
  width: 160px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
  transform-origin: 50% 90%;
  transition: transform .7s var(--spring), opacity .35s ease;
}
.polaroid img, .polaroid .ph { display: block; width: 100%; height: 130px; object-fit: cover; }
.polaroid .ph {
  display: grid; place-items: center;
  background: radial-gradient(circle, var(--line-2) .6px, transparent 1px) 0 0 / 8px 8px, var(--hover);
  font: 10px/1 var(--mono);
  color: var(--soft);
}
.polaroid-n { display: block; margin-top: 4px; font: 9px/1.4 var(--mono); text-align: center; color: var(--soft); }
@media (max-width: 768px) {
  .polaroid-stack { width: 130px; height: 130px; }
  .polaroid { width: 130px; }
  .polaroid img, .polaroid .ph { height: 100px; }
}

/* wall of pieces */
.wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.wall-piece { display: block; width: 100%; text-align: left; cursor: zoom-in; }
.wall-piece:focus-visible { outline: 0; }
.wall-piece:focus-visible .wall-frame { outline: 1.5px solid var(--fg); outline-offset: 2px; }
.wall-frame {
  display: block;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: transform .45s var(--spring), box-shadow .35s ease;
}
.wall-frame img, .wall-frame .ph { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: var(--hover); user-select: none; -webkit-user-drag: none; }
.wall-frame .ph, .lb-print .ph {
  display: grid; place-items: center;
  background: radial-gradient(circle, var(--line-2) .6px, transparent 1px) 0 0 / 8px 8px, var(--hover);
  font: 11px/1 var(--mono);
  color: var(--soft);
}
.wall-cap { display: flex; gap: 8px; margin-top: 10px; padding-left: 2px; font: 11px/1.4 var(--mono); color: var(--muted); transition: color .2s; }
.wall-cap .n { color: var(--soft); }
@media (hover: hover) {
  .wall-piece:hover .wall-frame { transform: translateY(-3px); box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .28); }
  .wall-piece:hover .wall-cap { color: var(--fg); }
}
.wall-piece:active .wall-frame { transform: scale(.98); }
.wall-more { margin-top: 22px; }
.wall-more[hidden] { display: none; }
.wall-rest { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.wall-rest[hidden] { display: none; }
.wall-rest .wall-frame { padding: 4px; border-radius: 9px; }
.wall-rest .wall-frame img, .wall-rest .wall-frame .ph { border-radius: 5px; }
.wall-rest .wall-piece { animation: rise .5s var(--ease-out) both; animation-delay: calc(var(--i) * 14ms); }
@media (max-width: 560px) {
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .wall-rest { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
}

/* wall lightbox: a print you can swipe sideways or flick down */
.lb-print {
  position: fixed; z-index: 95;
  overflow: hidden;
  border-radius: 12px;
  background: var(--hover);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .4);
}
.lb-print:active { cursor: grabbing; }
.lb-print img, .lb-print .ph { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.lb-print .ph { font-size: 14px; }
.lb-bar {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 96;
  display: flex; align-items: center; gap: 2px;
  padding: 3px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .25);
  font: 12px/1 var(--mono);
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .3s var(--ease-out), transform .4s var(--ease-out);
}
.lb-bar.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.lb-bar span { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.lb-bar button { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 99px; color: var(--muted); transition: color .2s, background-color .2s; }
.lb-bar button:hover { color: var(--fg); background: var(--hover); }
.lb-bar button:focus-visible { border-radius: 99px; outline-offset: 0; }
.lb-bar [data-close] { margin-left: 2px; border-left: 1px solid var(--line); border-radius: 0 99px 99px 0; }
.lb-bar .icon { width: 14px; height: 14px; }

/* dashed full-bleed line on top (the footer floor) */
.rule-top { position: relative; }
.rule-top::before {
  content: '';
  position: absolute; top: 0; height: 1px;
  left: calc(50% - 50vw); right: calc(50% - 50vw);
  background: linear-gradient(to right, var(--soft) 1px, transparent 1px) 0 0 / 4px 1px repeat-x;
  pointer-events: none;
}
.end + .foot.rule-top { margin-top: 40px; }

/* ---------- Dynamic island ---------- */
.island {
  position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 70;
  width: 112px; height: 36px;
  translate: -50% 0;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
  color: #f2f2f2;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5);
  opacity: 0; scale: .6;
  pointer-events: none;
  transition: width .6s var(--spring), opacity .22s ease, scale .55s var(--spring);
}
html.dark .island { box-shadow: 0 0 0 1px rgba(255, 255, 255, .13), 0 12px 30px -12px rgba(0, 0, 0, .7); }
.island.is-on { opacity: 1; scale: 1; }
.island-body {
  position: absolute; inset: 0;
  display: flex; align-items: center; gap: 9px;
  padding: 0 15px 0 6px;
  font: 500 12.5px/1.35 var(--sans);
  white-space: pre;
  transition: opacity .22s ease, filter .3s ease, transform .5s var(--spring);
}
.island-body.is-waiting { opacity: 0; filter: blur(5px); transform: scale(.92); }
.island-lead { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #262626; }
.island-lead svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.island.is-tappable { pointer-events: auto; cursor: pointer; }
/* now-playing equaliser */
.island .eq { display: flex; align-items: center; gap: 2px; height: 12px; }
.island .eq i { width: 2px; height: 100%; border-radius: 1px; background: #ffb340; transform-origin: 50% 100%; animation: eq .9s ease-in-out infinite alternate; }
.island .eq i:nth-child(2) { animation-duration: .7s; animation-delay: -.2s; }
.island .eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -.5s; }
.island .eq i:nth-child(4) { animation-duration: .8s; animation-delay: -.3s; }
@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  body::after { display: none; }
  .js .reveal { opacity: 1; filter: none; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
