/*
  Next Instruction: shared stylesheet.
  Plain CSS, mobile-first, no build step.

  Every color is a custom property on :root. Contrast ratios (WCAG 2.x) are
  noted beside each token; every text/background pair meets AA (4.5:1), and
  the focus ring meets the 3:1 non-text minimum against canvas and surface.
*/

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  /* "Hearth" light palette */
  --canvas: #faf7f2;
  --surface: #ffffff;
  --ink: #1f1b16;             /* 16.0 on canvas, 17.1 on surface */
  --muted: #6b635a;           /* 5.5 on canvas, 5.9 on surface */
  --line: #e7dfd4;            /* hairlines (decorative) */
  --line-strong: #d3c7b8;     /* secondary button outline (decorative) */
  --accent: #c44f37;          /* primary button fill: on-accent is 4.6 */
  --accent-hover: #a9412c;    /* on-accent is 6.0 */
  --on-accent: #ffffff;
  --accent-soft: #f6ddd3;
  --on-accent-soft: #8a3322;  /* 6.3 on accent-soft; ink is 13.2 */
  --accent-line: #c44f37;     /* underlines, markers, dots (never body text: 4.35 on canvas) */
  --focus: #c44f37;           /* 4.35 on canvas, 4.6 on surface */
  --shadow-sm: 0 1px 2px rgb(31 27 22 / 0.04), 0 8px 20px -12px rgb(31 27 22 / 0.12);
  --shadow-lg: 0 2px 6px rgb(31 27 22 / 0.04), 0 32px 64px -24px rgb(31 27 22 / 0.24);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lead: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4375rem);
  --text-h3: 1.25rem;
  --text-h2: clamp(1.875rem, 1.35rem + 2.2vw, 2.875rem);
  --text-h1: clamp(2.375rem, 1.45rem + 4.2vw, 4.25rem);
  --text-display: clamp(2.625rem, 1.5rem + 5vw, 5rem);

  /* Space and shape */
  --gutter: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem);
  --content: 70rem;
  --narrow: 42rem;
  --section: clamp(4.5rem, 3rem + 6vw, 8rem);
  --radius-sm: 0.75rem;
  --radius-md: 1.5rem;
  --radius-lg: 2rem;
  --radius-pill: 62.5rem;
}

/* Dark tokens apply on screens only, so printouts stay dark-on-light. */
@media screen and (prefers-color-scheme: dark) {
  :root {
    --canvas: #171411;
    --surface: #221e1a;
    --ink: #f5efe7;           /* 16.1 on canvas, 14.5 on surface */
    --muted: #a69c90;         /* 6.8 on canvas, 6.1 on surface */
    --line: #3a332d;
    --line-strong: #544a40;
    --accent: #c44f37;        /* unchanged, so on-accent stays 4.6 */
    --accent-hover: #a9412c;  /* on-accent is 6.0 */
    --on-accent: #ffffff;
    --accent-soft: #4a271d;
    --on-accent-soft: #f8c2b2; /* 8.4 on accent-soft; ink is 11.5 */
    --accent-line: #e88368;
    --focus: #e88368;         /* 6.9 on canvas, 6.2 on surface */
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.32);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 0.24), 0 32px 64px -24px rgb(0 0 0 / 0.7);
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-h2);
  line-height: 1.1;
}

h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p,
li {
  text-wrap: pretty;
}

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

address {
  font-style: normal;
}

/* Lists styled without bullets keep role="list" in the markup, because
   Safari's VoiceOver otherwise stops announcing them as lists. */
ul[role="list"],
ol[role="list"] {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

/* An email address moves to the next line whole instead of splitting. Only
   when it's wider than a full line does it break, before the @, at the
   <wbr> in the markup. */
a[href^="mailto:"]:not(.button) {
  display: inline-block;
  max-width: 100%;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow {
  max-width: calc(var(--narrow) + 2 * var(--gutter));
}

.section {
  padding-block: calc(var(--section) / 2);
}

.section-intro {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.lead {
  max-width: 34rem;
  color: var(--muted);
  font-size: var(--text-lead);
  line-height: 1.5;
}

.section-intro .lead {
  max-width: none;
  margin-top: 1rem;
}

/* ---------- Shared components ---------- */

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--canvas);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
}

.eyebrow {
  display: inline-block;
  padding: 0.3125rem 0.875rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--on-accent-soft);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
}

.button {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 0.3em;
  max-width: 100%;
  min-height: 3rem;
  padding: 0.75rem clamp(1rem, 0.25rem + 3vw, 1.75rem);
  border-radius: var(--radius-pill);
  font-size: clamp(1rem, 0.875rem + 0.4vw, 1.0625rem);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.button:focus-visible {
  outline-offset: 4px;
}

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

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

.button--secondary {
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  color: var(--ink);
}

.button--secondary:hover {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.card,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.card {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: clamp(1.25rem, 0.5rem + 4vw, 4rem);
  border-radius: var(--radius-lg);
}

/* ---------- Home: hero ---------- */

.hero {
  padding-block: clamp(3rem, 1rem + 8vw, 8rem) calc(var(--section) / 2);
}

.hero h1 {
  max-width: 11em;
  margin-top: 1.25rem;
  font-size: var(--text-display);
}

.hero .lead {
  max-width: 38rem;
  margin-top: 1.5rem;
}

.hero-actions {
  margin-top: 2.25rem;
}

/* ---------- Home: agentic AI steps ---------- */

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.step {
  padding: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

.step-num {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--on-accent-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.step p {
  margin-top: 0.5rem;
  color: var(--muted);
}

@media (min-width: 52rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* ---------- Home: principles ---------- */

.principles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

.principles .lead {
  margin-top: 1rem;
}

.value {
  padding-left: 1.5rem;
}

.value + .value {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.value h3 {
  position: relative;
}

.value h3::before {
  content: "";
  position: absolute;
  top: calc(0.65em - 0.25rem);
  left: -1.5rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

.value p {
  margin-top: 0.375rem;
  color: var(--muted);
}

@media (min-width: 60rem) {
  .principles {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 5rem;
  }
}

/* ---------- Home: call to action ---------- */

.cta {
  padding-bottom: var(--section);
  text-align: center;
}

.cta-inner {
  max-width: 36rem;
  margin-inline: auto;
}

.cta .lead {
  margin: 1rem auto 0;
}

.cta .button {
  margin-top: 2rem;
}

/* ---------- Policy pages ---------- */

.doc {
  padding-block: clamp(2.5rem, 1rem + 5vw, 5rem) var(--section);
}

.doc-header .lead {
  margin-top: 1.25rem;
}

.doc-header h1 {
  margin-top: 1.25rem;
}

.doc-meta {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.doc-body {
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  padding-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  border-top: 1px solid var(--line);
}

.doc-body section + section {
  margin-top: 2.75rem;
}

.doc-body h2 {
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.doc-body * + p,
.doc-body * + ul {
  margin-top: 1rem;
}

.doc-body ul {
  padding-left: 1.25rem;
}

.doc-body li {
  padding-left: 0.25rem;
}

.doc-body li + li {
  margin-top: 0.5rem;
}

.doc-body li::marker {
  color: var(--accent-line);
}

/* ---------- Not found ---------- */

.notfound {
  display: grid;
  align-content: center;
  padding-block: var(--section);
  text-align: center;
}

.notfound h1 {
  margin-top: 1.25rem;
}

.notfound .lead {
  margin: 1.25rem auto 0;
}

.notfound .button {
  margin-top: 2rem;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 3rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.footer-heading {
  margin-bottom: 0.75rem;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: normal;
}

.contact-list {
  display: grid;
  gap: 0.5rem;
}

.contact-list div {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1rem;
}

.contact-list dt {
  min-width: 4.5rem;
}

.contact-list a,
.footer-bottom a {
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: 3rem;
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: 1fr auto;
  }
}

/* ---------- Motion (only for people who haven't asked for less) ---------- */

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

  a,
  .button {
    transition: background-color 0.2s ease, box-shadow 0.2s ease, text-decoration-thickness 0.2s ease;
  }

  .skip-link {
    transition: transform 0.2s ease;
  }
}

/* ---------- Forced colors (e.g. Windows contrast themes) ---------- */

@media (forced-colors: active) {
  .button,
  .eyebrow,
  .step-num {
    border: 1px solid;
  }
}
