/* ==========================================================================
   Niclzy — one visual system: navy glass panels, gold hairlines, marble accents.
   The 3D map (world.js) sits behind everything; each chapter frames one place.
   ========================================================================== */

:root {
  color-scheme: dark;
  --ink: #0c111c;
  --ink-2: #111827;
  --panel: rgba(10, 14, 24, .9);
  --paper: #eeece5;
  --paper-dim: #b9bcc6;
  --muted: #8a90a0;
  --gold: #c9a76b;
  --gold-light: #e3cb9c;
  --gold-deep: #9c7a3c;
  --cyan: #9fe3ff;
  --line: rgba(238, 236, 229, .12);
  --hair: rgba(201, 167, 107, .35);
  --marble: url("images/marble.webp");
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --serif: "Playfair Display", Georgia, serif;
  --pad: 7.2vw;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { position: relative; margin: 0; overflow-x: hidden; background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
main, .site-header, .site-footer { position: relative; z-index: 2; }
a { color: inherit; }
button { font: inherit; }
img { display: block; max-width: 100%; height: auto; }
::selection { color: var(--ink); background: var(--gold-light); }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -.03em; line-height: 1.02; }
h2 em, h1 .accent { color: var(--gold-light); font-style: italic; }
.shell { padding-inline: var(--pad); }

/* ---------- Map layers ---------- */
.world { position: fixed; z-index: 0; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; pointer-events: none; transition: opacity 1.8s ease; }
.world-ready .world { opacity: 1; }
.world-veil { position: fixed; z-index: 0; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(8, 12, 22, .78) 0%, rgba(8, 12, 22, .45) 34%, rgba(8, 12, 22, 0) 60%), linear-gradient(180deg, rgba(8, 12, 22, .4), transparent 22%, transparent 78%, rgba(8, 12, 22, .6)); }
.world-labels { position: fixed; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 1.4s ease .6s; }
.world-ready .world-labels { opacity: 1; }
.world-unavailable .world, .world-unavailable .world-veil, .world-unavailable .world-labels { display: none; }

.map-label { position: absolute; top: 0; left: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: .72; transition: opacity .5s ease; will-change: transform; }
.map-label.is-active { opacity: 1; }
.map-tag { min-width: 112px; padding: 3px 9px; background: #0b0d12; color: #d9dde6; font-family: var(--mono); font-size: 7px; letter-spacing: .2em; white-space: nowrap; box-shadow: 0 6px 18px rgba(5, 10, 20, .35); transition: background .4s ease, color .4s ease; }
.map-label strong { color: #121a28; font-family: var(--serif); font-size: 21px; font-weight: 600; white-space: nowrap; text-shadow: 0 0 12px rgba(255, 255, 255, .95), 0 0 3px rgba(255, 255, 255, .9); }
.map-label.is-active .map-tag { background: var(--gold); color: var(--ink); }
.map-label.is-active strong { font-size: 25px; }
.map-label--goal .map-tag { border-left: 3px solid var(--cyan); }
.map-label--goal.is-active .map-tag { background: var(--cyan); color: #0b1220; }
.map-country, .map-sea, .map-city { position: absolute; top: 0; left: 0; white-space: nowrap; pointer-events: none; transition: opacity .5s ease; will-change: transform; }
.map-country { color: rgba(18, 28, 46, .55); font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .42em; text-shadow: 0 0 8px rgba(255, 255, 255, .8); }
.map-sea { color: rgba(170, 194, 230, .55); font-family: var(--serif); font-size: 15px; font-style: italic; }
.map-city { display: flex; align-items: center; gap: 5px; color: #dfe6f2; font-family: var(--mono); font-size: 8px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; text-shadow: 0 1px 6px rgba(10, 16, 30, .9); }
.map-city i { width: 4px; height: 4px; background: var(--gold-light); transform: rotate(45deg); }
.world-labels.is-close .map-country, .world-labels.is-close .map-sea, .world-labels.is-close .map-city { opacity: 0; }
.map-label.is-hidden, .map-country.is-hidden, .map-sea.is-hidden, .map-city.is-hidden { opacity: 0; }

/* ---------- Chrome: progress, skip link, header, nav ---------- */
.scroll-progress { position: fixed; z-index: 20; top: 0; right: 0; left: 0; height: 2px; pointer-events: none; }
.scroll-progress span { width: 100%; height: 100%; display: block; background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--cyan)); transform: scaleX(0); transform-origin: left center; box-shadow: 0 0 10px rgba(201, 167, 107, .65); }
.skip-link { position: fixed; z-index: 30; top: 10px; left: 10px; padding: 12px 16px; background: var(--paper); color: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-header { z-index: 5; height: 78px; padding: 0 var(--pad); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(8, 12, 22, .7), rgba(8, 12, 22, 0)); }
.wordmark, .footer-mark { color: var(--paper); font-family: var(--serif); font-size: 31px; font-weight: 700; line-height: 1; text-decoration: none; }
.wordmark-mark, .footer-mark span { color: var(--gold); }
.primary-nav { display: flex; align-items: center; gap: clamp(24px, 3.5vw, 52px); }
.primary-nav a { position: relative; color: var(--paper-dim); font-size: 12px; text-decoration: none; transition: color .2s ease; }
.primary-nav a:hover, .primary-nav a:focus-visible { color: var(--gold-light); }
.primary-nav a:not(.nav-contact)::after { position: absolute; right: 0; bottom: -6px; left: 0; height: 1px; content: ""; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.primary-nav a:hover::after, .primary-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.primary-nav .nav-contact { padding: 11px 15px; border: 1px solid rgba(201, 167, 107, .55); color: var(--gold-light); }
.menu-toggle { display: none; }

/* ---------- Shared type + controls ---------- */
.eyebrow, .kicker, .chapter-meta, .coord, .footer-copyright { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow { margin: 0; display: flex; align-items: center; gap: 10px; color: var(--paper-dim); }
.dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--gold); box-shadow: 0 0 11px rgba(201, 167, 107, .65); }
.kicker { margin: 0 0 14px; color: var(--gold); }
.button { min-height: 47px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 16px; border: 1px solid transparent; font-size: 12px; font-weight: 600; text-decoration: none; transition: translate .35s var(--ease), background .2s ease, color .2s ease; }
.button-gold { border-color: var(--gold); background: rgba(201, 167, 107, .08); color: var(--gold-light); }
.button-gold:hover, .button-gold:focus-visible { background: var(--gold-light); color: var(--ink); }
.text-link { display: inline-flex; align-items: center; gap: 9px; color: var(--paper-dim); font-size: 12px; text-decoration: none; transition: color .2s ease; }
.text-link:hover, .text-link:focus-visible { color: var(--gold-light); }
.place-link { color: var(--gold-light); white-space: nowrap; text-decoration: underline dotted rgba(227, 203, 156, .6); text-underline-offset: 4px; transition: color .2s ease, background .2s ease; outline: none; }
.place-link::before { display: inline-block; width: 5px; height: 5px; margin: 0 6px 2px 2px; content: ""; background: currentColor; transform: rotate(45deg); }
.place-link:hover, .place-link:focus-visible { color: var(--ink); background: var(--gold-light); text-decoration: none; text-shadow: none; }
.place-link--goal { color: var(--cyan); text-decoration-color: rgba(159, 227, 255, .6); }
.place-link--goal:hover, .place-link--goal:focus-visible { background: var(--cyan); }
.binary { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 0 5px; color: rgba(201, 167, 107, .38); font-family: var(--mono); font-size: 9px; user-select: none; }
.binary span { transition: color .4s ease, text-shadow .4s ease; }
.binary span.is-lit { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); transition: none; }

/* ---------- Prologue: hero + marble portrait ---------- */
.hero { min-height: calc(100vh - 78px); padding-block: 60px; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 6vw; }
.hero-copy { max-width: 560px; text-shadow: 0 1px 14px rgba(8, 12, 22, .75); }
.hero h1 { margin: 26px 0 24px; font-size: clamp(56px, 7vw, 96px); letter-spacing: -.055em; line-height: .98; }
.hero h1 .gold { color: var(--gold); font-style: normal; }
.hero-intro { max-width: 470px; margin: 0 0 32px; color: var(--paper-dim); font-size: 16px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 26px; }

.portrait { margin: 0; justify-self: center; display: grid; justify-items: center; gap: 18px; perspective: 1100px; }
.portrait-frame { position: relative; width: min(400px, 34vw); padding: 18px; background: var(--marble) center / 520px; box-shadow: 0 40px 80px rgba(2, 6, 14, .55), 0 0 0 1px rgba(201, 167, 107, .55), inset 0 0 0 6px rgba(255, 255, 255, .25); border-radius: 220px 220px 6px 6px; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .5s var(--ease); }
.portrait-frame::before { position: absolute; inset: 9px; border: 1px solid var(--gold); border-radius: 212px 212px 3px 3px; content: ""; pointer-events: none; }
.portrait-arch { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: 200px 200px 2px 2px; box-shadow: 0 0 0 3px var(--gold), 0 0 0 5px rgba(255, 255, 255, .6), inset 0 0 40px rgba(0, 0, 0, .25); }
.portrait-arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transform: scale(1.04) translate(calc(var(--ry, 0deg) * -.6), calc(var(--rx, 0deg) * .6)); transition: transform .5s var(--ease); }
.portrait-arch::after { position: absolute; inset: 0; content: ""; background: radial-gradient(ellipse at 50% 35%, transparent 55%, rgba(8, 12, 22, .28)); pointer-events: none; }
.portrait-glint { position: absolute; z-index: 2; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.portrait-glint::before { position: absolute; top: -30%; bottom: -30%; left: 0; width: 40%; content: ""; background: linear-gradient(90deg, transparent, rgba(255, 244, 214, .55), transparent); transform: translateX(-150%) skewX(-18deg); animation: glint 7s ease-in-out infinite; will-change: transform; }
.portrait:hover .portrait-glint::before { animation-duration: 1.6s; }
@keyframes glint { 0%, 70% { transform: translateX(-150%) skewX(-18deg); } 100% { transform: translateX(330%) skewX(-18deg); } }
.corner { position: absolute; z-index: 3; width: 34px; height: 34px; border: 2px solid var(--gold); pointer-events: none; }
.corner::after { position: absolute; width: 7px; height: 7px; content: ""; background: var(--gold-light); transform: rotate(45deg); }
.corner--tl { top: 64px; left: -9px; border-width: 2px 0 0 2px; }
.corner--tr { top: 64px; right: -9px; border-width: 2px 2px 0 0; }
.corner--bl { bottom: -9px; left: -9px; border-width: 0 0 2px 2px; }
.corner--br { right: -9px; bottom: -9px; border-width: 0 2px 2px 0; }
.corner--tl::after, .corner--bl::after { left: -5px; }
.corner--tr::after, .corner--br::after { right: -5px; }
.corner--tl::after, .corner--tr::after { top: -5px; }
.corner--bl::after, .corner--br::after { bottom: -5px; }
.plaque { min-width: 250px; padding: 10px 26px; display: grid; justify-items: center; gap: 2px; background: var(--marble) 40% 60% / 400px; border: 1px solid var(--gold); box-shadow: 0 14px 30px rgba(2, 6, 14, .45), inset 0 0 0 3px rgba(255, 255, 255, .35); color: #3b3221; }
.plaque strong { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: .02em; background: linear-gradient(180deg, #b48a40, #7a5a22); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plaque span { color: #6c5a35; font-family: var(--mono); font-size: 8px; letter-spacing: .24em; text-transform: uppercase; }

/* ---------- Chapters: one place per screen, one panel style ---------- */
.chapter { position: relative; min-height: 100vh; padding: 120px var(--pad); display: flex; align-items: center; }
.panel { position: relative; width: min(540px, 100%); padding: 44px 44px 40px; background: var(--panel); border: 1px solid var(--hair); box-shadow: 0 30px 70px rgba(2, 6, 14, .45); }
.panel::before { position: absolute; top: -1px; bottom: -1px; left: -1px; width: 6px; content: ""; background: var(--marble) 0 0 / 300px; box-shadow: 1px 0 0 var(--gold); }
.panel::after { position: absolute; top: -1px; left: 40px; width: 90px; height: 2px; content: ""; background: var(--gold); }
.chapter-meta { margin: 0 0 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--paper-dim); }
.numeral { min-width: 52px; font-family: var(--serif); font-size: 46px; font-weight: 700; font-style: normal; letter-spacing: 0; line-height: 1; background: var(--marble) 30% 40% / 220px; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: .6px var(--gold); }
.coord { margin-left: auto; color: var(--gold); }
.panel h2, .diverge-copy h2 { margin-bottom: 20px; font-size: clamp(36px, 4.2vw, 54px); }
.lede { margin: 0 0 14px; color: var(--paper); font-size: 17px; line-height: 1.75; }
.panel p:not(.lede):not(.chapter-meta) { margin: 0; color: var(--paper-dim); font-size: 14px; line-height: 1.8; }
.facts { margin: 28px 0 0; padding-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; border-top: 1px solid var(--line); }
.facts dt, .stats dt { color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.facts dd, .stats dd { margin: 4px 0 0; color: var(--paper); font-size: 13px; font-weight: 600; }
.live { display: flex; align-items: center; gap: 8px; color: var(--gold-light) !important; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; animation: pulse 1.6s ease-in-out infinite; }
.live--cyan { color: var(--cyan) !important; }
@keyframes pulse { 50% { opacity: .3; } }

/* Wide chapters: projects and brands */
.chapter--wide { flex-direction: column; align-items: stretch; justify-content: center; gap: 36px; }
.section-head h2 { font-size: clamp(38px, 4.6vw, 60px); text-shadow: 0 2px 20px rgba(8, 12, 22, .8); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { position: relative; min-height: 260px; padding: 30px 28px; display: flex; flex-direction: column; gap: 12px; background: var(--panel); border: 1px solid var(--hair); transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px)); transition: transform .4s var(--ease), border-color .3s ease, box-shadow .3s ease; }
.card:hover { --lift: -6px; border-color: var(--gold); box-shadow: 0 24px 50px rgba(2, 6, 14, .5), 0 0 0 1px rgba(201, 167, 107, .4); }
.card::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; content: ""; background: var(--marble) 0 0 / 260px; opacity: .85; }
.card-index { color: var(--gold); font-family: var(--mono); font-size: 11px; letter-spacing: .14em; }
.card h3 { font-size: 26px; }
.card p { margin: 0; flex: 1; color: var(--paper-dim); font-size: 14px; line-height: 1.75; }
.card--placeholder { border-style: dashed; }
.tags { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.tags li { padding: 3px 9px; border: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.brands { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; list-style: none; }
.brand { padding: 30px 28px; display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: center; background: var(--panel); border: 1px solid var(--hair); transition: border-color .3s ease, transform .4s var(--ease); }
.brand:hover { border-color: var(--gold); transform: translateY(-4px); }
.brand-mark { grid-row: span 2; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--marble) center / 200px; box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px rgba(255, 255, 255, .2); color: var(--gold-deep); font-family: var(--serif); font-size: 26px; font-weight: 700; transition: rotate .6s var(--ease); }
.brand:hover .brand-mark { rotate: 360deg; }
.brand strong { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.2; }
.brand span:last-child { color: var(--paper-dim); font-size: 13px; }

/* Milestones */
.milestones { margin: 6px 0 0; padding: 0; list-style: none; }
.milestones li { position: relative; padding: 14px 0 14px 104px; border-bottom: 1px solid var(--line); }
.milestones li::before { position: absolute; top: 22px; left: 82px; width: 8px; height: 8px; content: ""; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 10px rgba(201, 167, 107, .6); }
.milestones .year { position: absolute; top: 15px; left: 0; color: var(--gold); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; }
.milestones strong { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.milestones p { margin: 2px 0 0 !important; font-size: 13px !important; }
.stats { margin: 26px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stats dd { color: var(--gold-light); font-family: var(--serif); font-size: 30px; font-weight: 600; }

/* ---------- Passage: Kuching → Singapore, scrubbed by scroll ---------- */
.passage { position: relative; height: 210vh; }
.passage-sticky { position: sticky; top: 0; height: 100vh; padding: 0 var(--pad); display: grid; align-content: center; justify-items: center; gap: 30px; text-align: center; }
.passage-route { width: min(760px, 100%); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; }
.passage-city { color: var(--paper); font-family: var(--serif); font-size: clamp(24px, 3vw, 38px); text-shadow: 0 2px 18px rgba(8, 12, 22, .9); }
.passage-city--to { color: rgba(238, 236, 229, calc(.35 + var(--p, 0) * .65)); }
.passage-line { position: relative; height: 2px; background: rgba(201, 167, 107, .25); }
.passage-line i { position: absolute; inset: 0; background: linear-gradient(270deg, var(--gold), var(--gold-light)); transform: scaleX(var(--p, 0)); transform-origin: right; box-shadow: 0 0 12px rgba(227, 203, 156, .7); }
.passage-line b { position: absolute; top: -6px; left: calc((1 - var(--p, 0)) * 100%); width: 14px; height: 14px; margin-left: -7px; background: var(--gold-light); transform: rotate(45deg); box-shadow: 0 0 16px var(--gold-light); }
.passage-text { max-width: 520px; margin: 0; padding: 16px 22px; color: var(--paper); font-family: var(--serif); font-size: clamp(18px, 2vw, 24px); font-style: italic; background: rgba(8, 12, 22, .82); opacity: calc(var(--p, 0) * 3 - .3); transform: translateY(calc((1 - min(1, var(--p, 0) * 3)) * 20px)); }

/* ---------- Divergence: one path becomes many ---------- */
.diverge { position: relative; height: 340vh; }
.diverge-sticky { position: sticky; top: 0; height: 100vh; padding: 90px var(--pad) 40px; display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: 4vw; }
.diverge-copy { padding: 36px 36px 30px; background: var(--panel); border: 1px solid var(--hair); }
.diverge-graph { position: relative; aspect-ratio: 640 / 420; }
.diverge-graph svg { width: 100%; height: 100%; overflow: visible; }
.diverge-graph path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; }
.d-trunk { stroke: var(--gold-light); stroke-dashoffset: calc(1 - var(--d0, 0)); filter: drop-shadow(0 0 6px rgba(227, 203, 156, .7)); }
.d-branch { stroke: var(--gold); filter: drop-shadow(0 0 6px rgba(201, 167, 107, .6)); }
.d-b1 { stroke-dashoffset: calc(1 - var(--d1, 0)); }
.d-b2 { stroke-dashoffset: calc(1 - var(--d2, 0)); stroke: var(--gold-light); }
.d-b3 { stroke-dashoffset: calc(1 - var(--d3, 0)); }
.d-node { fill: var(--ink); stroke: var(--gold); stroke-width: 2; }
.d-split { fill: var(--gold); opacity: calc(var(--d0, 0) * 1.2); }
.d-goal { stroke: var(--cyan); stroke-width: 2.5; opacity: var(--d4, 0); filter: drop-shadow(0 0 10px var(--cyan)); }
.d-label { position: absolute; color: var(--paper); font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }
.d-label--start { top: 56%; left: 0; }
.d-label--goal { top: 56%; right: -2%; color: var(--cyan); opacity: var(--d4, 0); }
.venture { position: absolute; width: min(230px, 40%); padding: 12px 14px; display: grid; gap: 3px; background: var(--panel); border: 1px solid var(--hair); border-left: 3px solid var(--gold); transition: border-color .3s ease, translate .4s var(--ease); }
.venture:hover { border-color: var(--gold); translate: 0 -4px; }
.venture b { color: var(--gold); font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .16em; }
.venture strong { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.venture span { color: var(--paper-dim); font-size: 12px; line-height: 1.5; }
.venture--1 { top: -6%; left: 44%; opacity: var(--v1, 0); transform: translateY(calc((1 - var(--v1, 0)) * 16px)); }
.venture--2 { top: 36%; left: 46%; opacity: var(--v2, 0); transform: translateY(calc((1 - var(--v2, 0)) * 16px)); }
.venture--3 { top: 80%; left: 44%; opacity: var(--v3, 0); transform: translateY(calc((1 - var(--v3, 0)) * 16px)); }

/* ---------- Epilogue + footer ---------- */
.contact { min-height: 100vh; padding-block: 120px; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.contact-copy { max-width: 520px; padding: 44px; background: var(--panel); border: 1px solid var(--hair); }
.contact-copy h2 { margin: 18px 0 18px; font-size: clamp(40px, 5vw, 64px); }
.contact-copy > p:not(.eyebrow) { margin: 0 0 26px; color: var(--paper-dim); font-size: 14px; line-height: 1.8; }
.contact-seal { position: relative; width: 218px; height: 218px; margin-right: 6vw; display: grid; place-items: center; border: 1px solid rgba(201, 167, 107, .37); border-radius: 50%; color: var(--gold-light); cursor: pointer; transition: translate .35s var(--ease); }
.contact-seal::before, .contact-seal::after { position: absolute; inset: 14px; border: 1px solid rgba(201, 167, 107, .24); border-radius: 50%; content: ""; }
.contact-seal::after { inset: 27px; border-style: dashed; }
.seal-orbit { position: absolute; top: 14px; right: 29px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 15px var(--gold); }
.seal-star { margin-top: -36px; font-size: 29px; }
.seal-caption { position: absolute; margin-top: 66px; color: var(--paper-dim); font-family: var(--mono); font-size: 8px; letter-spacing: .15em; line-height: 1.8; text-align: center; }
.site-footer { border-top: 1px solid var(--line); background: rgba(8, 11, 18, .94); }
.binary--footer { margin: 0; padding: 10px var(--pad) 0; height: 22px; overflow: hidden; }
.footer-inner { min-height: 60px; padding: 8px var(--pad) 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-mark { font-size: 24px; }
.footer-inner > p { margin: 0; color: var(--paper-dim); font-size: 11px; }
.footer-inner > p span { color: var(--muted); }
.footer-copyright { color: var(--muted) !important; font-size: 9px !important; }
.back-to-top { color: var(--paper-dim); font-size: 11px; text-decoration: none; transition: translate .35s var(--ease), color .2s ease; }
.back-to-top span { margin-left: 5px; color: var(--gold); }
.back-to-top:hover, .back-to-top:focus-visible { color: var(--gold-light); }

/* ---------- Chapter rail ---------- */
.chapter-rail { position: fixed; z-index: 6; top: 50%; right: 22px; display: flex; gap: 14px; transform: translateY(-50%); opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.chapter-rail.is-on { opacity: 1; pointer-events: auto; }
.chapter-rail ol { margin: 0; padding: 0; display: grid; gap: 26px; list-style: none; }
.chapter-rail a { display: flex; flex-direction: row-reverse; align-items: center; gap: 10px; color: var(--muted); text-decoration: none; }
.chapter-rail b { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--hair); background: rgba(8, 12, 22, .7); color: var(--paper-dim); font-family: var(--serif); font-size: 12px; transition: background .3s ease, color .3s ease, border-color .3s ease; }
.chapter-rail span { font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; opacity: 0; translate: 6px 0; transition: opacity .3s ease, translate .3s var(--ease); }
.chapter-rail a:hover span, .chapter-rail a.is-current span { opacity: 1; translate: 0 0; }
.chapter-rail a.is-current { color: var(--gold-light); }
.chapter-rail a.is-current b { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.chapter-rail a.is-done b { border-color: var(--gold); color: var(--gold-light); }
.rail-track { position: absolute; top: 14px; right: 13px; bottom: 14px; width: 1px; background: var(--hair); }
.rail-track i { position: absolute; inset: 0; background: var(--gold); transform: scaleY(var(--story, 0)); transform-origin: top; }

/* ---------- Reveal + letters ---------- */
.motion-ready .reveal { opacity: 0; translate: 0 28px; transition: opacity .72s ease, translate .72s var(--ease), transform .4s var(--ease), border-color .3s ease, box-shadow .3s ease; transition-delay: var(--reveal-delay, 0ms); }
.motion-ready .reveal.is-visible { opacity: 1; translate: none; transition-delay: 0ms; }
.split { transform: skewY(var(--scroll-skew, 0deg)); transform-origin: left center; }
.split .word { display: inline-block; white-space: nowrap; }
.split .char { display: inline-block; opacity: 0; transform: translateY(.55em) rotate(9deg); transition: transform .7s cubic-bezier(.2, .9, .2, 1), opacity .6s ease, color .3s ease; transition-delay: calc(var(--i) * 18ms); }
.split.is-in .char { opacity: 1; transform: none; }
.split .char.is-hit { animation: char-hop .7s cubic-bezier(.3, 1.6, .4, 1); color: var(--gold-light); }
@keyframes char-hop { 0% { transform: none; } 35% { transform: translateY(-.28em) rotate(-10deg) scale(1.12); } 100% { transform: none; } }

/* ---------- Custom cursor ---------- */
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor { position: fixed; z-index: 100; inset: 0; pointer-events: none; }
.cursor-dot { position: absolute; top: 0; left: 0; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--gold-light); transform: translate(var(--x, -100px), var(--y, -100px)) rotate(45deg); }
.cursor-hex { position: absolute; top: 0; left: 0; width: 38px; height: 38px; margin: -19px 0 0 -19px; overflow: visible; transform: translate(var(--rx, -100px), var(--ry, -100px)) rotate(0deg) scale(1); transition: transform .25s var(--ease), opacity .3s ease; }
.cursor-hex polygon { fill: rgba(201, 167, 107, 0); stroke: var(--gold-light); stroke-width: 1.2; transition: fill .25s ease; vector-effect: non-scaling-stroke; }
.cursor-label, .cursor-readout { position: absolute; top: 0; left: 0; color: var(--gold-light); font-family: var(--mono); font-size: 9px; letter-spacing: .18em; white-space: nowrap; opacity: 0; transform: translate(calc(var(--rx, -100px) + 30px), calc(var(--ry, -100px) - 6px)); transition: opacity .2s ease; }
.cursor-readout { display: flex; flex-direction: column; gap: 2px; padding: 6px 9px; background: rgba(9, 13, 22, .78); border-left: 2px solid var(--gold); transform: translate(calc(var(--rx, -100px) + 26px), calc(var(--ry, -100px) + 12px)); }
.cursor-readout b { color: #fff; font-weight: 500; text-transform: uppercase; }
.cursor-readout span { color: #9fb3d1; }
.cursor.is-link .cursor-hex { transform: translate(var(--rx), var(--ry)) rotate(90deg) scale(1.9); }
.cursor.is-link .cursor-hex polygon { fill: rgba(201, 167, 107, .14); }
.cursor.is-link .cursor-label { opacity: 1; transform: translate(calc(var(--rx) + 44px), calc(var(--ry) - 5px)); }
.cursor.is-map .cursor-readout { opacity: 1; }
.cursor.is-down .cursor-hex { transform: translate(var(--rx), var(--ry)) rotate(30deg) scale(.7); }
.cursor.is-away { opacity: 0; }
.click-burst { position: fixed; z-index: 99; width: 40px; height: 40px; margin: -20px 0 0 -20px; pointer-events: none; animation: burst .8s cubic-bezier(.1, .7, .2, 1) forwards; }
.click-burst svg { width: 100%; height: 100%; overflow: visible; }
.click-burst polygon { fill: none; stroke: var(--gold-light); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
@keyframes burst { from { opacity: 1; transform: scale(.4) rotate(0deg); } to { opacity: 0; transform: scale(3.2) rotate(60deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cards, .brands { grid-template-columns: 1fr 1fr; }
  .diverge-sticky { grid-template-columns: 1fr; align-content: center; gap: 24px; }
  .diverge-copy { max-width: 560px; }
}
@media (max-width: 760px) {
  :root { --pad: 6vw; }
  .site-header { height: 68px; }
  .wordmark { font-size: 28px; }
  .menu-toggle { padding: 10px 0 10px 10px; display: flex; align-items: center; gap: 12px; border: 0; background: none; color: var(--paper-dim); font-size: 11px; cursor: pointer; }
  .menu-icon { width: 19px; display: grid; gap: 5px; }
  .menu-icon span { height: 1px; display: block; background: var(--gold-light); transition: transform .2s ease; }
  .menu-toggle[aria-expanded="true"] .menu-icon span:first-child { transform: translateY(3px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-icon span:last-child { transform: translateY(-3px) rotate(-45deg); }
  .primary-nav { position: absolute; top: 67px; right: 0; left: 0; padding: 13px 6% 23px; display: none; align-items: stretch; gap: 0; border-bottom: 1px solid var(--line); background: var(--ink); }
  .primary-nav.is-open { display: flex; flex-direction: column; }
  .primary-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .primary-nav .nav-contact { width: fit-content; margin-top: 13px; padding: 10px 14px; }
  .chapter-rail { display: none; }
  .world-veil { background: linear-gradient(180deg, rgba(8, 12, 22, .5), rgba(8, 12, 22, .2) 40%, rgba(8, 12, 22, .65)); }
  .map-city, .map-country, .map-sea, .map-label:not(.is-active) { display: none; }
  .hero { min-height: auto; padding-block: 48px 70px; grid-template-columns: 1fr; gap: 48px; }
  .hero h1 { font-size: clamp(50px, 15vw, 70px); }
  .portrait-frame { width: min(320px, 82vw); }
  .chapter { min-height: 100vh; padding: 46vh 6vw 60px; align-items: flex-end; }
  .chapter--wide { padding-top: 90px; align-items: stretch; }
  .panel { padding: 34px 24px 28px; }
  .facts, .stats { grid-template-columns: 1fr 1fr; }
  .cards, .brands { grid-template-columns: 1fr; }
  .milestones li { padding-left: 92px; }
  .milestones li::before { left: 74px; }
  .passage-route { grid-template-columns: 1fr; justify-items: center; gap: 14px; }
  .passage-line { width: 2px; height: 120px; }
  .passage-line i { transform: scaleY(var(--p, 0)); transform-origin: top; }
  .passage-line b { top: calc(var(--p, 0) * 100%); left: -6px; margin: -7px 0 0; }
  .passage-city--from { order: 1; }
  .passage-line { order: 2; }
  .passage-city--to { order: 3; }
  .hero-intro { padding: 12px 14px; background: rgba(8, 12, 22, .72); }
  .diverge-graph { margin-top: 70px; }
  .diverge { height: 300vh; }
  .diverge-sticky { padding-top: 78px; gap: 14px; }
  .diverge-copy { padding: 22px; }
  .diverge-copy h2 { font-size: 32px; }
  .diverge-copy .lede { font-size: 14px; }
  .venture { width: 46%; padding: 8px 10px; }
  .venture strong { font-size: 14px; }
  .venture span { display: none; }
  .contact { flex-direction: column; align-items: stretch; padding-block: 80px; }
  .contact-copy { padding: 30px 24px; }
  .contact-seal { width: 160px; height: 160px; margin: 0 auto; }
  .footer-inner { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motion-ready .reveal { opacity: 1; translate: none; }
  .split .char { opacity: 1; transform: none; transition: none; }
  .split { transform: none; }
  .portrait-glint::before, .live i { animation: none; }
}

.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.stats dd.stat-text { font-size: 20px; line-height: 1.3; }

/* Honours, grouped by chapter of life */
.stats--wide { margin: 0; grid-template-columns: repeat(4, auto); justify-content: start; gap: 18px 48px; }
.stats--wide dd { text-shadow: 0 2px 16px rgba(8, 12, 22, .9); }
.stats--wide dt { color: var(--paper-dim); text-shadow: 0 1px 8px rgba(8, 12, 22, .9); }
.honours-grid { align-items: start; }
.honours-grid .card { min-height: 0; }
.honours { margin: 6px 0 0; padding: 0; display: grid; gap: 14px; list-style: none; }
.honours li { display: grid; grid-template-columns: 78px 1fr; gap: 2px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.honours li:last-child { border-bottom: 0; padding-bottom: 0; }
.honours time { grid-row: span 2; padding-top: 3px; color: var(--gold); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.honours strong { font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.3; }
.honours span { color: var(--paper-dim); font-size: 12px; line-height: 1.55; }
.honours li.is-top strong { color: var(--gold-light); font-size: 20px; }
.card--feature { border-color: rgba(201, 167, 107, .6); box-shadow: 0 0 0 1px rgba(201, 167, 107, .25), 0 30px 60px rgba(2, 6, 14, .45); }
.card--feature::before { height: 5px; }
@media (max-width: 760px) { .world-labels { display: none; } .stats--wide { width: 100%; padding: 0; justify-content: stretch; grid-template-columns: 1fr 1fr; gap: 14px 20px; } .honours li { grid-template-columns: 1fr; } .honours time { grid-row: auto; } }

.cards--two { grid-template-columns: repeat(2, 1fr); }
.card--grit { border-color: rgba(201, 167, 107, .5); }
.card--grit::before { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.diverge-note { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--gold-light); font-family: var(--serif); font-size: 16px; font-style: italic; }
@media (max-width: 1100px) { .cards--two { grid-template-columns: 1fr; } }
.panel p:not(.chapter-meta) + p { margin-top: 12px !important; }

/* Project images */
.card::before { z-index: 1; }
.card-media { position: relative; margin: -30px -28px 8px; overflow: hidden; aspect-ratio: 16 / 10; border-bottom: 1px solid var(--hair); background: #0b0f18; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.045); }
.card-media::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg, transparent 60%, rgba(10, 14, 24, .35)); pointer-events: none; }
.card-media--logo::after { display: none; }

/* Projects: featured card + detail lists */
.cards--projects { grid-template-columns: repeat(2, 1fr); }
.card--featured { grid-column: 1 / -1; padding: 0; display: grid; grid-template-columns: 1.05fr 1fr; gap: 0 34px; border-color: rgba(201, 167, 107, .6); }
.card--featured .card-media { margin: 0; aspect-ratio: auto; height: 100%; min-height: 340px; border-bottom: 0; border-right: 1px solid var(--hair); }
.card--featured .card-media img { object-position: top left; }
.card-body { padding: 30px 34px 30px 0; display: flex; flex-direction: column; gap: 12px; }
.card-body > p { flex: none; }
.card-details { margin: 4px 0 6px; display: grid; gap: 12px; }
.card-details div { padding-left: 14px; border-left: 2px solid var(--gold); }
.card-details dt { color: var(--gold); font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.card-details dd { margin: 3px 0 0; color: var(--paper-dim); font-size: 13px; line-height: 1.6; }
.card-points { margin: 0; padding: 0; display: grid; gap: 7px; flex: 1; list-style: none; }
.card-points li { position: relative; padding-left: 18px; color: var(--paper-dim); font-size: 13px; line-height: 1.6; }
.card-points li::before { position: absolute; top: .62em; left: 2px; width: 6px; height: 6px; content: ""; background: var(--gold); transform: rotate(45deg); }
.card > p:has(+ .card-points) { flex: none; }
@media (max-width: 1100px) {
  .cards--projects { grid-template-columns: 1fr; }
  .card--featured { grid-template-columns: 1fr; }
  .card--featured .card-media { aspect-ratio: 16 / 10; height: auto; min-height: 0; border-right: 0; border-bottom: 1px solid var(--hair); }
  .card-body { padding: 4px 28px 30px; }
}

/* Skills & interests */
.skills-layout { display: grid; grid-template-columns: 1.6fr .9fr; gap: 26px; align-items: start; }
.skill-groups { padding: 30px 30px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 34px; background: var(--panel); border: 1px solid var(--hair); }
.skill-group h3, .interests h3 { margin: 0 0 12px; color: var(--gold); font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; }
.hexes { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 4px; list-style: none; }
.hex { position: relative; padding: 9px 18px; color: var(--paper); font-size: 12px; font-weight: 600; white-space: nowrap; cursor: default; outline: none; background: rgba(201, 167, 107, .14); clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); transition: background .25s ease, color .25s ease, transform .3s var(--ease); }
.hex:hover, .hex:focus-visible { background: var(--gold-light); color: var(--ink); transform: translateY(-3px); }
.hex--cert::after { position: absolute; top: 5px; right: 11px; width: 5px; height: 5px; content: ""; background: var(--gold); transform: rotate(45deg); }
.hex--cert:hover::after, .hex--cert:focus-visible::after { background: var(--ink); }
.interests { padding: 30px; background: var(--panel); border: 1px solid var(--hair); }
.interest-list { margin: 0 0 22px; padding: 0; display: grid; gap: 12px; list-style: none; }
.interest-list li { padding: 12px 14px 12px 64px; position: relative; display: grid; gap: 2px; border: 1px solid var(--line); transition: border-color .3s ease, transform .3s var(--ease); }
.interest-list li:hover { border-color: var(--gold); transform: translateX(4px); }
.interest-list li::before { position: absolute; top: 50%; left: 14px; width: 34px; height: 30px; margin-top: -15px; content: ""; background: var(--marble) center / 160px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); box-shadow: inset 0 0 0 2px var(--gold); }
.interest-list b { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.interest-list span { color: var(--paper-dim); font-size: 12px; line-height: 1.5; }
.skill-readout { min-height: 58px; margin: 0; padding: 12px 14px; display: grid; gap: 2px; border-left: 2px solid var(--gold); background: rgba(201, 167, 107, .06); }
.skill-readout-label { color: var(--gold-light); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.skill-readout-text { color: var(--paper-dim); font-size: 13px; }
.skill-legend { margin: 12px 0 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.skill-legend i { width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
@media (max-width: 1100px) { .skills-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .skill-groups { grid-template-columns: 1fr; padding: 24px 20px; } .interests { padding: 24px 20px; } }

.work-mode { margin: 0; padding: 16px 22px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; background: var(--panel); border: 1px solid var(--hair); border-left: 3px solid var(--gold); color: var(--paper); font-size: 14px; line-height: 1.6; }
.work-mode-label { color: var(--gold); font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
