/* ============ Parabellum cinematic ============
   void #04040F | signal #E6E9F2 | violet #7C3AED | cyan #22D3EE | steel #8A93A6
================================================= */

:root {
  --void: #04040F;
  --signal: #E6E9F2;
  --violet: #7C3AED;
  --cyan: #22D3EE;
  --steel: #8A93A6;
  --glass: rgba(124, 58, 237, 0.06);
  --glass-line: rgba(124, 58, 237, 0.28);
  --display: "Archivo", sans-serif;
  --body: "Instrument Sans", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--void); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--void);
  color: var(--signal);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--violet); color: var(--signal); }

.mono { font-family: var(--mono); }
em { font-style: normal; color: var(--violet); }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--void);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader__inner { width: min(320px, 70vw); text-align: left; }
.loader__mono {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.35em;
  color: var(--cyan);
}
.loader__bar {
  margin-top: 14px; height: 1px; background: rgba(230, 233, 242, 0.12);
  overflow: hidden;
}
.loader__bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}

/* ---------- HUD (signature) ---------- */
.hud {
  position: fixed; right: clamp(16px, 3vw, 40px); bottom: clamp(16px, 3vw, 32px);
  z-index: 40; text-align: right;
  color: var(--cyan);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
  pointer-events: none;
}
body.ready .hud { opacity: 1; transform: none; }
.hud__readout {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  color: var(--steel);
}
.hud__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.hud__trace { width: 120px; height: 24px; margin-top: 6px; opacity: 0.9; }

/* ---------- Overlays ---------- */
.grain {
  position: fixed; inset: -100%; z-index: 60; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}
.vignette {
  position: fixed; inset: 0; z-index: 55; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(2, 2, 8, 0.55) 100%);
}

/* ---------- Topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(18px, 3vw, 28px) clamp(20px, 4vw, 48px);
  mix-blend-mode: normal;
}
.topbar__brand {
  font-family: var(--display); font-variation-settings: "wdth" 125, "wght" 800;
  letter-spacing: 0.18em; font-size: 15px;
  color: var(--signal); text-decoration: none;
}
.topbar__nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.mono-link {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  color: var(--steel); text-decoration: none;
  transition: color 0.25s ease;
}
.mono-link:hover { color: var(--cyan); }
.mono-link--accent { color: var(--violet); }
.mono-link--accent:hover { color: var(--cyan); }

/* ---------- Shared ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.35em;
  color: var(--cyan); margin-bottom: 22px;
}
.eyebrow--center { text-align: center; }
.section-title {
  font-family: var(--display);
  font-variation-settings: "wdth" 120, "wght" 850;
  font-size: clamp(34px, 5.5vw, 72px);
  line-height: 0.98; letter-spacing: 0.005em;
  text-transform: uppercase;
}
.btn {
  display: inline-block; text-decoration: none;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
  padding: 16px 30px; border-radius: 2px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.btn--primary {
  background: var(--violet); color: #fff;
  box-shadow: 0 0 0 rgba(124, 58, 237, 0);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.45);
}
.btn--ghost {
  color: var(--signal);
  border: 1px solid rgba(230, 233, 242, 0.22);
  background: rgba(230, 233, 242, 0.02);
  backdrop-filter: blur(6px);
}
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: 1; }
.hero__media video {
  width: 100%; height: 100%; object-fit: cover;
  object-position: 72% 50%;
  filter: brightness(0.85);
}
@media (max-width: 900px) {
  .hero__media video { object-position: 60% 50%; }
}
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 4, 15, 0.55) 0%, rgba(4, 4, 15, 0.15) 40%, rgba(4, 4, 15, 0.92) 100%),
    linear-gradient(90deg, rgba(4, 4, 15, 0.6) 0%, transparent 55%);
}
.hero__particles { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; }
.hero__content {
  position: relative; z-index: 3;
  padding: clamp(90px, 12vh, 140px) clamp(20px, 6vw, 96px) 90px;
  max-width: 1100px;
}
.hero__title {
  font-family: var(--display);
  font-variation-settings: "wdth" 122, "wght" 880;
  font-size: clamp(38px, 6vw, 88px);
  line-height: 0.98; text-transform: uppercase;
  letter-spacing: 0.002em;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .hero__title { white-space: normal; }
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: inline-block; will-change: transform; }
.hero__sub {
  margin-top: 26px; max-width: 520px;
  color: var(--steel); font-size: clamp(15px, 1.4vw, 18px);
}
.hero__cta { margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero__scrollhint {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: clamp(20px, 4vw, 40px);
  z-index: 3; text-align: center;
  font-size: 10px; letter-spacing: 0.32em; color: var(--steel);
}
@media (max-height: 700px), (max-width: 640px) {
  .hero__scrollhint { display: none; }
}
.hero__scrollhint::after {
  content: ""; display: block; width: 1px; height: 34px;
  margin-top: 10px; margin-left: auto; margin-right: auto;
  background: linear-gradient(180deg, var(--cyan), transparent);
  animation: drop 1.8s ease-in-out infinite;
}
@keyframes drop { 0% { transform: scaleY(0); transform-origin: top; } 60% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Manifesto ---------- */
.manifesto {
  position: relative;
  background: var(--void);
  padding: 0 clamp(20px, 6vw, 96px);
  display: flex; align-items: center; justify-content: center;
  min-height: 100svh;
}
.manifesto__inner { max-width: 1200px; }
.manifesto__line {
  font-family: var(--display);
  font-variation-settings: "wdth" 118, "wght" 830;
  font-size: clamp(30px, 5vw, 68px);
  line-height: 1.12; text-transform: uppercase;
  color: rgba(230, 233, 242, 0.14);
  margin: clamp(10px, 2vh, 22px) 0;
}
.manifesto__line--accent .word-on { color: var(--violet) !important; }

/* ---------- Machine ---------- */
.machine {
  position: relative; overflow: hidden;
  padding: clamp(100px, 14vh, 180px) clamp(20px, 6vw, 96px);
}
.machine__media { position: absolute; inset: 0; z-index: 1; }
.machine__media video {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.5; filter: brightness(0.8);
}
.machine__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--void) 0%, rgba(4, 4, 15, 0.35) 30%, rgba(4, 4, 15, 0.35) 70%, var(--void) 100%);
}
.machine__inner { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; }
.machine .section-title { text-align: center; margin-bottom: clamp(48px, 8vh, 90px); }
.cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
}
.card {
  position: relative;
  padding: clamp(28px, 3vw, 44px);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 4px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
  will-change: transform;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.05);
}
.card__chan {
  font-size: 10px; letter-spacing: 0.3em; color: var(--cyan);
}
.card h3 {
  font-family: var(--display);
  font-variation-settings: "wdth" 120, "wght" 850;
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: 0.04em;
  margin: 16px 0 14px;
}
.card p { color: var(--steel); font-size: 15px; }

/* ---------- Build log ---------- */
.buildlog { position: relative; background: var(--void); }
.buildlog__pin {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
  padding: clamp(80px, 10vh, 120px) 0;
}
.buildlog__head { padding: 0 clamp(20px, 6vw, 96px); margin-bottom: clamp(40px, 6vh, 70px); }
.buildlog__track {
  display: flex; gap: clamp(16px, 2vw, 28px);
  padding: 0 clamp(20px, 6vw, 96px);
  width: max-content;
}
.log {
  width: clamp(280px, 30vw, 420px);
  flex-shrink: 0;
  padding: clamp(26px, 2.6vw, 40px);
  border: 1px solid rgba(230, 233, 242, 0.1);
  border-radius: 4px;
  background: rgba(230, 233, 242, 0.015);
  transition: border-color 0.3s ease;
}
.log:hover { border-color: var(--glass-line); }
.log__id {
  font-size: 11px; letter-spacing: 0.3em; color: var(--violet);
}
.log h3 {
  font-family: var(--display);
  font-variation-settings: "wdth" 115, "wght" 800;
  font-size: clamp(19px, 1.8vw, 24px);
  text-transform: uppercase; line-height: 1.15;
  margin: 16px 0 12px;
}
.log p { color: var(--steel); font-size: 15px; }
.log--next { border-style: dashed; border-color: rgba(34, 211, 238, 0.3); }
.log--next .log__id { color: var(--cyan); }

/* ---------- CTA ---------- */
.cta {
  position: relative;
  min-height: 90svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 60%, rgba(124, 58, 237, 0.16), transparent 70%),
    var(--void);
  padding: clamp(100px, 12vh, 160px) clamp(20px, 6vw, 96px);
  overflow: hidden;
}
.cta__title {
  font-family: var(--display);
  font-variation-settings: "wdth" 124, "wght" 900;
  font-size: clamp(52px, 10vw, 150px);
  line-height: 0.94; text-transform: uppercase;
}
.cta__sub { margin-top: 26px; color: var(--steel); font-size: clamp(15px, 1.5vw, 18px); }
.cta__actions { margin-top: 44px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid rgba(230, 233, 242, 0.08);
  padding: clamp(32px, 5vh, 56px) clamp(20px, 6vw, 96px);
  background: #030309;
}
.footer__row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
}
.footer__brand {
  font-family: var(--display); font-variation-settings: "wdth" 125, "wght" 800;
  letter-spacing: 0.18em; font-size: 13px;
}
.footer__nav { display: flex; gap: clamp(16px, 3vw, 32px); flex-wrap: wrap; }
.footer__legal {
  margin-top: 26px; font-size: 10px; letter-spacing: 0.08em;
  color: rgba(138, 147, 166, 0.55);
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .buildlog__track {
    width: auto; overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
  }
  .log { scroll-snap-align: start; width: min(78vw, 360px); }
  .hud__trace { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .hud__dot, .hero__scrollhint::after { animation: none; }
  .loader { display: none; }
  .hero__title .line > span { transform: none !important; }
  .manifesto__line { color: var(--signal); }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- Focus ---------- */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
