/* Qloak — Direction A · Obsidian · "The Vault"
   Black lacquer, ivory type, champagne used only for rules, numerals and small marks.
   Tokens follow docs/DESIGN.md §6.1; hooks follow shared/CONTRACT.md. */

:root {
  --bg: #0A0A0B;
  --surface: #141416;
  --ink: #EDE7DC;
  --ink-muted: #A8A196;
  --gold: #C8AE79;
  --gold-bright: #DCC596;
  --line: rgba(200, 174, 121, 0.18);
  --field-border: #8C857A;
  --focus: #EDE7DC;
  --decor: rgba(200, 174, 121, 0.12);
  --danger: #E8907F;
  --success: #9FC9A4;

  --font-display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Manrope", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(20px, 5vw, 64px);
  --maxw: 1240px;
  --section-pad: clamp(88px, 11vw, 168px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h, 80px) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html[data-motion="full"] { scroll-behavior: smooth; }
}

html[data-nav-open] { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@media (min-width: 1200px) {
  body { font-size: 18px; }
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--ink);
  letter-spacing: 0;
}

em { font-style: italic; }

::selection { background: var(--gold); color: var(--bg); }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 0.95em;
  height: 0.95em;
  flex: none;
  margin-left: 0.5em;
  vertical-align: -0.08em;
}

/* ---------- Focus ---------- */

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

main:focus,
main:focus-visible,
.form-outcome:focus { outline: none; }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 12px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible { transform: none; }

/* ---------- Type ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.eyebrow-num::after {
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums;
}

.nw { white-space: nowrap; }

.display {
  font-size: clamp(2.75rem, 7vw, 6.25rem);
  line-height: 1.04;
  text-wrap: balance;
}

.display em {
  font-style: italic;
  font-weight: 300;
}

h2 {
  font-size: clamp(2.25rem, 4.6vw, 4rem);
  line-height: 1.08;
  text-wrap: balance;
}

h3 {
  font-size: clamp(1.5rem, 2.1vw, 1.875rem);
  font-weight: 400;
  line-height: 1.2;
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn-primary:hover { background: #FFFFFF; border-color: #FFFFFF; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--field-border);
}

.btn-ghost:hover { border-color: var(--ink); }

.btn[aria-disabled="true"] {
  opacity: 0.72;
  cursor: progress;
}

.text-link {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 15px;
  border-bottom: 1px solid var(--field-border);
  padding-bottom: 3px;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease);
}

.text-link:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 50;
  background: rgba(10, 10, 11, 0.94);
  border-bottom: 1px solid var(--line);
}

html.js .site-header {
  position: sticky;
  top: 0;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* backdrop-filter would become the containing block for the fixed overlay. */
html[data-nav-open] .site-header {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  min-height: 76px;
  margin-inline: auto;
  padding: 12px var(--gutter);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  color: var(--ink);
}

/* The cipher-ghost mark stands in for the Q of "Qloak". */
.monogram { width: auto; height: 36px; flex: none; }

.wordmark-text {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  margin-right: -0.34em;
}

.site-header .monogram { height: 52px; }
.site-header .wordmark-text { font-size: 30px; }

.primary-nav { margin-left: auto; }

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 30px;
}

.primary-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.3s var(--ease);
}

.primary-nav a:hover,
.primary-nav a[aria-current="true"] { color: var(--ink); }

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0.2em;
  bottom: 9px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.primary-nav a[aria-current="true"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 4px;
  background: none;
  border: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-toggle-icon {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 10px;
}

.nav-toggle-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}

.nav-toggle-icon span:first-child { top: 0; }
.nav-toggle-icon span:last-child { top: 9px; }

html[data-nav-open] .nav-toggle-icon span:first-child { top: 4.5px; transform: rotate(45deg); }
html[data-nav-open] .nav-toggle-icon span:last-child { top: 4.5px; transform: rotate(-45deg); }

/* Without JS on small screens: the nav wraps beneath the wordmark (always usable). */
@media (max-width: 899px) {
  .primary-nav { margin-left: 0; order: 3; width: 100%; }
  .primary-nav ul { gap: 0 22px; }
}

/* With JS on small screens: collapse into a full-screen overlay. */
@media (max-width: 899px) {
  html.js .nav-toggle { display: inline-flex; }
  html.js .nav-toggle { order: 3; margin-left: auto; }
  html.js .header-inner { flex-wrap: nowrap; }
  html.js .primary-nav { display: none; }

  html.js[data-nav-open] .primary-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h, 76px);
    bottom: 0;
    width: auto;
    padding: 24px var(--gutter) 48px;
    background: var(--bg);
    overflow-y: auto;
  }

  html.js[data-nav-open] .primary-nav ul {
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
  }

  html.js[data-nav-open] .primary-nav li { border-bottom: 1px solid var(--line); }

  html.js[data-nav-open] .primary-nav a {
    display: flex;
    min-height: 72px;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
  }

  html.js[data-nav-open] .primary-nav a::after { display: none; }
  html.js[data-nav-open] .primary-nav a[aria-current="true"] { color: var(--gold); }
}

@media (max-width: 599px) {
  .site-header .monogram { height: 44px; }
  .site-header .wordmark-text { font-size: 25px; }
}

@media (max-width: 380px) {
  .wordmark-text { font-size: 18px; letter-spacing: 0.28em; margin-right: -0.28em; }
  .monogram { height: 31px; }
  .site-header .monogram { height: 38px; }
  .site-header .wordmark-text { font-size: 21px; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: min(calc(100svh - 76px), 980px);
  padding-block: clamp(88px, 12vh, 140px) clamp(72px, 10vh, 120px);
  text-align: center;
  isolation: isolate;
}

.hero-ornament {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.rosette {
  display: block;
  width: 100%;
  height: 100%;
}

html[data-motion="full"] .rosette {
  animation: rosette-in 2.4s var(--ease) both;
  transform-origin: 50% 50%;
}

@keyframes rosette-in {
  from { opacity: 0; transform: rotate(-9deg) scale(0.965); }
  to { opacity: 1; transform: none; }
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero .eyebrow { justify-content: center; }

.hero .display {
  max-width: 13.5em;
  margin-top: 30px;
  font-size: clamp(2.5rem, 6vw, 5.25rem);
}

.lede {
  max-width: 40em;
  margin-top: 34px;
  font-size: clamp(1.0625rem, 1.35vw, 1.1875rem);
  line-height: 1.7;
  color: var(--ink-muted);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 46px;
}

.ledger-link {
  margin-top: 30px;
  font-size: 14px;
  color: var(--ink-muted);
}

.ledger-link:hover { color: var(--ink); }

.spec-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 64px;
}

.spec-chips li {
  padding: 9px 16px;
  border: 1px solid rgba(200, 174, 121, 0.34);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ---------- Dividers ---------- */

.divider {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.divider svg { width: 11px; height: 11px; flex: none; }

/* ---------- Sections ---------- */

.section { padding-block: var(--section-pad); }

.section-head {
  display: grid;
  gap: 28px;
  margin-bottom: clamp(56px, 7vw, 96px);
}

.section-title h2 { margin-top: 26px; }

.section-intro {
  max-width: 34em;
  color: var(--ink-muted);
  text-wrap: pretty;
}

@media (min-width: 960px) {
  .section-head {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: end;
    gap: 64px;
  }
  .section-head .section-intro { padding-bottom: 0.6em; }
}

.section-head-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 44px;
}

.section-head-center h2 { margin-top: 26px; }

/* Approach — principles */

.principles {
  display: grid;
  gap: 56px;
}

@media (min-width: 900px) {
  .principles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
}

.principle {
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.numeral {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 3.25rem;
  line-height: 1;
  color: var(--gold);
  margin-bottom: 30px;
}

.principle h3 { margin-bottom: 16px; }
.principle p { color: var(--ink-muted); text-wrap: pretty; }

/* Quantum — facts */

.facts {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

@media (min-width: 900px) {
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.fact {
  background: var(--bg);
  padding: 40px 0;
}

@media (min-width: 900px) {
  .fact { padding: 48px 40px; }
  .fact:first-child { padding-left: 0; }
}

.fact-figure {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: lining-nums;
  margin-bottom: 20px;
}

.fact dd { color: var(--ink-muted); max-width: 22em; text-wrap: pretty; }

/* Technology — spec sheet */

.spec-sheet {
  padding: clamp(20px, 4.5vw, 64px);
  background: var(--surface);
  border: 1px solid var(--line);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.spec-table caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 28px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.spec-table th {
  padding: 0 16px 16px 0;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
}

.spec-table th:nth-child(1) { width: 34%; }
.spec-table th:nth-child(2) { width: 36%; }

.spec-table td {
  padding: 24px 16px 24px 0;
  vertical-align: top;
  border-bottom: 1px dotted rgba(200, 174, 121, 0.3);
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

.spec-table tr:last-child td { border-bottom: 0; }

.spec-table td.algo {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--ink);
}

.spec-table td.std {
  font-size: 0.86em;
  padding-right: 0;
}

.spec-sheet .text-link { margin-top: 36px; }

/* Small screens: each row becomes a stacked spec entry (roles keep table semantics). */
@media (max-width: 599px) {
  .spec-sheet { position: relative; }
  .spec-table thead,
  .spec-table thead tr { display: block; height: 0; padding: 0; border: 0; }
  .spec-table th {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .spec-table caption { padding-bottom: 8px; }
  .spec-table tr {
    display: block;
    padding: 20px 0;
    border-bottom: 1px dotted rgba(200, 174, 121, 0.3);
  }
  .spec-table tr:last-child { border-bottom: 0; }
  .spec-table td,
  .spec-table td.std {
    display: block;
    padding: 0;
    border: 0;
  }
  .spec-table td:first-child {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-muted);
  }
  .spec-table td.algo { margin-top: 10px; font-size: 15px; }
  .spec-table td.std { margin-top: 6px; font-size: 14px; }
}

/* Host visibility ledger */

.visibility { margin-top: clamp(72px, 9vw, 120px); }

.visibility-title {
  font-size: clamp(1.875rem, 3.2vw, 2.75rem);
  font-weight: 300;
  margin-bottom: 44px;
}

.ledger {
  display: grid;
  gap: 40px;
}

@media (min-width: 900px) {
  .ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
}

.ledger-col {
  padding-top: 24px;
  border-top: 1px solid var(--gold);
}

.ledger-col h4 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

.ledger-glyph { width: 16px; height: 16px; flex: none; color: var(--gold); }

@media (min-width: 900px) {
  .ledger-col h4 { align-items: flex-start; min-height: 3.4em; }
  .ledger-glyph { margin-top: 1px; }
}

.ledger-col li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
}

.limits {
  max-width: 50em;
  margin-top: 56px;
  padding-left: 24px;
  border-left: 1px solid var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 300;
  line-height: 1.5;
  text-wrap: pretty;
}

.footnote {
  margin-top: 22px;
  padding-left: 25px;
  font-size: 14px;
  color: var(--ink-muted);
}

/* Products */

.products {
  display: grid;
  gap: 28px;
}

@media (min-width: 960px) {
  .products { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: stretch; }
}

.card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4.5vw, 56px);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.6s var(--ease);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(237, 231, 220, 0.05) 50%, transparent 62%);
  transform: translateX(-110%);
}

.card:hover { border-color: rgba(200, 174, 121, 0.5); }

html[data-motion="full"] .card:hover::after {
  transform: translateX(110%);
  transition: transform 1.2s var(--ease);
}

.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.status-soon .status-dot {
  background: transparent;
  border: 1px solid var(--gold);
}

.card-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.card-name {
  font-size: clamp(2.5rem, 4.4vw, 3.75rem);
  font-weight: 300;
  line-height: 1;
}

.card-tagline {
  margin-top: 16px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 300;
  color: var(--ink);
}

.card-body {
  margin-top: 24px;
  margin-bottom: 40px;
  color: var(--ink-muted);
  max-width: 34em;
  text-wrap: pretty;
}

.features {
  margin-bottom: 40px;
  border-top: 1px solid var(--line);
}

.features li {
  position: relative;
  padding: 14px 0 14px 26px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.94em;
}

.features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.45em;
  width: 6px;
  height: 6px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}

.card-cta {
  align-self: flex-start;
  margin-top: auto;
}

.card-emblem { display: none; }

@media (min-width: 960px) {
  .card-emblem {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    margin-block: 0 48px;
  }
  .card-emblem svg { width: min(240px, 70%); height: auto; }
}

/* Company */

.statement {
  max-width: 30em;
  margin-inline: auto;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1.32;
  color: var(--ink);
  text-wrap: balance;
}

.commitments {
  display: grid;
  gap: 40px;
  margin-top: clamp(64px, 8vw, 112px);
}

@media (min-width: 700px) {
  .commitments { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
}

@media (min-width: 1100px) {
  .commitments { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; }
}

.commitment {
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.commitment-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 22px;
}

.commitment h3 {
  font-size: clamp(1.375rem, 1.8vw, 1.625rem);
  margin-bottom: 12px;
}

.commitment p { color: var(--ink-muted); font-size: 0.94em; }

/* Contact */

.contact-grid {
  display: grid;
  gap: 56px;
}

@media (min-width: 960px) {
  .contact-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 96px; }
}

.contact-intro h2 { margin-top: 26px; }
.contact-intro .section-intro { margin-top: 26px; }

.contact-form {
  display: grid;
  gap: 26px;
}

.field-row {
  display: grid;
  gap: 26px;
}

@media (min-width: 640px) {
  .field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.field { display: grid; gap: 10px; align-content: start; }

.field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.optional {
  letter-spacing: 0.06em;
  text-transform: none;
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--field-border);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 0.3s var(--ease);
}

/* overflow-x: hidden keeps axe from reporting the textarea as partially obscured. */
.field textarea { min-height: 168px; resize: vertical; overflow-x: hidden; overflow-y: auto; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--ink-muted); }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { border-color: var(--ink); }

.field [aria-invalid="true"] { border-color: var(--danger); }

.select { position: relative; }

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  cursor: pointer;
}

.field select option { background: var(--surface); color: var(--ink); }

.select::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  transform: rotate(45deg);
  pointer-events: none;
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--danger);
}

.field-error[hidden] { display: none; }

.error-icon { width: 16px; height: 16px; flex: none; margin-top: 3px; }

.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 6px;
}

.form-status {
  font-size: 15px;
  color: var(--ink-muted);
}

.form-status:empty { display: none; }
.form-status[data-state="success"] { color: var(--success); }
.form-status[data-state="error"] { color: var(--danger); }

.form-note {
  font-size: 14px;
  color: var(--ink-muted);
  max-width: 36em;
}

.form-outcome {
  display: none;
  margin-top: 32px;
  padding: 20px 22px;
  border: 1px solid var(--success);
  color: var(--success);
}

.form-outcome-error { border-color: var(--danger); color: var(--danger); }
.form-outcome:target { display: block; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: clamp(72px, 9vw, 120px) 48px;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  gap: 48px;
}

@media (min-width: 800px) {
  .footer-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
}

.footer-line {
  margin-top: 22px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.375rem;
  color: var(--ink-muted);
}

.footer-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}

.footer-col li { margin-bottom: 6px; }

.footer-col a,
.footer-plain {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--ink-muted);
  font-size: 15px;
  transition: color 0.3s var(--ease);
}

.footer-col a:hover { color: var(--ink); }

.footer-note { margin-left: 0.35em; font-size: 0.9em; }

.footer-legal {
  display: grid;
  gap: 10px;
  margin-top: clamp(56px, 7vw, 96px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-muted);
}

.trademark { max-width: 60em; font-size: 12px; }

/* ---------- 404 ---------- */

.not-found {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: calc(100svh - 160px);
  padding-block: 120px;
  text-align: center;
  isolation: isolate;
}

.not-found .hero-inner p:not(.eyebrow) {
  margin-top: 28px;
  color: var(--ink-muted);
}

.not-found .display { margin-top: 28px; font-size: clamp(2.5rem, 6vw, 5rem); }
.not-found .btn { margin-top: 44px; }

/* ---------- Reveal (JS + full motion only) ---------- */

html.js[data-motion="full"] [data-reveal] {
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

html.js[data-motion="full"] [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(18px);
}

html.js[data-motion="full"] .d1 { transition-delay: 100ms; }
html.js[data-motion="full"] .d2 { transition-delay: 200ms; }
html.js[data-motion="full"] .d3 { transition-delay: 300ms; }

/* ---------- Test hook: flat (no decoration) ---------- */

html.flat [data-decor] { display: none !important; }
html.flat .card::after { content: none; }

/* ---------- Forced colours ---------- */

@media (forced-colors: active) {
  [data-decor] { display: none !important; }
  .card::after { content: none; }
  .btn, .spec-chips li { border: 1px solid CanvasText; }
  .status-dot { forced-color-adjust: none; background: CanvasText; }
}

/* ---------- Print ---------- */

@media print {
  html, body { background: #fff; color: #000; }
  html.js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .site-header, .nav-toggle, .primary-nav, .skip-link, [data-decor],
  .contact-form, .hero-actions, .card-cta { display: none !important; }
  h1, h2, h3, h4, .display, .numeral, .fact-figure, .eyebrow, .card-name,
  .card-tagline, .statement, .limits, .spec-table td, .spec-table td.algo { color: #000 !important; }
  .section-intro, .lede, .principle p, .fact dd, .card-body, .features li,
  .ledger-col li, .commitment p, .footnote, .footer-legal { color: #333 !important; }
  .card, .spec-sheet { background: #fff; border-color: #999; }
  .section { padding-block: 32px; }
}

/* 404 page footer variant */
.site-footer-compact { padding-block: 32px; }
.site-footer-compact .footer-legal { margin-top: 0; padding-top: 0; border-top: 0; }
