/* Grounded AI Practice — landing site stylesheet.
   Palette and roles from project_brief.md "Visual identity".
   No external resources are loaded: Public Sans is self-hosted as
   subsetted WOFF2 (tools/build_site_fonts.py), with local() sources
   first so an installed copy is preferred, and the system stack as
   fallback. Light and dark themes follow the visitor's own setting
   (prefers-color-scheme); dark surfaces use Ink, matching the brand's
   reversed asset conventions. */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Public Sans"), local("PublicSans-Regular"),
       url("fonts/public_sans_400.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local("Public Sans Italic"), local("PublicSans-Italic"),
       url("fonts/public_sans_400_italic.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local("Public Sans SemiBold"), local("PublicSans-SemiBold"),
       url("fonts/public_sans_600.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Public Sans Bold"), local("PublicSans-Bold"),
       url("fonts/public_sans_700.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: local("Public Sans ExtraBold"), local("PublicSans-ExtraBold"),
       url("fonts/public_sans_800.woff2") format("woff2");
}

:root {
  --ink: #27221E;
  --ember: #F15E4B;
  --sand: #F9E8DC;
  --paper: #F9F9F9;
  --mist: #EFEEED;
  --sage: #D5E2E1;
  --stone: #6E6E6E;
  --graphite: #404040;

  --bg: var(--paper);
  --text: var(--ink);
  --muted: var(--graphite);
  --faint: var(--stone);
  --band: var(--mist);
  --band-warm: var(--sand);
  --card: #FFFFFF;
  --hairline: color-mix(in srgb, var(--stone) 35%, transparent);
  --btn-text: var(--ink);
  color-scheme: light dark;
}

/* Dark values appear twice: once behind the system query (unless the
   visitor has overridden to light) and once behind the manual override
   (docs/theme.js sets data-theme on <html>). Keep the two blocks
   identical when editing either. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--ink);
    --text: var(--paper);
    --muted: var(--mist);
    --faint: color-mix(in srgb, var(--mist) 80%, var(--ink));
    --band: color-mix(in srgb, var(--ink) 94%, white);
    --band-warm: color-mix(in srgb, var(--ink) 90%, var(--ember));
    --card: color-mix(in srgb, var(--ink) 88%, white);
    --hairline: color-mix(in srgb, var(--stone) 55%, transparent);
  }
}

:root[data-theme="dark"] {
  --bg: var(--ink);
  --text: var(--paper);
  --muted: var(--mist);
  --faint: color-mix(in srgb, var(--mist) 80%, var(--ink));
  --band: color-mix(in srgb, var(--ink) 94%, white);
  --band-warm: color-mix(in srgb, var(--ink) 90%, var(--ember));
  --card: color-mix(in srgb, var(--ink) 88%, white);
  --hairline: color-mix(in srgb, var(--stone) 55%, transparent);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: "Public Sans", "Segoe UI", -apple-system, system-ui, Arial,
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

/* ---------------------------------------------------------- utilities */

.container {
  max-width: 66rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.prose { max-width: 46rem; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 10;
  background: var(--ember);
  color: var(--ink);
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 0.4rem;
  transition: top 120ms ease;
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------- text */

h1, h2, h3 { line-height: 1.2; text-wrap: balance; }

h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 3.5vw, 2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }

p + p, .prose > * + * { margin-top: 1rem; }

.prose h3 { margin-top: 2rem; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--ember);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 3px;
}

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

.lead { font-size: 1.2rem; }
.small { font-size: 0.9rem; color: var(--muted); }
.mt { margin-top: 2.25rem; }
.mt-s { margin-top: 0.75rem; }
.nowrap { white-space: nowrap; }
.eyebrow {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.75rem;
}

/* ------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding-block: 0.9rem;
}

.brand img { height: 30px; width: auto; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
  list-style: none;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover { text-decoration: underline; text-decoration-color: var(--ember); text-decoration-thickness: 2px; }

/* The theme switch. Hidden until docs/theme.js reveals it, so a
   visitor without JavaScript never sees a button that does nothing. */
.theme-toggle {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: inherit;
  background: none;
  border: 2px solid var(--hairline);
  border-radius: 0.5rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}

.theme-toggle:hover { border-color: var(--ember); }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-block;
  background: var(--ember);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  padding: 0.7rem 1.3rem;
  border-radius: 0.5rem;
}

.btn:hover { filter: brightness(1.06); }

.btn-quiet {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  padding: 0.7rem 1.3rem;
  border-radius: 0.5rem;
  border: 2px solid var(--hairline);
}

.btn-quiet:hover { border-color: var(--ember); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.75rem;
}

/* ------------------------------------------------------------- bands */

.band { padding-block: clamp(3rem, 7vw, 4.5rem); }
.band-tint { background: var(--band); }
.band-warm { background: var(--band-warm); }

.band h2 { margin-bottom: 1rem; }

/* Subpages open with their own h1 (the home page's lives in the hero);
   the global heading sizes already fit, these add the spacing. The
   narrative pages also use h2 as running subheads inside .prose.
   Added 2026-08-06 with the about page. */
.band h1 { margin-bottom: 1rem; }
.prose h2 { margin-top: 2.5rem; }
.prose > h2:first-child { margin-top: 0; }

/* -------------------------------------------------------------- hero */

.hero { padding-block: clamp(3rem, 8vw, 5.5rem); }

.hero-mark { margin-bottom: 2rem; }
.hero-mark img { width: min(340px, 70vw); height: auto; }

.notfound-mark { margin-bottom: 1.5rem; }
.notfound-mark img { width: min(320px, 62vw); height: auto; }

.notfound-brand { margin-top: 3.5rem; }
.notfound-brand img { width: min(180px, 45vw); height: auto; opacity: 0.75; }

.hero .lead { margin-top: 1.25rem; max-width: 46rem; }
.hero p:not(.lead) { max-width: 46rem; }

/* ------------------------------------------------------------ figures */

figure.panel {
  margin-block: 2rem;
  border: 1px solid var(--hairline);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--bg);
}

figure.panel img { width: 100%; }

figure.panel figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.8rem 1.1rem;
  border-top: 1px solid var(--hairline);
}

/* --------------------------------------------------------- pull quote */

blockquote.pull {
  margin-block: 2.25rem;
  padding: 0.4rem 0 0.4rem 1.5rem;
  border-left: 6px solid var(--ember);
  border-radius: 3px;
  max-width: 44rem;
}

blockquote.pull p {
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  font-weight: 600;
  line-height: 1.45;
}

blockquote.pull footer {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* -------------------------------------------------------------- cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 0.75rem;
  padding: 1.4rem;
}

.card h3 { margin-bottom: 0.6rem; }
.card p { font-size: 0.97rem; }

.card .status {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1.5px solid var(--hairline);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  margin-bottom: 0.9rem;
}

.card-grid.rules {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 40rem) {
  .card-grid.rules { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------- icon wells
   Icons are Ink linework with white interior fills, so they sit on a
   white well in both themes — the same construction as the Word
   callout cards' icon wells. */

.icon-well {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: 0.6rem;
  padding: 0.35rem;
  flex: none;
}

.icon-well img { width: 34px; height: 34px; }

.card .icon-well { margin-bottom: 0.9rem; }
.card .icon-well img { width: 40px; height: 40px; }

/* ---------------------------------------------------------- claim flow */

.flowwrap { margin-top: 2.5rem; max-width: 46rem; }
.flowwrap h3 { margin-bottom: 1.1rem; }
.flowwrap .small { margin-top: 1rem; }

ol.flow {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 0.7rem;
}

ol.flow li {
  counter-increment: step;
  position: relative;
  background: var(--band);
  border: 1px solid var(--hairline);
  border-radius: 0.6rem;
  padding: 0.8rem 1.1rem 0.8rem 3.6rem;
  font-weight: 500;
}

ol.flow li::before {
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.9rem; height: 1.9rem;
  border-radius: 50%;
  background: var(--ember);
  color: var(--ink);
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ------------------------------------------------------ system diagram */

.sysdiagram {
  display: grid;
  grid-template-columns: 1fr 2.2rem minmax(12rem, 0.9fr) 2.2rem 1fr;
  gap: 1.1rem;
  align-items: center;
  margin-top: 2.25rem;
}

.sys-col {
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.sys-col li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-radius: 0.6rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.sys-in li { background: var(--mist); color: var(--ink); }
.sys-out li { background: var(--sage); color: var(--ink); }

.sys-col .icon-well { padding: 0.25rem; border-radius: 0.5rem; }
.sys-col .icon-well img { width: 24px; height: 24px; }

.sys-engine {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
  border: 3px solid var(--ember);
  border-radius: 0.8rem;
  padding: 1.3rem 1rem;
  font-weight: 700;
}

.sys-engine .icon-well img { width: 40px; height: 40px; }

.sys-arrow {
  text-align: center;
  color: var(--faint);
  font-size: 1.6rem;
  font-weight: 700;
}

.sys-arrow::before { content: "\2192"; }

.sys-gate {
  grid-column: 1 / -1;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--band-warm);
  border-radius: 0.6rem;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
}

.syscaption { margin-top: 1rem; }

@media (max-width: 52rem) {
  .sysdiagram { grid-template-columns: 1fr; }
  .sys-arrow::before { content: "\2193"; }
  .sys-engine { justify-self: stretch; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sys-in li { background: var(--card); color: var(--text); }
  :root:not([data-theme="light"]) .sys-out li {
    background: var(--card);
    color: var(--text);
    border-left: 3px solid var(--sage);
  }
}

:root[data-theme="dark"] .sys-in li { background: var(--card); color: var(--text); }
:root[data-theme="dark"] .sys-out li {
  background: var(--card);
  color: var(--text);
  border-left: 3px solid var(--sage);
}

/* ------------------------------------------------------------ callout */

.callout {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--band-warm);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  max-width: 46rem;
}

.callout .icon-well { margin-top: 0.15rem; }

.callout-body {
  border-left: 5px solid var(--ember);
  border-radius: 3px;
  padding-left: 1rem;
}

/* --------------------------------------------------------- comparison */

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}

.compare-col {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.compare-col h3 {
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

.compare-col ul {
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.compare-col li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.compare-col .icon-well { padding: 0.25rem; border-radius: 0.5rem; }
.compare-col .icon-well img { width: 24px; height: 24px; }

@media (max-width: 46rem) {
  .compare { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ replica
   Terminal replicas are not currently shown on the site; these rules
   stay because the pattern is ready for a learning-unit page, where a
   picture of a real shell session earns its place. */

figure.replica { max-width: 44rem; }
figure.replica img { width: 100%; }

/* ------------------------------------------------------------- footer */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: 3rem;
  margin-top: 0;
}

.site-footer a {
  color: var(--paper);
  text-decoration-color: var(--ember);
}

.site-footer .foot-mark img { width: 200px; height: auto; }

.site-footer .foot-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 4rem;
  justify-content: space-between;
  align-items: flex-start;
}

.site-footer ul { list-style: none; display: grid; gap: 0.5rem; }

.site-footer .small { color: var(--mist); }

.site-footer .legal {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, var(--stone) 45%, transparent);
  font-size: 0.85rem;
  color: var(--mist);
  max-width: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-footer { border-top: 1px solid var(--hairline); }
}

:root[data-theme="dark"] .site-footer { border-top: 1px solid var(--hairline); }

/* ------------------------------------------------------------- print */

@media print {
  .site-header, .skip-link, .cta-row { display: none; }
}
