/* ============================================================
   RAFSAN ISDANI — A WINTER FOREST PORTFOLIO
   ============================================================
   One page, two ways to read it (switch any time, instantly):
   • html.world-mode → the 3D forest: scroll walks the main road,
                        each section is a house down its own path.
   • (no class)      → the simple page: sections top to bottom.

   Palette: pine & emerald, midnight navy, moonlit silver,
   antique gold and lantern amber.
   ============================================================ */
:root {
  --ink:       #04070d;
  --night:     #08101d;
  --navy:      #0e1a2e;
  --pine:      #12261e;
  --emerald:   #1d4637;
  --silver:    #c8d2e1;
  --snow:      #eef2f8;
  --mist:      #93a1b8;
  --text:      #d3dbe7;
  --gold:      #c9a86a;
  --gold-soft: rgba(201,168,106,0.22);
  --amber:     #eaa95c;

  --card:      rgba(8,14,26,0.76);
  --line:      rgba(201,168,106,0.18);
  --line-cool: rgba(200,210,225,0.12);

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
  --r:     14px;
  --bar-h: 60px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
html:not(.world-mode) { scroll-padding-top: calc(var(--bar-h) + 12px); }
body { font-family: var(--sans); color: var(--text); line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 300; padding: .6rem 1rem; border-radius: 8px; background: var(--snow); color: var(--ink); font-weight: 600; }
.skip-link:focus { top: 12px; }

html:not(.world-mode) .world-only { display: none !important; }
html.world-mode .simple-only { display: none !important; }

/* ── type & controls ── */
.kicker { font-family: var(--mono); font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: .7rem; }
.muted { color: var(--mist); }
.text-link { color: var(--amber); border-bottom: 1px solid rgba(234,169,92,.35); transition: color .25s, border-color .25s; }
.text-link:hover { color: var(--snow); border-color: var(--snow); }
strong { color: var(--snow); font-weight: 600; }
em { color: var(--snow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.4rem; border-radius: 999px; font-size: .86rem; font-weight: 600; white-space: nowrap;
  transition: transform .3s var(--ease), background .3s, border-color .3s, color .3s, box-shadow .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: linear-gradient(180deg, #d9bb7f, #b48f51); color: #1a1208; box-shadow: 0 6px 24px rgba(201,168,106,.18); }
.btn-gold:hover { box-shadow: 0 10px 30px rgba(201,168,106,.3); }
.btn-ghost { border: 1px solid rgba(200,210,225,.28); color: var(--snow); background: rgba(8,14,26,.4); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: .55rem 1.1rem; font-size: .8rem; }

.tool {
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap;
  padding: .45rem .85rem; border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--silver);
  border: 1px solid var(--line-cool); background: rgba(8,14,26,.5);
  transition: color .25s, border-color .25s;
}
.tool:hover { color: var(--gold); border-color: var(--gold-soft); }

.pill { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .9rem .3rem .65rem; border-radius: 999px; font-family: var(--mono); font-size: .72rem; color: var(--amber); border: 1px solid rgba(234,169,92,.3); background: rgba(10,8,6,.35); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; transform: scale(.75); } }

/* ============================================================
   BACKDROP
   ============================================================ */
.sky {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1px 1px at 28% 8%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 44% 22%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1px 1px at 63% 12%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1px 1px at 78% 26%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 88% 9%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(circle at 24% 20%, rgba(232,236,245,.95) 0 1.4vmin, rgba(170,190,230,.14) 1.6vmin, transparent 12vmin),
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(234,169,92,.08), transparent 70%),
    linear-gradient(180deg, #03060d 0%, #0a1527 50%, #13223b 74%, #0c1712 100%);
}
#world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: none; opacity: 0; transition: opacity 1.2s ease; }
.world-mode #world { display: block; }
.world-mode.world-ready #world { opacity: 1; }

.veil { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, #2a1a0c 0%, #0c0805 60%, #040302 100%); opacity: 0; }
html:not(.world-mode) .veil { opacity: 0 !important; }

.loader { position: fixed; left: 18px; bottom: 16px; z-index: 60; display: none; align-items: center; gap: .6rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--mist); transition: opacity .8s; }
.world-mode .loader { display: inline-flex; }
.world-ready .loader { opacity: 0; pointer-events: none; }
.loader.notice { display: inline-flex; opacity: 1; }
.loader-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); animation: breathe 1.6s ease-in-out infinite; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 clamp(16px, 3vw, 36px);
  background: linear-gradient(180deg, rgba(4,7,13,.82), rgba(4,7,13,0));
}
html:not(.world-mode) .topbar { background: rgba(4,7,13,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-cool); }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; letter-spacing: .24em; text-transform: uppercase; color: var(--snow); white-space: nowrap; }
.topnav { display: flex; align-items: center; }
.menu { display: flex; list-style: none; gap: clamp(.7rem, 1.6vw, 1.5rem); }
.menu:focus { outline: none; }
.menu a { font-size: .84rem; color: var(--silver); position: relative; padding: .3rem 0; transition: color .25s; }
.menu a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold); transform: scaleX(0); transition: transform .35s var(--ease); }
.menu a:hover, .menu a[aria-current="true"] { color: var(--snow); }
.menu a:hover::after, .menu a[aria-current="true"]::after { transform: scaleX(1); }
.menu-toggle { display: none; padding: .4rem .8rem; border: 1px solid var(--line-cool); border-radius: 999px; font-size: .8rem; }
.tools { display: flex; gap: .5rem; }
.vt-simple { display: none; }
html:not(.world-mode) .vt-world { display: none; }
html:not(.world-mode) .vt-simple { display: inline; }
html:not(.has-webgl) #viewToggle { display: none; }

/* ============================================================
   HOME + THE ROAD
   ============================================================ */
.journey-road { position: relative; }
.world-mode .journey-road { height: 1000vh; }
.stage { position: relative; }
.world-mode .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

.caption { pointer-events: none; }
.caption > * { pointer-events: auto; }
.world-mode .caption { position: absolute; opacity: 0; visibility: hidden; transition: opacity .55s linear, visibility .55s; }
.world-mode .caption.on { opacity: 1; visibility: visible; }

.caption--hero { text-align: center; padding: calc(var(--bar-h) + 13vh) 1.2rem 12vh; display: flex; flex-direction: column; align-items: center; }
html:not(.world-mode) .caption--hero { min-height: 100vh; justify-content: center; }
.world-mode .caption--hero { left: 0; right: 0; top: 0; padding-top: calc(var(--bar-h) + 10vh); }
.hero-name {
  font-family: var(--serif); font-weight: 500; text-transform: uppercase;
  font-size: clamp(2.2rem, 6.2vw, 4.6rem); letter-spacing: .14em; line-height: 1.08; margin: 1.3rem -.14em 0 0;
  color: var(--snow); text-shadow: 0 2px 30px rgba(0,0,0,.6);
}
.hero-title { margin-top: .9rem; font-size: clamp(.98rem, 1.8vw, 1.15rem); color: var(--snow); text-shadow: 0 1px 14px rgba(0,0,0,.8); }
.hero-edu { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.6rem; margin-top: .7rem; color: var(--silver); font-size: clamp(.86rem, 1.5vw, .98rem); text-shadow: 0 1px 12px rgba(0,0,0,.8); }
.hero-edu strong { color: var(--gold); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 2rem; }
.hint { margin-top: 2.2rem; display: inline-flex; flex-direction: column; align-items: center; gap: .7rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--mist); }
.hint-line { width: 1px; height: 38px; background: linear-gradient(var(--gold), transparent); animation: hintFall 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes hintFall { 0% { transform: scaleY(0); opacity: 0; } 40% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1) translateY(16px); opacity: 0; } }

.caption--map { left: clamp(18px, 6vw, 90px); bottom: 12vh; max-width: min(30rem, 86vw); }
.caption-text { font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 2.3vw, 1.7rem); line-height: 1.4; color: var(--snow); text-shadow: 0 2px 18px rgba(0,0,0,.9); }

/* junction cards — what you see at each turn of the road */
.junctions { position: absolute; inset: 0; pointer-events: none; }
.junction {
  position: absolute; bottom: clamp(18px, 6vh, 64px); max-width: min(25rem, calc(100vw - 36px));
  padding: 1.1rem 1.3rem 1.2rem; border-radius: var(--r);
  background: rgba(6,10,18,.72); border: 1px solid var(--line); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .45s, visibility .45s, transform .45s var(--ease);
  pointer-events: auto;
}
.junction.right { right: clamp(18px, 6vw, 90px); }
.junction.left { left: clamp(18px, 6vw, 90px); }
.junction.center { left: 50%; translate: -50% 0; }
.junction.on { opacity: 1; visibility: visible; transform: none; }
.junction .kicker { margin-bottom: .35rem; display: flex; align-items: center; gap: .5rem; }
.junction h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.1; color: var(--snow); }
.junction p.j-desc { font-size: .88rem; color: var(--silver); margin: .3rem 0 .9rem; }
.junction .j-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.junction.books { max-width: min(36rem, calc(100vw - 36px)); }
.book-roads { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .4rem; }
.book-roads a { display: flex; flex-direction: column; padding: .55rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: rgba(20,14,8,.4); transition: border-color .25s, background .25s; }
.book-roads a:hover { border-color: rgba(234,169,92,.6); background: rgba(40,26,12,.6); }
.book-roads b { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: var(--snow); line-height: 1.2; }
.book-roads span { font-size: .72rem; color: var(--mist); }

.travel {
  position: absolute; left: 50%; bottom: 26px; translate: -50% 0; z-index: 46;
  display: flex; align-items: center; gap: .9rem; padding: .45rem .5rem .45rem 1rem; border-radius: 999px;
  background: rgba(6,10,18,.7); border: 1px solid var(--line); backdrop-filter: blur(8px);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--silver);
}
.travel[hidden] { display: none; }

/* walking a side road yourself */
.junction .j-note { margin-top: .6rem; font-size: .74rem; color: var(--mist); }
.junction .j-note b { color: var(--silver); font-weight: 600; }
.book-road { position: relative; }
.book-road > a { height: 100%; padding-right: 4.2rem; }
.walk-mini {
  position: absolute; right: .45rem; top: 50%; translate: 0 -50%;
  padding: .3rem .6rem; border-radius: 999px; border: 1px solid rgba(200,210,225,.28); background: rgba(8,14,26,.55);
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--silver);
  transition: border-color .25s, color .25s;
}
.walk-mini:hover, .walk-mini:focus-visible { border-color: var(--gold); color: var(--gold); }
.branch-hud {
  position: absolute; left: 50%; bottom: clamp(18px, 5vh, 48px); translate: -50% 0; z-index: 46;
  width: min(26rem, calc(100vw - 36px)); padding: .85rem 1rem .9rem; border-radius: var(--r);
  background: rgba(6,10,18,.72); border: 1px solid var(--line); backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s var(--ease);
}
.branch-hud.on { opacity: 1; transform: none; }
.branch-hud[hidden] { display: none; }
.bh-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .8rem; }
.bh-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; color: var(--snow); line-height: 1.15; }
.bh-hint { font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); }
.bh-track { height: 3px; margin: .65rem 0 .8rem; border-radius: 3px; background: rgba(200,210,225,.16); overflow: hidden; }
.bh-fill { display: block; height: 100%; background: linear-gradient(90deg, #b48f51, var(--amber)); transform-origin: left; transform: scaleX(0); }
.bh-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; }
.branch-hud.at-door .bh-hint { color: var(--amber); }
.branch-hud.at-door [data-open-door] { animation: doorPulse 1.8s ease-in-out infinite; }
@keyframes doorPulse { 50% { box-shadow: 0 0 0 6px rgba(234,169,92,.18), 0 10px 30px rgba(201,168,106,.35); } }

/* progress rail */
.rail { position: absolute; right: clamp(8px, 2vw, 26px); top: 50%; transform: translateY(-50%); list-style: none; display: flex; flex-direction: column; gap: .85rem; }
.rail button { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; padding: .15rem; }
.rail button::after { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(200,210,225,.55); transition: background .3s, border-color .3s, box-shadow .3s; }
.rail button.here::after { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 10px rgba(234,169,92,.7); }
.rail span { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--silver); opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .3s; text-shadow: 0 1px 8px rgba(0,0,0,.9); }
.rail button:hover span, .rail button:focus-visible span { opacity: 1; transform: none; }

/* floating names over houses and the map overview */
.labels { position: fixed; inset: 0; z-index: 20; pointer-events: none; display: none; }
.world-mode .labels { display: block; }
.place-label {
  position: absolute; left: 0; top: 0; pointer-events: none;
  padding: .22rem .7rem; border-radius: 999px; white-space: nowrap;
  font-family: var(--serif); font-weight: 600; font-size: .98rem; color: var(--snow);
  background: rgba(6,10,18,.72); border: 1px solid rgba(201,168,106,.3);
  opacity: 0; transition: opacity .45s;
}
.place-label.on { opacity: 1; }
.place-label.book { font-style: italic; border-color: rgba(234,169,92,.45); }
.place-label.hot { border-color: rgba(234,169,92,.85); background: rgba(28,18,8,.75); }

/* ============================================================
   THE HOUSES (sections)
   ============================================================ */
.dest { position: relative; isolation: isolate; overflow: hidden; }
html:not(.world-mode) .dest { border-top: 1px solid var(--line-cool); }
.world-mode .dest { position: fixed; inset: 0; z-index: 55; display: none; opacity: 0; transition: opacity .6s ease; }
.world-mode .dest.is-open { display: block; }
.world-mode .dest.is-shown { opacity: 1; }
html.world-mode.panel-open, html.world-mode.panel-open body { overflow: hidden; }

.room { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.room-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.world-mode .room-art { opacity: .8; }
html:not(.world-mode) .room-art { opacity: .45; }
.room-glow { position: absolute; inset: 0; }
.room::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(100deg, rgba(3,5,9,.62) 0%, rgba(3,5,9,.25) 45%, transparent 70%),
    radial-gradient(ellipse 75% 70% at 50% 40%, transparent 30%, rgba(3,5,9,.72) 100%);
}
html:not(.world-mode) .room::after { background: linear-gradient(180deg, rgba(4,7,13,.75), rgba(4,7,13,.4) 30%, rgba(4,7,13,.6)); }

.dest--about .room   { background: repeating-linear-gradient(90deg, rgba(0,0,0,.2) 0 2px, transparent 2px 120px), linear-gradient(180deg, #24170e, #1a1009 60%, #0f0905); }
.dest--about .room-glow { background: radial-gradient(ellipse 40% 40% at 58% 64%, rgba(234,169,92,.3), transparent 70%); }
.dest--journey .room { background: linear-gradient(180deg, #161512 0%, #12110e 55%, #0b0a08 100%); }
.dest--journey .room-glow { background: radial-gradient(ellipse 40% 35% at 30% 50%, rgba(234,169,92,.18), transparent 70%), radial-gradient(ellipse 22% 30% at 76% 30%, rgba(150,175,230,.12), transparent 70%); }
.dest--skills .room  { background: linear-gradient(180deg, #1c130d 0%, #120c08 60%, #0b0705 100%); }
.dest--skills .room-glow { background: radial-gradient(ellipse 45% 40% at 54% 14%, rgba(234,169,92,.28), transparent 70%); }
.dest--projects .room { background: linear-gradient(180deg, #060b16 0%, #0a1222 55%, #070b14 100%); }
.dest--projects .room-glow { background: radial-gradient(ellipse 18% 55% at 50% 10%, rgba(150,175,230,.18), transparent 75%); }
.dest--antiproton .room { background: linear-gradient(180deg, #05080e 0%, #070c14 55%, #04060a 100%); }
.dest--antiproton .room-glow { background: radial-gradient(ellipse 50% 22% at 50% 8%, rgba(79,216,255,.12), transparent 75%), radial-gradient(ellipse 30% 30% at 56% 70%, rgba(255,225,180,.12), transparent 70%); }
.dest--hobbies .room {background: repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 140px), linear-gradient(180deg, #20160e, #170f09 60%, #0e0805); }
.dest--hobbies .room-glow { background: radial-gradient(ellipse 35% 35% at 40% 70%, rgba(234,169,92,.24), transparent 70%); }
.dest--contact .room { background: linear-gradient(180deg, #1d140d, #140d08 60%, #0b0705); }
.dest--contact .room-glow { background: radial-gradient(ellipse 40% 40% at 55% 66%, rgba(234,169,92,.28), transparent 70%); }

/* the four book houses each have their own room */
.dest--books .room-art { display: none; }
.dest--books[data-book="amber"] .art-amber,
.dest--books[data-book="ocean"] .art-ocean,
.dest--books[data-book="iridescent"] .art-iridescent,
.dest--books[data-book="alam"] .art-alam { display: block; }
.dest--books[data-book="amber"] .room { background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 3px, transparent 3px 46px), linear-gradient(180deg, #2a180b, #1c1008 60%, #0f0804); }
.dest--books[data-book="amber"] .room-glow { background: radial-gradient(ellipse 40% 40% at 25% 62%, rgba(240,150,60,.35), transparent 70%), radial-gradient(ellipse 30% 30% at 75% 35%, rgba(150,175,230,.1), transparent 70%); }
.dest--books[data-book="ocean"] .room { background: linear-gradient(180deg, #0c1622, #0a121c 60%, #070b12); }
.dest--books[data-book="ocean"] .room-glow { background: radial-gradient(ellipse 30% 40% at 50% 35%, rgba(160,190,235,.18), transparent 70%), radial-gradient(ellipse 25% 25% at 22% 75%, rgba(170,40,60,.16), transparent 70%); }
.dest--books[data-book="iridescent"] .room { background: linear-gradient(180deg, #1f120c, #170d09 60%, #0e0806); }
.dest--books[data-book="iridescent"] .room-glow { background: radial-gradient(ellipse 30% 35% at 50% 38%, rgba(90,200,210,.16), transparent 70%), radial-gradient(ellipse 30% 30% at 40% 40%, rgba(170,90,220,.14), transparent 70%); }
.dest--books[data-book="alam"] .room { background: linear-gradient(180deg, #0c0a16, #0a0912 60%, #060509); }
.dest--books[data-book="alam"] .room-glow { background: radial-gradient(ellipse 30% 45% at 50% 50%, rgba(120,90,200,.22), transparent 70%); }
html:not(.world-mode) .dest--books .art-amber { display: block; }

.dest-scroll { position: relative; }
.world-mode .dest-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.dest-bar { display: none; }
.world-mode .dest-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 14px clamp(16px, 4vw, 40px); background: linear-gradient(180deg, rgba(4,6,10,.88), rgba(4,6,10,0)); }
.back { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.1rem; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--snow); background: rgba(10,14,22,.72); border: 1px solid var(--line); transition: border-color .25s, color .25s; }
.back:hover { border-color: var(--amber); color: var(--amber); }

.dest-inner { max-width: 1100px; margin: 0 auto; padding: clamp(5rem, 9vw, 7rem) clamp(16px, 4vw, 40px) 5rem; }
.world-mode .dest-inner { padding-top: clamp(.5rem, 3vw, 2.4rem); }
.dest-head { max-width: 46rem; margin-bottom: 2.4rem; }
.dest-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.dest-head h2 { font-family: var(--serif); font-weight: 500; color: var(--snow); font-size: clamp(2.1rem, 4.6vw, 3.1rem); line-height: 1.08; }
.dest-head h2:focus { outline: none; }
.lede { margin-top: .9rem; font-size: 1.02rem; color: var(--silver); }
.lede-serif { font-family: var(--serif); font-style: italic; font-size: 1.35rem; line-height: 1.5; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.card h3 { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; line-height: 1.22; color: var(--snow); }

/* about */
.about-head { display: flex; align-items: center; gap: clamp(1.2rem, 4vw, 2.4rem); max-width: none; }
.portrait { --pw: clamp(230px, 26vw, 300px); position: relative; flex: none; width: var(--pw); height: calc(var(--pw) * 1.25); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.6); background: linear-gradient(160deg, #22303f, #10161f); }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 18%; }
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; padding: clamp(1.3rem, 3vw, 2rem); }
.about-text { display: flex; flex-direction: column; gap: .9rem; }
.about-text p { font-size: .98rem; line-height: 1.75; }
.facts { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; align-content: start; }
.facts li { padding: 1rem; border-radius: 12px; border: 1px solid var(--line-cool); background: rgba(200,210,225,.03); display: flex; flex-direction: column; gap: .3rem; text-align: center; }
.facts b { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--gold); line-height: 1; }
.facts span { font-size: .76rem; color: var(--mist); line-height: 1.35; }

/* journey */
.timeline { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.timeline li { padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: .35rem; }
.timeline p { font-size: .88rem; }
.t-date { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; color: var(--gold); }

/* skills */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.skill-set { padding: 1.3rem 1.4rem; }
.skill-set h3 { margin-bottom: .9rem; font-size: 1.2rem; }
.levels { list-style: none; display: flex; flex-direction: column; gap: .65rem; }
.levels li { display: flex; flex-direction: column; gap: .28rem; font-size: .8rem; color: var(--silver); }
.levels i { display: block; height: 3px; border-radius: 3px; background: rgba(200,210,225,.08); position: relative; overflow: hidden; }
.levels i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--l); background: linear-gradient(90deg, var(--emerald), var(--gold)); border-radius: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; }
.chips li { padding: .22rem .65rem; border-radius: 999px; font-size: .72rem; color: var(--silver); border: 1px solid var(--line-cool); background: rgba(200,210,225,.04); }
.chips--key li { color: var(--gold); border-color: var(--line); background: rgba(201,168,106,.07); font-weight: 600; }

/* projects */
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.work { overflow: hidden; display: flex; flex-direction: column; }
.work-fig { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: #0d0806; }
.work-fig .pj-svg { width: 100%; height: 100%; }
.work-tag { position: absolute; top: 10px; right: 10px; padding: .18rem .6rem; border-radius: 999px; font-family: var(--mono); font-size: .64rem; color: var(--gold); background: rgba(4,6,10,.8); border: 1px solid var(--line); }
.work-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .7rem; }
.work-body p { font-size: .9rem; line-height: 1.68; }
.work-body .btn { align-self: flex-start; margin-top: .3rem; }

/* antiproton technologies */
.company-head { display: flex; align-items: center; gap: clamp(1.2rem, 4vw, 2.2rem); max-width: 54rem; }
.company-mark { flex: none; width: clamp(76px, 11vw, 104px); height: auto; border-radius: 50%; box-shadow: 0 0 0 1px rgba(79,216,255,.25), 0 14px 36px rgba(0,0,0,.6); }
.company-links, .product-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.product-links { margin-top: .4rem; }
.product-links .btn, .company-links .btn { margin-top: 0; }
.work-fig--shot { aspect-ratio: auto; background: #05080e; }
.work-fig--shot img { width: 100%; height: auto; }
.product-points { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.product-points li { position: relative; padding-left: 1.1rem; font-size: .86rem; line-height: 1.55; color: var(--silver); }
.product-points li::before { content: ''; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: #4fd8ff; box-shadow: 0 0 8px rgba(79,216,255,.6); }

/* books */
.books { display: grid; gap: 1.4rem; }
html:not(.world-mode) .books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.book { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.2rem, 3vw, 2.4rem); padding: clamp(1.2rem, 3vw, 2rem); align-items: center; }
html:not(.world-mode) .book { grid-template-columns: 1fr; justify-items: center; text-align: center; }
html:not(.world-mode) .book-links { justify-content: center; }
.book[hidden] { display: none; }
.book-cover { position: relative; border-radius: 2px 5px 5px 2px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.book-cover::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.35) 0%, rgba(255,255,255,.1) 2.5%, rgba(0,0,0,.1) 4.5%, transparent 9%); pointer-events: none; }
.book-cover img { height: clamp(260px, 36vw, 380px); width: auto; aspect-ratio: 2 / 3; object-fit: cover; background: linear-gradient(160deg, #22303f, #10161f); }
.book-meta { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mist); }
.book-meta span { color: var(--gold); }
.book-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.9rem, 3.6vw, 2.6rem) !important; line-height: 1.08 !important; margin: .35rem 0 .7rem; }
.book-desc { font-family: var(--serif); font-size: 1.22rem; line-height: 1.55; }
.book-format { font-family: var(--serif); font-style: italic; color: var(--mist); margin: .9rem 0 1.2rem; }
.book-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.other-books { margin-top: 2rem; }
.other-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.other-list a { padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(8,14,26,.6); font-family: var(--serif); font-size: 1.02rem; color: var(--snow); transition: border-color .25s; }
.other-list a span { font-size: .85rem; color: var(--mist); font-style: italic; }
.other-list a:hover { border-color: var(--amber); }
.other-list a[hidden] { display: none; }
.author-bar { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 1.3rem 1.6rem; }
.author-name { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--snow); }

/* hobbies */
.hobbies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.hobbies > div { padding: 1.2rem 1.3rem; }
.hobbies p { font-size: .88rem; color: var(--mist); margin-top: .45rem; line-height: 1.6; }

/* contact */
.contact { max-width: 620px; margin: 0 auto; }
.linkedin-big { display: flex; align-items: center; justify-content: center; gap: .8rem; padding: 1rem; margin-bottom: 1.2rem; border-radius: var(--r); color: #fff; font-weight: 600; background: linear-gradient(135deg, #0a6aa0, #064a70); box-shadow: 0 6px 24px rgba(0,0,0,.4); transition: transform .3s var(--ease); }
.linkedin-big:hover { transform: translateY(-3px); }
.contact-details { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }
.contact-item { display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1.15rem; border-radius: 999px; font-size: .88rem; color: var(--snow); background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(8px); transition: border-color .25s, color .25s, transform .3s var(--ease); }
.contact-item svg { color: var(--gold); flex: none; }
a.contact-item:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-2px); }

.dest-next { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .8rem 2rem; margin-top: 3.5rem; padding-top: 1.6rem; border-top: 1px solid var(--line-cool); }
.dest-next a, .next-road { font-family: var(--serif); font-size: 1.15rem; color: var(--silver); transition: color .25s; }
.dest-next a:hover, .next-road:hover { color: var(--amber); }
html:not(.world-mode) .next-road { display: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem 2rem; padding: 1.4rem clamp(16px, 4vw, 40px); font-size: .8rem; color: var(--mist); border-top: 1px solid var(--line-cool); background: rgba(4,7,13,.9); }
.f-link { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-cool); color: var(--mist); transition: color .3s, border-color .3s; }
.f-link:hover { color: var(--gold); border-color: var(--gold); }

/* ============================================================
   THE MAP
   ============================================================ */
.map { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 14px; background: rgba(2,4,8,.74); backdrop-filter: blur(4px); animation: fadeIn .35s ease; }
.map[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.map-sheet {
  width: min(760px, 100%); max-height: calc(100vh - 28px); max-height: calc(100svh - 28px); overflow: auto;
  padding: clamp(12px, 2.6vw, 24px); border-radius: 10px;
  background: radial-gradient(ellipse at 30% 20%, rgba(201,168,106,.1), transparent 60%), linear-gradient(160deg, #1b1913, #12110d 60%, #0d0c09);
  border: 1px solid rgba(201,168,106,.35); box-shadow: 0 30px 80px rgba(0,0,0,.7), inset 0 0 60px rgba(0,0,0,.6);
  animation: rise .45s var(--ease);
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.map-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .4rem; }
.map-head h2 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(1.4rem, 3vw, 1.9rem); color: #e8d9b4; }
.map-canvas { position: relative; aspect-ratio: 800 / 760; }
#mapArt { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-markers { position: absolute; inset: 0; }
.map-marker { position: absolute; display: flex; align-items: center; gap: .4rem; padding: .2rem; font-family: var(--serif); font-size: clamp(.78rem, 1.7vw, 1rem); font-weight: 600; color: #ead9b0; white-space: nowrap; transform: translate(-7px, -50%); }
.map-marker.left { flex-direction: row-reverse; transform: translate(calc(-100% + 7px), -50%); }
.map-marker .mm-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; background: radial-gradient(circle, #ffd394 0 30%, #c9862e 60%, transparent 70%); box-shadow: 0 0 10px rgba(234,169,92,.7); }
.map-marker.book span:last-child { font-style: italic; }
.map-marker:hover span:last-child, .map-marker:focus-visible span:last-child { color: #fff2d2; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(234,169,92,.6); }
.map-marker.minor { font-style: italic; font-weight: 500; color: #bfae88; }
.map-marker.minor .mm-dot { width: 7px; height: 7px; background: #bfae88; box-shadow: none; }
.map-marker.you .mm-dot { background: radial-gradient(circle, #eef2f8 0 35%, #8fa8d8 60%, transparent 72%); }
.map-foot { margin-top: .4rem; font-size: .8rem; text-align: center; color: #9a8d70; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1060px) {
  .menu { gap: .8rem; }
  .menu a { font-size: .8rem; }
}
@media (max-width: 960px) {
  .works, .timeline { grid-template-columns: 1fr; }
  .skills, .hobbies { grid-template-columns: 1fr 1fr; }
  .about { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  html:not(.world-mode) .books { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --bar-h: 56px; }
  .brand { font-size: .95rem; letter-spacing: .2em; }
  .menu-toggle { display: inline-flex; }
  .topnav { margin-left: auto; }
  .menu { position: absolute; top: calc(var(--bar-h) - 4px); right: 12px; flex-direction: column; gap: 0; min-width: 200px; padding: .5rem; border-radius: 12px; background: rgba(6,10,18,.96); border: 1px solid var(--line); box-shadow: 0 20px 40px rgba(0,0,0,.6); display: none; }
  .menu.open { display: flex; }
  .menu a { display: block; padding: .65rem .9rem; font-size: .95rem; }
  .menu a::after { display: none; }
}
@media (max-width: 640px) {
  .tools .tool > span { display: none; }
  #viewToggle span { display: none !important; }
  #viewToggle::before { content: 'View'; }
  .skills, .hobbies { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .book { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .book-links { justify-content: center; }
  .about-head, .company-head { flex-direction: column; align-items: flex-start; }
  .rail { right: 4px; gap: .7rem; }
  .rail span { display: none; }
  .junction, .junction.left, .junction.right, .junction.center { left: 12px; right: 12px; translate: none; max-width: none; bottom: 14px; }
  .book-roads { grid-template-columns: 1fr; }
  .caption--map { left: 18px; right: 18px; }
  .place-label { font-size: .82rem; padding: .16rem .5rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .world-mode .caption--hero { padding-top: calc(var(--bar-h) + 1vh); }
  .hero-name { margin-top: .5rem; }
  .hero-actions { margin-top: 1rem; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
