:root {
  color-scheme: light;
  --paper: #f6f3ec;
  --paper-2: #fffdf8;
  --ink: #241f1a;
  --muted: #5c564e;
  --line: #e3dbd0;
  --orange: #f76826;
  --orange-ink: #b8430a;
  --on-orange: #1a120c;
  --stage: #efe8dc;
  --band: #2a211c;
  --band-text: #f6f1e8;
  --band-muted: #d9cfc2;
  --band-line: #8a7b6e;
  --popup-shadow: drop-shadow(0 18px 32px rgba(36, 31, 26, 0.16));
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1120px;
  --header: 4.5rem;
  --space: 4.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #161411;
    --paper-2: #221e1a;
    --ink: #f4efe6;
    --muted: #c8bfb2;
    --line: #3d362f;
    --orange-ink: #ffb088;
    --stage: #2a2622;
    --popup-shadow: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.45));
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 0.75rem); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange-ink); }
button, summary { font: inherit; color: inherit; }
::selection { background: #f6c7ad; color: #241f1a; }
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--orange-ink);
  outline-offset: 3px;
}
.button-primary:focus-visible { outline-color: var(--ink); }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 8px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.wrap { width: min(var(--wrap), calc(100% - 3rem)); margin-inline: auto; }
.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange-ink);
}
h1, h2, h3, p { margin-top: 0; }
h1, h2 {
  font-family: var(--serif);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}
h1 { font-size: clamp(2.55rem, 5.2vw, 4.15rem); margin-bottom: 1.1rem; }
h2 { font-size: clamp(1.85rem, 3vw, 2.5rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.125rem; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 0.45rem; }
.accent { color: var(--orange-ink); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.header-bar {
  min-height: var(--header);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding-block: 0.65rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.125rem;
}
.brand img { width: 2rem; height: 2rem; }
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin-left: auto;
}
.site-header nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.975rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}
.site-header nav a:hover { background: var(--stage); }
.site-header nav a[aria-current="page"] { color: var(--orange-ink); font-weight: 650; }
.header-cta { display: flex; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(17rem, 0.8fr);
  gap: 2.5rem 3.5rem;
  align-items: center;
  padding-block: 3.25rem 4.25rem;
}
.lead, .band-lead {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 38rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 0.9rem;
  margin: 1.5rem 0 0;
}
.status-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.975rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.05rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 680;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
}
.button-primary { background: var(--orange); color: var(--on-orange); border-color: #e05918; }
.button-primary:hover { background: #ff7a3c; }
.button-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.button-secondary:hover { background: var(--stage); }
.button-small { padding-inline: 0.9rem; }
.text-link { font-weight: 650; text-decoration: underline; text-underline-offset: 0.18em; }

.demo { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.demo h2 {
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 680;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}
.demo-figure { margin: 0; width: min(100%, 23.25rem); }
.popup { width: 100%; height: auto; filter: var(--popup-shadow); }
.demo-figure figcaption {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.975rem;
}

.section { padding-bottom: var(--space); }
.section-rule { border-top: 1px solid var(--line); padding-top: var(--space); }
.section-intro { max-width: 40rem; margin-bottom: 1.75rem; }
.section-intro p:last-child { color: var(--muted); }

.loop {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem 1.5rem;
  padding: 0;
  margin: 0;
}
.loop li { margin: 0; border-top: 3px solid var(--orange); padding-top: 0.9rem; }
.step-num {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.loop p { margin: 0; color: var(--muted); }
kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.08em 0.35em;
  margin-right: 0.12em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--paper-2);
  color: var(--ink);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.card {
  margin: 0;
  padding: 1.2rem 1.2rem 1.3rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.card p { margin: 0; color: var(--muted); }

.band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 2.5rem;
  padding: 2.25rem;
  border-radius: 22px;
  background: var(--band);
  color: var(--band-text);
}
.band .eyebrow { color: #ffb088; }
.band h2, .band h3 { color: var(--band-text); }
.band-lead, .band-note, .reqs, .band > div > p { color: var(--band-muted); }
.band a:not(.button) {
  color: #ffb088;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.band .button-secondary { color: var(--band-text); border-color: var(--band-line); }
.band .button-secondary:hover { background: rgba(255, 255, 255, 0.06); }
.band .status-note { color: var(--band-muted); }
.band-sub { margin-bottom: 0.65rem; }
.reqs { margin: 0; padding-left: 1.15rem; }
.reqs li + li { margin-top: 0.4rem; }
.band-note { margin: 1rem 0 0; font-size: 0.975rem; }
.band-note + .band-note { margin-top: 0.75rem; }

.faq-section {
  display: grid;
  grid-template-columns: minmax(12rem, 0.7fr) minmax(0, 1.6fr);
  gap: 2rem 2.5rem;
  align-items: start;
  padding-top: var(--space);
}
.faq-list details { border-top: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0.85rem 0;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  flex: none;
  color: var(--muted);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list details p { margin: 0 0 1.05rem; color: var(--muted); max-width: 65ch; }

.prose { width: min(68ch, calc(100% - 3rem)); margin: 0 auto; padding-block: 2.75rem 4.25rem; }
.prose h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); }
.prose h2 { font-size: 1.55rem; margin-top: 2.1rem; }
.prose p, .prose li { color: var(--muted); }
.prose li { margin: 0.4rem 0; }
.prose a { font-weight: 650; text-decoration: underline; text-underline-offset: 0.18em; }
.prose code, .todo-token {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--stage);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}
.updated { font-size: 0.975rem; }
.todo {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.05rem 0.2rem;
  border: 2px solid var(--orange-ink);
  border-radius: 14px;
  background: var(--paper-2);
}
.todo p { color: var(--ink); }
.todo-token { font-weight: 700; }
.not-found .actions { margin-top: 1.5rem; }

.lang-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  padding-bottom: 1.5rem;
}
.lang-switcher a {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
}
.lang-switcher a:hover { background: var(--stage); }
.lang-switcher a[aria-current="true"] { color: var(--orange-ink); font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); padding-top: 1.35rem; }
.footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.35rem; }
.footer-nav a {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
}
.footer-nav a:hover { background: var(--stage); }
.copyright { margin: 0; color: var(--muted); font-size: 0.9375rem; }

@media (max-width: 960px) {
  .intro, .band, .faq-section { grid-template-columns: 1fr; }
  .loop, .cards { grid-template-columns: 1fr 1fr; }
  .intro { padding-top: 2.25rem; gap: 2.25rem; }
  .section, .section-rule, .faq-section { --space: 3.25rem; }
  .band { padding: 1.5rem; gap: 1.75rem; }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 8.5rem; }
  .header-bar { row-gap: 0.15rem; }
  .header-cta { order: 2; margin-left: auto; }
  .site-header nav { order: 3; width: 100%; margin-left: 0; }
  .site-header nav a.nav-download { display: none; }
  .loop, .cards { grid-template-columns: 1fr; }
  .wrap, .prose { width: min(var(--wrap), calc(100% - 2rem)); }
  h1 { font-size: clamp(2.35rem, 11vw, 3rem); }
}

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

@media (forced-colors: active) {
  .button, .card, .band, .demo-figure, .todo { border: 1px solid ButtonText; }
  .popup { filter: none; }
}
