/* =========================================================
   HIVE DEFENCE — DESIGN SYSTEM · REV D
   Built against measured values from Anduril, Palantir and
   Saronic: Swiss neo-grotesque, 400/500 weights, warm greys,
   no neon, pill buttons, whitespace instead of borders.
   ========================================================= */

/* === Font ================================================ */
/* One family. Archivo held near normal width so it reads as a
   neutral grotesque rather than a "technology" typeface.     */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/ArchivoVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Surfaces — near-black, very slightly warm. */
  --ink:    #0a0a0b;
  --ink-2:  #121213;
  --line:   rgba(241, 240, 234, 0.13);
  --line-2: rgba(241, 240, 234, 0.26);

  /* Text — warm greys, the way the real ones do it. */
  --bone:  #f1f0ea;
  --grey:  #b0b0a9;
  --dim:   #86867f;

  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --edge: clamp(20px, 5vw, 76px);
  --max:  1360px;
}

/* === Base ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--ink); overflow-x: clip; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-stretch: 100%;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--bone);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
  overflow-x: clip;
}
::selection { background: var(--bone); color: var(--ink); }
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }

/* === Type scale ==========================================
   Display sizes carry NEGATIVE tracking and medium weight.
   Nothing on this site is heavier than 600.                */
.d1, .d2, .d3 {
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.d1 { font-size: clamp(40px, 6.6vw, 92px); }
.d2 { font-size: clamp(30px, 4.2vw, 58px); letter-spacing: -0.024em; line-height: 1.06; }
.d3 { font-size: clamp(22px, 2.4vw, 34px); letter-spacing: -0.018em; line-height: 1.12; }

.lede {
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.5;
  letter-spacing: -0.011em;
  color: var(--grey);
  max-width: 34em;
}
p { letter-spacing: -0.009em; }

/* The one small-caps device, used sparingly — eyebrows only. */
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* === Layout ============================================== */
.wrap { width: min(var(--max), 100%); margin-inline: auto; padding-inline: var(--edge); }
.section { padding-block: clamp(90px, 12vh, 168px); }
.section-tight { padding-block: clamp(64px, 8vh, 110px); }
section { position: relative; }
section[id] { scroll-margin-top: 90px; }
.rule { height: 1px; background: var(--line); border: 0; }

/* === Buttons — pill, the way they actually build them ==== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.006em;
  padding: 13px 26px;
  border-radius: 1000px;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--bone); color: var(--ink); }
.btn-primary:hover { background: #fff; }
.btn-ghost { border: 1px solid var(--line-2); color: var(--bone); }
.btn-ghost:hover { border-color: var(--bone); background: rgba(241,240,234,0.06); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Text link with a moving underline. */
.tlink {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500; color: var(--bone);
  padding-bottom: 3px;
  background-image: linear-gradient(var(--bone), var(--bone));
  background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.tlink:hover { background-size: 100% 1px; }
.tlink .arw { transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.tlink:hover .arw { transform: translateX(4px); }

/* === Nav ================================================= */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 60;
  padding: 22px var(--edge);
  transition: background 0.4s ease, padding 0.4s ease, backdrop-filter 0.4s ease;
}
.nav.stuck {
  padding-block: 14px;
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-in {
  max-width: var(--max); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
}
.nav-brand { display: flex; align-items: center; gap: 11px; }
.nav-brand .emblem { width: 26px; height: 26px; color: var(--bone); flex: none; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-size: 15px; font-weight: 400; color: var(--grey);
  transition: color 0.25s ease;
}
.nav-links a:hover, .nav-links a[aria-current] { color: var(--bone); }
.nav-cta { font-size: 15px; font-weight: 500; padding: 10px 22px; border-radius: 1000px; border: 1px solid var(--line-2); transition: background 0.3s ease, border-color 0.3s ease; }
.nav-cta:hover { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.burger { display: none; width: 26px; height: 16px; position: relative; }
.burger::before, .burger::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: var(--bone);
  transition: transform 0.3s ease;
}
.burger::before { top: 0; } .burger::after { bottom: 0; }
.nav.open .burger::before { transform: translateY(7px) rotate(45deg); }
.nav.open .burger::after { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 900px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: var(--edge); right: var(--edge);
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--ink-2); padding: 8px 0;
  }
  .nav-links a { padding: 14px 22px; width: 100%; font-size: 17px; }
  .nav.open .nav-links { display: flex; }
  .nav.open { background: rgba(10,10,11,0.96); backdrop-filter: blur(16px); }
  .burger { display: block; }
  .nav-cta { display: none; }
}

/* === Wordmark plate ====================================== */
/* HIVE over a full-width rule over DEFENCE, both rows edge-justified. */
.plate { display: grid; }
.plate .pl1, .plate .pl2 {
  display: flex; justify-content: space-between;
  line-height: 1; text-transform: uppercase; color: currentColor;
}
.plate i { font-style: normal; }
.plate .pl1 { font-weight: 600; }
.plate .pl2 { font-weight: 400; }
.plate .prule { background: currentColor; }

.plate-nav { width: 58px; color: var(--bone); }
.plate-nav .pl1 { font-size: 16.5px; }
.plate-nav .prule { height: 1.5px; margin: 3px 0 2.5px; }
.plate-nav .pl2 { font-size: 7.1px; }

.plate-ft { width: 128px; color: var(--bone); }
.plate-ft .pl1 { font-size: 37px; }
.plate-ft .prule { height: 2px; margin: 6px 0 5px; }
.plate-ft .pl2 { font-size: 15.7px; }

/* === Home hero =========================================== */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: clip; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,11,0.72) 0%, rgba(10,10,11,0.18) 38%, rgba(10,10,11,0.74) 82%, var(--ink) 100%);
}
.hero-in { position: relative; z-index: 2; padding-bottom: clamp(56px, 9vh, 116px); padding-top: 30vh; }
.hero h1 { max-width: 17ch; }
.hero .lede { margin-top: 24px; }
.hero .btn-row { margin-top: 38px; }

/* === Editorial two-column ================================ */
.split {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 110px); align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 26px; } }
.stack-p > p + p { margin-top: 1.15em; }
.stack-p p { color: var(--grey); font-size: 17px; line-height: 1.6; max-width: 40em; }
.stack-p strong { color: var(--bone); font-weight: 500; }

/* === Capability list — rules, not boxes ================== */
.caps { border-top: 1px solid var(--line); }
.cap {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(16px, 3vw, 48px);
  padding: 30px 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.cap .n { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.cap h3 { font-size: clamp(19px, 1.9vw, 25px); font-weight: 500; letter-spacing: -0.018em; }
.cap p { color: var(--grey); font-size: 15.5px; line-height: 1.6; }
@media (max-width: 760px) {
  .cap { grid-template-columns: 40px 1fr; }
  .cap p { grid-column: 2; }
}

/* === Product grid — photography does the work ============ */
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 44px) clamp(18px, 2.6vw, 38px); }
@media (max-width: 760px) { .pgrid { grid-template-columns: 1fr; } }
.pcard { display: block; }
.pcard-shot { display: block; position: relative; aspect-ratio: 4 / 3; overflow: clip; background: var(--ink-2); }
.pcard-shot img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.pcard:hover .pcard-shot img { transform: scale(1.04); }
.pcard-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 20px; }
.pcard h3 { font-size: clamp(21px, 2vw, 27px); font-weight: 500; letter-spacing: -0.02em; }
.pcard h3 sup { font-size: 0.36em; font-weight: 400; color: var(--dim); top: -0.9em; }
.pcard .status { font-size: 13px; color: var(--dim); white-space: nowrap; }
.pcard p { margin-top: 9px; color: var(--grey); font-size: 15.5px; line-height: 1.55; max-width: 40em; }
.pcard .go { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--bone); }
.pcard .go .arw { transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.pcard:hover .go .arw { transform: translateX(4px); }

/* Feature card — full width, image left */
.pfeature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.pfeature .pcard-shot { aspect-ratio: 16 / 10; }
.pfeature .pcard-meta { margin-top: 0; }
@media (max-width: 860px) { .pfeature { grid-template-columns: 1fr; } .pfeature .pcard-meta { margin-top: 20px; } }

/* === Stats — plain numbers, no boxes ===================== */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 60px); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; gap: 30px; } }
.stat .v { font-size: clamp(38px, 4.4vw, 62px); font-weight: 500; letter-spacing: -0.035em; line-height: 1; }
.stat .k { margin-top: 12px; color: var(--grey); font-size: 15px; line-height: 1.5; max-width: 26em; }

/* === System detail page ================================== */
.sys-hero { position: relative; min-height: min(86svh, 820px); display: grid; align-items: end; overflow: clip; }
.sys-hero-media { position: absolute; inset: 0; }
.sys-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.sys-hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,11,0.66) 0%, rgba(10,10,11,0.14) 40%, rgba(10,10,11,0.78) 84%, var(--ink) 100%);
}
.sys-hero-in { position: relative; z-index: 2; padding-bottom: clamp(44px, 7vh, 92px); padding-top: 28vh; }
.crumb { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--grey); margin-bottom: 26px; transition: color 0.25s ease; }
.crumb:hover { color: var(--bone); }
.sys-hero h1 { font-size: clamp(44px, 7.6vw, 104px); font-weight: 500; letter-spacing: -0.032em; line-height: 1; }
.sys-hero h1 sup { font-size: 0.2em; font-weight: 400; color: var(--grey); top: -1.6em; }
.sys-tag { margin-top: 22px; font-size: clamp(19px, 2vw, 27px); font-weight: 400; letter-spacing: -0.019em; line-height: 1.28; color: var(--bone); max-width: 22ch; }
.imgnote { position: absolute; right: var(--edge); bottom: 16px; z-index: 2; font-size: 11.5px; color: var(--dim); }

/* How-it-works: numbered rules */
.steps { border-top: 1px solid var(--line); }
.step {
  display: grid; grid-template-columns: 54px minmax(0, 1fr);
  gap: clamp(16px, 3vw, 44px);
  padding: 34px 0; border-bottom: 1px solid var(--line);
}
.step .n { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; padding-top: 5px; }
.step h3 { font-size: clamp(20px, 2vw, 27px); font-weight: 500; letter-spacing: -0.02em; margin-bottom: 10px; }
.step p { color: var(--grey); font-size: 16px; line-height: 1.62; max-width: 62ch; }

/* Spec table */
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(30px, 5vw, 80px); }
@media (max-width: 760px) { .specs { grid-template-columns: 1fr; } }
.spec { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.spec dt { color: var(--dim); font-size: 14.5px; }
.spec dd { color: var(--bone); font-size: 15.5px; text-align: right; letter-spacing: -0.008em; }

/* Figures */
.fig { margin: 0; }
.fig img { width: 100%; height: auto; }
.fig figcaption { margin-top: 14px; display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--dim); }
.figs { display: grid; gap: clamp(22px, 3vw, 40px); }

/* Engineering sheets are 1300px drawings. Letting them shrink to a phone width
   renders their 8px labels at about 2px, which is not a small drawing, it is no
   drawing. Give the sheet its own scroll box and hold a legible minimum width.
   The caption stays put outside the scroller, and the page body still never
   scrolls sideways.                                                            */
.fig-scroll { overflow-x: auto; overscroll-behavior-x: contain; min-width: 0; }
/* Grid and flex children default to min-width:auto, so without this the figure
   simply grows to the sheet's 1040px instead of scrolling, and the overflow gets
   swallowed by the overflow-x:clip on html.                                     */
.figs, .figs > .fig { min-width: 0; }
.swipe { display: none; }
@media (max-width: 900px) {
  .fig-scroll img { min-width: 1040px; max-width: none; }
  .swipe { display: inline; color: var(--grey); }
}

/* === Contact ============================================= */
.contact { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(30px, 6vw, 100px); align-items: start; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* === Footer ============================================== */
footer { border-top: 1px solid var(--line); padding-block: clamp(52px, 7vh, 84px) 44px; }
.foot-top { display: grid; grid-template-columns: auto 1fr; gap: clamp(30px, 6vw, 90px); align-items: start; }
@media (max-width: 760px) { .foot-top { grid-template-columns: 1fr; gap: 34px; } }
.foot-nav { display: flex; flex-wrap: wrap; gap: 12px 40px; align-self: start; justify-content: flex-end; }
@media (max-width: 760px) { .foot-nav { justify-content: flex-start; } }
.foot-nav a { font-size: 15px; color: var(--grey); transition: color 0.25s ease; }
.foot-nav a:hover { color: var(--bone); }
.foot-legal { margin-top: clamp(46px, 6vh, 72px); font-size: 12.5px; line-height: 1.75; color: var(--dim); max-width: 92ch; }
.foot-legal strong { color: var(--grey); font-weight: 400; }
.foot-base { margin-top: 30px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); }

/* === Reveal ==============================================
   One quiet fade-up. No stagger theatre, no typewriters.   */
.rv { opacity: 0; transform: translate3d(0, 16px, 0); transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .pcard-shot img, .tlink, .tlink .arw { transition: none; }
}
