:root {
  --accent: #f5a54a;
  --ground: #0d0806;
  --white: #ffffff;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --vh: 100vh;
}
@supports (height: 100dvh) { :root { --vh: 100dvh; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ground); color: var(--white); overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--white); }
button { font: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--accent); color: #1b0f08; padding: 10px 16px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--ground); transition: opacity .6s ease, visibility .6s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader-ring { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: spin 1s linear infinite; }
.loader-text { font-family: var(--mono); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: #f0e2cf; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- stage & worlds ---------- */
.stage { position: fixed; inset: 0; height: var(--vh); overflow: hidden; perspective: 1400px; background: var(--ground); touch-action: none; user-select: none; -webkit-user-select: none; }
.world { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.layer { position: absolute; inset: 0; overflow: hidden; visibility: hidden; will-change: transform, opacity; backface-visibility: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%); }
.bg-img { position: absolute; max-width: none; will-change: transform; -webkit-user-drag: none; pointer-events: none; }
.bg-blur { display: none; position: absolute; left: -10%; top: -10%; width: 120%; height: 120%; max-width: none; object-fit: cover; pointer-events: none; }
.shade { position: absolute; inset: 0; pointer-events: none; }
.shade-left { background: linear-gradient(90deg, rgba(13,8,6,.88) 0%, rgba(13,8,6,.58) 33%, rgba(13,8,6,0) 58%); }
.shade-right { background: linear-gradient(270deg, rgba(13,8,6,.9) 0%, rgba(13,8,6,.6) 30%, rgba(13,8,6,0) 55%); }
.shade-sky { background: linear-gradient(100deg, rgba(24,10,22,.82) 0%, rgba(24,10,22,.45) 36%, rgba(24,10,22,0) 58%); }
.front { position: absolute; inset: 0; overflow: hidden; z-index: 10; pointer-events: none; visibility: hidden; will-change: transform, opacity;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%); }

/* ---------- the boy ---------- */
.ground { position: absolute; left: 0; top: 0; z-index: 8; border-radius: 50%; pointer-events: none; will-change: transform, opacity;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 72%); }
.hero { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 9; transform-origin: 0 0; will-change: transform; pointer-events: none; filter: drop-shadow(0 22px 26px rgba(0,0,0,.38)); }
.idle { position: absolute; left: 0; top: 0; width: 0; height: 0; animation: breathe 3.2s ease-in-out infinite; }
.pose { position: absolute; max-width: none; visibility: hidden; opacity: 0; transform-origin: 50% 100%; -webkit-user-drag: none; }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ---------- copy ---------- */
/* top padding reserves the navbar's band, so page text is centred in the space below it */
.copy-wrap { position: absolute; inset: 0; z-index: 14; display: flex; align-items: center; align-items: safe center; padding: 104px 6vw 40px; pointer-events: none; }
.copy-wrap.right { justify-content: flex-end; }
.copy-wrap.top { align-items: flex-start; padding-top: max(16vh, 124px); }
.copy { max-width: 440px; visibility: hidden; opacity: 0; will-change: opacity; text-rendering: optimizeLegibility; }
.copy-wrap.right .copy { max-width: 400px; }
.copy-wide { max-width: 560px; }
.eyebrow { font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--white); margin: 0 0 18px; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.eyebrow::before { content: ''; display: inline-block; width: 22px; height: 3px; border-radius: 2px; background: var(--accent); vertical-align: middle; margin: -3px 12px 0 0; }
.h { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 5vw, 68px); line-height: 1; letter-spacing: -.02em; color: var(--white); margin: 0 0 18px; text-shadow: 0 2px 4px rgba(0,0,0,.35); }
.tagline { font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: .04em; color: var(--accent); margin: 0 0 16px; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.body { font-size: 20px; font-weight: 500; line-height: 1.45; color: var(--white); margin: 0 0 24px; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.body-sm { font-size: 18px; margin-bottom: 16px; }
.status { display: inline-block; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #1b0f08; background: var(--accent); border-radius: 999px; padding: 6px 12px; margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.chip { font-size: 15px; font-weight: 700; color: var(--white); border: 1px solid rgba(255,255,255,.45); background: rgba(20,12,10,.6); border-radius: 999px; padding: 8px 15px; }
.chips-sm { gap: 8px; margin-bottom: 16px; }
.chips-sm .chip { font-size: 13px; padding: 6px 12px; }

.project { background: rgba(16,10,8,.62); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; padding: 18px 20px 20px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.project-kicker { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.project-title { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.1; margin: 0 0 10px; }
.project-desc { font-size: 17px; font-weight: 500; line-height: 1.45; color: #f3e9dd; margin: 0 0 16px; }
.facts { list-style: none; margin: 0 0 18px; padding: 14px 0 0; border-top: 1px solid rgba(255,255,255,.14); display: grid; gap: 8px; font-size: 15px; color: #e9ddcf; }
.facts li { display: flex; align-items: center; gap: 10px; }
.facts li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.facts strong { color: var(--white); font-weight: 700; }
.project .facts:last-child { margin-bottom: 0; }

.stack { margin: 0; display: grid; gap: 12px; }
.stack > div { background: rgba(16,10,8,.55); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 10px 14px; }
.stack dt { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
.stack dd { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.45; color: var(--white); }
.badge { font-size: 10px; letter-spacing: .12em; color: #1b0f08; background: var(--accent); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 1px; }

.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { font-family: var(--sans); font-weight: 700; font-size: 16px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; transition: filter .2s ease, transform .2s ease; }
.btn[hidden] { display: none; }
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #1b0f08; }
.btn-ghost { background: rgba(255,255,255,.08); color: var(--white); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.btn-sm { min-height: 44px; font-size: 15px; padding: 0 18px; }

/* ---------- atmosphere ---------- */
.motes { position: absolute; inset: 0; pointer-events: none; z-index: 12; will-change: transform; }
.mote { position: absolute; border-radius: 50%; background: radial-gradient(circle, #ffe2b0 0%, rgba(255,190,110,.6) 40%, rgba(255,170,90,0) 70%); animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { 0% { transform: translate3d(0,0,0); } 100% { transform: translate3d(14px,-38px,0); } }
.vignette { position: absolute; inset: 0; pointer-events: none; z-index: 13; background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 55%, rgba(8,4,3,.55) 100%); }

/* ---------- chrome ---------- */
.top-bar { position: absolute; left: 0; right: 0; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: max(16px, env(safe-area-inset-top)) 6vw 30px; background: linear-gradient(180deg, rgba(13,8,6,.9) 0%, rgba(13,8,6,.6) 55%, rgba(13,8,6,0) 100%); }
.logo { font-family: var(--display); font-weight: 800; font-size: 23px; letter-spacing: -.01em; color: var(--white); background: none; border: 0; padding: 8px 0; min-height: 44px; cursor: pointer; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-btn { font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--white); text-shadow: 0 1px 8px rgba(0,0,0,.6); background: transparent; border: 0; min-height: 44px; padding: 0 14px; border-radius: 999px; cursor: pointer; }
.nav-btn:hover { background: rgba(255,255,255,.1); }
.rail { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 2px; }
.dot { width: 44px; height: 30px; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: flex-end; padding: 0; }
.dot-mark { display: block; width: 12px; height: 3px; border-radius: 3px; background: rgba(246,231,211,.45); transition: width .3s ease, background-color .3s ease; }
.dot.active .dot-mark { width: 30px; background: var(--accent); }
.hint { position: absolute; left: 50%; bottom: 72px; z-index: 20; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--white); pointer-events: none; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.hint svg { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
.noscript { position: fixed; inset: auto 20px 20px; z-index: 70; background: #1b120e; padding: 16px; border-radius: 12px; }

/* ---------- waiting for a world's images (slow connection) ---------- */
.stage::after { content: ''; position: absolute; right: 24px; bottom: 24px; z-index: 30; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--accent); opacity: 0; transition: opacity .3s ease; animation: spin 1s linear infinite; pointer-events: none; }
.waiting .stage::after { opacity: 1; }

/* ---------- lite mode: slow devices keep the motion, lose the costly effects ---------- */
.lite .hero { filter: none; }
.lite .motes, .lite .vignette { display: none; }
.lite .project, .lite .stack > div { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(16,10,8,.82); }
.lite .layer, .lite .front, .lite .layer > .bg-img, .lite .front > .bg-img { -webkit-mask-image: none; mask-image: none; }
.lite .idle { animation: none; }

/* ---------- short desktop / laptop windows: tighter copy so it stays below the navbar ---------- */
@media (min-width: 761px) and (max-height: 820px) {
  .copy-wrap { padding-top: 92px; padding-bottom: 20px; }
  .h { font-size: clamp(32px, 6.4vh, 58px); margin-bottom: 12px; }
  .eyebrow { margin-bottom: 10px; }
  .tagline { margin-bottom: 10px; }
  .body { font-size: 17px; margin-bottom: 16px; }
  .project { padding: 14px 18px 16px; }
  .project-title { font-size: 21px; margin-bottom: 6px; }
  .project-desc { font-size: 15px; margin-bottom: 10px; }
  .facts { padding-top: 10px; gap: 4px; margin-bottom: 12px; font-size: 14px; }
  .stack { gap: 8px; }
  .stack > div { padding: 7px 12px; }
  .stack dd { font-size: 14px; }
}

/* ---------- tablet landscape ---------- */
@media (max-width: 1100px) and (orientation: landscape) {
  .copy, .copy-wrap.right .copy { max-width: 380px; }
  .copy-wide { max-width: 460px; }
  .body { font-size: 18px; }
  .project-desc { font-size: 15px; }
  .stack dd { font-size: 14px; }
}

/* ---------- phones and portrait tablets: copy on top, boy below ---------- */
@media (max-width: 760px), (max-width: 1100px) and (orientation: portrait) {
  .copy-wrap, .copy-wrap.right, .copy-wrap.top { align-items: flex-start; justify-content: flex-start; padding: calc(max(16px, env(safe-area-inset-top)) + 86px) 20px 0; }
  .copy, .copy-wrap.right .copy, .copy-wide { max-width: 620px; }
  .shade-left, .shade-right, .shade-sky { background: linear-gradient(180deg, rgba(13,8,6,.55) 0%, rgba(13,8,6,.25) 30%, rgba(13,8,6,0) 45%); }
  .rail, .hint { display: none; }
  /* scene in the lower part of the screen, fading up into its own blurred backdrop */
  .bg-blur { display: block; }
  .layer > .bg-img, .front > .bg-img {
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 20%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 20%); }
  .layer, .front {
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 6%, #000 94%, transparent 100%); }
  .nav-btn { padding: 0 10px; letter-spacing: .1em; }
}
@media (max-width: 760px) {
  .h { font-size: 30px; margin-bottom: 10px; }
  .eyebrow { font-size: 12px; margin-bottom: 10px; }
  .tagline { font-size: 12px; margin-bottom: 8px; }
  .body { font-size: 15px; line-height: 1.4; margin-bottom: 12px; }
  .body-sm { font-size: 15px; margin-bottom: 10px; }
  .project { padding: 14px 16px 16px; border-radius: 14px; }
  .project-title { font-size: 19px; margin-bottom: 6px; }
  .project-desc { font-size: 14px; margin-bottom: 10px; }
  .chips-sm { margin-bottom: 12px; }
  .chips-sm .chip { font-size: 12px; padding: 5px 10px; }
  .chip { font-size: 14px; padding: 7px 12px; }
  .stack { gap: 6px; }
  .stack > div { padding: 6px 12px; }
  .stack dt { font-size: 11px; margin-bottom: 2px; }
  .stack dd { font-size: 13px; }
  .btn { min-height: 44px; font-size: 15px; padding: 0 18px; }
  .top-bar { flex-wrap: nowrap; gap: 8px; padding-left: 16px; padding-right: 10px; }
  .logo { font-size: 18px; white-space: nowrap; }
  .nav { flex-wrap: nowrap; gap: 0; }
  .nav-btn { font-size: 11px; letter-spacing: .08em; padding: 0 7px; }
  /* phones: a project card replaces the scene summary, and stays compact so the boy shows */
  .copy:has(.project) > .body { display: none; }
  .chips-sm { display: none; }
  /* phones: the description and buttons carry each project; the fact list would push the boy off-screen */
  .facts { display: none; }
  .project { padding: 12px 14px 14px; }
  .btn, .btn-sm { min-height: 44px; font-size: 14px; padding: 0 16px; }
  .ctas { gap: 8px; }
}
/* very short screens (phones in landscape) */
@media (max-height: 520px) {
  .h { font-size: 28px; }
  .body { font-size: 14px; margin-bottom: 10px; }
  .facts, .tagline { display: none; }
  .copy-wrap { padding-top: 80px; padding-bottom: 12px; }
  .copy-wrap.top { padding-top: 80px; }
  .rail, .hint { display: none; }
}

