/* ============ THEODEN INFRASTRUCTURE — light ============ */

:root {
  --ink: #0c1519;         /* from the logo art — now the TYPE color */
  --paper: #f4f5f9;       /* cloud, slightly cooled — the base */
  --paper-2: #eceef4;
  --panel: #e9ebf2;
  --ink-dim: rgba(12, 21, 25, 0.6);
  --ink-soft: rgba(12, 21, 25, 0.55);
  --white: #ffffff;
  --steel: #bcbfcc;
  --smoke: #d3d6e0;
  --graphite: #6e7180;
  --line: rgba(12, 21, 25, 0.14);
  --display: "Cal Sans", sans-serif;
  --body: "Inter", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
}

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

html { scroll-behavior: initial; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* Fonts gate */
main, footer, .nav { visibility: hidden; }
html.is-ready main, html.is-ready footer, html.is-ready .nav { visibility: visible; }
html.is-locked { overflow: hidden; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

a { color: inherit; text-decoration: none; cursor: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

.mono {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.steel { color: var(--graphite); }

/* ---------- Cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 99;
  width: 8px; height: 8px;
  background: var(--ink);
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.cursor-follower {
  position: fixed; top: 0; left: 0; z-index: 98;
  width: 34px; height: 34px;
  border: 1px solid rgba(12,21,25,0.3);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}
.cursor-follower.is-hover { width: 60px; height: 60px; border-color: var(--graphite); }
@media (hover: none) {
  .cursor, .cursor-follower { display: none; }
  body, a { cursor: auto; }
}

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -100%; z-index: 90;
  pointer-events: none; opacity: 0.03;
  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%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0,0); } 20% { transform: translate(-5%,5%); }
  40% { transform: translate(5%,-5%); } 60% { transform: translate(-3%,-3%); } 80% { transform: translate(4%,2%); }
}

/* ---------- Nav ----------
   mix-blend difference: white renders near-ink on paper, near-white on the
   dark media bands — one nav works across the whole light/dark rhythm. */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem 2.5rem;
  mix-blend-mode: difference;
  color: var(--white);
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__logo {
  display: flex; align-items: center; gap: 0.7rem;
  font-family: var(--display);
  font-size: 1.05rem; letter-spacing: 0.22em;
}
.nav__logo svg { width: 34px; height: auto; color: var(--white); }
.nav__links { display: flex; gap: 2.5rem; }
.nav__links a {
  font-family: var(--mono); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.2em;
  position: relative;
  color: var(--white);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: var(--white);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-block;
  font-family: var(--mono); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.25em;
  padding: 1.4rem 3.5rem;
  border: 1px solid rgba(12,21,25,0.4);
  overflow: hidden;
}
.btn__fill {
  position: absolute; inset: 0;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  transform: translateY(101%);
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.btn:hover .btn__fill { transform: translateY(0); }

/* ---------- Page transition wipe (stays ink — the dramatic beat) ---------- */
.wipe {
  position: fixed; inset: 0; z-index: 200;
  background: var(--ink);
  transform: translateY(101%);
  pointer-events: none;
}
.wipe::after {
  content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 15px;
  background: var(--graphite); opacity: 0.4;
}

/* ---------- HERO — ink structure on paper ---------- */
.hero {
  position: relative; height: 100svh; min-height: 640px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
/* the work, waiting behind the paper — revealed by the exit scrub */
.hero__bg { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
.hero__bg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08);
}
.hero__bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,21,25,0.7) 0%, rgba(12,21,25,0.5) 50%, rgba(12,21,25,0.8) 100%);
}
.hero__stage {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 0 1.5rem 6.5rem; /* keeps the centered stage clear of the scroll cue on short viewports */
}
.hero__survey { position: absolute; inset: 0; pointer-events: none; }
.hero__survey-h, .hero__survey-v {
  position: absolute; background: rgba(12,21,25,0.18);
  opacity: 0;
}
.hero__survey-h { left: -50vw; right: -50vw; top: 38%; height: 1px; transform: scaleX(0); }
.hero__survey-v { top: -20vh; bottom: -20vh; left: 50%; width: 1px; transform: scaleY(0); }
.hero__mark { width: clamp(190px, 25vw, 330px); color: var(--ink); }
.hero__mark svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero__mark polygon { opacity: 0; }
.hero__title {
  margin-top: 2rem;
  font-family: var(--display);
  font-size: clamp(2rem, 5.6vw, 5.2rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  font-weight: 400;
}
.hero__line { display: block; overflow: hidden; }
.hero__line--steel { color: var(--graphite); }
.hero__sub {
  margin-top: 1.4rem; max-width: 36rem;
  color: var(--ink-dim);
  font-size: clamp(0.92rem, 1.3vw, 1.05rem);
  opacity: 0; visibility: hidden; transform: translateY(24px);
}
.hero__scroll {
  position: absolute; bottom: 2.5rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  opacity: 0; visibility: hidden;
  z-index: 2;
}
.hero__scroll-line {
  width: 1px; height: 52px;
  background: linear-gradient(to bottom, var(--graphite), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.5); opacity: 0.4; }
}

/* ---------- FIELD TICKER ---------- */
.ticker {
  display: flex; align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.ticker__label {
  flex-shrink: 0;
  padding: 0.9rem 1.5rem;
  border-right: 1px solid var(--line);
  color: var(--graphite);
  white-space: nowrap;
}
.ticker__viewport { overflow: hidden; white-space: nowrap; flex: 1; }
.ticker__track {
  display: inline-flex;
  font-family: var(--mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--ink-soft);
  padding: 0.9rem 0;
}

/* ---------- COMPANIES ---------- */
.companies { position: relative; padding: 9rem 0 7rem; overflow: hidden; }
/* full-section image, crossfaded per hovered row — washed by paper */
.companies__bg { position: absolute; inset: 0; pointer-events: none; }
.companies__bg img { opacity: 0; filter: saturate(0.85); }
.companies__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(244,245,249,0.96) 0%, rgba(244,245,249,0.82) 55%, rgba(244,245,249,0.62) 100%);
}
.companies__inner { position: relative; z-index: 2; }
.companies__header {
  padding: 0 2.5rem; margin-bottom: 4rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.companies__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.1rem, 4.7vw, 4.3rem);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.companies__list { border-top: 1px solid var(--line); }
.co {
  position: relative;
  display: grid;
  grid-template-columns: 5rem 1fr auto 3rem;
  align-items: center; gap: 2rem;
  padding: 2.4rem 2.5rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.4s ease;
}
.co:hover { background: rgba(12,21,25,0.03); }
.co__index { color: var(--graphite); }
.co__lockup { display: flex; align-items: center; gap: 1.4rem; min-width: 0; }
.co__mark { width: 44px; flex-shrink: 0; color: var(--graphite); transition: color 0.4s ease; height: auto; }
.co:hover .co__mark { color: var(--ink); }
.co__name {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.5rem, 3.2vw, 2.9rem);
  line-height: 1.1;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.co:hover .co__name { transform: translateX(12px); }
.co__desc { text-align: right; }
.co__arrow {
  font-size: 1.5rem; color: var(--graphite);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), color 0.4s ease;
}
.co:hover .co__arrow { transform: translateX(8px); color: var(--ink); }

/* ---------- THE STANDARD — the dark cinematic band in a light site ---------- */
.standard {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  overflow: hidden;
  color: var(--white);
}
.standard__media { position: absolute; inset: -10% 0; }
.standard__media img { filter: saturate(0.85); }
.standard__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,21,25,0.92) 0%, rgba(12,21,25,0.66) 50%, rgba(12,21,25,0.92) 100%);
}
.standard__content {
  position: relative; z-index: 2;
  max-width: 1180px; margin: 0 auto;
  padding: 10rem 2.5rem;
  display: flex; flex-direction: column; gap: 3rem;
}
.standard .mono { color: rgba(255,255,255,0.55); }
.standard__text {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.8rem, 3.9vw, 3.6rem);
  line-height: 1.3;
}
.standard__text .word { opacity: 0.13; }

/* ---------- FORWARD: the survey flyover ----------
   Pinned fullscreen. Scrolling runs a live land survey over the drone
   footage: the mapping grid draws, a scanline sweeps, readouts count,
   capability points land as scan results. */
.forward { position: relative; }
.forward__pin {
  position: relative; height: 100vh; min-height: 640px;
  overflow: hidden;
  color: var(--white);
}
.forward__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.15);
}
.forward__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,21,25,0.72) 0%, rgba(12,21,25,0.38) 45%, rgba(12,21,25,0.85) 100%);
}
.forward__hud {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%;
  pointer-events: none;
}
.forward__hud line { stroke: rgba(255,255,255,0.22); stroke-width: 1; }
.forward__scanline {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.85), transparent);
  box-shadow: 0 0 24px rgba(255,255,255,0.35);
  opacity: 0;
  pointer-events: none;
}
.forward__bracket {
  position: absolute; z-index: 3;
  width: 34px; height: 34px;
  border: 0 solid rgba(255,255,255,0.6);
  opacity: 0;
  pointer-events: none;
}
.forward__bracket--tl { top: 5.5rem; left: 2rem; border-top-width: 2px; border-left-width: 2px; }
.forward__bracket--tr { top: 5.5rem; right: 2rem; border-top-width: 2px; border-right-width: 2px; }
.forward__bracket--bl { bottom: 2rem; left: 2rem; border-bottom-width: 2px; border-left-width: 2px; }
.forward__bracket--br { bottom: 2rem; right: 2rem; border-bottom-width: 2px; border-right-width: 2px; }
.forward__content {
  position: absolute; z-index: 4;
  top: 50%; left: 2.5rem;
  transform: translateY(-50%);
  max-width: 36rem;
}
.forward__content .mono { color: rgba(255,255,255,0.6); }
.forward__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.2rem, 4.6vw, 4.4rem);
  line-height: 1.05;
  margin: 1.4rem 0 1.6rem;
}
.forward__title .line { display: block; overflow: hidden; }
.forward__body {
  color: rgba(255,255,255,0.72);
  opacity: 0; visibility: hidden; transform: translateY(24px);
}
.forward__readout {
  position: absolute; z-index: 4;
  left: 2.5rem; bottom: 3.5rem;
  display: flex; gap: 2.25rem; flex-wrap: wrap;
  color: rgba(255,255,255,0.65);
}
.forward__readout b { color: var(--white); font-weight: 600; font-variant-numeric: tabular-nums; }
.forward__readout span { opacity: 0; }
.forward__points {
  position: absolute; z-index: 4;
  right: 2.5rem; bottom: 3.25rem;
  width: min(340px, 34vw);
  display: flex; flex-direction: column;
}
.forward__points p {
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.85); font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0; transform: translateY(24px);
}
.forward__points .mono { display: block; margin-bottom: 0.3rem; color: rgba(255,255,255,0.55); }

/* ---------- THE RECORD (spec sheet) ---------- */
.record { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.record__inner { max-width: 1400px; margin: 0 auto; padding: 8rem 2.5rem; }
.record__inner > .mono { display: block; margin-bottom: 4.5rem; }
.record__rows { display: flex; flex-direction: column; }
.rec {
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr minmax(240px, auto);
  align-items: center; gap: 3rem;
  padding: 2.6rem 0;
}
.rec + .rec { border-top: 1px solid var(--line); }
.rec__value {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(4.5rem, 11vw, 10rem);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}
.rec__suffix { color: var(--graphite); font-size: 0.5em; vertical-align: super; }
.rec__rule {
  height: 1px; background: var(--graphite); opacity: 0.55;
  transform: scaleX(0); transform-origin: left;
}
.rec--flip { grid-template-columns: minmax(240px, auto) 1fr minmax(180px, auto); }
.rec--flip .rec__value { order: 3; text-align: right; }
.rec--flip .rec__rule { order: 2; transform-origin: right; }
.rec--flip .rec__meta { order: 1; }
.rec__meta { display: flex; flex-direction: column; gap: 0.4rem; }
.rec__label {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.1rem, 1.9vw, 1.5rem);
}
.rec__note { color: var(--graphite); }

/* ---------- CONTACT ---------- */
.contact {
  min-height: 82vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  padding: 8rem 2.5rem;
}
.contact .mono:first-child { margin-bottom: 2.5rem; }
.contact__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.8rem, 9vw, 8.5rem);
  line-height: 1.0;
  margin-bottom: 4rem;
}
.contact__line { display: block; overflow: hidden; }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); background: var(--paper); }
.footer__main {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3rem;
  padding: 4.5rem 2.5rem;
  max-width: 1400px; margin: 0 auto;
}
.footer__mark { width: 64px; height: auto; color: var(--ink); margin-bottom: 1.5rem; }
.footer__tag {
  font-family: var(--display); font-weight: 400;
  font-size: 1.35rem; line-height: 1.3;
}
.footer__col { display: flex; flex-direction: column; gap: 0.85rem; }
.footer__col-title { margin-bottom: 0.5rem; color: var(--graphite); }
.footer__col a {
  font-size: 0.95rem; color: var(--ink-dim);
  transition: color 0.3s ease, transform 0.3s ease;
}
.footer__col a:hover { color: var(--ink); transform: translateX(4px); }
.footer__loc { font-size: 0.9rem; color: var(--graphite); margin-top: 0.5rem; }
.footer__bottom {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.75rem 2.5rem;
  border-top: 1px solid var(--line);
  max-width: 1400px; margin: 0 auto;
}

/* ---------- Reveal helper ---------- */
[data-reveal] { opacity: 0; transform: translateY(30px); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .forward__points { position: static; width: auto; margin: 0; padding: 0 1.25rem 3rem; }
  .forward__pin { height: auto; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; }
  .forward__content { position: static; transform: none; padding: 7rem 1.25rem 2rem; max-width: none; }
  .forward__readout { position: static; padding: 0 1.25rem 1.5rem; gap: 1.25rem; }
  .forward__bracket--bl, .forward__bracket--br { bottom: 1rem; }
  .rec, .rec--flip { grid-template-columns: 1fr; gap: 1rem; padding: 2.2rem 0; }
  .rec--flip .rec__value { order: 1; text-align: left; }
  .rec--flip .rec__rule { order: 2; transform-origin: left; }
  .rec--flip .rec__meta { order: 3; }
  .footer__main { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 860px) {
  .co { grid-template-columns: 3rem 1fr 2rem; gap: 1rem; padding: 1.8rem 1.25rem; }
  .co__desc { display: none; }
  .co__mark { width: 30px; }
  .co__lockup { gap: 0.9rem; }
}
@media (max-width: 768px) {
  .ticker__label { padding: 0.75rem 1rem; }
  .nav { padding: 1.25rem 1.25rem; }
  .nav__links { gap: 1.1rem; }
  .nav__links a { font-size: 0.6rem; }
  .nav__logo span { display: none; }
  .hero__mark { width: clamp(220px, 56vw, 300px); }
  .hero__title { margin-top: 2.25rem; font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .hero__sub { font-size: 0.9rem; padding: 0 0.5rem; }
  .companies { padding-top: 6rem; }
  .companies__header { padding: 0 1.25rem; margin-bottom: 2.5rem; }
  .standard__content { padding: 7rem 1.25rem; }
  .record__inner { padding: 5rem 1.25rem; }
  .rec__value { font-size: clamp(3.6rem, 18vw, 5.5rem); }
  .contact { padding: 6rem 1.25rem; min-height: 70vh; }
  .footer__main, .footer__bottom { padding-left: 1.25rem; padding-right: 1.25rem; }
  .companies__bg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .hero__scroll-line { animation: none !important; }
  .hero__mark polygon { opacity: 1; }
  .rec__rule { transform: scaleX(1); }
  [data-reveal], .hero__sub, .hero__scroll { opacity: 1 !important; visibility: visible !important; transform: none !important; }
}
