:root {
  --bg: #07090f;
  --bg-soft: #0d1018;
  --panel: rgba(20, 24, 36, 0.6);
  --panel-2: rgba(28, 33, 50, 0.75);
  --ink: #f3f1ea;
  --ink-dim: #b3b2c4;
  --ink-faint: #767690;
  --line: rgba(255, 255, 255, 0.09);
  --gold: #e8b873;
  --gold-2: #f0d9a8;
  --sky: #6fa8dc;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", system-ui, sans-serif; line-height: 1.7;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, .serif { font-family: "Fraunces", "Cormorant Garamond", Georgia, serif; font-weight: 500; }
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ---- starfield backdrop ---- */
.stars { position: fixed; inset: 0; z-index: -2; background:
   radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.7), transparent),
   radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.5), transparent),
   radial-gradient(1.5px 1.5px at 40% 70%, rgba(255,255,255,.6), transparent),
   radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,.5), transparent),
   radial-gradient(1px 1px at 55% 45%, rgba(255,255,255,.4), transparent),
   radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,.5), transparent);
   background-color: var(--bg); opacity: .5; }
.glow { position: fixed; inset: 0; z-index: -1; pointer-events: none;
   background: radial-gradient(60vmax 50vmax at 70% -10%, rgba(232,184,115,.10), transparent 70%),
               radial-gradient(50vmax 50vmax at 10% 110%, rgba(111,168,220,.10), transparent 70%); }

/* ---- header ---- */
.nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 5vw, 4rem); backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(7,9,15,.85), rgba(7,9,15,.2)); border-bottom: 1px solid var(--line); }
.brand { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.3rem; letter-spacing: .08em; text-decoration: none; }
.brand b { color: var(--gold); }
.nav-links { display: flex; gap: 1.4rem; align-items: center; }
.nav-links a { color: var(--ink-dim); text-decoration: none; font-size: .92rem; font-weight: 500; letter-spacing: .02em; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.pill { border: 1px solid var(--line); padding: .4rem .9rem; border-radius: 100px; }
.nav-links a.pill:hover { border-color: var(--gold); color: var(--gold); }

/* ---- hero ---- */
.hero { position: relative; min-height: 92vh; display: flex; align-items: flex-end;
  padding: clamp(2rem,6vw,5rem); overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: -1; background-size: cover; background-position: center;
  filter: saturate(1.05) contrast(1.02); }
.hero__bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(7,9,15,.96) 5%, rgba(7,9,15,.5) 45%, rgba(7,9,15,.25) 100%); }
.hero__inner { position: relative; max-width: 900px; }
.hero__eyebrow { text-transform: uppercase; letter-spacing: .4em; font-size: .78rem; color: var(--gold); margin: 0 0 1rem; }
.hero h1 { font-size: clamp(2.8rem, 9vw, 6.5rem); line-height: 1.0; margin: 0; letter-spacing: -.01em; }
.hero h1 em { font-style: italic; color: var(--gold-2); }
.hero__lead { max-width: 46ch; margin: 1.6rem 0 0; font-size: clamp(1.05rem,2.2vw,1.35rem); color: var(--ink-dim); }
.hero__sig { margin-top: 1.2rem; font-family: "Fraunces", serif; font-style: italic; color: var(--ink-faint); }
.scrollcue { margin-top: 2.4rem; display: inline-flex; gap: .5rem; align-items: center; color: var(--ink-dim);
  text-decoration: none; font-size: .9rem; }

/* ---- generic section ---- */
.section { max-width: 1200px; margin: 0 auto; padding: clamp(3.5rem,8vh,6.5rem) clamp(1.25rem,5vw,4rem); }
.section-head { max-width: 720px; margin: 0 auto clamp(2rem,5vh,3.5rem); text-align: center; }
.section-head .kicker { text-transform: uppercase; letter-spacing: .35em; font-size: .74rem; color: var(--gold); margin: 0 0 .8rem; }
.section-head h2 { font-size: clamp(2rem,5vw,3rem); margin: 0 0 .6rem; }
.section-head p { color: var(--ink-dim); margin: 0; font-size: 1.05rem; }
.lede { max-width: 680px; margin: 0 auto; font-size: clamp(1.1rem,2.4vw,1.4rem); color: var(--ink-dim); text-align: center; }
.lede strong { color: var(--ink); font-weight: 600; }

/* ---- map ---- */
#map { height: clamp(380px, 60vh, 620px); border-radius: 20px; border: 1px solid var(--line); overflow: hidden; z-index: 1; }
.leaflet-popup-content-wrapper { background: #11131c; color: var(--ink); border-radius: 12px; }
.leaflet-popup-tip { background: #11131c; }
.map-pop img { width: 200px; border-radius: 8px; margin-bottom: .4rem; }
.map-pop b { color: var(--gold); }
.map-pop small { color: var(--ink-faint); }
.map-legend { text-align: center; margin-top: 1rem; color: var(--ink-faint); font-size: .85rem; }
.map-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); margin: 0 .3rem 0 1rem; vertical-align: middle; }
.map-legend .dot.small { background: var(--sky); width: 7px; height: 7px; }

/* ---- timeline diary ---- */
.diary { display: flex; flex-direction: column; gap: clamp(2.5rem,6vh,5rem); }
.entry { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem,4vw,3rem); align-items: start; }
.entry:nth-child(even) .entry__media { order: 2; }
.entry__frame { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(0,0,0,.5); }
.entry__media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .8s var(--ease); }
.entry:hover .entry__frame img { transform: scale(1.04); }
.entry__where { position: absolute; top: 12px; left: 12px; background: rgba(7,9,15,.7); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 100px; padding: .35rem .8rem; font-size: .78rem; color: var(--gold-2); }
.entry__date { color: var(--gold); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .6rem; }
.entry__text { font-family: "Fraunces", serif; font-size: clamp(1.15rem,2.4vw,1.5rem); line-height: 1.5; margin: 0 0 1.3rem; color: var(--ink); }
.track { border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; background: var(--panel); }
.track__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .18em; color: var(--ink-faint); margin: 0 0 .35rem; }
.track__title { font-weight: 600; margin: 0 0 .1rem; }
.track__album { color: var(--ink-faint); font-size: .85rem; margin: 0 0 .7rem; }
.track__player { width: 100%; max-width: 100%; height: 175px; border: 0; border-radius: 12px; margin: 0 0 .8rem; display: block; background: var(--bg); overflow: hidden; }
.track__links { display: flex; gap: .5rem; flex-wrap: wrap; }
.track__links a { font-size: .8rem; font-weight: 600; text-decoration: none; padding: .4rem .8rem; border-radius: 100px;
  border: 1px solid var(--line); color: var(--ink-dim); transition: all .2s; }
.track__links a:hover { color: var(--bg); background: var(--gold); border-color: var(--gold); }

/* ---- biography ---- */
.bio-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: clamp(2rem,5vw,4rem); align-items: start; }
.bio-portrait { border-radius: 18px; border: 1px solid var(--line); overflow: hidden; position: sticky; top: 90px; box-shadow: 0 30px 70px rgba(0,0,0,.5); }
.prose p { color: var(--ink-dim); font-size: 1.08rem; margin: 0 0 1.2rem; }
.prose p:first-of-type::first-letter { font-family: "Fraunces", serif; font-size: 3.4rem; line-height: .8; float: left; padding: .1em .12em 0 0; color: var(--gold); }
.prose h3 { font-size: 1.5rem; margin: 2.4rem 0 .8rem; color: var(--ink); }
.prose .pull { font-family: "Fraunces", serif; font-style: italic; font-size: 1.5rem; color: var(--gold-2); border-left: 2px solid var(--gold); padding-left: 1.2rem; margin: 2rem 0; }
.factbar { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.factbar div span { display: block; }
.factbar .k { color: var(--ink-faint); font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; }
.factbar .v { color: var(--ink); font-weight: 600; }

/* ---- projects ---- */
.projects { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.project { display: grid; grid-template-columns: 90px 1fr auto; gap: 1.2rem; align-items: center; padding: 1.3rem clamp(1rem,3vw,2rem); background: var(--bg-soft); transition: background .25s; }
.project:hover { background: var(--panel-2); }
.project__year { font-family: "Fraunces", serif; font-size: 1.6rem; color: var(--gold); }
.project__title { font-size: 1.2rem; font-weight: 600; margin: 0; }
.project__meta { color: var(--ink-faint); font-size: .9rem; margin: .2rem 0 0; }
.project__tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-dim); border: 1px solid var(--line); padding: .3rem .7rem; border-radius: 100px; white-space: nowrap; }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 3rem clamp(1.25rem,5vw,4rem); }
.footer__inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.footer__rooms { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer__rooms a { color: var(--ink-dim); text-decoration: none; font-size: .9rem; }
.footer__rooms a:hover { color: var(--gold); }
.footer small { color: var(--ink-faint); }

/* ---- photo stack ---- */
.entry__open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.stack { position: absolute; left: 12px; bottom: 12px; display: flex; }
.thumb { width: 48px; height: 48px; border-radius: 9px; overflow: hidden; border: 2px solid rgba(7,9,15,.85);
  margin-left: -16px; padding: 0; cursor: pointer; background: #1a1d28; box-shadow: 0 5px 14px rgba(0,0,0,.5); transition: transform .2s var(--ease); }
.thumb:first-child { margin-left: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { transform: translateY(-5px); z-index: 3; }
.thumb--more { display: grid; place-items: center; color: var(--ink); font-size: .82rem; font-weight: 700; background: rgba(7,9,15,.9); }

/* ---- quote + discovery ---- */
.quote { margin: 1.5rem 0; padding-left: 1.1rem; border-left: 2px solid var(--gold);
  font-family: "Fraunces", serif; font-style: italic; font-size: 1.18rem; line-height: 1.45; color: var(--gold-2); }
.quote cite { display: block; margin-top: .5rem; font-style: normal; font-family: "Inter", sans-serif;
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.discovery { margin: 1rem 0 0; }
.discovery__text { margin: 0; font-family: "Fraunces", serif; font-weight: 500; font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  line-height: 1.2; letter-spacing: -.01em; color: var(--ink);
  background: linear-gradient(180deg, var(--ink) 0%, var(--gold-2) 140%); -webkit-background-clip: text; background-clip: text; }

/* ---- book excerpt (The Kid and the Machine) ---- */
.book { margin: 1.4rem 0; padding: 1.1rem 1.2rem; background: var(--panel); border: 1px solid var(--line);
  border-left: 2px solid var(--gold); border-radius: 0 12px 12px 0; }
.book__text { margin: 0; font-family: "Fraunces", serif; font-style: italic; font-size: 1.06rem;
  line-height: 1.6; color: var(--ink-dim); }
.book__ref { margin: .7rem 0 0; font-family: "Inter", sans-serif; font-size: .68rem; font-style: normal;
  text-transform: uppercase; letter-spacing: .18em; color: var(--gold); }
.book__ref::before { content: "from "; color: var(--ink-faint); }

/* ---- book banner ---- */
.bookbanner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .4rem .8rem;
  padding: .55rem 1.2rem; text-align: center; border-bottom: 1px solid var(--line); text-decoration: none;
  background: linear-gradient(90deg, rgba(232,184,115,.10), rgba(232,184,115,.18), rgba(232,184,115,.10));
  transition: background .25s; }
.bookbanner:hover { background: linear-gradient(90deg, rgba(232,184,115,.16), rgba(232,184,115,.28), rgba(232,184,115,.16)); }
.bookbanner:hover .bookbanner__note { color: var(--gold-2); }
.bookbanner__tag { font-size: .62rem; text-transform: uppercase; letter-spacing: .2em; color: var(--bg);
  background: var(--gold); padding: .16rem .5rem; border-radius: 100px; font-weight: 700; }
.bookbanner__title { font-family: "Fraunces", serif; font-style: italic; color: var(--gold-2); font-size: 1rem; }
.bookbanner__note { font-size: .8rem; color: var(--ink-dim); letter-spacing: .02em; transition: color .2s; }

/* ---- lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5,6,11,.95); backdrop-filter: blur(6px);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.lightbox[hidden] { display: none; }
.lb__stage { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; }
.lb__stage img { max-width: 88vw; max-height: 82vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb__stage figcaption { color: var(--ink-dim); margin-top: .8rem; font-size: .9rem; letter-spacing: .04em; }
.lb__nav { background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--ink);
  width: 54px; height: 54px; border-radius: 50%; font-size: 2rem; line-height: 1; cursor: pointer; margin: 0 1rem; flex: none; }
.lb__nav:hover { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.lb__close { position: absolute; top: 1.2rem; right: 1.2rem; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--ink); font-size: 1rem; cursor: pointer; z-index: 2; }
.lb__close:hover { background: var(--gold); color: var(--bg); }
.lb__count { position: absolute; bottom: 1.4rem; left: 50%; transform: translateX(-50%); color: var(--ink-faint); font-size: .85rem; letter-spacing: .1em; }
@media (max-width: 640px) {
  .lb__nav { width: 42px; height: 42px; font-size: 1.5rem; margin: 0 .3rem; }
  .lb__stage img { max-width: 94vw; }
}

/* reveal */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---- right-edge time rail ---- */
.timerail { position: fixed; top: 0; right: 0; width: 96px; height: 100vh; z-index: 40;
  pointer-events: none; opacity: 0; transition: opacity .4s var(--ease); }
.timerail.is-on { opacity: 1; }
.timerail__line { position: absolute; top: 6vh; bottom: 6vh; right: 30px; width: 1px; background: var(--line); }
.timerail__tick { position: absolute; right: 0; transform: translateY(-50%); pointer-events: auto;
  display: flex; align-items: center; justify-content: flex-end; gap: .5rem; width: 96px; padding: 0 24px 0 0;
  background: none; border: 0; cursor: pointer; color: var(--ink-faint); }
.timerail__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); opacity: .5;
  transition: transform .2s, background .2s, opacity .2s; }
.timerail__year { font-family: "Inter", sans-serif; font-size: .76rem; letter-spacing: .04em; color: var(--ink-faint);
  transition: color .2s; }
.timerail__tick:hover .timerail__dot { opacity: 1; transform: scale(1.5); background: var(--gold); }
.timerail__tick:hover .timerail__year { color: var(--ink-dim); }
.timerail__tick.is-active .timerail__dot { opacity: 1; background: var(--gold); transform: scale(1.4); }
.timerail__tick.is-active .timerail__year { color: var(--gold-2); }
.timerail__now { position: absolute; right: 0; transform: translateY(-50%); display: flex; align-items: center;
  justify-content: flex-end; width: 100%; }
.timerail__now::before { content: ""; position: absolute; right: 30px; width: 40px; height: 1px; background: var(--gold); }
.timerail__now span { font-family: "Fraunces", serif; font-size: .82rem; font-weight: 600; color: var(--bg);
  background: var(--gold); padding: .18rem .6rem; border-radius: 100px; margin-right: 24px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.4); }

@media (max-width: 1180px) { .timerail { display: none; } }
@media (max-width: 820px) {
  .entry, .bio-grid { grid-template-columns: 1fr; }
  .entry:nth-child(even) .entry__media { order: 0; }
  .bio-portrait { position: static; }
  .project { grid-template-columns: 60px 1fr; }
  .project__tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity:1; transform:none; } html { scroll-behavior:auto; } }
