/* =========================================================================
   GroundSense — ground-sense.com
   Design tokens are derived from the logo: petrol #164454 + gold #E2C85A.
   Light palette on :root, dark palette via prefers-color-scheme / data-theme.
   ========================================================================= */

:root {
  /* Brand (fixed in both themes) */
  --petrol: #164454;
  --petrol-deep: #0F3240;
  --gold: #E2C85A;
  --gold-hover: #EDD677;
  --on-gold: #0F2A34;

  /* Light theme */
  --ground: #EEF2F2;
  --surface: #F8FAFA;
  --field-bg: #FFFFFF;
  --ink: #0F2A34;
  --ink-2: #2D4953;
  --muted: #56707A;
  --line: #CCD8DB;
  --line-strong: #94AAB1;
  --accent-text: #1B5A6E;   /* eyebrows, links on the ground */
  --tag-open-bg: #DCEBE3;
  --tag-open-ink: #1E5A3C;
  --focus: #164454;

  --band-bg: var(--petrol);
  --band-ink: #EAF1F2;
  --band-muted: #A8C3CA;
  --band-line: rgba(234, 241, 242, 0.18);

  /* Type */
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --f-mark: "Jost", "Futura", "Century Gothic", sans-serif;

  --t-xs: 0.75rem;     /* 12 */
  --t-sm: 0.875rem;    /* 14 */
  --t-base: 1.125rem;  /* 18 */
  --t-md: 1.375rem;    /* 22 */
  --t-lg: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --t-xl: clamp(2.3rem, 1.4rem + 3vw, 3.6rem);

  /* Space & layout */
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  --section-y: clamp(4rem, 3rem + 5vw, 7.5rem);
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0B1C23;
    --surface: #10272F;
    --field-bg: #0E232B;
    --ink: #E6EDEE;
    --ink-2: #C3D2D5;
    --muted: #8FA7AE;
    --line: #1F3C46;
    --line-strong: #3A5C67;
    --accent-text: #E2C85A;
    --tag-open-bg: #16372B;
    --tag-open-ink: #9FD7B6;
    --focus: #E2C85A;
    --band-bg: #164454;
  }
}
:root[data-theme="dark"] {
  --ground: #0B1C23;
  --surface: #10272F;
  --field-bg: #0E232B;
  --ink: #E6EDEE;
  --ink-2: #C3D2D5;
  --muted: #8FA7AE;
  --line: #1F3C46;
  --line-strong: #3A5C67;
  --accent-text: #E2C85A;
  --tag-open-bg: #16372B;
  --tag-open-ink: #9FD7B6;
  --focus: #E2C85A;
  --band-bg: #164454;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

img, canvas { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); text-wrap: balance; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }

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

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--on-gold);
  padding: 10px 14px; font-family: var(--f-display); font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Shared pieces ---------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 600;
  font-stretch: 108%;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn-primary { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.9375rem; }

.spec-list {
  list-style: none;
  display: grid;
  gap: 0;
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  line-height: 1.45;
  color: var(--ink-2);
}
.spec-list li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  padding-block: 9px;
  border-top: 1px solid var(--line);
}
.spec-list li::before {
  content: "";
  width: 6px; height: 6px;
  margin-top: 0.5em;
  background: var(--accent-text);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  min-height: 68px;
}
.brand { text-decoration: none; display: inline-flex; }
.wordmark {
  display: inline-block;
  background: var(--petrol);
  color: var(--gold);
  font-family: var(--f-mark);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.2em;
  line-height: 1;
  padding: 11px 10px 11px 14px; /* right padding smaller: tracking adds trailing space */
  border-radius: 2px;
}

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) {
  font-family: var(--f-display);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding-block: 6px;
  border-bottom: 1.5px solid transparent;
}
.site-nav a:not(.btn):hover { color: var(--ink); border-bottom-color: var(--gold); }

.nav-toggle {
  display: none;
  font-family: var(--f-mono); font-size: var(--t-sm); letter-spacing: 0.06em; text-transform: uppercase;
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  min-height: 40px; padding: 0 14px; cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ground);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding-block: 14px; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 16px; }
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0;
}
.hero > * { min-width: 0; }
.hero-copy { display: grid; gap: 1.5rem; padding-top: clamp(0rem, 2vw, 1.5rem); }
.hero h1 {
  font-size: var(--t-xl);
  font-weight: 760;
  font-stretch: 118%;
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.lede { font-size: 1.1875rem; line-height: 1.6; color: var(--ink-2); max-width: 36rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
}
.hero-facts div { display: grid; gap: 4px; }
.hero-facts dt, .scene-meta dt, .use-dl dt, .seg-label {
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-facts dd { font-family: var(--f-display); font-weight: 600; font-size: 0.9375rem; line-height: 1.3; }

/* ---------- Scene (hero figure) ---------- */
.scene { margin: 0; display: grid; gap: 14px; }

.scene-controls { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.seg { display: grid; gap: 6px; }
.seg-buttons {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.seg-buttons button {
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  padding: 8px 12px;
  min-height: 36px;
  background: transparent;
  color: var(--ink-2);
  border: 0;
  border-left: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.seg-buttons button:first-child { border-left: 0; }
.seg-buttons button:hover { background: color-mix(in srgb, var(--petrol) 8%, transparent); color: var(--ink); }
.seg-buttons button[aria-pressed="true"] { background: var(--petrol); color: var(--gold); }
.seg-buttons button:focus-visible { outline-offset: -3px; }

.scene-stage { position: relative; padding-top: 20px; }
.scene-ruler {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between;
  list-style: none;
  font-family: var(--f-mono); font-size: 0.6875rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.scene-ruler li { position: relative; line-height: 1; }
.scene-ruler li:first-child { transform: translateX(-1px); }

.scene-frame {
  position: relative;
  aspect-ratio: 3 / 2;
  max-width: 100%;
  background: var(--petrol-deep);
  border: 1px solid var(--line-strong);
}
/* corner registration ticks, like a product frame */
.scene-frame::before, .scene-frame::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--ink); border-style: solid;
}
.scene-frame::before { top: -6px; left: -6px; border-width: 1.5px 0 0 1.5px; }
.scene-frame::after { bottom: -6px; right: -6px; border-width: 0 1.5px 1.5px 0; }

#scene-canvas {
  width: 100%; height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.scene-scale {
  position: absolute; left: 10px; bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  background: rgba(11, 28, 35, 0.72);
  color: #EAF1F2;
  font-family: var(--f-mono); font-size: 0.6875rem;
  width: calc(22.222% + 96px); /* 200 m of 900 m + label room */
}
.scale-north { font-weight: 500; }
.scale-bar {
  flex: 1;
  height: 6px;
  border: 1px solid #EAF1F2;
  background: linear-gradient(90deg, #EAF1F2 0 50%, transparent 50% 100%);
}

.scene-callout {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.callout-ring {
  display: block;
  width: var(--ring, 64px); height: var(--ring, 64px);
  border: 1.5px dashed var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(11, 28, 35, 0.35);
}
.callout-label {
  position: absolute; top: 50%; left: calc(100% + 10px);
  transform: translateY(-50%);
  white-space: nowrap;
  background: var(--gold); color: var(--on-gold);
  font-family: var(--f-mono); font-size: 0.6875rem; font-weight: 500;
  padding: 4px 7px;
}
.scene-callout.flip .callout-label { left: auto; right: calc(100% + 10px); }
@media (max-width: 600px) {
  .callout-label,
  .scene-callout.flip .callout-label { top: calc(100% + 6px); left: 50%; right: auto; transform: translateX(-50%); }
}

.scene-caption { display: grid; gap: 12px; }
.scene-note { font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2); max-width: 44rem; min-height: 3.1em; }

.scene-legend { display: grid; gap: 4px; max-width: 320px; }
.legend-bar { height: 8px; border: 1px solid var(--line-strong); }
.legend-ticks {
  display: flex; justify-content: space-between;
  font-family: var(--f-mono); font-size: 0.6875rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.scene-meta {
  display: flex; flex-wrap: wrap;
  gap: 8px 22px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.scene-meta div { display: grid; gap: 2px; }
.scene-meta dd { font-family: var(--f-mono); font-size: 0.8125rem; color: var(--ink); font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-top: 0; }
}
@media (max-width: 520px) {
  .seg-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .seg { width: 100%; }
  .seg-buttons button { padding: 8px 4px; font-size: 0.75rem; }
  .hero-facts { grid-template-columns: 1fr 1fr; }
  .hero-facts div:last-child { grid-column: 1 / -1; }
  .scene-scale { width: auto; }
  .scale-bar { flex: 0 0 60px; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y) 0; scroll-margin-top: 72px; }
#top { scroll-margin-top: 72px; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas:
    "eyebrow eyebrow"
    "title intro";
  gap: 14px clamp(2rem, 5vw, 5rem);
  align-items: end;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem);
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}
.section-head .eyebrow { grid-area: eyebrow; }
.section-head h2 {
  grid-area: title;
  font-size: var(--t-lg);
  font-weight: 720;
  font-stretch: 114%;
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.section-intro { grid-area: intro; color: var(--ink-2); max-width: 38rem; }

@media (max-width: 820px) {
  .section-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "eyebrow" "title" "intro"; }
}

/* ---------- Services ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
}
.service { display: grid; grid-template-rows: auto auto 1fr; gap: 14px; align-content: start; }
.service h3 {
  font-size: var(--t-md);
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}
.service > p { color: var(--ink-2); font-size: 1.0625rem; }
.service .spec-list { align-self: start; margin-top: 6px; }

@media (max-width: 900px) {
  .services { grid-template-columns: minmax(0, 1fr); }
  .service { gap: 12px; }
}

/* ---------- Data table ---------- */
.table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 1rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: 0; }
.data-table thead th {
  font-family: var(--f-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  padding-block: 12px;
}
.data-table tbody th {
  font-family: var(--f-display); font-weight: 600; font-size: 1rem;
}
.data-table tbody th span {
  display: block;
  font-family: var(--f-mono); font-weight: 400; font-size: 0.75rem; color: var(--muted);
  margin-top: 2px;
}
.data-table td { color: var(--ink-2); }
.data-table .num { font-family: var(--f-mono); font-size: 0.875rem; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.data-table thead .num { color: var(--muted); }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--petrol) 5%, transparent); }
/* Group heading row that starts a second <tbody> (e.g. "Chinese very high resolution optical") */
.data-table tbody tr.group-row th {
  font-family: var(--f-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  padding-top: 22px; padding-bottom: 8px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.data-table tbody tr.group-row:hover { background: none; }

.tag {
  display: inline-block;
  font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink-2);
  white-space: nowrap;
}
.tag-open { background: var(--tag-open-bg); border-color: transparent; color: var(--tag-open-ink); }

.footnote { margin-top: 14px; font-size: 0.875rem; color: var(--muted); max-width: 48rem; }

/* ---------- Use cases ---------- */
.uses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 5rem);
}
.use {
  display: grid;
  gap: 10px;
  align-content: start;
  padding-block: 22px 26px;
  border-top: 1px solid var(--line);
}
.use-sector {
  font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-text);
}
.use-q {
  font-family: var(--f-body);
  font-style: italic;
  font-weight: 400;
  font-size: 1.4375rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.use-dl { display: grid; gap: 4px; margin-top: 4px; }
.use-dl div { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: baseline; }
.use-dl dd { font-size: 0.9375rem; color: var(--ink-2); }

@media (max-width: 760px) { .uses { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Method track ---------- */
.track {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  position: relative;
}
.track-step {
  position: relative;
  display: grid; gap: 10px; align-content: start;
  padding: 34px 20px 0 0;
}
/* ground-track line with a node per step */
.track-step::before {
  content: ""; position: absolute; top: 10px; left: 0; right: 0;
  height: 1.5px; background: var(--line-strong);
}
.track-step::after {
  content: ""; position: absolute; top: 5px; left: 0;
  width: 11px; height: 11px; background: var(--ground);
  border: 1.5px solid var(--ink); transform: rotate(45deg);
}
.track-step:first-child::after { background: var(--gold); border-color: var(--gold); }
.track-n { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.track-step h3 { font-size: 1.25rem; font-weight: 700; font-stretch: 112%; }
.track-step p { font-size: 1rem; color: var(--ink-2); }

@media (max-width: 900px) {
  .track { grid-template-columns: minmax(0, 1fr); }
  .track-step { padding: 0 0 28px 36px; }
  .track-step::before { top: 0; bottom: 0; left: 5px; right: auto; width: 1.5px; height: auto; }
  .track-step:last-child::before { bottom: auto; height: 12px; }
  .track-step::after { top: 4px; left: 0; }
}

/* ---------- Brand band (principles) ---------- */
.band {
  margin-top: var(--section-y);
  background: var(--band-bg);
  color: var(--band-ink);
}
.band-inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(3.5rem, 3rem + 3vw, 6rem);
}
.band-title {
  font-size: var(--t-lg);
  font-weight: 720;
  font-stretch: 116%;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--band-ink);
}
.band-title em { font-style: normal; color: var(--gold); }
.principles { display: grid; gap: 0; }
.principle {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 8px 32px;
  padding-block: 20px;
  border-top: 1px solid var(--band-line);
}
.principle:first-child { border-top: 0; padding-top: 4px; }
.principle h3 { font-size: 1.125rem; font-weight: 650; font-stretch: 110%; color: var(--gold); }
.principle p { color: var(--band-muted); font-size: 1.0625rem; }

@media (max-width: 900px) {
  .band-inner { grid-template-columns: minmax(0, 1fr); }
  .principle { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Platform teaser ---------- */
.status-pill {
  font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.08em;
  padding: 3px 8px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}
.products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
}
.product {
  display: grid; gap: 10px; align-content: start;
  padding: 24px 26px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.product-reg { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: 0.06em; color: var(--accent-text); }
.product h3 { font-size: var(--t-md); font-weight: 700; font-stretch: 112%; }
.product p:last-child { color: var(--ink-2); font-size: 1.0625rem; }
.platform-cta { margin-top: 22px; }
.link-arrow {
  font-family: var(--f-display); font-weight: 600; font-size: 1rem;
  color: var(--accent-text);
  text-decoration: none;
  border-bottom: 1.5px solid var(--gold);
  padding-bottom: 2px;
}
.link-arrow::after { content: " →"; }
.link-arrow:hover { color: var(--ink); }

@media (max-width: 760px) { .products { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  padding-bottom: var(--section-y);
}
.contact-copy {
  display: grid; gap: 16px; align-content: start;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}
.contact-copy h2 {
  font-size: var(--t-lg);
  font-weight: 720;
  font-stretch: 114%;
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.contact-copy > p { color: var(--ink-2); }
.contact-sub { font-size: 1rem; font-weight: 650; font-stretch: 108%; margin-top: 10px; }
.contact-direct { font-size: 1rem; }
.contact-direct a { color: var(--accent-text); text-underline-offset: 3px; }

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  align-content: start;
  padding: clamp(20px, 3vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
}
.field { display: grid; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field label {
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2);
}
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 12px;
  min-height: 46px;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.field input::placeholder { color: var(--muted); opacity: 0.8; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.field [aria-invalid="true"] { border-color: #B3261E; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form-status { font-size: 0.9375rem; color: var(--ink-2); }
.form-status.is-error { color: #B3261E; }
:root[data-theme="dark"] .form-status.is-error { color: #FF8A80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-status.is-error { color: #FF8A80; } }

@media (max-width: 900px) { .contact { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .form { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 36px 44px;
  background: var(--ground);
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
  gap: 24px 40px;
  align-items: start;
}
.footer-brand { display: grid; gap: 12px; justify-items: start; }
.footer-brand p { font-size: 0.9375rem; color: var(--muted); max-width: 26rem; }
.footer-nav, .footer-legal { display: flex; flex-wrap: wrap; gap: 10px 22px; font-family: var(--f-display); font-size: 0.9375rem; }
.footer-legal { flex-direction: column; gap: 8px; font-size: 0.875rem; color: var(--muted); }
.footer-nav a, .footer-legal a { color: var(--ink-2); text-decoration: none; }
.footer-nav a:hover, .footer-legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 760px) { .footer-inner { grid-template-columns: minmax(0, 1fr); } }
