/* ==========================================================
   majdlahbib.com — one language, many moods.
   Tokens first; every scene only re-maps tokens.
   ========================================================== */
:root {
  --paper: #f6f4ee;
  --card: #ffffff;
  --ink: #121212;
  --muted: #67645d;
  --line: #e2ded3;
  --accent: #2346ff;
  --accent-soft: rgba(35, 70, 255, .12);
  --font: "Space Grotesk", system-ui, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --px: "Silkscreen", ui-monospace, monospace;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(16px, 5vw, 64px);
}
body.night {
  --paper: #0c0c0d;
  --card: #141416;
  --ink: #f1efe8;
  --muted: #9b978e;
  --line: #26262a;
  --accent: #8093ff;
  --accent-soft: rgba(128, 147, 255, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
  transition: background-color .8s var(--ease), color .8s var(--ease);
}
a { color: inherit; text-underline-offset: 3px; }
::selection { background: var(--accent); color: #fff; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background-color .8s var(--ease), border-color .8s;
}
body[data-scene="cinema"] .bar, body[data-scene="grave"] .bar, body[data-scene="library"] .bar {
  --paper: #0b0b0c; --ink: #f1efe8; --muted: #9b978e; --line: #232326; color: var(--ink);
}
.logo { font-weight: 700; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.logo span { color: var(--muted); }
.nav { display: flex; gap: 22px; }
.nav a { position: relative; text-decoration: none; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); transition: color .2s; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }
.bar-right { display: flex; align-items: center; gap: 10px; }
.modes { display: flex; border: 1.5px solid var(--ink); border-radius: 10px; overflow: hidden; }
.modes > * {
  font: inherit; font-size: 13px; font-weight: 500; padding: 6px 12px;
  background: none; border: 0; color: var(--ink); cursor: pointer; text-decoration: none;
  transition: background-color .2s, color .2s;
}
.modes > * + * { border-left: 1.5px solid var(--ink); }
.modes [aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.modes .locked { color: var(--muted); }
.modes .locked::before { content: ""; display: inline-block; width: 7px; height: 8px; margin-right: 5px; border: 1.5px solid currentColor; border-radius: 1px; vertical-align: -1px; box-shadow: 0 -3px 0 -1px transparent; }
.modes .nope { animation: nope .4s; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 10px; background: none; color: var(--ink); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="false"] .wave { opacity: 0; }

/* ---------- shared type ---------- */
.label { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
h1.name { font-size: clamp(60px, 12.5vw, 176px); line-height: .92; letter-spacing: -.05em; margin: 0; font-weight: 700; }
h2 { font-size: clamp(40px, 7vw, 96px); line-height: 1; letter-spacing: -.035em; margin: 0 0 22px; font-weight: 700; text-wrap: balance; }
.lede { font-size: clamp(20px, 2.3vw, 28px); line-height: 1.3; max-width: 26em; margin: 0 0 16px; text-wrap: pretty; }
.more { color: var(--muted); max-width: 38em; margin: 0 0 26px; text-wrap: pretty; }
.center .lede, .center .more { margin-left: auto; margin-right: auto; }
.center .actions { justify-content: center; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.center .tags { justify-content: center; }
.tags li { font-size: 13px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.hint { font-size: 15px; color: var(--muted); margin-top: 28px; }
.hint a { color: var(--ink); font-weight: 500; }

/* ---------- the one button ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font: inherit; font-size: 16px; font-weight: 500;
  padding: 13px 22px; border: 1.5px solid var(--ink); border-radius: 12px;
  background: transparent; color: var(--ink); text-decoration: none; cursor: pointer;
  transition: transform .3s var(--spring), background-color .2s, color .2s, box-shadow .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 -2px var(--accent-soft); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- scenes ---------- */
.scene {
  position: relative; min-height: 100svh;
  display: grid; align-items: center;
  padding: 110px var(--gutter) 90px;
  overflow: hidden; isolation: isolate;
}
.scene-inner { position: relative; z-index: 2; width: 100%; max-width: 1120px; margin: 0 auto; }
.center { text-align: center; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 5vw, 80px); align-items: center; }

.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .9s var(--spring); transition-delay: calc(var(--d, 0) * 90ms); }
.js .in .reveal { opacity: 1; transform: none; }

/* ---------- torch / hidden layer ---------- */
.hidden-layer {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  --x: -999px; --y: -999px; --r: 170px;
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0 40%, transparent 100%);
  mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0 40%, transparent 100%);
}
body.flash .hidden-layer { -webkit-mask-image: none; mask-image: none; }
.doodle { position: absolute; font-family: var(--hand); font-size: 28px; line-height: 1.05; color: var(--accent); }
.doodle svg { display: block; fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.secret-note { pointer-events: auto; background: none; border: 2px dashed var(--accent); border-radius: 10px; padding: 4px 12px; cursor: pointer; transform: rotate(-4deg); }
.torch-glow {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .8s;
  background: radial-gradient(circle 240px at var(--mx, -999px) var(--my, -999px), rgba(255, 238, 200, .07), transparent 70%);
}
body.night .torch-glow { opacity: 1; }
.torch-hint { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); margin: 0; z-index: 2; font-family: var(--hand); font-size: 22px; color: var(--muted); opacity: 0; transition: opacity 1s; white-space: nowrap; }
.in .torch-hint { opacity: .8; transition-delay: 2.5s; }
.torch-hint.gone { opacity: 0 !important; transition-delay: 0s; }
@media (pointer: coarse) { .torch-hint { display: none; } }

/* ---------- the ink line ---------- */
.ink-line { position: absolute; left: 0; top: 0; width: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.ink-line path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.ink-line .sig { stroke-width: 3.5; opacity: 1; }
.ink-line circle { fill: var(--accent); }

/* ---------- intro ---------- */
.name .ch, .name .sp { display: inline-block; }
.js .name .ch { clip-path: inset(-20% 100% -20% 0); animation: write .45s var(--ease) forwards; animation-delay: calc(.3s + var(--i) * .08s); }
@keyframes write { to { clip-path: inset(-20% -8% -20% 0); } }
.name .ch { transition: transform .35s var(--spring), color .3s; cursor: default; }
.name .ch:hover { transform: translateY(-.07em) rotate(-4deg); color: var(--accent); }
.underline { display: block; width: min(560px, 80%); height: 22px; margin: 6px 0 30px; overflow: visible; }
.underline path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 700; stroke-dashoffset: 700; }
.in .underline path { animation: draw 1.1s var(--ease) 1.4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.scroll-cue { position: absolute; left: 50%; bottom: 26px; width: 22px; height: 36px; margin-left: -11px; border: 1.5px solid var(--muted); border-radius: 12px; z-index: 2; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--muted); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- experience ---------- */
.job-head { font-size: 18px; margin: 0 0 12px; }
.badge { justify-self: center; position: relative; background: none; border: 0; padding: 0; cursor: grab; transform-origin: 50% -120px; animation: sway 5s ease-in-out infinite; color: var(--ink); font: inherit; }
.badge.spin { animation: badge-spin 1.1s var(--spring); }
.lanyard { position: absolute; left: 50%; top: -140px; width: 26px; height: 150px; margin-left: -13px; background: repeating-linear-gradient(45deg, var(--accent) 0 8px, color-mix(in srgb, var(--accent) 70%, #000) 8px 16px); clip-path: polygon(0 0, 100% 0, 70% 100%, 30% 100%); }
.card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 220px; padding: 0 0 20px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 16px; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .35); overflow: hidden; }
.card-top { width: 100%; padding: 12px; background: var(--ink); color: var(--paper); font-weight: 700; letter-spacing: .3em; font-size: 13px; }
.card-photo { width: 92px; height: 92px; margin-top: 10px; border-radius: 12px; border: 1.5px solid var(--line); display: grid; place-items: center; }
.card-photo svg { width: 64px; fill: none; stroke: var(--ink); stroke-width: 2.5; }
.card-name { font-weight: 700; font-size: 20px; }
.card-role { color: var(--muted); font-size: 14px; }
.card-bar { width: 70%; height: 22px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 7px, transparent 7px 9px); }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes badge-spin { 0% { transform: rotateY(0); } 100% { transform: rotateY(720deg); } }

/* ---------- paper (Pixel Publisher) ---------- */
.paper {
  --paper-margin: calc(var(--gutter) + 36px);
  background-color: var(--card);
  background-image:
    linear-gradient(90deg, transparent var(--paper-margin), rgba(226, 80, 80, .35) var(--paper-margin), rgba(226, 80, 80, .35) calc(var(--paper-margin) + 2px), transparent calc(var(--paper-margin) + 2px)),
    repeating-linear-gradient(to bottom, transparent 0 35px, var(--line) 35px 36px);
}
.type .caret { display: inline-block; width: .06em; height: .85em; margin-left: .05em; background: var(--accent); vertical-align: -.05em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pages { position: absolute; right: 7%; top: 50%; width: 220px; height: 290px; margin-top: -145px; perspective: 1200px; z-index: 1; }
.pages i { position: absolute; inset: 0; background: var(--paper); border: 1.5px solid var(--line); border-radius: 2px 10px 10px 2px; transform-origin: left center; box-shadow: 4px 6px 0 -2px var(--line); }
.pages i::before { content: ""; position: absolute; inset: 30px 24px; background: repeating-linear-gradient(to bottom, var(--line) 0 3px, transparent 3px 16px); }
.in .pages i { animation: flip 7s var(--ease) infinite; }
.pages i:nth-child(2) { animation-delay: 1.75s !important; }
.pages i:nth-child(3) { animation-delay: 3.5s !important; }
.pages i:nth-child(4) { animation-delay: 5.25s !important; }
@keyframes flip { 0%, 20% { transform: rotateY(0); } 45%, 100% { transform: rotateY(-170deg); opacity: .0; } }

/* ---------- cinema (Project Studio) ---------- */
.cinema {
  --paper: #050505; --card: #111; --ink: #f3f1ea; --muted: #8e8b84; --line: #262626;
  background: radial-gradient(ellipse at center, #17171b 0%, #050505 70%); color: var(--ink);
}
.letterbox { position: absolute; left: 0; right: 0; height: 0; background: #000; z-index: 4; transition: height 1.1s var(--ease); }
.letterbox.top { top: 0; }
.letterbox.bottom { bottom: 0; }
.cinema.in .letterbox { height: 11vh; }
.grain {
  position: absolute; inset: -50%; z-index: 1; opacity: .07; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .6s steps(3) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } }
.clapper { position: absolute; left: 7%; top: 50%; width: 130px; margin-top: -60px; z-index: 3; background: none; border: 0; padding: 0; cursor: pointer; }
.clapper svg { width: 100%; overflow: visible; }
.clapper .board { fill: #1c1c1c; stroke: #f3f1ea; stroke-width: 2; }
.clapper .stripe { stroke: #f3f1ea; stroke-width: 5; }
.clapper .chalk { fill: #f3f1ea; font-family: var(--hand); font-size: 18px; }
.clapper .stick { transform-origin: 8px 38px; transform: rotate(-22deg); transition: transform .25s var(--spring); }
.clapper.snap .stick { transform: rotate(0); transition: transform .07s ease-in; }

/* ---------- builds ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; perspective: 1400px; }
.flip { position: relative; height: 270px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; transform-style: preserve-3d; transition: transform .8s var(--spring), opacity .8s var(--ease); }
.flip.flipped { transform: rotateY(180deg); }
.js .in .flip.reveal.flipped { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1.5px solid var(--ink); border-radius: 16px; background: var(--card); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face strong { font-size: 24px; line-height: 1.1; letter-spacing: -.02em; }
.face .k { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.face.front .k:first-child { margin-bottom: auto; }
.face.back { transform: rotateY(180deg); background: var(--ink); color: var(--paper); justify-content: space-between; }
.face.back .k { color: color-mix(in srgb, var(--paper) 60%, transparent); }

/* ---------- toolbox ---------- */
.chips { list-style: none; padding: 0; margin: 10px auto 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 900px; }
.chip { position: relative; font: inherit; font-size: 18px; font-weight: 500; padding: 12px 20px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); color: var(--ink); cursor: pointer; }
.chip::after { content: attr(data-say); position: absolute; left: 50%; bottom: calc(100% + 12px); width: max-content; max-width: 240px; padding: 6px 12px; background: var(--ink); color: var(--paper); font-family: var(--hand); font-size: 20px; border-radius: 10px; transform: translate(-50%, 6px) scale(.9); opacity: 0; pointer-events: none; transition: .3s var(--spring); z-index: 5; }
.chip.talk::after { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- graveyard ---------- */
.graveyard {
  --paper: #10141a; --card: #1a1f27; --ink: #e9ecef; --muted: #8e98a2; --line: #2a3038;
  background: linear-gradient(#0c0f15 0%, #182030 55%, #1b2a22 100%); color: var(--ink);
}
.moon { position: absolute; top: 15%; right: 11%; width: 78px; height: 78px; border-radius: 50%; background: #f4f1e4; box-shadow: 0 0 70px rgba(244, 241, 228, .35); z-index: 1; }
.fog { position: absolute; left: -20%; right: -20%; bottom: 0; height: 45%; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 30% 100%, rgba(200, 210, 220, .16), transparent 60%), radial-gradient(ellipse at 75% 100%, rgba(200, 210, 220, .12), transparent 60%); animation: fog 16s ease-in-out infinite alternate; }
@keyframes fog { to { transform: translateX(8%); } }
.grass { position: absolute; left: 0; right: 0; bottom: 0; height: 60px; z-index: 1; background: #13201a; clip-path: polygon(0 40%, 3% 20%, 6% 45%, 9% 15%, 12% 40%, 16% 22%, 20% 44%, 24% 18%, 28% 42%, 33% 20%, 38% 45%, 42% 16%, 47% 40%, 52% 22%, 57% 44%, 62% 18%, 67% 42%, 72% 20%, 77% 45%, 82% 16%, 87% 40%, 92% 22%, 96% 44%, 100% 25%, 100% 100%, 0 100%); }
.stones { display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; gap: clamp(16px, 3vw, 40px); margin-top: 70px; }
.stone {
  position: relative; width: 230px; min-height: 236px; padding: 44px 20px 24px;
  border: 0; border-radius: 115px 115px 8px 8px; font: inherit; color: #e9ecef; text-align: center; cursor: pointer;
  background: linear-gradient(#56606b, #363c44);
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, .25), inset 0 4px 0 rgba(255, 255, 255, .08), 0 24px 30px rgba(0, 0, 0, .35);
}
.in .stone.reveal { transition: opacity .8s var(--ease), transform .45s var(--spring); }
.in .stone.reveal:hover { transform: rotate(-1.5deg) translateY(-4px); }
.rip { display: block; font-weight: 700; letter-spacing: .3em; font-size: 14px; opacity: .6; }
.stone strong { display: block; font-size: 20px; line-height: 1.15; margin: 12px 0 6px; }
.stone .meta { display: block; font-size: 13px; color: #aab3bc; }
.stone .epitaph { display: block; font-size: 15px; margin-top: 12px; line-height: 1.35; }
.ghost { position: absolute; left: 50%; top: 0; width: 64px; transform: translate(-50%, 10px) scale(.3); opacity: 0; pointer-events: none; transition: transform .8s var(--spring), opacity .5s; }
.ghost svg { width: 64px; fill: rgba(240, 244, 248, .92); }
.ghost svg circle { fill: #1a1f27; }
.ghost .say { position: absolute; left: 50%; bottom: calc(100% + 8px); width: 220px; transform: translateX(-50%); padding: 8px 12px; border-radius: 12px; background: #f0f4f8; color: #1a1f27; font-family: var(--hand); font-size: 20px; line-height: 1.1; }
.ghost .say:empty { display: none; }
.stone.haunted .ghost { opacity: 1; transform: translate(-50%, -115%) scale(1); animation: float 2.4s ease-in-out .8s infinite; }
@keyframes float { 50% { margin-top: -8px; } }

/* ---------- ask ---------- */
.seen { border: 1.5px solid var(--ink); border-radius: 16px; padding: 22px; background: var(--card); }
.seen ul { list-style: none; padding: 0; margin: 0 0 12px; }
.seen li { display: flex; align-items: baseline; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.seen li:last-child { border-bottom: 0; }
.seen li strong { font-weight: 500; }
.seen li .ua { font-size: 12px; color: var(--muted); }
.seen li .when { margin-left: auto; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seen .note { font-size: 13px; color: var(--muted); margin: 0; }
.eye { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #29c46a; box-shadow: 0 0 0 0 rgba(41, 196, 106, .5); animation: ping 2s infinite; vertical-align: 1px; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(41, 196, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(41, 196, 106, 0); } }

.prompt { position: relative; margin: 0 0 16px; padding: 16px 18px; border: 1.5px dashed var(--ink); border-radius: 14px; background: var(--card); max-width: 34em; }
.prompt figcaption { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.prompt p { margin: 0 0 12px; font-size: 17px; }
.prompt .btn { padding: 8px 16px; font-size: 14px; }

/* ---------- contact ---------- */
.signature { display: block; width: min(300px, 70%); margin: 10px auto 30px; overflow: visible; }
.signature { height: 110px; width: auto; max-width: 80%; }
.signature path { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.in .signature path { animation: draw 2.4s var(--ease) .5s forwards; }
body.ink-sign .signature { visibility: hidden; }
.plane-icon { display: inline-block; }
.btn.shake { animation: shake .5s 3; }
@keyframes shake { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.off-sign { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%) rotate(-1.5deg); font-family: var(--hand); font-size: 24px; color: var(--muted); white-space: nowrap; z-index: 2; }

/* ---------- off the clock (pixel library) ---------- */
.library {
  --paper: #1a110b; --card: #24170e; --ink: #f6ead8; --muted: #c1ab90; --line: #3d2b1f;
  color: var(--ink);
  background-color: #1a110b;
  background-image: radial-gradient(#2a1c12 1px, transparent 1px);
  background-size: 8px 8px;
}
.shelf-wrap { position: relative; width: min(720px, 100%); margin: 36px 0 0; perspective: 1600px; }
.door-behind { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; padding: 24px; text-align: center; background: #000; color: #7cff6b; font-family: var(--px); font-size: 13px; line-height: 1.6; box-shadow: inset 0 0 60px rgba(124, 255, 107, .15); }
.door-behind .px-big { font-size: clamp(20px, 3vw, 30px); line-height: 1.3; margin: 0; text-shadow: 0 0 12px rgba(124, 255, 107, .6); }
.door-behind p { margin: 0 auto; max-width: 30em; }
.door-behind .btn { justify-self: center; font-family: var(--px); font-size: 12px; border-color: #7cff6b; color: #7cff6b; border-radius: 0; margin-top: 8px; }
.shelf { position: relative; z-index: 2; padding: 14px; background: #6b3f22; box-shadow: inset 0 0 0 6px #4a2a15, 8px 8px 0 #0b0704; transform-origin: left center; transition: transform 1.5s cubic-bezier(.55, 0, .2, 1); image-rendering: pixelated; }
.shelf.open { transform: rotateY(-80deg); }
.row { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 128px; padding: 0 12px; margin-bottom: 12px; background: #2a180d; border-bottom: 10px solid #4a2a15; box-shadow: inset 0 8px 0 rgba(0, 0, 0, .35); }
.row:last-child { margin-bottom: 0; }
.row-label { position: absolute; top: 8px; right: 12px; font-family: var(--px); font-size: 10px; color: #e8c79a; opacity: .75; }
.book {
  flex: none; width: var(--w, 26px); height: var(--h, 90px); padding: 8px 0; border: 0;
  background: var(--c); color: rgba(255, 255, 255, .88); cursor: pointer;
  font-family: var(--px); font-size: 9px; writing-mode: vertical-rl; text-orientation: mixed; white-space: nowrap; overflow: hidden;
  box-shadow: inset -4px 0 0 rgba(0, 0, 0, .28), inset 4px 0 0 rgba(255, 255, 255, .14), inset 0 10px 0 rgba(0, 0, 0, .15);
  transition: transform .2s steps(3);
}
.book:hover, .book.pick { transform: translateY(-14px); }
.book.tape { writing-mode: horizontal-tb; font-size: 8px; display: grid; place-items: center; box-shadow: inset 0 -16px 0 rgba(255, 255, 255, .12), inset 0 0 0 3px rgba(0, 0, 0, .3); }
.book.vhs { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .08), inset 0 30px 0 rgba(255, 255, 255, .1); }
.book.loose { transform: rotate(-9deg) translate(2px, -2px); transform-origin: bottom left; animation: wobble 3.4s steps(2) infinite; }
.book.loose:hover { transform: rotate(-14deg) translate(4px, -6px); }
.book.fall { animation: fall 1s cubic-bezier(.5, 0, .85, .55) forwards; }
@keyframes wobble { 0%, 86% { rotate: 0deg; } 90% { rotate: -3deg; } 95% { rotate: 2deg; } }
@keyframes fall { 0% { transform: rotate(-9deg); } 25% { transform: rotate(-35deg) translate(-8px, -12px); } 100% { transform: translate(-70px, 440px) rotate(-210deg); opacity: 0; } }
a.book { display: block; text-decoration: none; }
.book.deco { cursor: default; opacity: .75; }
.book.deco:hover { transform: none; }
.book.reading { box-shadow: inset -4px 0 0 rgba(0, 0, 0, .28), inset 4px 0 0 rgba(255, 255, 255, .14), inset 0 -16px 0 -10px #ffd166; }
.book.sleeve { width: 72px; height: 72px; padding: 0; background-color: #222; background-size: cover; background-position: center; image-rendering: pixelated; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .35), 3px 3px 0 #0b0704; transform: rotate(calc((var(--i, 0) - 2.5) * 1.6deg)); }
.book.sleeve:hover { transform: translateY(-14px) rotate(0); }
.row-empty { align-self: center; font-family: var(--px); font-size: 10px; color: #c1ab90; opacity: .7; }
.book.vhs.todo { opacity: .55; }
.book.vhs.now { box-shadow: inset 0 0 0 3px #ffd166, 0 0 16px rgba(255, 209, 102, .45); color: #fff; }
.progress { position: absolute; left: 12px; right: 12px; bottom: -8px; height: 6px; background: #1a0f08; }
.progress span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #7cff6b 0 6px, #4fc043 6px 8px); transition: width 1.2s steps(12); }
.progress::after { content: attr(data-label); position: absolute; right: 0; bottom: 94px; font-family: var(--px); font-size: 10px; color: #7cff6b; }
.now-playing { align-self: center; margin-left: auto; margin-right: 90px; display: flex; align-items: flex-end; gap: 2px; font-family: var(--px); font-size: 10px; color: #7cff6b; }
.now-playing i { width: 3px; height: 10px; background: #7cff6b; animation: eq .9s steps(3) infinite; }
.now-playing i:nth-child(2) { animation-delay: .3s; }
.now-playing i:nth-child(3) { animation-delay: .6s; margin-right: 6px; }
@keyframes eq { 50% { height: 4px; } }
.interests { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.interests li { font-family: var(--px); font-size: 11px; padding: 5px 10px; border: 2px solid var(--line); color: var(--muted); }
.shelf-card { min-height: 1.6em; margin: 18px 0 8px; font-size: 17px; color: var(--muted); }
.shelf-card strong { color: var(--ink); font-weight: 500; }
.taste-list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.foot { margin: 40px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- fixed UI ---------- */
#weather { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
.sun-glare { position: fixed; inset: 0; z-index: 39; pointer-events: none; opacity: 0; transition: opacity 2s; background: radial-gradient(circle at 92% 6%, rgba(255, 214, 120, .30), transparent 45%); }
body[data-weather="sun"] .sun-glare { opacity: 1; }
.speedlines { position: fixed; inset: 0; z-index: 41; pointer-events: none; opacity: 0; background: repeating-linear-gradient(90deg, transparent 0 40px, var(--line) 40px 41px, transparent 41px 97px, var(--muted) 97px 98px); transition: opacity .4s; }
.speedlines.on { opacity: .35; transition: opacity .05s; }

#umbrella { position: fixed; left: 0; top: 0; width: 84px; height: 84px; z-index: 70; pointer-events: none; display: none; transform: translate(calc(var(--mx, -999px) - 42px), calc(var(--my, -999px) - 78px)); }
#umbrella svg { width: 100%; overflow: visible; }
#umbrella .canopy { fill: var(--accent); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
#umbrella .handle { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
#soaked { position: fixed; left: 24px; bottom: 16px; width: 60px; z-index: 42; pointer-events: none; display: none; }
#soaked svg { width: 100%; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
#soaked .eyes { fill: var(--ink); }
#soaked .happy { display: none; }
#soaked .drip { stroke: var(--accent); animation: drip 1s linear infinite; }
#soaked.dry .happy { display: block; }
#soaked.dry .sad, #soaked.dry .drip { display: none; }
@keyframes drip { to { transform: translateY(8px); opacity: 0; } }
body[data-weather="rain"] #umbrella, body[data-weather="storm"] #umbrella,
body[data-weather="rain"] #soaked, body[data-weather="storm"] #soaked { display: block; }
@media (pointer: coarse) { #umbrella, #soaked { display: none !important; } }

#counter { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 46px; height: 46px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; }
#counter .pencil { width: 46px; height: 46px; padding: 6px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 1.5px var(--line); fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; transition: transform .6s var(--spring), opacity .4s; animation: idle 7s ease-in-out infinite; }
@keyframes idle { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(-12deg); } 96% { transform: rotate(8deg); } }
#counter .pill { position: absolute; right: 0; bottom: 3px; display: flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--ink); white-space: nowrap; overflow: hidden; font-weight: 500; font-size: 15px; clip-path: circle(0 at 85% 50%); transition: clip-path .8s var(--spring); }
.ink-fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--fill, 0) * 100%); background: var(--accent-soft); transition: width .9s var(--ease); }
.pill-text { position: relative; }
#counter.active .pencil { transform: rotate(220deg) scale(0); opacity: 0; animation: none; }
#counter.active .pill { clip-path: circle(160% at 85% 50%); }
#counter.bump .pill { animation: bump .5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.14); } }
#egg-list { position: fixed; right: 18px; bottom: 72px; z-index: 60; width: 270px; padding: 18px 20px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 16px; }
#egg-list ol { margin: 0; padding-left: 22px; font-size: 15px; }
#egg-list li.unknown { color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: 26px; z-index: 65; max-width: min(560px, calc(100vw - 120px)); padding: 10px 18px; background: var(--paper); color: var(--accent); border: 2px dashed var(--accent); border-radius: 12px; font-family: var(--hand); font-size: 24px; line-height: 1.15; text-align: center; transform: translate(-50%, 140%) rotate(-1deg); opacity: 0; transition: transform .6s var(--spring), opacity .3s; pointer-events: none; }
#toast.show { transform: translate(-50%, 0) rotate(-1deg); opacity: 1; }

.linger-note { position: absolute; z-index: 5; right: 8%; bottom: 14%; font-family: var(--hand); font-size: 24px; color: var(--accent); background: none; border: 0; cursor: pointer; transform: rotate(3deg) scale(.6); opacity: 0; transition: .6s var(--spring); }
.linger-note.show { transform: rotate(3deg) scale(1); opacity: 1; }

#finale { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--paper) 70%, transparent); backdrop-filter: blur(6px); }
#finale[hidden] { display: none; }
.finale-card { max-width: 520px; padding: 36px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 20px; text-align: center; animation: bump .7s var(--spring); }
.finale-card h2 { font-size: 44px; }
.confetti { position: fixed; top: -20px; width: 10px; height: 14px; z-index: 95; pointer-events: none; }

#dev { position: fixed; left: 12px; bottom: 12px; z-index: 99; display: flex; flex-wrap: wrap; gap: 6px; max-width: 360px; padding: 10px; background: var(--paper); border: 1.5px dashed var(--muted); border-radius: 12px; font-size: 12px; }
#dev[hidden] { display: none; }
#dev b { width: 100%; font-weight: 500; color: var(--muted); }
#dev button { font: inherit; font-size: 12px; padding: 4px 8px; border: 1px solid var(--ink); border-radius: 6px; background: none; color: var(--ink); cursor: pointer; }

/* ---------- gold: everything found ---------- */
body.gold .bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: linear-gradient(90deg, #a8740a, #ffd54a, #fff4c2, #ffd54a, #a8740a, #ffd54a, #fff4c2); background-size: 200% 100%; animation: gold 3s linear infinite; }
body.gold .logo::before { content: "★ "; color: #e0a800; }
body.gold #counter .pill { background: linear-gradient(135deg, #ffe27a, #e0a800); border-color: #a8740a; color: #2a1d00; }
body.gold #counter .ink-fill { display: none; }
@keyframes gold { to { background-position: -200% 0; } }

@keyframes nope { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- per-scene cursors ---------- */
@media (pointer: fine) {
  body[data-scene="intro"] .scene.intro { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M3 29 L6 20 L22 4 L28 10 L12 26 Z' fill='white' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") 3 29, auto; }
  body[data-scene="cinema"] .scene.cinema { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect x='3' y='12' width='24' height='16' rx='2' fill='white' stroke='black' stroke-width='2'/%3E%3Crect x='3' y='5' width='24' height='6' fill='black' stroke='white' stroke-width='1.5' transform='rotate(-12 3 11)'/%3E%3C/svg%3E") 3 3, auto; }
  body[data-scene="grave"] .scene.graveyard { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M16 3 C 13 8, 11 10, 11 14 a5 5 0 0 0 10 0 C 21 10, 19 8, 16 3 Z' fill='%23ffd166' stroke='black' stroke-width='1.5'/%3E%3Crect x='12' y='18' width='8' height='11' fill='white' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E") 16 3, auto; }
}

/* ==========================================================
   MODES
   ========================================================== */
/* 8-bit: Konami code or Play mode */
body.pixel { --font: var(--px); --hand: var(--px); }
body.pixel * { border-radius: 0 !important; }
body.pixel h1.name { letter-spacing: 0; font-size: clamp(34px, 8vw, 104px); }
body.pixel h2 { letter-spacing: 0; font-size: clamp(26px, 4.6vw, 60px); }
body.pixel .lede { font-size: clamp(15px, 1.6vw, 20px); line-height: 1.6; }
body.pixel .btn { box-shadow: 4px 4px 0 var(--ink); }
body.pixel::after { content: ""; position: fixed; inset: 0; z-index: 80; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .07) 0 2px, transparent 2px 4px); }

/* Pro: the recruiter view. No margins, no weather, no motion. */
body.pro .hidden-layer, body.pro #weather, body.pro #umbrella, body.pro #soaked, body.pro #counter, body.pro #egg-list,
body.pro .torch-hint, body.pro .torch-glow, body.pro .ink-line, body.pro .pages, body.pro .clapper, body.pro .grain,
body.pro .fog, body.pro .moon, body.pro .grass, body.pro .letterbox, body.pro .linger-note, body.pro .scroll-cue,
body.pro .sun-glare, body.pro .speedlines, body.pro .underline, body.pro .signature, body.pro .off-sign,
body.pro .badge, body.pro .library, body.pro .ghost, body.pro .cards + p, body.pro .tools .more { display: none !important; }
body.pro .scene { min-height: 0; padding: 96px var(--gutter) 40px; --paper: inherit; --card: inherit; --ink: inherit; --muted: inherit; --line: inherit; background: var(--paper) !important; color: var(--ink); scroll-snap-align: none; }
body.pro .scene + .scene { border-top: 1px solid var(--line); padding-top: 56px; }
body.pro .split { grid-template-columns: 1fr; }
body.pro .center { text-align: left; }
body.pro .center .actions, body.pro .center .tags, body.pro .chips, body.pro .stones { justify-content: flex-start; }
body.pro .center .lede, body.pro .center .more, body.pro .chips { margin-left: 0; }
body.pro h1.name { font-size: clamp(48px, 8vw, 96px); margin-bottom: 20px; }
body.pro h2 { font-size: clamp(30px, 4vw, 48px); }
body.pro .flip { height: auto; transform: none !important; }
body.pro .face { position: relative; backface-visibility: visible; }
body.pro .face.back { transform: none; background: none; color: var(--muted); border: 0; padding-top: 0; }
body.pro .face.front { border-bottom: 0; border-radius: 16px 16px 0 0; }
body.pro .flip .face.back { border: 1.5px solid var(--ink); border-top: 0; border-radius: 0 0 16px 16px; }
body.pro .stone { background: none; box-shadow: none; border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink); min-height: 0; padding: 20px; text-align: left; }
body.pro .stones { margin-top: 20px; }
body.pro .stone .meta { color: var(--muted); }
body.pro .chip::after { display: none; }
body.pro, body.pro *, body.pro *::before, body.pro *::after { animation: none !important; transition: none !important; }
body.pro .reveal, body.pro .name .ch { opacity: 1 !important; transform: none !important; clip-path: none !important; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .nav a:not([href="#ask"]) { display: none; }
  .nav { gap: 0; }
  .split { grid-template-columns: 1fr; }
  .pages, .clapper { display: none; }
  .badge { margin-top: 130px; }
  .modes > * { padding: 6px 9px; font-size: 12px; }
  .logo span { display: none; }
  .stone { width: min(300px, 100%); }
  #toast { max-width: calc(100vw - 90px); font-size: 21px; }
  .off-sign { font-size: 19px; white-space: normal; width: 90%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal, .js .name .ch { opacity: 1; transform: none; clip-path: none; }
  .underline path, .signature path { stroke-dashoffset: 0; }
  html { scroll-behavior: auto; }
}

/* ---------- print: point to the real CV (cv.html) ---------- */
.print-only { display: none; }
@media print {
  body > *:not(.print-only) { display: none !important; }
  body { background: #fff; color: #000; }
  .print-only { display: block; padding: 40mm 20mm; font-family: var(--font); }
  .print-only h1 { font-size: 40pt; margin: 0 0 10mm; letter-spacing: -.04em; }
}
