/* ==========================================================================
   Invictus AeroTech Corporation — invictusaerotech.com
   Fluid, token-driven stylesheet. WCAG AAA color usage per brand spec.
   ========================================================================== */

/* ---- Brand webfonts (self-hosted; no Google Fonts) ---- */
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/Jost-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/Jost-400-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/Jost-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/Jost-500-Italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens ---- */
:root {
  --font-sans: "Jost", "Century Gothic", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;

  /* Light surfaces */
  --bg: #ffffff;
  --surface-raised: #f7f6f4;
  --card: #ffffff;
  --line: #e3e0db;

  /* Text on light (all >= 7:1 AAA on white) */
  --ink: #2d2a26;
  --ink-muted: #5c564e;
  --blue-ink: #0853ac;   /* AAA on white */
  --amber-ink: #7a4900;  /* AAA on white */

  /* Navy surfaces */
  --navy: #0a1628;
  --navy-raised: #12233b;
  --navy-line: #22344e;

  /* Text on navy (AAA on navy) */
  --on-navy: #ebe4d8;
  --on-navy-muted: #99aabf;
  --blue-on-navy: #6faaff; /* AAA on navy; also CTA fill w/ navy ink */
  --amber: #ff9b00;        /* AAA on navy */

  /* Raw brand blue — large text (>=24px) & non-text (icons >=3:1) ONLY */
  --blue-raw: #0b72ff;

  --grid-line: rgba(143, 160, 181, 0.07);

  --radius: 12px;
  --radius-sm: 6px;
  --shadow-card: 0 4px 14px rgba(10, 22, 40, 0.05);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.45);

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* max() keeps the gutter clear of the notch/island in landscape, while the
     band backgrounds themselves stay full-bleed to the screen edge. */
  --pad-x: max(clamp(24px, 5vw, 56px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --pad-y: clamp(48px, 7vw, 72px);
  --maxw: 1440px;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--blue-ink);
  text-decoration: none;
}
a:hover {
  color: var(--amber-ink);
}

/* ---- Accessibility helpers ---- */
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 1000;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font: 500 14px/1 var(--font-sans);
  transition: top 120ms var(--ease-out);
}
.skip-link:focus {
  /* Sits below the status bar / Dynamic Island, not under it. */
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  color: #fff;
  outline: 3px solid var(--blue-on-navy);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Visible focus ring everywhere (AAA focus visibility) */
:focus-visible {
  outline: 3px solid var(--blue-raw);
  outline-offset: 2px;
  border-radius: 3px;
}
[data-band="navy"] :focus-visible {
  outline-color: var(--blue-on-navy);
}

/* ---- Shared layout ---- */
.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: var(--pad-y) var(--pad-x);
}
.section-eyebrow {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.section-title {
  font: 500 clamp(26px, 2.6vw, 34px) / 1.2 var(--font-sans);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-wrap: pretty;
}
.rule {
  width: 64px;
  height: 2px;
  background: var(--amber);
  border: 0;
}

.band-grid {
  background-color: var(--navy);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ==========================================================================
   Header / nav
   ========================================================================== */
/* iOS standalone PWA: the status bar is black-translucent, so the page paints
   its own colour behind the status bar and Dynamic Island. The glyphs are
   always white there, and the header is not sticky, so a fixed scrim keeps
   that strip exactly --navy at every scroll position; without it, light
   sections would scroll under white-on-white text.

   Scoped to standalone: in Safari the status bar is Safari's own chrome and
   is already correct, so this must not apply there. The skip link (z-index
   1000) deliberately sits above the scrim, since it is offset below the inset
   and needs its focus ring visible. */
@media (display-mode: standalone) {
  @supports (padding: max(0px)) {
    body::before {
      content: "";
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: env(safe-area-inset-top, 0px);
      background: var(--navy);
      z-index: 999;
      pointer-events: none;
    }
  }
}

/* The bar keeps the rule full-bleed; the nav inside it aligns to the same
   max-width and gutters as every other section. */
.nav-bar {
  border-bottom: 1px solid var(--navy-line);
  /* Clear the status bar / Dynamic Island so the logo isn't tucked under it. */
  padding-top: env(safe-area-inset-top, 0px);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px var(--pad-x);
  max-width: var(--maxw);
  margin-inline: auto;
}
.nav__logo {
  display: flex;
  align-items: center;
}
.nav__logo svg {
  width: clamp(240px, 27vw, 325px); /* ~25% larger than before */
  height: auto;
}
.nav__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(16px, 2.5vw, 34px);
}
.nav__link {
  font: 400 14px/1 var(--font-sans);
  letter-spacing: 0.04em;
  color: var(--on-navy);
}
.nav__link:hover {
  color: var(--amber);
}

/* Buttons */
.btn {
  display: inline-block;
  font: 500 15px/1 var(--font-sans);
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  padding: 15px 26px;
  cursor: pointer;
  transition: background 120ms var(--ease-out), color 120ms var(--ease-out);
}
.btn--primary {
  color: var(--navy);
  background: var(--blue-on-navy);
  border: 1px solid var(--blue-on-navy);
}
.btn--primary:hover {
  background: #8cbeff;
  color: var(--navy);
  border-color: #8cbeff;
}
.btn--ghost {
  color: var(--on-navy);
  background: transparent;
  border: 1px solid var(--navy-line);
}
.btn--ghost:hover {
  background: rgba(111, 174, 255, 0.08);
  color: var(--on-navy);
}
.nav__link.btn {
  font-size: 14px;
  padding: 11px 18px;
}

/* Mobile menu toggle — hidden on desktop */
.nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--on-navy);
  background: transparent;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav__toggle:hover {
  color: var(--amber);
  border-color: var(--amber);
}

/* Below this the inline links get cramped and read like a run-on sentence, so
   collapse them into a toggled vertical menu of distinct tap rows. 768px, not
   720: under ~740 the logo + links stop fitting on one row and the full navbar
   wraps to two, so switch to the hamburger before that happens. */
@media (max-width: 768px) {
  .nav__toggle {
    display: inline-flex;
  }
  /* Cap the logo so it never crowds the toggle on small phones (safe to ~320px). */
  .nav__logo svg {
    width: clamp(200px, 58vw, 280px);
  }
  .nav__links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav__links.is-open {
    display: flex;
  }
  .nav__link {
    padding: 15px 6px;
    border-top: 1px solid var(--navy-line);
  }
  .nav__link:active {
    color: var(--amber);
  }
  .nav__link.btn {
    margin-top: 14px;
    padding: 15px 18px;
    border-top: none;
    text-align: center;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(56px, 8vw, 92px) var(--pad-x) clamp(48px, 7vw, 80px);
}
.coord {
  position: absolute;
  top: 16px;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.08em;
  color: rgba(157, 172, 192, 0.6);
}
.coord--left {
  left: var(--pad-x);
}
.coord--right {
  right: var(--pad-x);
}
.hero__content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.hero__kicker {
  font: 500 12px/1.5 var(--font-mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber);
}
.hero__title {
  font: 500 clamp(30px, 3.8vw, 52px) / 1.14 var(--font-sans);
  letter-spacing: 0.01em;
  color: #fff;
  text-wrap: pretty;
}
.hero__tagline {
  font: italic 400 clamp(17px, 1.6vw, 21px) / 1.5 var(--font-sans);
  color: var(--on-navy);
}
.hero__intro {
  font: 400 clamp(15px, 1.3vw, 17px) / 1.65 var(--font-sans);
  color: var(--on-navy-muted);
  max-width: 560px;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* JSON telemetry card */
.telemetry {
  justify-self: center;
  max-width: 100%;
  overflow-x: auto;
  background: var(--navy-raised);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-pop);
  font: 500 clamp(12px, 1.1vw, 13.5px) / 1.9 var(--font-mono);
}
.telemetry .p {
  color: var(--on-navy-muted);
}
.telemetry .k {
  color: var(--amber);
}
.telemetry .v {
  color: var(--blue-on-navy);
}
.telemetry .row {
  padding-left: 1.6em;
}

/* ==========================================================================
   Services
   ========================================================================== */
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.services__grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
}
.card__icon {
  width: 24px;
  height: 24px;
}
.card__title {
  font: 500 17px/1.3 var(--font-sans);
  color: var(--ink);
}
.card__body {
  font: 400 14.5px/1.6 var(--font-sans);
  color: var(--ink-muted);
}

/* ==========================================================================
   Focus band
   ========================================================================== */
.focus {
  background: var(--surface-raised);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.focus__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 26px;
  padding: clamp(44px, 6vw, 64px) var(--pad-x);
  max-width: var(--maxw);
  margin-inline: auto;
}
.route {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0;
  max-width: 100%;
}
.route__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.route__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
.route__dot--amber {
  background: var(--amber);
}
.route__dot--blue {
  background: var(--blue-raw);
}
.route__label {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.12em;
}
.route__label--amber {
  color: var(--amber-ink);
}
.route__label--blue {
  color: var(--blue-ink);
}
.route__line {
  position: relative;
  width: clamp(120px, 24vw, 260px);
  border-top: 2px dashed var(--line);
}
.route__line::before {
  content: "";
  position: absolute;
  left: 0;
  top: -2px;
  width: 45%;
  border-top: 2px solid var(--blue-raw);
}
.focus__body {
  font: 400 clamp(15px, 1.3vw, 17px) / 1.7 var(--font-sans);
  color: var(--ink-muted);
  max-width: 680px;
  text-wrap: pretty;
}

/* ==========================================================================
   About
   ========================================================================== */
.about {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(32px, 5vw, 56px);
  align-items: flex-start;
}
.about__aside {
  flex: 1 1 280px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.about__photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(10, 22, 40, 0.12);
}
.about__name {
  font: 500 18px/1.3 var(--font-sans);
  color: var(--ink);
}
.about__role {
  font: 500 12px/1.5 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber-ink);
}
.about__body {
  flex: 1 1 440px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.about__body p {
  font: 400 16px/1.75 var(--font-sans);
  color: var(--ink);
  max-width: 68ch;
}

/* ==========================================================================
   Company facts
   ========================================================================== */
.company {
  background: var(--surface-raised);
  border-top: 1px solid var(--line);
}
.facts {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.fact {
  background: var(--card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fact__key {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.fact__val {
  font: 400 15px/1.5 var(--font-sans);
  color: var(--ink);
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(48px, 7vw, 72px) var(--pad-x) clamp(56px, 8vw, 84px);
}
.contact__intro {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contact__eyebrow {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--on-navy-muted);
}
.contact__title {
  font: 500 clamp(26px, 2.6vw, 34px) / 1.2 var(--font-sans);
  letter-spacing: 0.02em;
  color: #fff;
}
.contact__lead {
  font: 400 16px/1.7 var(--font-sans);
  color: var(--on-navy-muted);
  max-width: 460px;
}
.contact__coord {
  font: 500 12px/1.9 var(--font-mono);
  color: var(--on-navy-muted);
  margin-top: 8px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--navy-raised);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field__label {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-navy-muted);
}
.field__req {
  color: var(--amber);
}
.field input,
.field textarea {
  font: 400 15px/1.4 var(--font-sans);
  color: var(--on-navy);
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  width: 100%;
}
.field textarea {
  line-height: 1.5;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue-on-navy);
  box-shadow: 0 0 0 3px rgba(111, 174, 255, 0.25);
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #6c7d92;
}
.field__error {
  font: 500 12px/1.4 var(--font-sans);
  color: #ffb38a;
  min-height: 0;
}
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #ffb38a;
}

.cf-turnstile {
  min-height: 65px;
}

.form__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.form button[type="submit"] {
  border: none;
}
.form button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* Status colors are all AAA (>=7:1) on the navy form card (#12233B). The message
   text also states the outcome in words, so it never relies on color alone (WCAG 1.4.1). */
.form__status {
  font: 500 14px/1.5 var(--font-sans);
  color: var(--on-navy); /* #EBE4D8 — default "Sending…" state, ~12.5:1 */
}
.form__status[data-state="success"] {
  color: #8cbeff; /* ~8.2:1 */
}
.form__status[data-state="error"] {
  color: #ffb38a; /* ~9:1 */
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--navy);
  border-top: 1px solid var(--navy-line);
  /* Keep the links clear of the iOS home indicator. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 26px var(--pad-x);
  max-width: var(--maxw);
  margin-inline: auto;
}
.footer__copy,
.footer__meta span,
.footer__meta a {
  font: 500 11px/1.7 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--on-navy-muted);
}
.footer__meta {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.footer__meta a:hover {
  color: var(--amber);
}

/* ==========================================================================
   Privacy page
   ========================================================================== */
.doc {
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) var(--pad-x);
}
.doc__back {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.doc h1 {
  font: 500 clamp(30px, 3.4vw, 44px) / 1.15 var(--font-sans);
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-top: 20px;
}
.doc h2 {
  font: 500 clamp(19px, 2vw, 24px) / 1.3 var(--font-sans);
  color: var(--ink);
  margin-top: 40px;
}
.doc p,
.doc li {
  font: 400 16px/1.75 var(--font-sans);
  color: var(--ink);
  max-width: 68ch;
}
.doc p {
  margin-top: 16px;
}
.doc ul {
  margin-top: 16px;
  padding-left: 22px;
}
.doc li {
  margin-top: 8px;
}
.doc__meta {
  font: 500 12px/1.6 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-top: 12px;
}
/* Underline links inside prose so they are not distinguished by color alone (WCAG 1.4.1). */
.doc p a,
.doc li a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ==========================================================================
   Error page (404)
   ========================================================================== */
.error {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
  /* No nav bar on this page, so carry the safe-area insets here instead. */
  padding: calc(72px + env(safe-area-inset-top, 0px)) var(--pad-x)
    calc(72px + env(safe-area-inset-bottom, 0px));
}
.error__logo svg {
  width: clamp(200px, 40vw, 260px);
  height: auto;
  margin-bottom: 8px;
}
.error__code {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber);
}
.error__title {
  font: 500 clamp(30px, 5vw, 48px) / 1.14 var(--font-sans);
  letter-spacing: 0.01em;
  color: #fff;
  text-wrap: pretty;
}
.error__text {
  font: 400 clamp(15px, 1.3vw, 17px) / 1.65 var(--font-sans);
  color: var(--on-navy-muted);
  max-width: 480px;
}

/* ==========================================================================
   Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
