*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

:root {
  --sans:  'Helvetica Neue', Helvetica, 'Arial Nova', Arial, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --mono:  ui-monospace, 'SF Mono', 'Menlo', 'Roboto Mono', monospace;
  --ink:   #060608;
  --paper: #f2efe9;
  --frame: rgba(242,239,233,0.16);
  --m:     clamp(16px, 2.2vw, 30px);
  --ease:  cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── LOADER ─────────────────────────────────────────── */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1s var(--ease), visibility 1s;
}
#loader.out { opacity: 0; visibility: hidden; pointer-events: none; }

.l-inner { display: flex; flex-direction: column; align-items: center; gap: 44px; }

.l-wordmark {
  font-family: var(--sans);
  font-size: clamp(13px, 1.8vw, 17px);
  font-weight: 300;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--paper);
}

.l-bar-wrap { width: min(320px, 80vw); display: flex; flex-direction: column; gap: 10px; }

.l-track {
  height: 1px;
  background: rgba(242,239,233,0.12);
  border-radius: 99px;
  overflow: hidden;
}
.l-fill {
  height: 100%; width: 0%;
  background: var(--paper);
  transition: width .12s ease;
  border-radius: 99px;
}
.l-meta {
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(242,239,233,0.4);
}
#l-pct { color: var(--paper); font-variant-numeric: tabular-nums; }

/* ── SCROLL ZONE ─────────────────────────────────────── */
#sz { position: relative; height: 2500px; }

#sticky {
  position: sticky; top: 0;
  width: 100%; height: 100vh;
  padding: var(--m);
}

/* ── CINEMATIC FRAME ─────────────────────────────────── */
.frame {
  position: relative;
  width: 100%; height: 100%;
  border: 1px solid var(--frame);
  overflow: hidden;
}

#c {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

.dim {
  position: absolute; inset: 0;
  background: rgba(6,6,9,0.28);
  pointer-events: none;
}

.vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(125% 105% at 50% 40%, transparent 36%, rgba(4,4,7,0.72) 100%);
}

.grain {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 8;
  opacity: 0.45; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

/* ── TOP STRIP ───────────────────────────────────────── */
.tech {
  position: absolute;
  top: clamp(18px, 2.4vw, 30px);
  left: clamp(22px, 3vw, 42px);
  right: clamp(22px, 3vw, 42px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }

.rec {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--paper);
  animation: blink 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

.wordmark {
  font-size: 13px; letter-spacing: 0.36em;
  font-weight: 300; white-space: nowrap;
}

.spec {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.28em;
  color: rgba(242,239,233,0.45);
  white-space: nowrap;
}

.tech nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 38px); }
.tech nav a {
  color: rgba(242,239,233,0.65);
  text-decoration: none;
  font-weight: 300; font-size: 11.5px;
  letter-spacing: 0.18em;
  transition: color .3s;
  white-space: nowrap;
}
.tech nav a:hover { color: var(--paper); }

/* ── SCENE LABEL ─────────────────────────────────────── */
.cv-scene {
  position: absolute;
  right: clamp(22px, 3vw, 42px);
  bottom: clamp(80px, 10vh, 120px);
  z-index: 10; text-align: right; pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.cv-scene.hide { opacity: 0; transform: translateY(8px); }

.cv-sn {
  font-family: var(--mono);
  font-size: 9px; letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(242,239,233,0.35); margin-bottom: 4px;
}
.cv-sl {
  font-family: var(--serif);
  font-size: clamp(14px, 2vw, 20px); font-style: italic;
  color: rgba(242,239,233,0.65);
}

/* ── FRAME COUNTER HUD ───────────────────────────────── */
.cv-hud {
  position: absolute;
  bottom: clamp(80px, 10vh, 120px);
  left: clamp(22px, 3vw, 42px);
  z-index: 10;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.2em;
  color: rgba(242,239,233,0.28);
  pointer-events: none;
}

/* ── LOCKUP ──────────────────────────────────────────── */
.lockup {
  position: absolute;
  left: clamp(24px, 4vw, 64px);
  bottom: clamp(96px, 14vh, 160px);
  z-index: 10;
  max-width: min(90vw, 820px);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 0.4em;
  color: rgba(242,239,233,0.52);
  margin-bottom: clamp(14px, 2vw, 22px);
}

.lockup h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 5.4vw, 80px);
  line-height: 1.06; letter-spacing: -0.01em;
}
.lockup h1 em { font-style: italic; font-weight: 300; }

.sub {
  margin-top: clamp(24px, 3vw, 40px);
  font-weight: 200;
  font-size: clamp(13px, 1.2vw, 16px);
  letter-spacing: 0.02em;
  color: rgba(242,239,233,0.6);
  max-width: 30em; line-height: 1.58;
}

/* ── CONTROL BAR ─────────────────────────────────────── */
.bar {
  position: absolute;
  left: clamp(22px, 3vw, 42px);
  right: clamp(22px, 3vw, 42px);
  bottom: clamp(18px, 2.4vw, 28px);
  z-index: 10;
}

.track {
  height: 1px;
  background: rgba(242,239,233,0.18);
  position: relative;
  margin-bottom: clamp(14px, 1.6vw, 20px);
}

.cv-prog {
  position: absolute; left: 0; top: 0;
  height: 1px; width: 0%;
  background: var(--paper);
  transition: width .05s linear;
}

.controls {
  display: flex; justify-content: space-between; align-items: center;
}

.ctrl-left { display: flex; align-items: center; gap: 18px; }

.play {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(242,239,233,0.4);
  background: transparent; color: var(--paper);
  cursor: pointer; position: relative;
  display: flex; align-items: center; justify-content: center;
  transition: background .35s, color .35s, border-color .35s;
  flex-shrink: 0;
}
.play:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.play:focus-visible { outline: 1px solid rgba(242,239,233,0.6); outline-offset: 3px; }

.tri {
  width: 0; height: 0; margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.tc {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.16em;
  color: rgba(242,239,233,0.6);
  min-width: 9ch;
}

.reel {
  font-size: 11px; letter-spacing: 0.28em;
  font-weight: 300; color: rgba(242,239,233,0.5);
  white-space: nowrap;
}

.lang { display: flex; align-items: center; gap: 4px; }
.lang button {
  background: none; border: none; cursor: pointer;
  padding: 0 2px;
  font-family: var(--sans); font-weight: 300;
  font-size: 11.5px; letter-spacing: 0.16em;
  color: var(--paper); opacity: 0.38;
  transition: opacity .3s;
}
.lang button.on { opacity: 1; }
.lang button:hover { opacity: 0.75; }
.lang .sep { opacity: 0.25; font-size: 10px; color: var(--paper); user-select: none; }

/* ── POST-SCROLL SECTIONS ────────────────────────────── */
#after {
  padding: 120px 40px 100px;
  text-align: center; position: relative; overflow: hidden;
}
.af-line {
  width: 1px; height: 60px;
  background: linear-gradient(to bottom, rgba(242,239,233,0.5), transparent);
  margin: 0 auto 56px;
}
.af-h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 54px); font-weight: 300; font-style: italic;
  letter-spacing: -0.01em; color: var(--paper); line-height: 1.2; margin-bottom: 20px;
}
.af-body {
  font-size: clamp(13px, 1.5vw, 16px); font-weight: 300;
  color: rgba(242,239,233,0.58);
  line-height: 1.82; max-width: 500px; margin: 0 auto 50px;
  letter-spacing: 0.02em;
}
.btn-cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 36px;
  border: 1px solid rgba(242,239,233,0.4); color: var(--paper);
  font-size: 10px; font-weight: 300; letter-spacing: 0.28em;
  text-transform: uppercase; text-decoration: none; border-radius: 1px;
  position: relative; overflow: hidden; cursor: pointer;
  transition: color .38s, border-color .38s, transform .28s var(--ease);
}
.btn-cta::before {
  content: ''; position: absolute; inset: 0; background: var(--paper);
  transform: scaleX(0); transform-origin: left;
  transition: transform .42s cubic-bezier(.4,0,.2,1); z-index: -1;
}
.btn-cta:hover { color: var(--ink); border-color: var(--paper); transform: translateY(-2px); }
.btn-cta:hover::before { transform: scaleX(1); }
.btn-cta svg { width: 13px; height: 13px; stroke: currentColor; transition: transform .28s var(--ease); }
.btn-cta:hover svg { transform: translateX(4px); }

/* ── STATS ───────────────────────────────────────────── */
#stats {
  padding: 80px 40px;
  border-top:    1px solid rgba(242,239,233,0.07);
  border-bottom: 1px solid rgba(242,239,233,0.07);
}
.stats-row {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 64px; max-width: 960px; margin: 0 auto;
}
.stat { text-align: center; }
.stat-n {
  font-family: var(--serif);
  font-size: clamp(44px, 7vw, 70px); font-weight: 300;
  line-height: 1; color: var(--paper); margin-bottom: 8px;
}
.stat-n em { font-style: normal; color: rgba(242,239,233,0.45); }
.stat-l {
  font-family: var(--mono);
  font-size: 9px; letter-spacing: 0.28em;
  text-transform: uppercase; color: rgba(242,239,233,0.4);
}

/* ── SERVICES ────────────────────────────────────────── */
#services { padding: 120px 40px; }
.svc-wrap { max-width: 1200px; margin: 0 auto; }

.sec-eye {
  font-family: var(--mono);
  font-size: 9.5px; letter-spacing: 0.44em;
  text-transform: uppercase; color: rgba(242,239,233,0.4); margin-bottom: 14px;
}
.sec-h {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 52px); font-weight: 300; font-style: italic;
  letter-spacing: -0.01em; color: var(--paper); margin-bottom: 56px;
}

.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }

.svc {
  background: rgba(242,239,233,0.03); border: 1px solid rgba(242,239,233,0.07);
  border-radius: 2px; padding: 38px 32px;
  position: relative; overflow: hidden; cursor: pointer;
  transition: transform .3s var(--ease), border-color .3s;
}
.svc::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242,239,233,0.28), transparent);
  opacity: 0; transition: opacity .3s;
}
.svc:hover { transform: translateY(-5px); border-color: rgba(242,239,233,0.16); }
.svc:hover::after { opacity: 1; }

.svc-n {
  position: absolute; top: 26px; right: 26px;
  font-family: var(--mono);
  font-size: 9.5px; letter-spacing: .12em; color: rgba(242,239,233,0.15);
}
.svc-ico { width: 38px; height: 38px; margin-bottom: 20px; color: var(--paper); opacity: 0.45; }
.svc-ttl {
  font-family: var(--serif);
  font-size: 20px; font-weight: 300; font-style: italic;
  color: var(--paper); margin-bottom: 10px;
}
.svc-desc { font-size: 13px; font-weight: 300; color: rgba(242,239,233,0.52); line-height: 1.76; }

/* ── MANIFESTO ───────────────────────────────────────── */
#manifesto {
  padding: 120px 40px;
  text-align: center; max-width: 840px; margin: 0 auto;
}
.mani-q {
  font-family: var(--serif);
  font-size: clamp(18px, 2.8vw, 32px); font-weight: 300; font-style: italic;
  line-height: 1.6; color: rgba(242,239,233,0.68);
}
.mani-q strong { color: var(--paper); font-style: normal; font-weight: 400; }
.mani-sig {
  margin-top: 44px;
  font-family: var(--mono);
  font-size: 9.5px; letter-spacing: 0.36em;
  text-transform: uppercase; color: rgba(242,239,233,0.28);
}

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  padding: 56px 52px;
  border-top: 1px solid rgba(242,239,233,0.07);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 24px;
}
.ft-logo {
  font-size: 13px; font-weight: 300; letter-spacing: 0.32em;
  text-transform: uppercase; text-decoration: none; color: var(--paper);
}
.ft-links { display: flex; gap: 28px; list-style: none; }
.ft-links a {
  font-family: var(--mono);
  font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(242,239,233,0.4);
  text-decoration: none; transition: color .15s;
}
.ft-links a:hover { color: var(--paper); }
.ft-copy {
  font-family: var(--mono);
  font-size: 9.5px; letter-spacing: .1em; color: rgba(242,239,233,0.22);
}

/* ── FADE-UP ─────────────────────────────────────────── */
.fu {
  opacity: 0; transform: translateY(24px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.fu.on { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: .1s; }
.d2 { transition-delay: .2s; }
.d3 { transition-delay: .3s; }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  .spec, .reel        { display: none; }
  .tech nav a:not(:last-child) { display: none; }
  .controls           { flex-wrap: wrap; gap: 14px; }
  .lockup             { bottom: clamp(120px, 14vh, 180px); }
  footer              { flex-direction: column; text-align: center; padding: 40px 22px; }
  .ft-links           { flex-wrap: wrap; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
