/* ============================================================================
   Stoic Software — brand.css
   The branding layer. Everything here implements website/brand-guidelines.html
   ("the grid", decided 2 September 2026) and nothing here is page layout.
   Any Stoic web surface should link this file first and build layout on top.
   Load Public Sans 400/500/700 (font-display: swap) before this file applies.
   ========================================================================== */

/* ==================== Tokens (§03) ==================== */

:root {
  --white: #FFFFFF;
  --paper: #F3F3F0;
  --black: #121212;
  --red: #D22C22;
  --grey: #67675F;
  --hairline: #D9D9D5;

  --font: "Public Sans", "Segoe UI", Arial, sans-serif;

  --measure: 46rem;  /* text measure cap */
  --wide: 72rem;     /* full-width band cap */
}

/* ==================== Base (§01, §04, §05) ==================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0; /* square corners everywhere — brand law */
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--red);
  color: var(--white);
}

img {
  max-width: 100%;
  height: auto;
}

/* ==================== Type (§04) ==================== */

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.8rem;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.02rem;
  margin: 1.6rem 0 0.4rem;
}

p, ul, ol {
  margin: 0 0 1rem;
  max-width: var(--measure);
}

ul, ol {
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.35rem;
}

strong {
  font-weight: 700;
}

/* No italics in the brand: emphasis is 700, structure is rules. */
em, i {
  font-style: normal;
  font-weight: 700;
}

.kicker {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 0.8rem;
}

.kicker-grey {
  color: var(--grey);
}

/* Section index inside a kicker: grey, spaced off the label. */
.kicker .no {
  color: var(--grey);
  margin-right: 0.75em;
  font-variant-numeric: tabular-nums;
}

.label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  display: block;
  margin-bottom: 0.5rem;
}

.lede {
  font-size: 1.15rem;
  color: var(--grey);
  max-width: var(--measure);
}

.note {
  font-size: 0.85rem;
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}

.figure {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Index numbers (§05): small, 500, red or grey, tabular — only where order is real. */
.index {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.index-grey {
  color: var(--grey);
}

/* The house full stop, for display settings (§02, §04). */
.redsq {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  background: var(--red);
}

/* ==================== Links (§06) ==================== */

a {
  color: var(--black);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

a:hover {
  color: var(--red);
}

/* Navigation links drop the underline until hover. */
.nav-link {
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}

.text-link {
  font-weight: 500;
  white-space: nowrap;
}

.text-link::after {
  content: " \2192" / "";
}

/* ==================== Focus (§08) ==================== */

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

/* ==================== Buttons (§06) ==================== */

.btn {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.85rem 1.5rem;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.btn:hover {
  background: var(--red);
  color: var(--white);
}

/* Outline variant — reserved for regulatory equal-prominence dialogs (the consent banner,
   its privacy-page control). Marketing pages keep one primary button per page. */
.btn-outline {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--black);
  padding: calc(0.85rem - 1px) calc(1.5rem - 1px);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--red);
  border-color: var(--red);
}

/* ==================== Rules and panels (§05) ==================== */

.rule-3 {
  border-top: 3px solid var(--black);
}

.rule-2 {
  border-top: 2px solid var(--black);
}

.rule-1 {
  border-top: 1px solid var(--hairline);
}

.panel {
  background: var(--paper);
  padding: 1.4rem 1.6rem;
}

.panel > :last-child {
  margin-bottom: 0;
}

/* ==================== Tables (§04, §06) ==================== */

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  padding: 0.5rem 1.5rem 0.5rem 0;
  border-bottom: 2px solid var(--black);
  white-space: nowrap;
}

td {
  padding: 0.7rem 1.5rem 0.7rem 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}

td.figure {
  white-space: nowrap;
}

/* ==================== Stat and price blocks (§06) ==================== */

.stat {
  border-top: 1px solid var(--hairline);
  padding-top: 0.9rem;
}

.stat .label {
  margin-bottom: 0.3rem;
}

.stat .figure {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
  display: block;
}

.stat .caption {
  font-size: 0.85rem;
  color: var(--grey);
}

/* ==================== Forms (§06) ==================== */

.form-field {
  margin-bottom: 1.4rem;
}

.form-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 0.45rem;
}

.form-field .optional {
  text-transform: none;
  letter-spacing: 0.02em;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--hairline);
  padding: 0.8rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--black);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--black);
  box-shadow: inset 0 0 0 1px var(--black); /* sharpens to 2px without layout shift */
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.form-field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field-validation-error {
  display: block;
  color: var(--red);
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.validation-summary-errors {
  border-left: 3px solid var(--red);
  padding-left: 1.1rem;
  margin-bottom: 1.4rem;
  color: var(--red);
  font-weight: 500;
}

.validation-summary-errors ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

input.input-validation-error,
textarea.input-validation-error {
  border-color: var(--red);
}

/* Honeypot — off-screen, never display:none (some bots skip hidden fields). */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==================== Utilities ==================== */

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

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ==================== Motion (§07) ==================== */

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
