:root {
  --ink: #0B0D12; --paper: #F4EFE6; --paper2: #EAE3D6; --muted: #9AA0AD; --line: rgba(255,255,255,.1);
  --build: #F2A93B; --sell: #E8668B; --teach: #46C2B5; --me: #9DB4FF;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050608; color: var(--paper); font: 15px/1.5 Inter, system-ui, sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
kbd { font: 600 10px Inter; padding: 1px 5px; border: 1px solid rgba(255,255,255,.3); border-radius: 4px; margin-left: 4px; opacity: .7; }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#world.drag { cursor: grabbing; } #world.point { cursor: pointer; }

/* loader */
#loader { position: fixed; inset: 0; z-index: 60; background: #050608; display: grid; place-items: center; transition: opacity 1s; }
#loader.done { opacity: 0; pointer-events: none; }
.ld-inner { text-align: center; display: grid; gap: 14px; justify-items: center; }
.ld-time { font: 500 12px Inter; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ld-name { font: 800 clamp(36px, 7vw, 64px)/1 'Bricolage Grotesque'; letter-spacing: -.03em; }
.ld-bar { width: 200px; height: 2px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: var(--paper); transition: width .3s; }
.ld-skip { margin-top: 18px; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* top bar */
#top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; pointer-events: none; opacity: 0; transition: opacity .8s; }
#top.on { opacity: 1; }
#top > * { pointer-events: auto; }
#top .name { white-space: nowrap; font: 800 17px 'Bricolage Grotesque'; letter-spacing: -.01em; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
#top nav { display: flex; gap: 4px; padding: 5px; border-radius: 12px; background: rgba(10,12,18,.55); backdrop-filter: blur(12px); border: 1px solid var(--line); }
#top nav button { padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 13px; white-space: nowrap; }
#top nav button:hover { background: rgba(255,255,255,.08); }

/* hint + hover label */
.hint { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); z-index: 15; padding: 9px 14px; border-radius: 999px; font-size: 13px;
  background: rgba(10,12,18,.6); backdrop-filter: blur(10px); border: 1px solid var(--line); white-space: nowrap; opacity: 0; transition: opacity .5s; pointer-events: none; }
.hint.on { opacity: 1; }
.label { position: fixed; left: 0; top: 0; z-index: 16; pointer-events: none; transform: translate(-50%, calc(-100% - 16px)); opacity: 0; transition: opacity .15s;
  background: var(--paper); color: var(--ink); padding: 7px 11px 8px; border-radius: 8px; font: 600 13px Inter; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.label small { display: block; font: 500 11px Inter; color: #6B6559; }
.label.on { opacity: 1; }

/* wall switcher */
#walls { position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); z-index: 15; display: flex; gap: 4px; padding: 5px;
  border-radius: 999px; background: rgba(10,12,18,.55); backdrop-filter: blur(12px); border: 1px solid var(--line); opacity: 0; transition: opacity .6s; }
#walls.on { opacity: 1; }
#walls button { padding: 7px 13px; border-radius: 999px; font: 600 12px Inter; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
#walls button.on { background: var(--paper); color: var(--ink); }
.back { position: fixed; left: 18px; bottom: calc(22px + var(--safe-b)); z-index: 22; padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 13px;
  background: rgba(10,12,18,.65); backdrop-filter: blur(12px); border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: opacity .3s; }
.back.on { opacity: 1; pointer-events: auto; }

/* paper index card */
.card { position: fixed; right: 22px; bottom: calc(22px + var(--safe-b)); z-index: 21; width: min(380px, calc(100vw - 32px));
  background: var(--paper); color: var(--ink); border-radius: 6px; padding: 20px 22px 18px; box-shadow: 0 30px 70px rgba(0,0,0,.55);
  background-image: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(70,120,190,.18) 27px 28px); background-position: 0 58px;
  transform: translateY(24px) rotate(.6deg); opacity: 0; pointer-events: none; transition: all .45s cubic-bezier(.2,.8,.2,1); }
.card.on { transform: translateY(0) rotate(-.4deg); opacity: 1; pointer-events: auto; }
.card .meta { font: 600 11px Inter; letter-spacing: .1em; text-transform: uppercase; }
.card h2 { margin: 4px 0 18px; font: 800 28px/1.05 'Bricolage Grotesque'; letter-spacing: -.02em; }
.card p { margin: 0 0 12px; font: 600 22px/1.2 Caveat, cursive; color: #26303F; }
.card .stats { display: flex; gap: 18px; margin: 4px 0 16px; }
.card .stats b { display: block; font: 800 20px 'Bricolage Grotesque'; }
.card .stats span { font-size: 11px; color: #6B6559; line-height: 1.3; display: block; max-width: 110px; }
.card .acts { display: flex; gap: 8px; }
.btn { font: 600 14px Inter; padding: 11px 16px; border-radius: 10px; background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid rgba(0,0,0,.2); }

/* story */
.story { position: fixed; inset: 0; z-index: 40; background: #0B0D12; overflow-y: auto; opacity: 0; pointer-events: none; transition: opacity .5s; overscroll-behavior: contain; }
.story.on { opacity: 1; pointer-events: auto; }
.story .close { position: fixed; top: 14px; left: 14px; z-index: 2; padding: 10px 14px; border-radius: 999px; background: rgba(10,12,18,.7); border: 1px solid var(--line); backdrop-filter: blur(10px); font-weight: 600; font-size: 13px; }
.story .hero { min-height: 62vh; display: flex; align-items: flex-end; position: relative; padding: 48px clamp(18px, 6vw, 96px); overflow: hidden; }
.story .hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.story .hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, #0B0D12 4%, rgba(11,13,18,.2) 70%); }
.story .hero .t { position: relative; z-index: 1; }
.story .hero .meta { font: 600 12px Inter; letter-spacing: .12em; text-transform: uppercase; }
.story h1 { margin: 8px 0 0; font: 800 clamp(48px, 9vw, 128px)/.9 'Bricolage Grotesque'; letter-spacing: -.04em; }
.story .wrap { max-width: 980px; margin: 0 auto; padding: 32px clamp(18px, 6vw, 96px) 120px; display: grid; gap: 36px; }
.story .lede { font: 600 clamp(22px, 2.8vw, 34px)/1.25 'Bricolage Grotesque'; margin: 0; }
.story .nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 22px; }
.story .nums div { border-top: 2px solid; padding-top: 12px; }
.story .nums b { display: block; font: 800 44px/1 'Bricolage Grotesque'; }
.story .nums span { color: var(--muted); font-size: 14px; }
.story .ch h3 { margin: 0 0 6px; font: 700 20px 'Bricolage Grotesque'; }
.story .ch p { margin: 0; color: #C9CCD4; font-size: 17px; line-height: 1.7; max-width: 680px; }
.story figure { margin: 0; } .story figure img { width: 100%; border-radius: 10px; display: block; }
.story figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; }
.story .ph { padding: 28px; border: 1px dashed rgba(255,255,255,.2); border-radius: 10px; color: var(--muted); font-size: 13px; }
.story .tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.story .tabs button { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.story .tabs button.on { background: var(--paper); color: var(--ink); }
.story .next { justify-self: start; font: 700 22px 'Bricolage Grotesque'; padding: 18px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }

/* fast lane + contact sheets */
.sheet { position: fixed; inset: 0; z-index: 45; background: rgba(5,6,8,.72); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 18px;
  opacity: 0; pointer-events: none; transition: opacity .35s; overflow-y: auto; }
.sheet.on { opacity: 1; pointer-events: auto; }
.sheet .paper { background: var(--paper); color: var(--ink); width: min(820px, 100%); border-radius: 8px; padding: clamp(22px, 4vw, 44px); box-shadow: 0 40px 90px rgba(0,0,0,.5); max-height: calc(100vh - 36px); overflow-y: auto; }
.sheet.small .paper { width: min(460px, 100%); }
.sheet h2 { margin: 0; font: 800 clamp(28px, 4vw, 40px)/1 'Bricolage Grotesque'; letter-spacing: -.02em; }
.sheet .thesis { font: 600 24px/1.25 Caveat, cursive; color: #26303F; margin: 10px 0 22px; }
.sheet ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sheet li button { width: 100%; text-align: left; display: grid; grid-template-columns: 8px 1fr; gap: 12px; padding: 10px 8px; border-radius: 8px; }
.sheet li button:hover { background: rgba(0,0,0,.05); }
.sheet li i { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; }
.sheet li b { font: 700 16px 'Bricolage Grotesque'; display: block; } .sheet li span { color: #5D584E; font-size: 14px; }
.sheet .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; align-items: center; }
.sheet .x { float: right; font-size: 22px; line-height: 1; padding: 4px 8px; }
.sheet a { color: var(--ink); }

@media (max-width: 720px) {
  #top { padding: 12px; } #top .name { font-size: 15px; } #top nav { gap: 0; padding: 3px; } #top nav button { padding: 7px 8px; font-size: 12px; } #top nav kbd { display: none; }
  .card { left: 12px; right: 12px; width: auto; bottom: calc(76px + var(--safe-b)); }
  #walls button { padding: 6px 10px; font-size: 11px; }
  .hint { bottom: calc(76px + var(--safe-b)); white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 32px); }
}
