/* ============================================================
   Chitransh Saxena — "everything is a vector"
   A living latent space. Bricolage Grotesque · Familjen Grotesk · Instrument Serif · IBM Plex Mono
   ============================================================ */

:root {
  /* ---- the ember void (warm red-brown, NEVER blue-black) ---- */
  --bg:        #060308;
  --bg-lift:   #170b07;
  --bg-2:      #0d0608;
  --scrim-rgb: 6, 3, 6;   /* legibility scrim base — flips with theme */

  /* ---- ink ---- */
  --ink:       #eceef5;
  --ink-soft:  #c3c8d6;
  --ink-dim:   #8a90a6;
  --ink-faint: #555c73;

  /* ---- accents (color = state) ---- */
  --accent:      #5b8cff;   /* indigo — links, focus, the query vector (data) */
  --accent-2:    #46e0c8;   /* mint-teal — live / retrieved-right-now */
  --warm:        #ff8a5b;   /* coral — his signatures (Claude Code · trivela) */
  --accent-rgb:  91, 140, 255;
  --warm-rgb:    255, 138, 91;
  --glow-rgb:    91, 140, 255;   /* library compat */

  /* ---- surfaces: elevation by value (the instrument-panel system) ---- */
  --surface-well:  #06070b;            /* recessed media frame (holds cloud/game/diagram) */
  --surface-1:     #0e1018;            /* SOLID SLAB — opaque, where all reading text lives */
  --surface-glass: rgba(14, 16, 24, .82);   /* FROSTED HUD — rail / topbar / palette / overlay */
  --edge:      rgba(255, 255, 255, .085);
  --edge-hi:   rgba(255, 255, 255, .06);     /* inset top-light bevel */
  --hairline:  rgba(255, 255, 255, .08);

  /* elevation tokens — hairline + tight contact + one soft lift (no blurry glow) */
  --lift-1: inset 0 1px 0 var(--edge-hi), 0 1px 2px rgba(0,0,0,.45), 0 18px 50px -22px rgba(0,0,0,.7);
  --lift-2: inset 0 1px 0 var(--edge-hi), 0 28px 70px -28px rgba(0,0,0,.8);
  --well:   inset 0 1px 0 rgba(0,0,0,.55), 0 0 0 1px var(--hairline);
  --r-chip: 8px; --r-panel: 12px; --r-feat: 14px;

  /* old aliases so existing rules keep working through the sweep */
  --glass:      var(--surface-1);
  --glass-2:    var(--surface-glass);
  --glass-line: var(--edge);
  --glass-hi:   var(--edge-hi);
  --surface:   rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --ok:        #46e0c8;
  --on-accent: #060810;

  /* ---- genre phosphors (constant across spectrum) ---- */
  --g-mystery:  #d6516e;
  --g-finance:  #46c98a;
  --g-startup:  #e0a23c;
  --g-selfhelp: #a982ff;
  --g-ai:       #4bb6d4;

  /* ---- type ---- */
  --display: "Bricolage Grotesque", "Arial Black", sans-serif;   /* headlines — characterful grotesque */
  --serif:   "Instrument Serif", "Times New Roman", serif;        /* emphasis accent only (italic) */
  --sans:    "Familjen Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --ease: cubic-bezier(.22, .68, 0, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --rail-w: 168px;
}

/* ===== light theme — paper, not glass; the cloud re-renders as ink in hero.js ===== */
[data-theme="light"] {
  --bg:        #eceef4;
  --bg-lift:   #f5f6fa;
  --bg-2:      #e3e6ef;
  --scrim-rgb: 236, 238, 244;

  --ink:       #14161d;
  --ink-soft:  #394050;
  --ink-dim:   #5d6476;
  --ink-faint: #8b91a3;

  --accent:      #3a5bd9;   /* deepened so it carries on light */
  --accent-2:    #0e9c86;
  --warm:        #d96336;
  --accent-rgb:  58, 91, 217;
  --warm-rgb:    217, 99, 54;
  --glow-rgb:    58, 91, 217;

  /* surfaces — opaque paper slabs on a light field */
  --surface-well:  #e7eaf2;
  --surface-1:     #ffffff;
  --surface-glass: rgba(255, 255, 255, .84);
  --edge:      rgba(18, 22, 38, .12);
  --edge-hi:   rgba(255, 255, 255, .9);
  --hairline:  rgba(18, 22, 38, .1);
  --lift-1: inset 0 1px 0 var(--edge-hi), 0 1px 2px rgba(18,22,38,.06), 0 18px 44px -24px rgba(18,22,38,.20);
  --lift-2: inset 0 1px 0 var(--edge-hi), 0 24px 60px -30px rgba(18,22,38,.28);
  --well:   inset 0 1px 0 rgba(18,22,38,.06), 0 0 0 1px var(--hairline);

  /* aliases for any rule still reading the old names */
  --glass:      var(--surface-1);
  --glass-2:    var(--surface-glass);
  --glass-line: var(--edge);
  --glass-hi:   var(--edge-hi);
  --surface:   rgba(18, 22, 38, .035);
  --surface-2: rgba(18, 22, 38, .065);
  --on-accent: #fff;
}
[data-theme="light"] .aurora {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(58, 91, 217, .12), transparent 55%),
    radial-gradient(90% 70% at 85% 8%, rgba(14, 156, 134, .08), transparent 55%),
    radial-gradient(100% 90% at 12% 90%, rgba(140, 110, 232, .08), transparent 55%),
    radial-gradient(70% 60% at 50% 50%, var(--bg-lift), var(--bg) 72%);
}
[data-theme="light"] .grain { opacity: .02; mix-blend-mode: multiply; }
[data-theme="light"] .btn--solid { color: #fff; }
[data-theme="light"] .btn--line { background: rgba(18, 22, 38, .02); }
[data-theme="light"] ::selection { background: rgba(var(--accent-rgb), .26); color: #14161d; }
/* only the landing hero floats on media → keep its soft depth; page headings sit on solid ground */
[data-theme="light"] .landing__h { text-shadow: 0 2px 30px rgba(18, 22, 38, .12); }
/* keep the build terminal dark in both themes — terminals are dark */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: rgba(var(--accent-rgb), .32); color: #fff; }

.dim { color: var(--ink-dim); }
.r-c { color: var(--accent); }
.warm { color: var(--warm); }
.warm-em { color: var(--warm); font-style: italic; }
em { font-style: italic; }
b, strong { color: var(--ink); font-weight: 600; }

.skip {
  position: fixed; top: -60px; left: 50%; transform: translateX(-50%);
  z-index: 400; background: var(--accent); color: #fff; padding: .6rem 1.1rem;
  border-radius: 0 0 10px 10px; font: 500 .85rem var(--sans); transition: top .2s var(--ease);
}
.skip:focus { top: 0; }

/* ---------- atmosphere ---------- */
.aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70% 80% at 72% 42%, rgba(255, 110, 40, .12), transparent 55%),
    radial-gradient(50% 50% at 78% 40%, rgba(255, 60, 120, .08), transparent 60%),
    radial-gradient(60% 50% at 20% 88%, rgba(110, 22, 7, .35), transparent 60%),
    radial-gradient(80% 70% at 50% 50%, var(--bg-lift), var(--bg) 72%);
}
.latent {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity 1.1s var(--ease-soft);
}
.latent.lit { opacity: 1; }
.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* reading-ground: a fixed directional plate so content sits on near-solid ground, cloud only at the right edge */
.page-scrim {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease);
  background: linear-gradient(100deg, rgba(var(--scrim-rgb), .96) 0%, rgba(var(--scrim-rgb), .9) 40%, rgba(var(--scrim-rgb), .5) 56%, rgba(var(--scrim-rgb), .12) 72%, transparent 84%);
}
.js body.entered .page-scrim { opacity: 1; }
/* no-webgl: lean on the aurora */
body.no-webgl .aurora {
  background:
    radial-gradient(60% 50% at 50% 30%, rgba(var(--accent-rgb), .18), transparent 60%),
    radial-gradient(50% 40% at 78% 18%, rgba(70, 224, 200, .12), transparent 60%),
    radial-gradient(55% 45% at 20% 78%, rgba(197, 139, 255, .12), transparent 60%),
    radial-gradient(40% 35% at 62% 70%, rgba(var(--warm-rgb), .10), transparent 60%),
    var(--bg);
}

/* ---------- scroll-progress filament ---------- */
.filament {
  position: fixed; left: 0; top: 0; bottom: 0; width: 2px; z-index: 60; pointer-events: none;
  background: rgba(255, 255, 255, .05);
}
.filament i {
  display: block; width: 100%; height: 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), .7);
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem clamp(1rem, 4vw, 2.2rem);
  transition: background .3s var(--ease), backdrop-filter .3s var(--ease), border-color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  background: rgba(7, 8, 12, .55); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--hairline);
}
.brand { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.brand__mark { display: inline-flex; gap: 3px; }
.brand__mark i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .55; transition: opacity .3s var(--ease), box-shadow .3s var(--ease); }
.brand__mark i:nth-child(2) { background: var(--accent-2); }
.brand__mark i:nth-child(3) { background: var(--warm); }
.brand:hover .brand__mark i { opacity: 1; box-shadow: 0 0 8px currentColor; }
.brand__name { font-weight: 600; color: var(--ink); letter-spacing: -.01em; font-size: .95rem; white-space: nowrap; }
.brand__role { font: 400 .72rem var(--mono); color: var(--ink-dim); letter-spacing: .02em; white-space: nowrap; }
@media (max-width: 720px) { .brand__role { display: none; } }

.topbar__act { display: flex; align-items: center; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; font: 500 .78rem var(--mono); color: var(--ink-soft);
  border: 1px solid var(--hairline); border-radius: 9px; padding: .36rem .6rem; letter-spacing: .01em;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.chip:hover { border-color: rgba(var(--accent-rgb), .6); color: var(--ink); background: rgba(var(--accent-rgb), .08); }
.chip kbd { background: rgba(255, 255, 255, .06); border: 1px solid var(--hairline); border-radius: 4px; padding: 0 .26rem; font: inherit; font-size: .72rem; }
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.chip__ico { color: var(--accent); font-size: 1em; line-height: 1; }
.chip--ghost { color: var(--ink-dim); }
@media (max-width: 560px) { .chip#rezBtn { display: none; } }

/* ---------- right-edge section rail ---------- */
/* right rail = a frosted HUD capsule; labels ALWAYS legible, active = solid indigo chip */
.rail {
  position: fixed; right: clamp(.6rem, 2vw, 1.4rem); top: 50%; transform: translateY(-50%);
  z-index: 70; display: flex; flex-direction: column; gap: 2px; align-items: stretch;
  padding: 6px; border-radius: var(--r-feat);
  background: var(--surface-glass); border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--lift-2);
}
.rail__i {
  position: relative; display: grid; grid-template-columns: 1.4rem 1fr; align-items: center; gap: .55rem;
  min-width: 152px; padding: 7px 12px 7px 9px; border-radius: 9px;
  color: var(--ink-dim); font: 500 .78rem var(--mono); letter-spacing: .02em;
  transition: background .28s var(--ease), color .28s var(--ease), box-shadow .28s var(--ease);
}
.rail__i::before { content: attr(data-k); color: var(--ink-faint); font-size: .66rem; font-variant-numeric: tabular-nums; transition: color .18s var(--ease); }
.rail__l { opacity: 1; transform: none; }
.rail__i:hover { background: rgba(var(--accent-rgb), .12); color: var(--ink); }
.rail__i:hover::before { color: var(--accent); }
.rail__i:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rail__i.active { background: var(--accent); color: var(--on-accent); box-shadow: inset 2px 0 0 rgba(255, 255, 255, .35); }
.rail__i.active::before { color: var(--on-accent); opacity: .72; }

/* mobile: dock to a bottom thumb-bar, horizontal, index-first, active expands its label */
@media (max-width: 880px) {
  .rail {
    right: 12px; left: 12px; top: auto; bottom: max(12px, env(safe-area-inset-bottom)); transform: none;
    flex-direction: row; justify-content: center; gap: 2px; overflow-x: auto; border-radius: 14px;
  }
  .rail__i { min-width: 0; grid-template-columns: auto; justify-items: center; padding: 8px 11px; }
  .rail__i .rail__l { display: none; }
  .rail__i.active { grid-template-columns: auto auto; }
  .rail__i.active .rail__l { display: inline; }
}

/* ---------- section scaffold ---------- */
main { position: relative; z-index: 3; }
.sec {
  position: relative; max-width: 1160px; margin: 0 auto;
  padding: clamp(5rem, 13vh, 9rem) clamp(1.2rem, 5vw, 3rem) clamp(4rem, 10vh, 7rem);
  scroll-margin-top: 80px;
}
.sec--split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.sec--contact { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 880px) { .sec--split { grid-template-columns: 1fr; gap: 2.4rem; } }

.sec__head { margin-bottom: clamp(1.8rem, 4vw, 2.8rem); max-width: 60ch; }
.sec__h {
  font-family: var(--display); font-weight: 500; font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: .98; letter-spacing: -.03em; color: var(--ink); margin: .3rem 0 0;
}
.sec__h em { color: var(--accent); font-style: italic; }
/* signature: emphasis words drop into an elegant serif italic inside the grotesque
   headline — a grotesk × serif clash you don't see on dev portfolios */
.landing__h em, .sec__h em, .contact__h em, .sec__h .warm-em {
  font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; font-size: 1.06em;
}
.lede { font-size: clamp(1rem, 1.5vw, 1.15rem); color: var(--ink-soft); margin-top: 1rem; max-width: 52ch; line-height: 1.65; }

.kick {
  font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .22em;
  color: var(--ink-dim); display: inline-flex; align-items: center; gap: .6rem;
}
.kick::before { content: "//"; color: var(--accent); opacity: .8; }
.kick__i { color: var(--accent); letter-spacing: .1em; }

/* ---------- reveal (gated on .js so content shows if scripting fails) ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .85s var(--ease), transform .85s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.stagger.in > * { animation: rise .8s var(--ease) both; }
.js .stagger > * { opacity: 0; }
.stagger.in > *:nth-child(1) { animation-delay: .04s; }
.stagger.in > *:nth-child(2) { animation-delay: .12s; }
.stagger.in > *:nth-child(3) { animation-delay: .20s; }
.stagger.in > *:nth-child(4) { animation-delay: .28s; }
.stagger.in > *:nth-child(5) { animation-delay: .36s; }
.stagger.in > *:nth-child(6) { animation-delay: .44s; }
.stagger.in > *:nth-child(7) { animation-delay: .52s; }
.stagger.in > *:nth-child(8) { animation-delay: .60s; }
.stagger.in > *:nth-child(n+9) { animation-delay: .66s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- the plate primitive: one machined panel, three variants ---------- */
/* SOLID SLAB (default) — opaque; where all reading text lives. No blur (GPU win). */
.glass {
  background: var(--surface-1);
  border: 1px solid var(--edge); border-radius: var(--r-panel);
  box-shadow: var(--lift-1);
}
/* FROSTED HUD — floats over the live cloud as a control (rail/topbar/palette/overlay) */
.glass--hud {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--lift-2);
}
/* MEDIA FRAME — a recessed viewport that HOLDS the cloud / a game / a diagram */
.glass--well {
  background: var(--surface-well);
  box-shadow: var(--well);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.4rem; border-radius: 12px;
  font-weight: 500; font-size: .95rem; letter-spacing: -.01em;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), color .2s var(--ease);
}
.btn--solid { background: var(--accent); color: #fff; box-shadow: 0 14px 36px -16px rgba(var(--accent-rgb), .9); }
.btn--solid:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -16px rgba(var(--accent-rgb), 1); filter: brightness(1.06); }
.btn--line { border: 1px solid var(--glass-line); color: var(--ink); background: rgba(255, 255, 255, .03); }
.btn--line:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb), .6); color: var(--accent); }

/* ============================================================
   LANDING — immersive intro (alive sphere · identity · game · enter)
   ============================================================ */
.landing {
  position: relative; z-index: 4; min-height: 100svh;
  display: grid; place-items: center;
  padding: clamp(5.5rem, 13vh, 8.5rem) clamp(1.2rem, 5vw, 3rem) clamp(4.5rem, 9vh, 6rem);
}
.js .landing {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto;
  transition: opacity .6s var(--ease), transform .7s var(--ease), filter .6s var(--ease);
}
/* directional scrim so the left-hand copy stays crisp over the live cloud */
.landing::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, rgba(var(--scrim-rgb), .82) 0%, rgba(var(--scrim-rgb), .5) 24%, rgba(var(--scrim-rgb), .14) 42%, transparent 58%);
}
@media (max-width: 900px) {
  .landing::before { background: linear-gradient(180deg, rgba(var(--scrim-rgb), .5) 0%, rgba(var(--scrim-rgb), .8) 64%, var(--bg) 100%); }
}
.landing__inner {
  width: min(1180px, 100%); display: grid; grid-template-columns: 1.04fr .96fr;
  gap: clamp(1.6rem, 4vw, 3.6rem); align-items: center;
}
@media (max-width: 900px) {
  .landing__inner { grid-template-columns: 1fr; gap: 1.8rem; }
  .landing__play { order: 2; } .landing__lead { order: 1; }
}
.landing__lead { max-width: 38rem; }
.landing__h {
  font-family: var(--display); font-weight: 400; font-size: clamp(3rem, 8.5vw, 7rem);
  line-height: .94; letter-spacing: -.025em; color: var(--ink); margin: .8rem 0 1.2rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .9), 0 0 64px rgba(0, 0, 0, .7);
}
.landing__sub, .landing__bio { text-shadow: 0 1px 12px rgba(0, 0, 0, .85); }
.landing__h em { font-style: italic; color: var(--warm); text-shadow: 0 0 50px rgba(var(--warm-rgb), .4); }
.landing__sub { font-size: clamp(1.02rem, 1.7vw, 1.3rem); color: var(--ink); max-width: 40ch; line-height: 1.5; }
.landing__sub b { font-weight: 600; }
.landing__bio { font-size: clamp(.92rem, 1.2vw, 1.02rem); color: var(--ink-soft); max-width: 50ch; margin-top: .9rem; }
.landing__cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.6rem 0 1.2rem; }
.landing__soc { display: flex; gap: 1.4rem; font: 500 .85rem var(--mono); }
.landing__soc a { color: var(--ink-dim); border-bottom: 1px solid transparent; padding-bottom: 2px; transition: color .2s var(--ease), border-color .2s var(--ease); }
.landing__soc a:hover { color: var(--accent); border-color: var(--accent); }

/* the right column is a clear zone where the star blazes; only a small caption + play link float on it */
.landing__play { display: flex; flex-direction: column; justify-content: flex-end; gap: .55rem; min-width: 0; min-height: clamp(300px, 46vh, 460px); align-items: flex-start; }
@media (max-width: 900px) { .landing__play { min-height: 30vh; align-items: center; text-align: center; } }
.landing__star-cap { font: 500 .82rem var(--mono); letter-spacing: .04em; text-shadow: 0 1px 14px rgba(0,0,0,.8); }
.landing__star-sub { font: 400 .86rem var(--sans); color: var(--ink-soft); max-width: 26ch; text-shadow: 0 1px 12px rgba(0,0,0,.85); }
.landing__play-link { font: 500 .82rem var(--mono); color: var(--ink); border: 1px solid var(--edge); background: var(--surface-glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: .5rem .8rem; border-radius: var(--r-chip); margin-top: .4rem; transition: border-color .2s var(--ease), color .2s var(--ease); }
.landing__play-link:hover { border-color: var(--accent); color: var(--accent); }
.landing__play-link b { color: var(--warm); font-weight: 600; }
.landing__play-cap { font: 400 .82rem var(--mono); color: var(--ink-soft); }
.landing__game { height: clamp(300px, 50vh, 470px); overflow: hidden; background: rgba(6, 7, 11, .5); }
.landing__game hurdle-game { display: block; width: 100%; height: 100%; outline: none; }
.landing__game hurdle-game canvas { border-radius: inherit; }
.landing__keys { font: 400 .74rem var(--mono); color: var(--ink-dim); }
.landing__keys span { color: var(--ink); border: 1px solid var(--hairline); border-radius: 5px; padding: .05rem .32rem; }

.landing__enter {
  position: absolute; left: 0; right: 0; bottom: clamp(1.1rem, 3vh, 2.2rem);
  display: flex; align-items: center; justify-content: center; gap: clamp(.8rem, 4vw, 2.4rem);
  pointer-events: none; flex-wrap: wrap; padding: 0 1rem;
}
.landing__q { font: 400 .74rem var(--mono); color: var(--accent); letter-spacing: .02em; }
.landing__hint { font: 400 .72rem var(--mono); color: var(--ink-dim); text-transform: uppercase; letter-spacing: .14em; display: inline-flex; align-items: center; gap: .5rem; }
.landing__hint kbd { background: var(--surface); border: 1px solid var(--hairline); border-radius: 4px; padding: 0 .3rem; color: var(--ink-soft); }
.landing__arrow { display: inline-block; animation: bob 1.8s var(--ease) infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }
@media (max-width: 900px) { .landing__enter { position: static; margin-top: 1.6rem; } }

/* ---- landing ⇄ portfolio transition ---- */
.js #main { transition: opacity .55s var(--ease); }
.js body { overflow: hidden; height: 100svh; }
.js body:not(.entered) #main { opacity: 0; visibility: hidden; }
.js body.entered .landing { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-2.5vh) scale(.985); filter: blur(4px); }
.rail { transition: opacity .5s var(--ease); }
.js body:not(.entered) .rail { opacity: 0; pointer-events: none; }
.filament { display: none; }

/* ============================================================
   SCROLL + SCROLLSPY (entered) — pages scroll naturally; the rail tracks you;
   click the rail (or keys) to glide to a section. Organic, not locked.
   ============================================================ */
.js body.entered #main {
  position: fixed; inset: 0; z-index: 3;
  overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth;
  padding: 0 clamp(1.2rem, 5vw, 3.2rem);
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
@media (prefers-reduced-motion: reduce) { .js body.entered #main { scroll-behavior: auto; } }
/* reserve the rail's lane on wide screens so right-aligned content never tucks under it */
@media (min-width: 1040px) { .js body.entered #main { padding-right: 13.5rem; } }
/* each section is a comfortable full-height "chapter" you scroll through */
.js body.entered .sec {
  display: flex; flex-direction: column; justify-content: center;
  width: 100%; max-width: 1160px; margin: 0 auto;
  min-height: 100svh; padding: clamp(6rem, 13vh, 8rem) 0 clamp(3.5rem, 8vh, 5.5rem);
}
.js body.entered .sec--split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 880px) { .js body.entered .sec--split { grid-template-columns: 1fr; } }
.js body.entered .reveal { opacity: 1; transform: none; }   /* portfolio content always present; the scroll is the motion */
/* topbar carries its glass once you're in the pages */
.js body.entered .topbar { background: rgba(7, 8, 12, .5); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-bottom-color: var(--hairline); }
[data-theme="light"].js body.entered .topbar,
[data-theme="light"] body.entered .topbar { background: rgba(236, 238, 244, .6); }
/* the rail is the primary nav — labels always shown in the pages */
.js body.entered .rail__l { opacity: 1; transform: none; }

.tele { display: flex; flex-wrap: wrap; gap: clamp(1.2rem, 3.5vw, 2.6rem); margin-top: 2rem; }
.tele__i { min-width: 90px; text-align: left; padding: .3rem .55rem .3rem 0; border-radius: 10px; transition: transform .2s var(--ease); }
.tele__i--link { cursor: pointer; padding-left: .55rem; margin-left: -.55rem; }
.tele__i--link:hover { transform: translateY(-2px); }
.tele__i--link:hover .tele__v { color: var(--accent); }
.tele__i--link:hover .tele__l { color: var(--ink-soft); }
.tele__v, .tele__l { transition: color .2s var(--ease); }
.tele__v { display: block; font-family: var(--mono); font-weight: 500; font-size: clamp(1.5rem, 3.2vw, 2.3rem); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.tele__l { display: flex; align-items: center; gap: .4rem; font: 400 .72rem var(--mono); color: var(--ink-dim); margin-top: .5rem; letter-spacing: .02em; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot--live { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); animation: pulse 1.8s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- WHOAMI ---------- */
.who { display: grid; gap: 1rem; }
.kv { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.kv th, .kv td { text-align: left; padding: .7rem 1rem; font-weight: 400; font-size: .9rem; border-bottom: 1px solid var(--hairline); }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: none; }
.kv th { color: var(--ink-dim); width: 7rem; border-right: 1px solid var(--hairline); font: 400 .76rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.kv td { color: var(--ink); }
.live-ok { color: var(--accent-2); }
.facets { list-style: none; padding: 1rem 1.1rem; display: grid; gap: .55rem; }
.facets li { display: flex; gap: .7rem; align-items: baseline; font-size: .9rem; color: var(--ink-soft); }
.facets li span { font: 500 .68rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); min-width: 5.2rem; }

/* ---------- EXPERIENCE ledger ---------- */
.ledger { overflow: hidden; }
.lrow {
  display: grid; grid-template-columns: 2.2rem 1.6fr 1fr 1fr .7rem 1.6fr 1.4rem;
  align-items: center; gap: .8rem; padding: 1.05rem 1.2rem; cursor: pointer;
  border-bottom: 1px solid var(--hairline); transition: background .2s var(--ease);
}
.lrow:hover, .lrow:focus-visible { background: rgba(var(--accent-rgb), .06); outline: none; }
.lrow.open { background: linear-gradient(90deg, rgba(var(--accent-rgb), .10), transparent); }
.lrow__n { font: 500 .8rem var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.lrow__org b { color: var(--ink); font-weight: 600; }
.lrow__role { color: var(--ink-soft); font-size: .9rem; }
.lrow__when { font: 400 .82rem var(--mono); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.lrow__loc { font: 400 .78rem var(--mono); color: var(--ink-dim); }
.lrow__sig { color: var(--accent-2); font-size: .82rem; }
.lrow__chev { text-align: right; color: var(--ink-dim); transition: transform .3s var(--ease), color .2s var(--ease); }
.lrow.open .lrow__chev { transform: rotate(90deg); color: var(--accent); }
@media (max-width: 760px) {
  .lrow { grid-template-columns: 1.8rem 1fr auto 1.2rem; row-gap: .3rem; }
  .lrow__role, .lrow__loc, .lrow__sig { display: none; }
}
.ldetail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .42s var(--ease); }
.ldetail.show { grid-template-rows: 1fr; }
.ldetail > .ldetail__in { overflow: hidden; min-height: 0; padding: 0 1.3rem; border-bottom: 1px solid transparent; transition: padding .42s var(--ease), border-color .42s var(--ease); }
.ldetail.show > .ldetail__in { padding: .4rem 1.3rem 1.4rem; border-bottom-color: var(--hairline); }
.ldetail__sub { color: var(--accent-2); font-size: .85rem; margin-bottom: .8rem; font-family: var(--mono); }
.ldetail ul { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.ldetail li { position: relative; padding-left: 1.3rem; color: var(--ink-soft); font-size: .92rem; }
.ldetail li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.ldetail b { color: var(--ink); }
.award { color: var(--warm); }
.tagrow { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tagrow span { font: 400 .72rem var(--mono); color: var(--ink-soft); border: 1px solid var(--hairline); padding: .22rem .6rem; border-radius: 6px; }
.edu { margin-top: 1.4rem; font-size: .86rem; color: var(--ink-dim); font-family: var(--mono); }

/* ---------- STACK matrix ---------- */
.matrix { overflow: hidden; }
.mrow {
  display: grid; grid-template-columns: 2.4rem 11rem 1fr 2.4rem; align-items: center; gap: 1rem;
  padding: .95rem 1.2rem; border-bottom: 1px solid var(--hairline);
  transition: background .2s var(--ease); cursor: pointer;
}
.mrow:last-child { border-bottom: none; }
.mrow:hover, .mrow.lit { background: rgba(var(--accent-rgb), .08); }
.mrow.lit .mrow__d { color: var(--accent); }
.mrow__k { font: 500 .8rem var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.mrow__d { color: var(--ink); font-weight: 600; font-size: .92rem; }
.mrow__n { text-align: right; font: 500 .8rem var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.cells { display: flex; flex-wrap: wrap; gap: .4rem; }
.cells span { font: 400 .76rem var(--mono); color: var(--ink-soft); border: 1px solid var(--hairline); background: rgba(255, 255, 255, .02); padding: .22rem .6rem; border-radius: 6px; transition: border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease); }
.cells span:hover { border-color: rgba(var(--accent-rgb), .6); color: var(--accent); transform: translateY(-1px); }
@media (max-width: 720px) {
  .mrow { grid-template-columns: 2rem 1fr 2rem; }
  .mrow .cells { grid-column: 1 / -1; }
}

/* ---------- BUILD ---------- */
.build__list { list-style: none; display: flex; flex-direction: column; gap: .55rem; margin: 1.4rem 0; }
.build__list li { padding-left: 1.4rem; position: relative; color: var(--ink-soft); }
.build__list li::before { content: "$"; position: absolute; left: 0; color: var(--accent-2); font-family: var(--mono); }
.build__meta { font: 400 .82rem var(--mono); color: var(--ink-dim); border-left: 2px solid var(--warm); padding-left: .9rem; line-height: 1.6; }
.build__viz { display: flex; flex-direction: column; gap: 1.1rem; }
.pipeline { padding: 1.1rem 1.2rem; position: relative; overflow: hidden; }
.pipeline figcaption { font: 400 .72rem var(--mono); color: var(--ink-dim); margin-bottom: .3rem; }
.pipeline svg { width: 100%; height: auto; display: block; overflow: visible; }
.pl-wire { stroke: var(--hairline); stroke-width: 1.5; stroke-dasharray: 3 4; }
.pl-node circle { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.pl-node text { font: 500 11px var(--mono); fill: var(--ink-soft); text-anchor: middle; }
.pl-node--out circle { fill: var(--accent); stroke: var(--accent); }
.pl-node--out text { fill: var(--accent); }
.pl-packet { fill: var(--warm); filter: drop-shadow(0 0 5px var(--warm)); }
/* the terminal is ALWAYS dark in both themes → its text uses fixed bright values
   (never the theme --ink, which flips to near-black in light and vanishes here) */
.term { overflow: hidden; background: #0a0c12; border-color: rgba(255, 255, 255, .08); }
.term__bar { display: flex; align-items: center; gap: .45rem; padding: .65rem .9rem; border-bottom: 1px solid rgba(255, 255, 255, .08); font: 400 .7rem var(--mono); color: #8a90a6; }
.term__bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.term__bar span:first-child { background: #ff8a5b; }
.term__bar span:nth-child(2) { background: #46e0c8; }
.term__bar b { margin-left: auto; font-weight: 400; }
.term__body { font: 400 .8rem/1.9 var(--mono); padding: 1rem 1.1rem; color: #c3c8d6; white-space: pre-wrap; word-break: break-word; }
.c-p { color: #46e0c8; } .c-c { color: #7aa2ff; } .c-f { color: #eceef5; } .c-ok { color: #46e0c8; } .c-dim { color: #8a90a6; }
.c-cur { color: #7aa2ff; animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- PROJECTS ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.pcard { position: relative; overflow: hidden; padding: 1.3rem 1.35rem; display: flex; flex-direction: column; gap: .7rem; transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease); }
.pcard::after {   /* cursor-follow spotlight */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s var(--ease);
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), .15), transparent 62%);
}
.pcard:not(.pcard--pending) { cursor: pointer; }
.pcard:not(.pcard--pending):hover { transform: translateY(-5px); border-color: rgba(var(--accent-rgb), .5); box-shadow: inset 0 1px 0 var(--glass-hi), 0 34px 74px -34px #000, 0 0 0 1px rgba(var(--accent-rgb), .25); }
.pcard:not(.pcard--pending):hover::after { opacity: 1; }
.pcard > * { position: relative; z-index: 1; }
.pcard__top { display: flex; align-items: center; justify-content: space-between; }
.pcard__n { font: 500 .8rem var(--mono); color: var(--accent); }
.pcard__t { font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--ink); letter-spacing: -.01em; line-height: 1.05; }
.pcard__link { transition: color .2s var(--ease); }
.pcard__link span { color: var(--accent); font-size: .8em; }
.pcard__link:hover { color: var(--accent); }
.pcard__d { font-size: .9rem; color: var(--ink-soft); line-height: 1.55; flex: 1; }
.pcard__stack { font: 400 .74rem var(--mono); color: var(--ink-faint); }
.pcard__lnk { display: flex; gap: 1.2rem; margin-top: .2rem; }
.pcard__lnk a { font: 500 .8rem var(--mono); color: var(--ink-soft); border-bottom: 1px solid var(--hairline); padding-bottom: 2px; transition: color .2s var(--ease), border-color .2s var(--ease); }
.pcard__lnk a:hover { color: var(--accent); border-color: var(--accent); }
.inline-lnk { color: var(--accent); border-bottom: 1px solid rgba(var(--accent-rgb), .4); }
.inline-lnk:hover { border-color: var(--accent); }
.pcard--pending { opacity: .72; }
.tag { font: 500 .66rem var(--mono); padding: .18rem .5rem; border-radius: 5px; letter-spacing: .08em; white-space: nowrap; }
.tag--live { color: var(--accent-2); border: 1px solid color-mix(in srgb, var(--accent-2) 45%, transparent); }
.tag--pending { color: var(--ink-dim); border: 1px solid var(--hairline); }

/* ---------- ARCADE ---------- */
.arcade { display: grid; grid-template-columns: 1fr 280px; gap: 1.2rem; align-items: stretch; }
@media (max-width: 820px) { .arcade { grid-template-columns: 1fr; } }
.arcade__stage { height: clamp(330px, 58vh, 580px); overflow: hidden; background: rgba(6, 7, 11, .6); }
.arcade__stage trivela-game, .arcade__stage hurdle-game { display: block; width: 100%; height: 100%; outline: none; }
.arcade__stage hurdle-game canvas { border-radius: inherit; }
.arcade__side { padding: 1.2rem 1.25rem; display: flex; flex-direction: column; }
.arcade__title { font-family: var(--display); font-size: 1.5rem; margin-bottom: .5rem; }
.arcade__desc { color: var(--ink-soft); margin-bottom: .9rem; font-size: .92rem; }
.arcade__keys { font: 400 .76rem/2 var(--mono); color: var(--ink-dim); margin-bottom: 1rem; }
.arcade__keys span { color: var(--ink); border: 1px solid var(--hairline); border-radius: 5px; padding: .05rem .35rem; }
.arcade__note { font: 400 .74rem var(--mono); margin: .1rem 0 .7rem; line-height: 1.6; }
.arcade__roadmap { font: 400 .76rem var(--mono); margin-top: auto; }
.arcade__roadmap .inline-lnk { font-size: inherit; }

/* ---------- links table (arcade + contact) ---------- */
.links { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: .86rem; }
.links td { padding: .7rem .9rem; border-bottom: 1px solid var(--hairline); }
.links tr:last-child td { border-bottom: none; }
.links td:first-child { width: 1.6rem; color: var(--accent); font-family: var(--mono); }
.links td:nth-child(2) { color: var(--ink-dim); width: 7.5rem; font: 400 .78rem var(--mono); }
.links a { color: var(--ink); border-bottom: 1px solid rgba(var(--accent-rgb), .35); padding-bottom: 1px; transition: color .2s var(--ease), border-color .2s var(--ease); }
.links a:hover { color: var(--accent); border-color: var(--accent); }
.arcade__links { margin-bottom: 1rem; background: rgba(255, 255, 255, .02); border: 1px solid var(--hairline); border-radius: 10px; }

/* ---------- CONTACT ---------- */
.contact { max-width: 760px; }
.contact__h { font-family: var(--display); font-weight: 400; font-size: clamp(2.3rem, 6vw, 4.6rem); line-height: 1.0; letter-spacing: -.03em; color: var(--ink); margin: 1rem 0 1.8rem; }
.contact__h em { color: var(--accent); font-style: italic; }
.contact__mail { display: inline-flex; align-items: center; gap: .8rem; font-size: clamp(1.05rem, 3vw, 1.6rem); color: var(--ink); border: 1px solid var(--glass-line); padding: .8rem 1.2rem; border-radius: 12px; background: rgba(255, 255, 255, .025); transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease); font-family: var(--mono); }
.contact__mail:hover { border-color: rgba(var(--accent-rgb), .6); color: var(--accent); background: rgba(var(--accent-rgb), .06); }
.contact__mail .copy { font: 400 .72rem var(--mono); color: var(--ink-dim); }
.contact .links { margin-top: 2rem; }
.foot { max-width: 1160px; margin: clamp(3rem, 8vh, 5rem) auto 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; font: 400 .76rem var(--mono); color: var(--ink-faint); padding-top: 1.4rem; border-top: 1px solid var(--hairline); }
.foot__live { display: inline-flex; align-items: center; gap: .5rem; }

/* ---------- command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 13vh 1rem 1rem; background: rgba(4, 5, 9, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.cmdk[data-open="true"] { display: flex; animation: cmdkin .16s var(--ease); }
@keyframes cmdkin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.cmdk__panel { width: min(580px, 100%); overflow: hidden; }
.cmdk__input { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--hairline); color: var(--ink); font: 400 1rem var(--mono); padding: 1.1rem 1.3rem; outline: none; }
.cmdk__input::placeholder { color: var(--ink-dim); }
.cmdk__list { list-style: none; max-height: 54vh; overflow-y: auto; padding: .5rem; }
.cmdk__item { display: flex; align-items: center; gap: .8rem; padding: .68rem .9rem; border-radius: 10px; cursor: pointer; color: var(--ink-soft); }
.cmdk__item .ico { color: var(--accent); width: 1.3em; text-align: center; font-size: .82rem; font-family: var(--mono); }
.cmdk__item .meta { margin-left: auto; font: 400 .72rem var(--mono); color: var(--ink-faint); }
.cmdk__item[aria-selected="true"] { background: rgba(var(--accent-rgb), .14); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.cmdk__empty { padding: 1.3rem; text-align: center; color: var(--ink-dim); font-family: var(--mono); font-size: .85rem; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 2.4rem; left: 50%; z-index: 210; transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none; background: var(--glass-2); border: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--ink); padding: .65rem 1.2rem; border-radius: 999px; font: 400 .85rem var(--mono); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast b { color: var(--accent); }

/* ---------- résumé preview ---------- */
.rez { position: fixed; inset: 0; z-index: 220; display: none; align-items: flex-start; justify-content: center; padding: 5vh 1rem 2rem; background: rgba(4, 5, 9, .7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.rez[data-open="true"] { display: flex; animation: cmdkin .18s var(--ease); }
.rez__panel { width: min(880px, 100%); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.rez__bar { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--hairline); }
.rez__t { font: 400 .76rem var(--mono); color: var(--accent); }
.rez__sp { flex: 1; }
.rez__doc { overflow-y: auto; padding: clamp(1.6rem, 4vw, 2.8rem); }
.rz-name { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 5vw, 3rem); line-height: 1; letter-spacing: -.01em; color: var(--ink); }
.rz-title { font: 500 .82rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-top: .4rem; }
.rz-contact { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .8rem; font-size: .78rem; }
.rz-contact a { color: var(--ink-soft); border-bottom: 1px solid var(--hairline); }
.rz-contact a:hover { color: var(--accent); border-color: var(--accent); }
.rz-summary { color: var(--ink-soft); font-size: .92rem; margin-top: 1.1rem; line-height: 1.55; }
.rz-summary b { color: var(--ink); }
.rz-h { font: 500 .76rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); border-bottom: 1px solid var(--hairline); padding-bottom: .35rem; margin: 1.6rem 0 .8rem; }
.rz-skills div { font-size: .84rem; color: var(--ink-soft); margin: .4rem 0; line-height: 1.5; }
.rz-skills b { color: var(--ink); }
.rz-job { margin-bottom: 1.1rem; }
.rz-jh { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.rz-co { color: var(--ink); font-weight: 600; font-size: .98rem; }
.rz-when { font: 400 .74rem var(--mono); color: var(--ink-dim); white-space: nowrap; }
.rz-role { font-size: .84rem; color: var(--accent); margin-top: .15rem; }
.rz-sub { font-size: .8rem; color: var(--ink-dim); font-style: italic; margin: .2rem 0 .4rem; }
.rz-job ul { list-style: none; padding-left: 1.2rem; margin: .35rem 0 0; }
.rz-job li { position: relative; font-size: .84rem; color: var(--ink-soft); margin: .35rem 0; line-height: 1.5; }
.rz-job li::before { content: "▹"; position: absolute; left: -1.2rem; color: var(--accent); }
.rz-job b { color: var(--ink); }
@media (max-width: 560px) { .rez__t { display: none; } }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sec:focus, .sec:focus-visible { outline: none; }   /* scroll-jump targets shouldn't draw a full-section ring */

/* ============================================================
   LIBRARY (section 07) — reading room, re-themed to the void
   ============================================================ */
[data-genre="mystery"]  { --g: var(--g-mystery); }
[data-genre="finance"]  { --g: var(--g-finance); }
[data-genre="startup"]  { --g: var(--g-startup); }
[data-genre="selfhelp"] { --g: var(--g-selfhelp); }
[data-genre="ai"]       { --g: var(--g-ai); }

.lib { display: grid; grid-template-columns: 1fr 320px; gap: clamp(1.4rem, 3vw, 2.6rem); align-items: start; }
@media (max-width: 900px) { .lib { grid-template-columns: 1fr; } }
.lib__main { min-width: 0; }

.lib__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: .75rem; perspective: 1100px; }
.book {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: .55rem;
  min-height: 156px; padding: .9rem .95rem .85rem 1.2rem;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 3px 9px 9px 3px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, .03), 0 14px 30px -22px #000;
  color: var(--ink-soft); cursor: pointer; transform-origin: left center;
  transition: transform .28s var(--ease), border-color .22s var(--ease), box-shadow .28s var(--ease), opacity .22s var(--ease);
}
.book::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--g, var(--accent)); opacity: .85; border-radius: 3px 0 0 3px; box-shadow: 0 0 12px -2px var(--g, var(--accent)); }
.book__head { display: flex; align-items: center; gap: .4rem; font: 400 .64rem var(--mono); color: var(--ink-dim); letter-spacing: .03em; text-transform: uppercase; }
.book__head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--g, var(--accent)); opacity: .9; flex: 0 0 auto; }
.book__head .yr { margin-left: auto; font-variant-numeric: tabular-nums; }
.book__title { font-family: var(--sans); font-weight: 600; font-size: .98rem; line-height: 1.2; color: var(--ink); letter-spacing: -.01em; }
.book__author { font: 400 .72rem var(--mono); color: var(--ink-dim); margin-top: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book:hover { transform: translateY(-5px) rotateY(-8deg); border-color: color-mix(in srgb, var(--g) 55%, var(--glass-line)); box-shadow: 22px 18px 40px -22px #000, inset 1px 0 0 rgba(255, 255, 255, .05); }
.book.sel { transform: translateY(-3px) rotateY(-5deg); border-color: var(--g, var(--accent)); box-shadow: inset 0 0 0 1px var(--g, var(--accent)), 18px 16px 36px -20px #000; }
.book.dim { opacity: .3; filter: saturate(.5); pointer-events: none; }
.book.dim.sel { opacity: 1; filter: none; pointer-events: auto; }
.book__ribbon { position: absolute; top: -1px; right: 14px; width: 13px; height: 20px; background: var(--accent-2); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); box-shadow: 0 3px 6px -3px #000; }
.book.reading .book__ribbon { animation: pulse 1.8s var(--ease) infinite; }
.book:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lib__legend { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.gchip { display: inline-flex; align-items: center; gap: .45rem; font: 400 .75rem var(--mono); color: var(--ink-soft); border: 1px solid var(--hairline); border-radius: 999px; padding: .32rem .75rem; transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease); }
.gchip i { width: 7px; height: 7px; border-radius: 50%; background: var(--g, var(--accent)); flex: 0 0 auto; }
.gchip b { color: var(--ink-soft); font-weight: 600; }
.gchip .n { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.gchip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--g) 60%, var(--hairline)); }
.gchip.on { background: color-mix(in srgb, var(--g) 16%, transparent); border-color: var(--g); color: var(--ink); }
.gchip.on b { color: var(--ink); }

.lib__summary { margin-top: 1.4rem; border: 1px solid var(--glass-line); border-radius: 12px; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sum__stats { display: grid; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 540px) { .sum__stats { grid-template-columns: 1fr 1fr; } }
.sum__stat { text-align: left; padding: .85rem .95rem; min-width: 0; background: none; border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); transition: background .16s var(--ease); }
.sum__stat:nth-child(4n) { border-right: none; }
@media (max-width: 540px) { .sum__stat:nth-child(even) { border-right: none; } }
button.sum__stat { cursor: pointer; }
button.sum__stat:hover { background: rgba(var(--accent-rgb), .08); }
button.sum__stat:hover b { color: var(--accent); }
.sum__stat b { display: block; font-family: var(--sans); font-weight: 700; font-size: 1.35rem; color: var(--ink); line-height: 1; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum__stat b small { font-size: .6em; color: var(--ink-dim); font-weight: 600; }
.sum__stat span { display: block; font: 400 .64rem var(--mono); color: var(--ink-dim); margin-top: .45rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum__dist { display: flex; height: 32px; }
.sum__seg { flex: 1 1 0; min-width: 30px; display: flex; align-items: center; padding: 0 .55rem; overflow: hidden; background: color-mix(in srgb, var(--g) 24%, transparent); border-right: 1px solid var(--bg); font: 400 .58rem var(--mono); color: var(--ink); letter-spacing: .02em; cursor: pointer; transition: background .18s var(--ease), flex-grow .35s var(--ease); }
.sum__seg:last-child { border-right: none; }
.sum__seg:hover, .sum__seg.on { background: color-mix(in srgb, var(--g) 48%, transparent); }
.sum__seg .seglabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }

.lib__card { position: sticky; top: 90px; }
@media (max-width: 900px) { .lib__card { position: static; } }

/* ============================================================
   THE TOME — a real 3D hardcover that opens to a reading spread.
   Pure CSS 3D (preserve-3d). The closed book shows a genre-cloth
   cover with a foil-stamped title + a thick page-block; on select
   the front cover swings open on its hinge to reveal the page.
   All readable content lives on an upright, opaque page surface.
   ============================================================ */
.lib__card { perspective: 1150px; perspective-origin: 64% 32%; --rx: 0deg; --ry: 0deg; }

.tome {
  --cloth: var(--g, var(--accent));
  --thick: 30px;                  /* page-block depth (drawn via layered shadow) */
  --rest: -7deg;                  /* a gentle resting yaw so it reads as a held object */
  --leaf-a: #cfc7b2; --leaf-b: #efe7d2;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--rx) + 1deg)) rotateY(calc(var(--ry) + var(--rest)));
  transition: transform .6s var(--ease);
  /* a fresh tome fades + settles toward the reader (opacity-only so it never fights the 3D pose) */
  animation: tomeArrive .55s var(--ease) both;
  will-change: transform;
}
/* once open it squares up to the reader so the page is flat & legible */
.tome.is-open { --rest: -2deg; }
@keyframes tomeArrive { from { opacity: 0; } to { opacity: 1; } }

/* the inside reading spread = the page surface at the back of the block (z = -thick/2):
   always upright, always readable. The page-block heft is drawn as a stack of leaf
   edges extruded to the lower-right via layered shadows (renders identically everywhere). */
.tome__inside {
  position: relative;
  transform: translateZ(calc(var(--thick) / -2));
  border: 1px solid var(--glass-line);
  border-radius: 3px var(--r-feat) var(--r-feat) 3px;
  background: var(--surface-1);
  overflow: hidden;
  transform-style: preserve-3d;
  box-shadow:
    /* the page-block: a fan of warm leaf-edges stepping down-right */
    2px 2px 0 var(--leaf-a), 3px 3px 0 var(--leaf-b), 5px 4px 0 var(--leaf-a),
    6px 6px 0 var(--leaf-b), 8px 7px 0 var(--leaf-a), 9px 9px 0 var(--leaf-b),
    11px 10px 0 var(--leaf-a), 12px 12px 0 var(--leaf-b), 14px 13px 0 var(--leaf-a),
    /* settle + contact shadow under the closed book */
    var(--lift-1), 20px 24px 44px -18px rgba(0,0,0,.6);
}
[data-theme="light"] .tome { --leaf-a: #d8d0bb; --leaf-b: #f4eedd; }
/* paper grain + a soft page-curve shadow toward the gutter (left) */
.tome__inside::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(0,0,0,.16), rgba(0,0,0,0) 9%, rgba(0,0,0,0) 92%, rgba(0,0,0,.05)),
    radial-gradient(120% 100% at 0% 50%, rgba(255,255,255,.03), transparent 40%);
}
[data-theme="light"] .tome__inside::before {
  background:
    linear-gradient(90deg, rgba(18,22,38,.1), rgba(18,22,38,0) 9%, rgba(18,22,38,0) 92%, rgba(18,22,38,.04)),
    radial-gradient(120% 100% at 0% 50%, rgba(18,22,38,.02), transparent 40%);
}
/* the gutter shadow where pages meet the spine */
.tome__gutter {
  position: absolute; left: 0; top: 0; bottom: 0; width: 26px; pointer-events: none; z-index: 4;
  background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,.06) 55%, transparent);
  border-left: 1px solid var(--glass-line);
}
[data-theme="light"] .tome__gutter { background: linear-gradient(90deg, rgba(18,22,38,.16), rgba(18,22,38,.03) 55%, transparent); }

.tome__page--right { position: relative; padding: 1.05rem 1.15rem 1.15rem 1.5rem; z-index: 2; }
/* the page-block heft is drawn by .tome__inside's layered shadow (see above) —
   .tome__leaves is kept as a hook but no longer a rotated quad */
.tome__leaves { display: none; }

/* ---- the front cover: hinged at the left, swings open on select ---- */
.tome__cover {
  position: absolute; inset: 0; z-index: 6;
  transform-origin: left center; transform-style: preserve-3d;
  transform: translateZ(calc(var(--thick) / 2)) rotateY(0deg);
  transition: transform .78s cubic-bezier(.6,.02,.16,1);
  cursor: default;
}
/* the two faces of the hardcover board */
.tome__front, .tome__back {
  position: absolute; inset: 0; border-radius: 4px 9px 9px 4px; overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.tome__front { box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 24px 50px -22px rgba(0,0,0,.7); }
.tome__back {                            /* the inside face — overhangs the shelf when open, so
                                            keep it TRANSLUCENT (just a tinted glass pane) so the
                                            book grid behind it still shows through */
  transform: rotateY(180deg);
  background: color-mix(in srgb, var(--cloth) 15%, transparent);
  box-shadow: inset 0 0 0 1px var(--glass-line), inset 3px 0 18px rgba(0,0,0,.12);
}
[data-theme="light"] .tome__back { background: color-mix(in srgb, var(--cloth) 13%, transparent); box-shadow: inset 0 0 0 1px var(--glass-line), inset 3px 0 18px rgba(18,22,38,.06); }
.tome__cloth {                          /* the genre cloth/leather, with weave + vignette.
  the cloth is deepened toward a dark-dyed tone so the foil title always reads */
  position: absolute; inset: 0; border-radius: inherit;
  --cloth-deep: color-mix(in srgb, var(--cloth) 64%, #16121c);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--cloth) 80%, #fff) 0%,
      var(--cloth-deep) 42%,
      color-mix(in srgb, var(--cloth-deep) 58%, #000) 100%);
}
.tome__cloth::after {                   /* cloth weave + edge vignette */
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: .5;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.10) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px),
    radial-gradient(120% 120% at 70% 20%, transparent 40%, rgba(0,0,0,.35));
  mix-blend-mode: overlay;
}
.tome__band {                           /* foil band that frames the title block */
  position: absolute; left: 14px; right: 14px; top: 18px; bottom: 18px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}
.tome__deco { position: absolute; left: 50%; top: -1px; width: 26px; height: 2px; transform: translateX(-50%); background: rgba(255,255,255,.42); }
.tome__deco::before, .tome__deco::after { content: ""; position: absolute; left: 50%; width: 6px; height: 6px; border: 1px solid rgba(255,255,255,.42); transform: translateX(-50%) rotate(45deg); }
.tome__deco::before { top: 7px; } .tome__deco::after { display: none; }
.tome__face {
  position: absolute; left: 24px; right: 24px; top: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center;
}
.tome__genre { font: 500 .56rem var(--mono); letter-spacing: .28em; text-transform: uppercase; color: rgba(255,255,255,.78); }
.tome__foil {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.15rem, 4.4vw, 1.6rem); line-height: 1.06;
  letter-spacing: -.01em; color: #fff;
  /* foil-stamped: bright bevel + dark relief */
  text-shadow: 0 1px 0 rgba(0,0,0,.45), 0 -1px 0 rgba(255,255,255,.35);
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--cloth) 16%, #fff) 70%, #e9e2cf);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.tome__author { font: 400 .68rem var(--mono); color: rgba(255,255,255,.72); letter-spacing: .02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tome__emboss {       /* embossed call number, lower band */
  position: absolute; left: 0; right: 0; bottom: 26px; text-align: center;
  font: 400 .58rem var(--mono); letter-spacing: .16em; color: rgba(255,255,255,.55);
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}
.tome__sheen {        /* specular highlight that sweeps on hover */
  position: absolute; inset: -40% -10%; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.45) 50%, transparent 62%);
  transform: translateX(-60%); transition: opacity .3s var(--ease);
}

/* ---- the spine / binding: a cloth strip down the hinge edge. It sits just
   behind the cover's left edge (closed) and is revealed at the gutter (open). ---- */
.tome__spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 22px; z-index: 5;
  transform: translateZ(calc(var(--thick) / -2 + 1px));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--cloth) 50%, #000) 0%, var(--cloth) 55%, color-mix(in srgb, var(--cloth) 72%, #000) 100%);
  border-radius: 3px 0 0 3px;
  display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 1rem 0;
  box-shadow: inset -3px 0 7px rgba(0,0,0,.4), inset 1px 0 0 rgba(255,255,255,.12);
  overflow: hidden;
}
.tome__spine-top { width: 60%; height: 2px; background: rgba(255,255,255,.32); flex: 0 0 auto; box-shadow: 0 7px 0 -1px rgba(255,255,255,.18); }
.tome__spine-txt {
  writing-mode: vertical-rl; text-orientation: mixed; flex: 1 1 auto;
  font: 600 .58rem var(--sans); color: rgba(255,255,255,.94); letter-spacing: .01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-height: 100%;
  text-shadow: 0 1px 1px rgba(0,0,0,.45);
}
.tome__spine-call { writing-mode: vertical-rl; font: 400 .48rem var(--mono); color: rgba(255,255,255,.62); letter-spacing: .08em; flex: 0 0 auto; }

/* ---- OPEN state: cover swings away to the left, spine retracts, page reads ---- */
.tome.is-open .tome__cover { transform: translateZ(calc(var(--thick) / 2)) rotateY(-152deg); }
.tome.is-open .tome__spine { opacity: 0; transition: opacity .4s var(--ease) .2s; }
/* once the swing has finished, fade the overhanging cover (incl. the ex-libris) away
   so it never blocks the shelf grid behind it */
.tome.is-open.settled .tome__cover { opacity: 0; pointer-events: none; transition: opacity .55s var(--ease); }
/* hover sheen + a faint lift while closed */
.tome:not(.is-open):hover .tome__cover { transform: translateZ(calc(var(--thick) / 2 + 7px)) rotateY(-5deg); }
.tome:not(.is-open):hover .tome__sheen { opacity: 1; animation: tomeSheen 1.1s var(--ease); }
@keyframes tomeSheen { from { transform: translateX(-60%); } to { transform: translateX(60%); } }

/* the ex-libris bookplate on the cover's inside (back) face */
.tome__plate {
  position: absolute; left: 16px; right: 16px; top: 18px; bottom: 18px; border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--cloth) 45%, var(--glass-line));
  background: color-mix(in srgb, var(--cloth) 5%, var(--surface-1));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center;
}
.tome__plate-mark { font: 400 1.15rem var(--serif); font-style: italic; color: var(--cloth); }
.tome__plate-name { font-family: var(--display); font-weight: 600; font-size: 1rem; color: var(--ink); letter-spacing: -.01em; }
.tome__plate-rule { width: 38px; height: 1px; background: color-mix(in srgb, var(--cloth) 50%, var(--glass-line)); margin: .15rem 0; }
.tome__plate-call { font: 400 .56rem var(--mono); color: var(--ink-dim); letter-spacing: .14em; }

/* the inside content fades up a beat after the cover starts opening */
.tome .tome__page--right > * { opacity: 0; transform: translateY(8px); }
.tome.is-open .tome__page--right > * { opacity: 1; transform: none; transition: opacity .5s var(--ease) .28s, transform .5s var(--ease) .28s; }
.tome.settled .tome__page--right > * { transition: opacity .25s var(--ease), transform .25s var(--ease); }

/* prev / next = a single leaf turning across the gutter */
.tome__flip {
  position: absolute; left: 0; top: 0; bottom: 0; width: 50%; z-index: 5; pointer-events: none;
  transform-origin: left center; transform: rotateY(0deg); opacity: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--surface-1) 88%, var(--cloth)), var(--surface-1));
  border-right: 1px solid var(--glass-line); box-shadow: 4px 0 14px -6px rgba(0,0,0,.5);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.tome.flip-next .tome__flip { animation: leafNext .42s var(--ease); }
.tome.flip-prev .tome__flip { animation: leafPrev .42s var(--ease); }
@keyframes leafNext { 0% { opacity: 1; transform: rotateY(0); } 99% { opacity: 1; } 100% { opacity: 0; transform: rotateY(-168deg); } }
@keyframes leafPrev { 0% { opacity: 1; transform: rotateY(-168deg); } 99% { opacity: 1; } 100% { opacity: 0; transform: rotateY(0); } }
.tome__page--right.turning > * { animation: pageSwap .42s var(--ease); }
@keyframes pageSwap { 0%,40% { opacity: .25; } 100% { opacity: 1; } }

/* legacy alias: the top row inside the open book */
.tome__top { display: flex; align-items: center; gap: .6rem; }
.cat__call { font: 400 .68rem var(--mono); color: var(--ink-dim); letter-spacing: .05em; }
.cat__status { font: 400 .63rem var(--mono); letter-spacing: .05em; white-space: nowrap; }
.cat__status--read { color: var(--accent-2); }
.cat__status--reading { color: var(--warm); }
.cat__nav { margin-left: auto; display: flex; gap: .3rem; }
.cat__nav button { width: 1.7em; height: 1.7em; display: grid; place-items: center; border: 1px solid var(--hairline); border-radius: 7px; color: var(--ink-soft); font-size: 1rem; line-height: 1; transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease); }
.cat__nav button:hover { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.cat__title { font-family: var(--display); font-weight: 400; font-size: 1.45rem; line-height: 1.1; color: var(--ink); margin: .65rem 0 .3rem; letter-spacing: -.01em; }
.cat__by { font-size: .84rem; color: var(--ink-soft); margin-bottom: .7rem; }
.cat__by .dim { font-size: .78rem; }
.cat__tagline { display: flex; align-items: center; gap: .55rem; }
.cat__tag { display: inline-flex; align-items: center; gap: .35rem; font: 400 .68rem var(--mono); color: var(--ink); cursor: pointer; border: 1px solid var(--g, var(--accent)); border-radius: 6px; padding: .15rem .55rem; background: color-mix(in srgb, var(--g, var(--accent)) 14%, transparent); transition: background .15s var(--ease); }
.cat__tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--g, var(--accent)); }
.cat__tag:hover { background: color-mix(in srgb, var(--g, var(--accent)) 26%, transparent); }
.cat__yr { font: 400 .72rem var(--mono); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.cat__syn { font-size: .86rem; color: var(--ink-soft); line-height: 1.55; margin: .9rem 0; font-style: italic; }
.cat__meta { border-top: 1px solid var(--hairline); padding-top: .75rem; }
.cat__row { display: flex; align-items: center; gap: .6rem; font: 400 .76rem var(--mono); margin: .35rem 0; }
.cat__row > span { color: var(--ink-dim); width: 4.6rem; flex: 0 0 auto; }
.cat__row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cat__bar { flex: 1; height: 6px; background: rgba(255, 255, 255, .05); border: 1px solid var(--hairline); border-radius: 4px; overflow: hidden; }
.cat__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s var(--ease); }
.cat__hint { font-size: .72rem; color: var(--ink-soft); margin-top: .9rem; line-height: 1.5; padding: .55rem .7rem; border-left: 2px solid var(--g, var(--accent)); background: rgba(255, 255, 255, .03); border-radius: 0 6px 6px 0; }
.cat__hint b { color: var(--warm); }
.cat__look { display: inline-block; margin-top: .9rem; font: 400 .74rem var(--mono); color: var(--ink-dim); border-bottom: 1px solid var(--hairline); }
.cat__look:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- responsive niceties ---------- */
@media (max-width: 880px) {
  .sec { padding-left: clamp(1.1rem, 5vw, 2rem); padding-right: clamp(1.1rem, 5vw, 2rem); }
}

/* ---------- small screens: keep modals reachable above the soft keyboard ---------- */
@media (max-width: 640px) {
  .cmdk { padding: 6vh 1rem 1rem; }
  .rez { padding: 2.5vh 1rem 1rem; }
  .rez__panel { max-height: 100svh; }
  .glass { -webkit-backdrop-filter: blur(8px) saturate(120%); backdrop-filter: blur(8px) saturate(120%); }
  .filament { width: 3px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .stagger > * { opacity: 1; }
  .pl-packet, .landing__arrow, .dot--live { animation: none !important; }
  .latent { opacity: 1; }
  /* the tome reads flat & open instantly — no swing, no float, fully legible */
  .tome { transform: none !important; }
  .tome__cover, .tome__spine, .tome__leaves, .tome__sheen, .tome__flip { display: none !important; }
  .tome__inside { box-shadow: var(--lift-1); }
  .tome__page--right > * { opacity: 1 !important; transform: none !important; }
  .tome__plate { opacity: 1 !important; transform: none !important; }
}
