/*
 * Design tokens: the ONLY place raw design values live (F-81 spec AC1; ADR 0011).
 *
 * Direction "C · Ledger": ink and saffron, Space Grotesk headings, Source Sans 3 text. Every
 * component and screen uses these custom properties, never a raw colour, font or size.
 * tokens.test.ts reads this file and checks each text / background pair against WCAG 2.1 AA, so a
 * later change can't quietly break contrast. Brand colours are the --accent* and --ink* groups:
 * replacing them here restyles every screen (AC2).
 */
:root {
  /* Ink: side menu, top bar, primary text */
  --ink: #111318;
  --ink-raised: #1d2026;
  --ink-line: #2e3138;
  --on-ink: #f3f1ec;
  --on-ink-muted: #c9c5bc;

  /* Paper and surfaces */
  --paper: #faf9f7;
  --surface: #ffffff;
  --line: #e4e1da; /* decorative lines only (rows, card borders) */
  --text: #111318;
  --text-muted: #55524b;
  --control-border: #8c887f; /* input and outlined-button borders: >= 3:1 */

  /* Accent (saffron) */
  --accent: #b45309; /* primary buttons; white text on it */
  --accent-hover: #9a4407;
  --accent-text: #9a4407; /* links and eyebrows on light */
  --accent-strong-text: #7a3505; /* text on --accent-soft */
  --accent-soft: #fdf0e1;
  --accent-on-ink: #f0a35e;
  --on-accent: #ffffff;

  /* States */
  --success: #166534;
  --success-soft: #e8f5ec;
  --danger: #b42318;
  --danger-hover: #912018;
  --danger-soft: #fdecea;
  --info-soft: #f1efea;

  /* Focus ring */
  --focus: #b45309;
  --focus-on-ink: #f0a35e;
  --focus-width: 3px;

  /* Type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-text: "Source Sans 3", system-ui, sans-serif;
  /* F-11: the 22 languages' scripts, each before the text font (loaded on demand). */
  --font-script-beng: "Noto Sans Bengali", var(--font-text);
  --font-script-deva: "Noto Sans Devanagari", var(--font-text);
  --font-script-gujr: "Noto Sans Gujarati", var(--font-text);
  --font-script-guru: "Noto Sans Gurmukhi", var(--font-text);
  --font-script-knda: "Noto Sans Kannada", var(--font-text);
  --font-script-mlym: "Noto Sans Malayalam", var(--font-text);
  --font-script-mtei: "Noto Sans Meetei Mayek", var(--font-text);
  --font-script-olck: "Noto Sans Ol Chiki", var(--font-text);
  --font-script-orya: "Noto Sans Oriya", var(--font-text);
  --font-script-taml: "Noto Sans Tamil", var(--font-text);
  --font-script-telu: "Noto Sans Telugu", var(--font-text);
  --font-script-arab: "Noto Naskh Arabic", var(--font-text);
  --font-script-urdu: "Noto Nastaliq Urdu", var(--font-text);
  --text-xs: 0.8125rem; /* 13 */
  --text-sm: 0.875rem; /* 14 */
  --text-md: 0.9375rem; /* 15 */
  --text-base: 1rem; /* 16 */
  --text-lg: 1.125rem; /* 18 */
  --text-xl: 1.25rem; /* 20 */
  --text-2xl: 1.5rem; /* 24 */
  --text-3xl: 1.875rem; /* 30 */
  --text-4xl: 2.25rem; /* 36 */
  --text-display: 3.25rem; /* 52: the signed-out brand headline only */
  --leading-text: 1.5;
  --leading-heading: 1.15;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Space (4 px steps), shape, size */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --radius-sm: 4px;
  --radius-md: 6px;
  --target-min: 44px; /* touch targets */
  --content-max: 72rem;
  --menu-width: 15.5rem;
  --shadow-raised: 0 1px 2px rgb(17 19 24 / 6%), 0 8px 24px rgb(17 19 24 / 8%);

  /* Motion: switched off when the device asks for reduced motion (AC16) */
  --motion-fast: 120ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* The dimmed page behind a modal dialog. Set on ::backdrop itself: older browsers don't let it
   inherit custom properties from :root. */
::backdrop {
  --backdrop: rgb(17 19 24 / 55%);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
  }
}

/* The one layout breakpoint (side menu <-> Menu button) is 900px; CSS can't read a custom property
   inside @media, so layouts write `@media (max-width: 900px)` and the guard test pins the value. */

@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
/*
 * The website's own rules (F-111 DD1). Only the console's tokens (tokens.css, placed before this
 * file by the build): no raw colours, fonts or sizes. Pages are one column at the reading width;
 * the header's links wrap under the logo below 900 px (the console's one breakpoint), so nothing
 * scrolls sideways at 360 px (rule 28). T9 adds the content's rules.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: var(--leading-text);
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
}

h1 {
  font-size: var(--text-3xl);
  margin: 0 0 var(--space-4);
}

a {
  color: var(--accent-text);
}

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

.skip {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-12));
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  z-index: 1;
}

.skip:focus {
  top: var(--space-2);
}

.bar {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* The header: ink, like the console's top bar. */
.top {
  background: var(--ink);
  color: var(--on-ink);
  padding: var(--space-3) 0;
}

.top .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
}

.top a:focus-visible {
  outline-color: var(--focus-on-ink);
}

.home {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--target-min);
  color: var(--on-ink);
  text-decoration: none;
}

.home img {
  display: block;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.name {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
}

.nav {
  flex: 1 1 auto;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-min);
  min-width: var(--target-min);
  color: var(--on-ink);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  text-decoration: underline;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.top .button {
  color: var(--on-accent);
}

.button:hover {
  background: var(--accent-hover);
}

main {
  display: block;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-10) var(--space-4);
}

main:focus {
  outline: none;
}

.lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
}

.facts {
  padding-left: var(--space-6);
}

.facts li + li {
  margin-top: var(--space-3);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}

/* The footer: ink, with the disclaimer and the contact (rule 2). */
.foot {
  background: var(--ink);
  color: var(--on-ink);
  padding: var(--space-8) 0;
}

.foot p {
  margin: 0 0 var(--space-3);
}

.foot a {
  color: var(--on-ink);
}

.foot a:focus-visible {
  outline-color: var(--focus-on-ink);
}

.product {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
}

/* The pages' content (T9). One column on a phone; cards side by side when there is room. */
.hero {
  padding-bottom: var(--space-8);
}

@media (min-width: 900px) {
  .hero h1 {
    font-size: var(--text-display);
  }
}

.band {
  margin-top: var(--space-10);
}

.band h2 {
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-4);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--content-max) / 4)), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cards > li {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.cards h3 {
  font-size: var(--text-lg);
  margin: 0 0 var(--space-2);
}

.cards p {
  margin: 0 0 var(--space-2);
}

.cards a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}

figure {
  margin: 0;
}

.loop {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--info-soft);
  border-radius: var(--radius-md);
}

.glimpse-title {
  font-weight: var(--weight-semibold);
}

.try-it,
.strip,
.closing {
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.strip {
  background: var(--accent-soft);
}

.sample {
  font-weight: var(--weight-semibold);
}

.band p > a:only-child:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}

.version {
  color: var(--text-muted);
}

.notice {
  max-width: var(--content-max);
}

.notice li + li {
  margin-top: var(--space-2);
}

.contact {
  margin-bottom: 0;
}

/* Request a demo (T10): one column at a reading width; 44 px controls; problems beside fields. */
.request {
  max-width: calc(var(--content-max) / 2);
}

.demo-form {
  display: grid;
  gap: var(--space-5);
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field label {
  font-weight: var(--weight-semibold);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: var(--target-min);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.field textarea {
  resize: vertical;
}

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

.field-error,
.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: var(--weight-semibold);
}

.form-error:not(:empty) {
  padding: var(--space-3) var(--space-4);
  background: var(--danger-soft);
  border-radius: var(--radius-md);
}

.form-note {
  margin: 0;
  color: var(--text-muted);
}

.demo-form .button {
  justify-self: start;
  border: 0;
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

/* The hidden field (rule 18; DD8): off-screen, not display:none, so a bot still sees it. */
.hp {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.thanks {
  padding: var(--space-5);
  background: var(--success-soft);
  color: var(--success);
  border-radius: var(--radius-md);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.no-script,
.form-off {
  font-size: var(--text-lg);
}

/* Clips (T11): the still, then the video in its place, full width; Play / Pause beneath. */
figure img.still,
figure video {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.clip-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-min);
  min-width: calc(var(--target-min) * 2);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

/* Try it (T11): the sample company's page with its banner, and the records beside it. */
.tryit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--content-max) / 3)), 1fr));
  gap: var(--space-6);
  margin-top: var(--space-4);
}

.tryit-page {
  padding: var(--space-4);
  background: var(--paper);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
}

.tryit-site {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
}

.tryit-records h3 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg);
}

.tryit-records ol {
  margin: 0;
  padding-left: var(--space-6);
}

.record + .record {
  margin-top: var(--space-2);
}

.record.withdrawn {
  font-weight: var(--weight-semibold);
}

/* F-119's content pages (Markdown, markdown.ts): reading width, the general-information sentence,
 * the byline, the checklist, and tables in their own scrolling box (the page never scrolls
 * sideways on a phone). */
.prose h2 {
  font-size: var(--text-2xl);
  margin: var(--space-10) 0 var(--space-4);
}

.prose h3 {
  font-size: var(--text-lg);
  margin: var(--space-6) 0 var(--space-2);
}

.prose .general,
.prose .byline {
  color: var(--text-muted);
}

.prose .table {
  overflow-x: auto;
  margin: var(--space-4) 0;
}

.prose table {
  border-collapse: collapse;
  min-width: 100%;
}

.prose th,
.prose td {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.checklist > li + li {
  margin-top: var(--space-3);
}

.checklist .cite {
  color: var(--text-muted);
}

/* A hub's list of the pages below it (DD4): each title a link, its description underneath. */
.listing {
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

.listing > li + li {
  margin-top: var(--space-5);
}

.listing a {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
}

.listing p {
  margin: var(--space-1) 0 0;
}

/* The breadcrumb on every page below Home (F-119 rule 17): one line of links, wrapping on a phone. */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.crumbs li + li::before {
  content: "/";
  margin-right: var(--space-2);
  color: var(--text-muted);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  min-width: var(--target-min);
}

.crumbs [aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}

/* An FAQ's questions and answers (rule 17): each question a heading, its short answer below. */
.faq .qa h3 {
  font-size: var(--text-lg);
  margin: var(--space-6) 0 var(--space-2);
}

.faq .qa p {
  margin: 0;
}

/* Printing a guide (rule 8, AC8): the words only, without the header, footer, breadcrumb or buttons. */
@media print {
  .top,
  .foot,
  .skip,
  .crumbs,
  .button {
    display: none;
  }

  main {
    padding: 0;
    max-width: none;
  }

  .prose a {
    color: inherit;
  }

  /* The checklist (rule 8) starts a new sheet and never splits an item across two. */
  .prose h2#the-dpdp-compliance-checklist {
    break-before: page;
  }

  .checklist > li {
    break-inside: avoid;
  }
}
