:root {
  --ink: #06111d;
  --navy: #0d2a48;
  --sun: #ef8826;
  --sun-soft: #ffb35c;
  --cream: #f6efe6;
  --mute: rgba(246, 239, 230, 0.62);
  --line: rgba(246, 239, 230, 0.14);
  --font: "SF Pro Display", "Helvetica Neue", "Inter", "Segoe UI", system-ui, sans-serif;
  --p: 0;      /* page scroll 0..1, set by main.js */
  --night: 0;  /* 0 sunset .. 1 night, set by main.js */
  --mx: 0;     /* pointer -1..1 */
  --my: 0;
  --boy: min(30vh, 34vw); /* height of the boy on his rock */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--ink); }
body {
  font-family: var(--font);
  color: var(--cream);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--sun); color: var(--ink); }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Scene: WebGL lake, skyline, mirror ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: linear-gradient(#0b1e33 0%, #6b3a3a 42%, #ef8826 58%, #081624 58%, #030a12 100%); }
.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.skyline, .mirror {
  position: absolute; left: 50%; height: 22vh; width: 110vh; max-width: 170vw;
  transform: translateX(calc(-50% + var(--mx) * -14px)); will-change: transform;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.skyline { bottom: 42%; }
.mirror {
  top: 58%; transform: translateX(calc(-50% + var(--mx) * -14px)) scaleY(-1); opacity: 0.3;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(to top, #000 10%, transparent 80%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(to top, #000 10%, transparent 80%);
  mask-composite: intersect;
}
.boy {
  position: absolute; left: calc(var(--boy) * -0.1); bottom: -2px; height: var(--boy); width: calc(var(--boy) * 1.726); fill: #040b14;
  filter: drop-shadow(3px -2px 0 rgba(239, 136, 38, calc(0.8 - var(--night) * 0.55)));
  transform: translateX(calc(var(--mx) * var(--boy) * -0.08)); will-change: transform;
}
.hill { fill: #13263a; transition: fill 0.4s; }
.eth { fill: #0d1c2d; }
.city { fill: #040b14; }
.clk { fill: var(--sun); filter: drop-shadow(0 0 calc(var(--night) * 8px) var(--sun)); }
.win { fill: var(--sun-soft); opacity: calc(var(--night) * 1.1 - 0.1); }
.veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3, 8, 14, 0) 0%, rgba(3, 8, 14, 0.55) 100%); opacity: calc(0.25 + var(--p) * 0.75); }
.grain {
  position: absolute; inset: -10%; opacity: 0.07; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } 100% { transform: translate(0, 0); } }
.no-gl .gl { display: none; }

/* ---------- Cursor ---------- */
.cursor { position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1px solid var(--cream); border-radius: 50%; pointer-events: none; z-index: 50; mix-blend-mode: difference; transition: width 0.25s, height 0.25s, margin 0.25s, background 0.25s, opacity 0.3s; opacity: 0; }
.cursor.on { opacity: 1; }
.cursor.big { width: 76px; height: 76px; margin: -38px 0 0 -38px; background: var(--cream); }
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------- Header ---------- */
.hdr { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 2rem; padding: 1.4rem clamp(1.2rem, 4vw, 3rem); transition: padding 0.4s, background 0.4s, backdrop-filter 0.4s; }
.hdr.scrolled { padding-top: 0.9rem; padding-bottom: 0.9rem; background: rgba(6, 17, 29, 0.45); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); }
.brand { display: block; width: 116px; color: var(--cream); }
.brand svg { display: block; width: 100%; height: auto; fill: currentColor; }
.nav { margin-left: auto; display: flex; gap: clamp(1rem, 2.4vw, 2.2rem); font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; }
.nav a { position: relative; opacity: 0.8; transition: opacity 0.3s; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--sun); transform: scaleX(0); transform-origin: right; transition: transform 0.45s cubic-bezier(0.7, 0, 0.2, 1); }
.nav a:hover, .nav a.active { opacity: 1; }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); transform-origin: left; }
.clock { font-size: 0.78rem; letter-spacing: 0.14em; font-variant-numeric: tabular-nums; opacity: 0.8; display: flex; align-items: center; gap: 0.5rem; }
.clock .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 10px var(--sun); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---------- Layout ---------- */
main { position: relative; z-index: 2; }
section { position: relative; padding: clamp(6rem, 16vh, 12rem) clamp(1.2rem, 6vw, 6rem); }
.kicker { font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--sun-soft); margin-bottom: 1.6rem; }
h2 { font-size: clamp(2.6rem, 7vw, 6.4rem); line-height: 0.95; letter-spacing: -0.035em; font-weight: 700; }

/* reveal */
.js .rv { opacity: 0; transform: translateY(40px); transition: opacity 1.1s cubic-bezier(0.2, 0.7, 0.1, 1), transform 1.1s cubic-bezier(0.2, 0.7, 0.1, 1); }
.js .rv.in, .js .rv:focus-visible { opacity: 1; transform: none; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 4px; border-radius: 4px; }

/* ---------- Hero ---------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; padding-top: 11vh; padding-bottom: 0; text-align: center; }
.mark { width: min(84vw, calc(56vw + 140px), 860px, 98vh); position: relative; filter: drop-shadow(0 18px 50px rgba(0, 0, 0, 0.35)); }
.mark svg { display: block; width: 100%; height: auto; fill: var(--cream); clip-path: inset(0 100% 0 0); animation: wipe 1.6s 0.25s cubic-bezier(0.77, 0, 0.18, 1) forwards; transform: perspective(900px) rotateX(calc(var(--my) * -6deg)) rotateY(calc(var(--mx) * 8deg)); }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }
.group { position: absolute; right: 0.2em; bottom: -1.5em; font-size: clamp(0.8rem, 1.6vw, 1.15rem); letter-spacing: 0.6em; text-transform: uppercase; font-weight: 500; color: var(--sun-soft); opacity: 0; animation: fade 1s 1.5s forwards; }
@keyframes fade { to { opacity: 1; } }
.hero .tag { margin-top: auto; margin-bottom: max(19vh, calc(var(--boy) + 4vh)); font-size: clamp(1.05rem, 2vw, 1.5rem); color: var(--mute); letter-spacing: 0.02em; }
.cue { position: absolute; bottom: 4vh; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.8rem; font-size: 0.7rem; letter-spacing: 0.4em; text-transform: uppercase; opacity: 0.7; }
.cue i { width: 1px; height: 56px; background: linear-gradient(var(--cream), transparent); animation: drip 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Manifesto (scroll-scrubbed words) ---------- */
.manifesto { min-height: 120vh; display: flex; flex-direction: column; justify-content: center; max-width: 1280px; margin: 0 auto; }
.kicker, .scrub { text-shadow: 0 2px 28px rgba(3, 8, 14, 0.6); }
.scrub { font-size: clamp(2rem, 5.2vw, 4.6rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 600; }
.js .w { opacity: 0.24; transition: opacity 0.5s, color 0.5s, text-shadow 0.5s; }
.w.on { opacity: 1; }
.w.hot { color: var(--sun-soft); text-shadow: 0 0 40px rgba(239, 136, 38, 0.45); }

/* ---------- Focus cards (3D tilt) ---------- */
.focus { max-width: 1400px; margin: 0 auto; }
.focus h2 { margin-bottom: clamp(3rem, 8vh, 5rem); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 1.6rem); perspective: 1200px; }
.card {
  position: relative; min-height: 420px; padding: 2.2rem; border-radius: 22px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(160deg, rgba(246, 239, 230, 0.09), rgba(246, 239, 230, 0.02));
  border: 1px solid var(--line); -webkit-backdrop-filter: blur(18px) saturate(130%); backdrop-filter: blur(18px) saturate(130%);
  transform-style: preserve-3d; will-change: transform;
}
.card.rv.in { transition: opacity 1.1s, transform 0.25s ease-out; }
.card:nth-child(2) { transition-delay: 0.08s; }
.card:nth-child(3) { transition-delay: 0.16s; }
.card .num { position: absolute; top: 1.6rem; left: 2.2rem; font-size: 0.8rem; letter-spacing: 0.3em; color: var(--sun-soft); transform: translateZ(40px); }
.card h3 { font-size: clamp(2rem, 3.4vw, 3rem); letter-spacing: -0.03em; line-height: 1; margin-bottom: 1rem; transform: translateZ(60px); }
.card p { color: var(--mute); max-width: 32ch; transform: translateZ(30px); }
.card::before { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -80px; border-radius: 50%; background: radial-gradient(circle, rgba(239, 136, 38, 0.55), transparent 65%); filter: blur(10px); transform: translateZ(10px); }
.glare { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px circle at calc(var(--gx, 50) * 1%) calc(var(--gy, 50) * 1%), rgba(255, 255, 255, 0.16), transparent 45%); opacity: 0; transition: opacity 0.3s; }
.card:hover .glare { opacity: 1; }

/* ---------- Marquee ---------- */
.marquee { position: relative; z-index: 2; overflow: hidden; padding: 2.2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(6, 17, 29, 0.35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.marquee-track { display: flex; width: max-content; gap: 2.4rem; align-items: center; animation: slide 38s linear infinite; transform: skewX(var(--skew, 0deg)); }
.marquee span { font-size: clamp(2.4rem, 6vw, 5.4rem); font-weight: 700; letter-spacing: -0.03em; text-transform: uppercase; color: transparent; -webkit-text-stroke: 1px rgba(246, 239, 230, 0.7); }
.marquee span:nth-of-type(2n) { color: var(--cream); -webkit-text-stroke: 0; }
.marquee b { color: var(--sun); font-size: 2rem; }
@keyframes slide { to { translate: -50% 0; } }

/* ---------- Horizon (3D statement) ---------- */
.horizon { min-height: 130vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.deep { perspective: 700px; }
.tilt3d {
  font-size: clamp(3.4rem, 12vw, 11rem); line-height: 0.88; letter-spacing: -0.05em; font-weight: 800;
  transform: rotateX(var(--rx, 40deg)) translateZ(var(--tz, -200px)); transform-origin: 50% 100%;
  background: linear-gradient(180deg, var(--cream) 30%, var(--sun) 120%); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 30px 80px rgba(239, 136, 38, 0.18);
}
.horizon p { margin-top: 5.5rem; max-width: 44ch; color: var(--mute); font-size: clamp(1.05rem, 1.8vw, 1.35rem); }

/* ---------- Contact ---------- */
.contact { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; max-width: 1280px; margin: 0 auto; }
.contact em { font-style: normal; color: var(--sun-soft); }
.btn { align-self: flex-start; margin-top: 3rem; display: inline-flex; gap: 0.8rem; align-items: center; padding: 1.2rem 2.2rem; border-radius: 999px; border: 1px solid var(--cream); font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; position: relative; overflow: hidden; isolation: isolate; transition: color 0.4s; }
.btn::before { content: ""; position: absolute; inset: 0; background: var(--cream); border-radius: inherit; transform: translateY(101%); transition: transform 0.45s cubic-bezier(0.7, 0, 0.2, 1); z-index: -1; }
.btn:hover { color: var(--ink); }
.btn:hover::before { transform: none; }
.magnet { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.1, 1); }
.js .btn.rv { transition: opacity 1.1s, transform 0.35s cubic-bezier(0.2, 0.7, 0.1, 1), color 0.4s; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Footer ---------- */
.foot { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; justify-content: space-between; padding: 2rem clamp(1.2rem, 6vw, 6rem) 2.4rem; border-top: 1px solid var(--line); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--mute); background: rgba(3, 8, 14, 0.6); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .clock { margin-left: auto; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 300px; }
  .hero { padding-top: 14vh; }
  :root { --boy: min(22vh, 60vw); }
  .cue { left: auto; right: 6vw; transform: none; }
}

@media (max-height: 520px) { .cue { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; }
  .mirror use { filter: none; }
  .cursor { display: none; }
  .mark svg { clip-path: none; transform: none; }
  .group { opacity: 1; }
  .js .w { opacity: 1; }
  .tilt3d { transform: none; }
  .marquee-track { transform: none; }
}
