/* THE FLIGHT — main stylesheet */
@import url("https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@800,500&f[]=satoshi@400,500,700&display=swap");

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--night);
  color: var(--moon);
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Cabinet Grotesk", sans-serif; font-weight: 800; margin: 0; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--night); }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: var(--z-preloader);
  background: var(--night);
  display: grid; place-items: center;
}
.preloader__horizon {
  position: absolute; left: 8vw; right: 8vw; top: 50%; height: 1px;
  background: var(--hair);
  transform: scaleX(0); transform-origin: left center;
}
.preloader__mark {
  width: 42px; height: 42px; color: var(--gold);
  background: currentColor;
  -webkit-mask: url("../assets/logo.svg") center / contain no-repeat;
          mask: url("../assets/logo.svg") center / contain no-repeat;
  transform: translateY(6px);
}
.preloader__count {
  position: absolute; right: 8vw; bottom: 8vh;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em;
  color: var(--moon-faint);
}
noscript ~ .preloader, html.no-js .preloader { display: none; }
.preloader { transition: opacity 0.8s var(--ease-inout), visibility 0.8s; }
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }

/* Hero intro — armed only when JS adds html.anim; released by html.intro.
   Pure CSS transitions: can never strand the hero hidden. */
html.anim .hero__title .line,
html.anim .hero__eyebrow, html.anim .hero__sub, html.anim .hero__hint {
  opacity: 0; transform: translateY(46px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
}
html.anim .hero__title .line:nth-child(2) { transition-delay: 0.12s; }
html.anim .hero__eyebrow { transition-delay: 0.35s; }
html.anim .hero__sub { transition-delay: 0.45s; }
html.anim .hero__hint { transition-delay: 0.55s; }
html.anim.intro .hero__title .line,
html.anim.intro .hero__eyebrow, html.anim.intro .hero__sub, html.anim.intro .hero__hint {
  opacity: 1; transform: none;
}

/* ---------- Skip link ---------- */
.skip {
  position: fixed; top: -100%; left: 50%; transform: translateX(-50%);
  z-index: calc(var(--z-preloader) + 1);
  background: var(--gold); color: var(--night);
  padding: 10px 18px; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 14px;
  transition: top 0.2s var(--ease-out);
}
.skip:focus-visible { top: 12px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 48px);
}
.nav__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav__mark, .footer__mark {
  width: 26px; height: 26px; color: var(--gold); background: currentColor;
  -webkit-mask: url("../assets/logo.svg") center / contain no-repeat;
          mask: url("../assets/logo.svg") center / contain no-repeat;
  display: inline-block;
}
.nav__word {
  font-family: "Cabinet Grotesk", sans-serif; font-weight: 800;
  letter-spacing: 0.14em; font-size: 17px;
  text-shadow: 0 1px 12px rgba(6, 14, 18, 0.8);
}
.nav__links { display: flex; gap: clamp(14px, 2.4vw, 30px); }
.nav__links a {
  text-decoration: none; font-size: 14px; font-weight: 500;
  color: var(--moon-dim);
  text-shadow: 0 1px 10px rgba(6, 14, 18, 0.9);
  transition: color 0.25s var(--ease-out);
}
.nav__links a:hover, .nav__links a:focus-visible { color: var(--gold); }
.nav__right { display: flex; align-items: center; gap: 16px; }
.nav__lang { text-decoration: none; font-size: 14px; color: var(--moon-dim); }
.nav__lang:hover { color: var(--gold); }
.nav__cta {
  text-decoration: none; font-size: 14px; font-weight: 700;
  color: var(--night); background: var(--gold);
  padding: 9px 18px; border-radius: 999px;
  transition: transform 0.3s var(--ease-out), background 0.25s;
}
.nav__cta:hover { background: var(--moon); transform: translateY(-2px); }

/* ---------- Flight stage (persistent canvas) ---------- */
.flight-stage { position: fixed; inset: 0; z-index: var(--z-canvas); }
#flight { width: 100%; height: 100%; display: block; }
/* Warm ground-glow framing the screen edges — full at takeoff and landing,
   gone at cruising altitude (JS drives opacity with the flight) */
.flight-stage__vignette {
  position: absolute; inset: 0; pointer-events: none; opacity: 1;
  background:
    radial-gradient(115% 88% at 50% 46%, transparent 56%, rgba(126, 78, 34, 0.38) 86%, rgba(186, 122, 58, 0.55) 100%),
    linear-gradient(to top, rgba(150, 96, 44, 0.42), transparent 24%);
  transition: opacity 0.35s linear;
}

.flight-stage__grain {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* ---------- Chapters ---------- */
main { position: relative; z-index: var(--z-content); }
.chapter {
  position: relative; min-height: 100vh; padding: 18vh clamp(20px, 6vw, 90px);
  text-shadow: 0 2px 26px rgba(6, 14, 18, 0.8), 0 0 10px rgba(6, 14, 18, 0.55);
}
.chapter form, .chapter .btn { text-shadow: none; }
.chapter__head h2 {
  font-size: clamp(34px, 5.4vw, 76px); line-height: 1.02;
  letter-spacing: -0.01em; text-wrap: balance;
}
.chapter__head p { color: var(--moon-dim); margin-top: 14px; }

/* Hero */
.chapter--hero {
  display: grid; align-items: end;
  min-height: 100svh; padding-bottom: 10vh;
}
.hero__eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--gold);
  margin: 0 0 18px;
}
.hero__title {
  font-size: clamp(44px, 9vw, 132px); line-height: 0.96;
  letter-spacing: -0.015em; text-transform: uppercase;
}
.hero__title .line { display: block; overflow: clip; }
.hero__title em { font-style: normal; color: var(--gold); }
.hero__sub { max-width: 44ch; color: var(--moon-dim); font-size: clamp(16px, 1.6vw, 20px); margin-top: 22px; }
.hero__hint {
  position: absolute; bottom: 4vh; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--moon-faint);
}

/* Manifesto */
.chapter--manifesto { display: grid; place-items: center; }
.manifesto__text {
  max-width: 22ch; margin: 0 auto;
  font-family: "Cabinet Grotesk", sans-serif; font-weight: 500;
  font-size: clamp(26px, 4vw, 54px); line-height: 1.22; text-align: center;
  text-wrap: balance;
}
.manifesto__text .acc { color: var(--gold); }

/* Services — landmarks */
.landmarks { list-style: none; margin: 10vh 0 0; padding: 0; display: grid; gap: 2px; }
.landmark {
  border-top: 1px solid var(--hair);
  padding: clamp(22px, 3.4vh, 40px) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px;
  background: linear-gradient(90deg, transparent, transparent);
  transition: padding-left 0.4s var(--ease-out);
}
.landmark:last-child { border-bottom: 1px solid var(--hair); }
.landmark:hover { padding-left: 14px; }
.landmark h3 { font-size: clamp(26px, 3.6vw, 52px); letter-spacing: -0.01em; }
.landmark p { margin: 0; color: var(--moon-dim); align-self: center; }

/* Process — gates */
.gates { list-style: none; margin: 12vh 0 0; padding: 0; display: grid; gap: clamp(40px, 12vh, 120px); }
.gate { max-width: 560px; }
.gate span {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.24em;
  color: var(--gold);
}
.gate h3 { font-size: clamp(28px, 4vw, 56px); margin: 6px 0 10px; }
.gate p { margin: 0; color: var(--moon-dim); }
.gate:nth-child(even) { justify-self: end; }

/* Why — ledger */
.ledger { list-style: none; margin: 10vh 0 0; padding: 0; }
.ledger li {
  position: relative;
  border-top: 1px solid var(--hair);
  padding: clamp(24px, 4vh, 44px) 140px clamp(24px, 4vh, 44px) 0;
}
.ledger li:last-child { border-bottom: 1px solid var(--hair); }
.ledger h3 { font-size: clamp(20px, 2.6vw, 34px); }
.ledger p { margin: 8px 0 0; color: var(--moon-dim); max-width: 60ch; }
.badge {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--hair); color: var(--moon-dim);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.badge--gold { border-color: var(--gold); color: var(--gold); }

/* Contact */
.chapter--contact { display: grid; place-items: center; text-align: center; }
.contact__title {
  font-size: clamp(42px, 8vw, 118px); line-height: 0.98;
  text-transform: uppercase; letter-spacing: -0.015em;
}
.contact__title em { font-style: normal; color: var(--gold); }
.contact__lead { color: var(--moon-dim); margin: 22px 0 40px; }
.contact__form {
  width: min(520px, 100%); text-align: left; display: grid; gap: 18px;
  background: rgba(6, 14, 18, 0.58);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hair); border-radius: 18px;
  padding: clamp(20px, 3.4vw, 34px);
}
.hp { position: absolute; left: -9999px; }
.field { display: grid; gap: 6px; }
.field label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--moon-faint);
}
.field input, .field textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--hair);
  color: var(--moon); font: inherit; padding: 8px 2px;
  transition: border-color 0.25s;
}
.field input:focus-visible, .field textarea:focus-visible {
  outline: none; border-bottom-color: var(--gold);
}
.btn {
  justify-self: start; cursor: pointer;
  font: 700 15px "Satoshi", sans-serif;
  color: var(--night); background: var(--gold);
  border: 0; border-radius: 999px; padding: 14px 30px;
  transition: transform 0.35s var(--ease-out), background 0.25s;
}
.btn:hover { background: var(--moon); transform: translateY(-2px); }
.contact__alt { display: flex; gap: 28px; margin-top: 34px; }
.contact__alt a { color: var(--moon-dim); text-decoration: none; border-bottom: 1px solid var(--hair); padding-bottom: 2px; }
.contact__alt a:hover { color: var(--gold); border-color: var(--gold); }

/* Footer */
.footer {
  position: relative; z-index: var(--z-content);
  padding: 40px clamp(20px, 6vw, 90px) 50px;
  border-top: 1px solid var(--hair);
  background: var(--night);
  display: grid; gap: 8px; justify-items: start;
  font-size: 13px; color: var(--moon-faint);
}
.footer p { margin: 0; }
.footer__line { color: var(--moon-dim); }

/* Chapter reveal — .reveal is added by JS only, so text can never be
   stranded hidden without it */
.chapter.reveal > * {
  opacity: 0; transform: translateY(38px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.chapter.reveal > *:nth-child(2) { transition-delay: 0.09s; }
.chapter.reveal > *:nth-child(3) { transition-delay: 0.18s; }
.chapter.reveal > *:nth-child(4) { transition-delay: 0.27s; }
.chapter.reveal > *:nth-child(5) { transition-delay: 0.36s; }
.chapter.reveal.in > * { opacity: 1; transform: none; }

/* Focus ring */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .nav__links { display: none; }
  .landmark { grid-template-columns: 1fr; gap: 8px; }
  .ledger li { padding-right: 0; padding-bottom: 60px; }
  .badge { top: auto; bottom: 20px; transform: none; }
  .gate:nth-child(even) { margin-left: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .preloader { display: none; }
  html { scroll-behavior: auto; }
}
