/* Kompetty web: single stylesheet. Tokens follow brand-spec.md.
   Hex values are the resolved result of the brand-spec color-mix() definitions
   (oklch, navy over white) so scripts/contrast.py can read them without a CSS engine.
   Deviation from brand-spec: --muted uses 65 % navy (#596C84, 5.1:1 on --bg); the 55 %
   in the spec (#718296) measures 3.7:1 and fails WCAG AA for text.
   Orange (--accent) is a signal, max 2 uses per page. It measures 2.9:1 on white, so it is
   never used as text or as the only indicator on a light background; only on navy (5.2:1),
   and only through the .is-accent marker, which the build check counts (T015). */
/* Montserrat variable, Latin subset, self-hosted (src/fonts/README.md). Normal covers 400/600/800;
   the italic file serves the 800 italic of the brand. */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/Montserrat-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/Montserrat-Italic-latin.woff2") format("woff2");
}

:root {
  --bg: #F7F8F9;
  --surface: #FFFFFF;
  --fg: #0B2747;
  --muted: #596C84;
  --border: #DEE2E8;
  --accent: #FF6A00;
  --fg-soft: #BFCBDB; /* secondary text on navy fields, 9:1 */
  --fg-hover: #1A4A80; /* navy button on hover: white text 9.0:1 */
  --accent-hover: #FF9147; /* orange button on hover (only via .is-accent): navy text 6.7:1 */

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --radius: 0.5rem;
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; } /* header is 65 px on desktop; see the narrow-screen block below */
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
}
img, video { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 var(--space-2); font-weight: 800; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 var(--space-2); }
a { color: var(--fg); text-underline-offset: 0.2em; }
.muted { color: var(--muted); }

.wrap { width: min(100% - 2 * var(--space-3), var(--wrap)); margin-inline: auto; }
main.wrap { padding-block: var(--space-5); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Keyboard focus: always visible, navy ring with a white halo (works on light and navy). */
:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; box-shadow: 0 0 0 6px var(--surface); }

.skip-link {
  position: absolute; left: var(--space-2); top: -4rem; z-index: 30;
  background: var(--fg); color: var(--surface); padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-2); }

.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); } /* always reachable: language switch and navigation */
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding-block: var(--space-2); }
.logo { display: inline-flex; align-items: center; min-height: 1.5rem; } /* tap area >= 24 px even when the wordmark is 21 px tall */
.nav { display: flex; flex-wrap: wrap; gap: var(--space-3); flex: 1 1 auto; }
.nav a, .langs a, .site-footer a { font-weight: 600; display: inline-block; padding-block: 0.2rem; }
.langs { display: flex; gap: var(--space-2); font-size: var(--step--1); }
.langs a[aria-current="page"] { text-decoration: none; border-bottom: 3px solid var(--fg); }

.site-footer { background: var(--fg); color: var(--surface); }
.site-footer a { color: var(--surface); }
/* Small on purpose: the supplied wordmark is an auto-traced vector with wobbly edges that show above ~300 px. */
.footer-logo { width: 15rem; max-width: 100%; height: auto; margin-bottom: var(--space-3); }
.footer-inner { padding-block: var(--space-4); display: grid; gap: var(--space-2); font-size: var(--step--1); }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.footer-inner p { margin: 0; }

/* The one sanctioned orange. Text on navy, or a flat button with navy text (5.2:1). */
.is-accent { color: var(--accent); }
.btn.is-accent { background: var(--accent); color: var(--fg); }

/* Buttons: flat, square, one colour (DESIGN.md §3). */
.btn {
  display: inline-block; padding: 0.9rem 1.6rem; border-radius: 0;
  background: var(--fg); color: var(--surface); font-weight: 800; text-decoration: none;
  transition: transform 120ms ease-out;
}
.btn:active { transform: translateY(1px); }
.btn-light { background: var(--surface); color: var(--fg); }
.text-link { font-weight: 600; }

/* Hover feedback, pointer devices only (on touch it would stick after a tap). Instant, no transition: nothing moves,
   so there is nothing for prefers-reduced-motion to switch off. */
@media (hover: hover) {
  .btn:hover:not(:disabled) { background: var(--fg-hover); }
  .btn.is-accent:hover:not(:disabled) { background: var(--accent-hover); }
  .btn-light:hover:not(:disabled) { background: var(--bg); } /* same specificity as the rule above, and later: navy text needs a light background */
  a:not(.btn):hover { text-decoration-thickness: 0.17em; }
}

/* The axis: titles start at the margin, everything else hangs from 42 % (DESIGN.md §2). */
:root { --section-gap: 4.5rem; }
@media (min-width: 900px) { :root { --section-gap: clamp(7.5rem, 12vw, 11rem); } }
.axis, .note { display: block; }
.hero { padding-top: var(--section-gap); }
.claim {
  font-size: clamp(2.5rem, 1.2rem + 7vw, 6.5rem); font-style: italic; font-weight: 800;
  line-height: 0.98; letter-spacing: -0.02em; max-width: 14ch; margin-bottom: var(--space-4);
}
.lead { font-size: var(--step-1); line-height: 1.45; max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }

.tools { padding-top: var(--section-gap); }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.tool { background: var(--fg); color: var(--surface); padding: var(--space-4) var(--space-3); }
.tool a:not(.btn) { color: var(--surface); }
.tool h3 { font-size: var(--step-2); margin-bottom: var(--space-3); }
.tool-label { color: var(--fg-soft); font-size: var(--step--1); font-weight: 600; margin-bottom: var(--space-1); }
.tool .btn-light { margin-top: var(--space-2); }

.note { padding-top: var(--section-gap); }
.note-side { font-size: var(--step--1); color: var(--muted); font-weight: 600; letter-spacing: 0; }
.statement { font-size: var(--step-2); line-height: 1.35; font-weight: 600; max-width: 38rem; }
main > section:last-of-type { padding-bottom: var(--section-gap); }

@media (min-width: 900px) {
  .axis, .note { display: grid; grid-template-columns: 42% 1fr; column-gap: 0; }
  .axis > * { grid-column: 2; }
  .note-side { grid-column: 1; margin: 0.6rem 0 0; padding-right: var(--space-3); }
  .note .statement { grid-column: 2; }
  .tool-list { grid-template-columns: 1fr 1fr; }
  .tool { padding: var(--space-5) var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* --- Organizer page (T036) ------------------------------------------------ */
.page-title {
  font-size: clamp(2.5rem, 1.2rem + 5.2vw, 5.5rem); font-weight: 800; line-height: 1;
  letter-spacing: -0.02em; max-width: 20ch; margin-bottom: var(--space-4);
}
.price-line { font-size: var(--step-1); font-weight: 800; margin-bottom: var(--space-1); }
.prose { max-width: 38rem; }

.breaks { padding-top: var(--section-gap); display: grid; gap: var(--space-4); }
.break h3 { font-size: var(--step-2); }
.break .scene { color: var(--muted); }
@media (min-width: 900px) {
  .break { display: grid; grid-template-columns: 42% 1fr; }
  .break h3 { padding-right: var(--space-3); }
}

.field-navy { background: var(--fg); color: var(--surface); margin-top: var(--section-gap); padding-block: var(--space-5); }
.field-navy h2 { font-size: var(--step-2); margin-bottom: var(--space-4); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: var(--space-5); font-size: var(--step-1); line-height: 1.45; }
/* The number sits on the text, not on the list item, so it never drifts to the image side. */
.step p::before { counter-increment: step; content: counter(step) ". "; font-weight: 800; }
.step { display: grid; gap: var(--space-3); align-items: center; }
.shot { margin-block: 0; } /* margin-inline stays auto on .wrap */
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.hero + .shot { margin-top: var(--space-5); }
@media (min-width: 900px) {
  .step { grid-template-columns: 1fr 1.4fr; gap: var(--space-5); }
  .steps li:nth-child(even) .step { grid-template-columns: 1.4fr 1fr; }
  .steps li:nth-child(even) .step .shot { order: -1; }
}

.nots { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); font-size: var(--step-1); line-height: 1.45; max-width: 38rem; }

.faq { max-width: 44rem; }
.faq details { border-bottom: 1px solid var(--border); padding-block: var(--space-2); }
.faq summary { font-weight: 800; cursor: pointer; }
.faq details p { margin: var(--space-1) 0 0; }

.form-wrap { max-width: 34rem; }
[hidden] { display: none !important; } /* .field sets display:grid, which would otherwise win over the hidden attribute */
.form { display: grid; gap: var(--space-3); }
.field { display: grid; gap: 0.35rem; }
.field label, .check label { font-weight: 600; }
.field input, .field select {
  font: inherit; color: var(--fg); background: var(--surface); width: 100%;
  border: 2px solid var(--fg); border-radius: 0; padding: 0.7rem 0.8rem;
}
.field [aria-invalid="true"] { border-color: var(--fg); outline: 3px solid var(--fg); outline-offset: 2px; }
.check { display: flex; gap: var(--space-1); align-items: flex-start; }
.check input { width: 1.5rem; height: 1.5rem; margin-top: 0.2rem; flex: none; accent-color: var(--fg); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { justify-self: start; border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.form .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.form-status { margin-top: var(--space-2); font-weight: 600; min-height: 1.6em; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font-weight: 600; }

/* --- Legal pages (T044) --------------------------------------------------- */
.legal { max-width: 46rem; }
.legal h1 { margin-bottom: var(--space-4); }
.legal-section { margin-bottom: var(--space-4); }
.legal-section h2 { font-size: var(--step-1); margin-bottom: var(--space-1); }
.holder { margin: 0; display: grid; gap: var(--space-1); }
.holder div { display: grid; grid-template-columns: 11rem 1fr; gap: var(--space-2); }
.holder dt { font-weight: 800; }
.holder dd { margin: 0; }
@media (max-width: 600px) { .holder div { grid-template-columns: 1fr; gap: 0; } }

/* --- Scout page (T027, T028) ---------------------------------------------- */
.after { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); font-size: var(--step-1); line-height: 1.45; max-width: 44rem; }
.levels { padding-top: var(--section-gap); }
.levels h2 { font-size: var(--step-2); margin-bottom: var(--space-3); }
.table-scroll { overflow-x: auto; border: 2px solid var(--fg); }
.table-scroll:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }
.levels-table { width: 100%; min-width: 46rem; border-collapse: collapse; text-align: left; }
.levels-table caption { text-align: left; padding: var(--space-2); font-weight: 600; color: var(--muted); }
.levels-table th, .levels-table td { padding: var(--space-2); vertical-align: top; border-top: 1px solid var(--border); }
.levels-table thead th { font-weight: 800; border-top: 0; border-bottom: 2px solid var(--fg); }
.levels-table tbody th { font-weight: 600; width: 11rem; }
.levels-table .price { font-weight: 800; font-size: var(--step-1); }
.levels-table .n1-cell { border-left: 1px solid var(--border); }
.levels-table .buy-row td, .levels-table .buy-row th { border-top: 2px solid var(--fg); vertical-align: middle; }
.levels-table .btn { white-space: nowrap; }
.levels-note { margin-top: var(--space-2); max-width: 44rem; }
.shot-wide img { aspect-ratio: auto; /* each capture keeps its own width/height */ border: 1px solid var(--border); }
.shots { display: grid; gap: var(--space-4); padding-top: var(--section-gap); }

/* Fixed header on narrow screens: ~75 px instead of ~200 (logo and languages share a row, nav on its own line). */
@media (max-width: 52rem) {
  html { scroll-padding-top: 6rem; }
  .header-inner { gap: 0.1rem var(--space-2); padding-block: 0.4rem; justify-content: space-between; }
  .logo img { width: 7.5rem; height: auto; }
  .langs { order: 2; gap: var(--space-1); font-size: 0.8125rem; }
  .nav { order: 3; flex: 1 0 100%; gap: var(--space-2); font-size: 0.8125rem; }
}
@media (max-width: 24rem) {
  .header-inner { column-gap: var(--space-1); }
  .logo img { width: 6.25rem; }
  .langs { gap: 0.4rem; font-size: 0.75rem; }
  .nav { gap: var(--space-1) 0.75rem; font-size: 0.75rem; }
}
/* The capture screen sits right under the "sheet" break, hanging from the same axis as the text column. */
.breaks .shot { margin: 0; }
@media (min-width: 900px) { .breaks .shot { margin-left: 42%; } }

/* Scout prices on small screens: the table needs ~46 rem, so below 52 rem each level becomes its own block
   (a navy rule, no card chrome) and the table is hidden. Above, the table shows and the blocks do not. */
.level-list, .level-more, .level-caption { display: none; }
@media (max-width: 52rem) {
  .table-scroll { display: none; }
  .level-caption, .level-list, .level-more { display: block; }
  .level-caption { margin-bottom: var(--space-3); }
  .level-list { display: grid; gap: var(--space-4); }
  .level { border-top: 2px solid var(--fg); padding-top: var(--space-2); display: grid; gap: var(--space-1); }
  .level h3 { font-size: var(--step-2); margin: 0; }
  .level-what { margin: 0; }
  .level-billing { margin: 0; color: var(--muted); font-weight: 600; font-size: var(--step--1); }
  .level-prices { margin: var(--space-1) 0 var(--space-2); }
  .level-prices div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); padding-block: 0.65rem; border-top: 1px solid var(--border); }
  .level-prices div:last-child { border-bottom: 1px solid var(--border); }
  .level-prices dt { font-weight: 600; }
  .level-prices dd { margin: 0; font-weight: 800; font-size: var(--step-1); white-space: nowrap; }
  .level .btn { display: block; text-align: center; min-height: 3rem; line-height: 3rem; padding-block: 0; }
  .level-more { margin-top: var(--space-3); }
}

/* Screenshots link to their full-size file: on a phone the page frame is ~340 px wide and a 1400 px table is a smear,
   so a tap opens the real image (pinch-zoom works there). */
.shot-link { display: block; }
.shot-link:focus-visible { outline-offset: 4px; }

/* Small screens: section titles keep heading rank (on desktop they hang from the axis as small side notes),
   long statements come down to a readable size, FAQ questions get a comfortable tap area. */
@media (max-width: 899px) {
  .note-side { font-size: var(--step-2); font-weight: 800; color: var(--fg); margin: 0 0 var(--space-2); letter-spacing: normal; }
  .statement { font-size: var(--step-1); line-height: 1.4; font-weight: 600; }
  .faq summary { padding-block: 0.55rem; }
}
