/* =================================================================
   UK Defence Technologies — shared design system
   Identity: "Admiralty / North Atlantic"
   Palette: deep-Atlantic ground, chart-paper light, single brass accent
   Type: Bricolage Grotesque (display) / IBM Plex Sans (body) /
         IBM Plex Mono (data, eyebrows, coordinates)
   ================================================================= */

:root {
  /* Ground + surfaces */
  --abyss:        #06121B;
  --atlantic:     #0A1A26;
  --slate:        #102A3A;
  --steel:        #173445;

  /* Light / chart paper */
  --paper:        #E9EDEE;
  --paper-2:      #DCE3E4;

  /* Ink + text */
  --ink:          #0A1A26;
  --on-dark:      #E7EDEF;
  --mist:         #9DB1BA;   /* muted text on dark */
  --mist-2:       #6E8693;

  /* Lines */
  --hair-dark:    #21404F;
  --hair-light:   #C5CFD1;

  /* Single accent — naval brass */
  --brass:        #C8A04A;
  --brass-bright: #E2C281;

  /* Depth/contour line colour (used translucent) */
  --depth:        #3F7F92;

  /* Type */
  --display: "Bricolage Grotesque", Georgia, serif;
  --body:    "IBM Plex Sans", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  /* Rhythm */
  --maxw: 1200px;
  --gut: clamp(20px, 5vw, 64px);
  --section-y: clamp(72px, 11vw, 150px);

  --r: 2px; /* near-zero radius; charts are not rounded */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--atlantic);
  color: var(--on-dark);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--brass); color: var(--abyss); }

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.section { padding-block: var(--section-y); position: relative; }
.section.tight { padding-block: clamp(48px, 7vw, 96px); }

.paper { background: var(--paper); color: var(--ink); }
.abyss { background: var(--abyss); }

/* ---------- Type scale ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--brass);
  display: inline-block;
}
.paper .eyebrow { color: #9A7A2E; }
.paper .eyebrow::before { background: #9A7A2E; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; margin: 0; }

.h-display {
  font-size: clamp(2.6rem, 6.4vw, 5.3rem);
  line-height: 0.98;
}
h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 700; letter-spacing: -0.01em; }

.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.5;
  color: var(--mist);
  max-width: 60ch;
}
.paper .lede { color: #3C5663; }

p { margin: 0 0 1.1em; }
.muted { color: var(--mist); }
.paper .muted { color: #51697480; }

.coord { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--mist-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 15px 26px;
  border: 1px solid var(--brass);
  color: var(--abyss);
  background: var(--brass);
  cursor: pointer;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.btn:hover { background: var(--brass-bright); transform: translateY(-2px); }
.btn .arr { transition: transform .25s ease; }
.btn:hover .arr { transform: translateX(4px); }

.btn.ghost {
  background: transparent;
  color: var(--on-dark);
  border-color: var(--hair-dark);
}
.btn.ghost:hover { border-color: var(--brass); color: var(--brass-bright); background: transparent; }
.paper .btn.ghost { color: var(--ink); border-color: var(--hair-light); }
.paper .btn.ghost:hover { border-color: #9A7A2E; color: #6b5113; }

/* ---------- Header ---------- */
.topbar {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist-2);
  border-bottom: 1px solid var(--hair-dark);
  background: var(--abyss);
}
.topbar .wrap { display: flex; justify-content: space-between; padding-block: 9px; gap: 16px; }
.topbar .tb-r { color: var(--mist); }
@media (max-width: 760px){ .topbar .tb-hide { display:none; } }

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,26,38,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair-dark);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand .mark { width: 74px; height: 31px; flex: none; }
.mk-line { fill: var(--mist-2); }
.mk-hull { fill: var(--on-dark); }
.mk-ping { fill: var(--brass); }
.brand .bt { font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; line-height: 1; }
.brand .bs { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; color: var(--mist-2); text-transform: uppercase; }

.navlinks { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.navlinks a {
  font-size: 14px; font-weight: 500; color: var(--mist);
  position: relative; padding: 6px 0; transition: color .2s ease;
}
.navlinks a:hover, .navlinks a[aria-current="page"] { color: var(--on-dark); }
.navlinks a[aria-current="page"]::after {
  content:""; position:absolute; left:0; bottom:-2px; width:100%; height:2px; background: var(--brass);
}
.nav .btn { padding: 11px 20px; }

.burger { display: none; background: none; border: 1px solid var(--hair-dark); color: var(--on-dark); width: 42px; height: 38px; cursor: pointer; }
.burger span { display:block; width:18px; height:2px; background: var(--on-dark); margin: 3px auto; }

@media (max-width: 940px){
  .navlinks { display: none; }
  .nav .btn.navcta { display: none; }
  .burger { display: block; }
  .navlinks.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--abyss); border-bottom: 1px solid var(--hair-dark);
    padding: 18px var(--gut) 26px;
  }
  .navlinks.open a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--hair-dark); font-size: 16px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--atlantic); overflow: hidden; border-bottom: 1px solid var(--hair-dark); }
.depthfield {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 78% -10%, rgba(63,127,146,0.16), transparent 62%),
    repeating-linear-gradient(to bottom, transparent 0 95px, rgba(63,127,146,0.10) 95px 96px);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.95), rgba(0,0,0,.3));
          mask-image: linear-gradient(to bottom, rgba(0,0,0,.95), rgba(0,0,0,.3));
}
.hero .wrap { position: relative; z-index: 2; padding-block: clamp(90px, 15vw, 190px) clamp(70px, 11vw, 140px); }
.hero .h-display { max-width: 17ch; }
.hero .hero-sub { margin-top: 28px; }
.hero .hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 40px; }
.hero .ticks {
  display: flex; gap: clamp(28px, 5vw, 64px); margin-top: 64px; flex-wrap: wrap;
  border-top: 1px solid var(--hair-dark); padding-top: 28px;
}
.hero .tick .tn { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem,3vw,2.3rem); color: var(--on-dark); line-height: 1; }
.hero .tick .tl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist-2); margin-top: 10px; }
.hero .tick .tn em { color: var(--brass); font-style: normal; }

/* page hero (interior pages) */
.phero { background: var(--abyss); border-bottom: 1px solid var(--hair-dark); position: relative; overflow: hidden; }

.phero .wrap { position: relative; z-index: 2; padding-block: clamp(70px, 11vw, 130px) clamp(48px, 8vw, 90px); }
.phero h1 { font-size: clamp(2.2rem, 5vw, 4rem); max-width: 18ch; }
.phero .lede { margin-top: 24px; }

/* ---------- Section heading block ---------- */
.shead { max-width: 64ch; }
.shead h2 { margin-bottom: 22px; }

/* ---------- Grid cards ---------- */
.grid { display: grid; gap: 1px; background: var(--hair-dark); border: 1px solid var(--hair-dark); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.paper .grid { background: var(--hair-light); border-color: var(--hair-light); }

.cell { background: var(--atlantic); padding: clamp(26px, 3vw, 40px); position: relative; transition: background .3s ease; }
.paper .cell { background: var(--paper); }
.cell:hover { background: var(--slate); }
.paper .cell:hover { background: #fff; }
.cell .cn { font-family: var(--mono); font-size: 12px; color: var(--brass); letter-spacing: 0.12em; }
.cell h3 { margin: 18px 0 12px; }
.cell p { color: var(--mist); font-size: 15.5px; margin: 0; }
.paper .cell p { color: #45606c; }
.cell .ic { width: 30px; height: 30px; color: var(--brass); margin-bottom: 22px; }

@media (max-width: 900px){ .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px){ .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

/* ---------- Split feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 80px); align-items: center; }
.split.rev .split-media { order: 2; }
@media (max-width: 860px){ .split { grid-template-columns: 1fr; } .split.rev .split-media { order: 0; } }

.specbox { border: 1px solid var(--hair-dark); background: var(--abyss); }
.paper .specbox { border-color: var(--hair-light); background: #fff; }
.specrow { display: flex; justify-content: space-between; gap: 20px; padding: 16px 22px; border-bottom: 1px solid var(--hair-dark); font-size: 14px; }
.paper .specrow { border-color: var(--hair-light); }
.specrow:last-child { border-bottom: none; }
.specrow .sk { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mist-2); }
.specrow .sv { color: var(--on-dark); text-align: right; font-weight: 500; }
.paper .specrow .sv { color: var(--ink); }

/* ---------- List with rule ---------- */
.rlist { list-style: none; margin: 0; padding: 0; }
.rlist li { padding: 22px 0; border-top: 1px solid var(--hair-dark); display: grid; grid-template-columns: 56px 1fr; gap: 20px; }
.paper .rlist li { border-color: var(--hair-light); }
.rlist li:last-child { border-bottom: 1px solid var(--hair-dark); }
.paper .rlist li:last-child { border-color: var(--hair-light); }
.rlist .rn { font-family: var(--mono); color: var(--brass); font-size: 13px; padding-top: 4px; }
.rlist h3 { font-size: 1.15rem; margin-bottom: 8px; }
.rlist p { margin: 0; color: var(--mist); font-size: 15px; }
.paper .rlist p { color: #45606c; }

/* ---------- Pull / quote band ---------- */
.band { border-top: 1px solid var(--hair-dark); border-bottom: 1px solid var(--hair-dark); }
.band .big { font-family: var(--display); font-weight: 800; font-size: clamp(1.5rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -0.02em; max-width: 22ch; }
.band .big .hl { color: var(--brass); }

/* ---------- CTA ---------- */
.cta-band { background: var(--slate); border-top: 1px solid var(--hair-dark); }
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-block: clamp(56px, 8vw, 100px); }
.cta-band h2 { max-width: 16ch; }

/* ---------- Footer ---------- */
footer { background: var(--abyss); border-top: 1px solid var(--hair-dark); color: var(--mist); font-size: 14px; }
.fgrid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-block: clamp(56px, 7vw, 90px); }
.fgrid h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mist-2); margin: 0 0 18px; font-weight: 500; }
.fgrid ul { list-style: none; margin: 0; padding: 0; }
.fgrid li { margin-bottom: 11px; }
.fgrid a:hover { color: var(--brass-bright); }
.fco p { max-width: 36ch; color: var(--mist-2); font-size: 13.5px; }
.fbar { border-top: 1px solid var(--hair-dark); }
.fbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding-block: 22px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--mist-2); flex-wrap: wrap; text-transform: uppercase; }
@media (max-width: 820px){ .fgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .fgrid { grid-template-columns: 1fr; } }

/* ---------- Reveal on scroll ----------
   Default = visible. Only the .js flag (added by main.js) arms the
   entrance animation, so content can never be permanently hidden. */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Edge coordinate ruler (signature) ---------- */
.ruler {
  position: absolute; top: 0; bottom: 0; width: 1px; background: var(--hair-dark);
  display: none;
}
.ruler.l { left: calc(var(--gut) - 22px); }
@media (min-width: 1180px){ .section .ruler { display: block; } }
.ruler .tk { position: absolute; left: -3px; width: 7px; height: 1px; background: var(--mist-2); }
.ruler .lbl { position: absolute; left: 12px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--mist-2); white-space: nowrap; }

/* ---------- Prose (insights/articles) ---------- */
.prose { max-width: 70ch; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 2em 0 0.6em; }
.prose h3 { margin: 1.6em 0 0.5em; }
.prose p, .prose li { color: var(--mist); }
.paper .prose p, .paper .prose li { color: #3c5663; }
.prose ul { padding-left: 1.1em; }
.prose li { margin-bottom: 0.5em; }

/* ---------- Forms ---------- */
.field { margin-bottom: 22px; }
.field label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mist-2); margin-bottom: 9px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--abyss); border: 1px solid var(--hair-dark);
  color: var(--on-dark); padding: 14px 16px; font-family: var(--body); font-size: 15px; border-radius: var(--r);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brass); outline-offset: 1px; border-color: var(--brass); }
.field textarea { min-height: 130px; resize: vertical; }

/* ---------- Tag / chip ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid var(--hair-dark); padding: 7px 12px; color: var(--mist); }
.paper .chip { border-color: var(--hair-light); color: #51697490; }

/* focus visibility */
a:focus-visible, button:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* No-JS / fallback: never hide content if scripts don't run */
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Project page (Seaspray) ---------- */
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--brass);
  border: 1px solid var(--hair-dark); padding: 8px 14px; margin-bottom: 26px;
}
.status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brass);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
@media (prefers-reduced-motion: reduce){ .status::before { animation: none; } }

.schematic { width: 100%; height: auto; display: block; }
.schematic .sc-line  { fill: var(--mist-2); }
.schematic .sc-hull  { fill: var(--ink); }
.schematic .sc-ping  { fill: #9A7A2E; }
.schematic .sc-solar { fill: #9A7A2E; }
.schematic .lead     { stroke: #90A4AD; stroke-width: 1; fill: none; }
.schematic .dot      { fill: #90A4AD; }
.schematic text {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em;
  fill: #3C5663; text-transform: uppercase;
}
.schematic .comms { stroke: #9A7A2E; stroke-width: 1.2; stroke-dasharray: 3 5; fill: none; }
