/* DSS homepage. Every colour, radius, size and font comes from the live design tokens
   (the inline seed in index.html + GET {backend}/coord/code/tokens.css). Nothing here may
   hard-code one — scripts/check_page.py (apps/homepage/check_page.py) fails if it does.
   Display sizes the token set lacks are derived from --text-2xl, not invented. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-fg); padding: var(--pad-control-y) var(--pad-control-x); z-index: 20; }
.skip:focus { left: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: var(--tracking-tight); line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2rem, 5.2vw, calc(var(--text-2xl) * 2.4)); font-weight: var(--weight-semibold); }
h2 { font-size: clamp(1.5rem, 3vw, calc(var(--text-2xl) * 1.4)); font-weight: var(--weight-semibold); }
h3 { font-size: calc(var(--text-base) * 1.125); font-weight: var(--weight-semibold); }
p { margin: 0; }
.muted { color: var(--text-muted); }
.eyebrow { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-muted); letter-spacing: var(--tracking-wide); text-transform: uppercase; }

/* announcement bar + header */
.announce { background: var(--surface-muted); border-bottom: 1px solid var(--border); text-align: center; font-size: var(--text-sm); padding: var(--pad-compact) 16px; }
.announce a { color: var(--text); font-weight: var(--weight-medium); }
.announce .more { margin-left: 8px; color: var(--link-color); }
header.site { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--border); }
header.site .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: var(--weight-bold); }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; display: block; }
nav.primary { display: none; gap: 24px; font-size: var(--text-sm); }
nav.primary a { color: var(--text-muted); }
nav.primary a:hover { color: var(--text); text-decoration: none; }
@media (min-width: 768px) { nav.primary { display: flex; } }
.header-cta { margin-left: auto; display: flex; gap: 8px; }

/* buttons: black primary, grey secondary (the DSS colour model) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: var(--pad-control-y) var(--pad-control-x); border-radius: var(--radius-md);
  font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: 1;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); cursor: pointer;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; }
.btn.secondary { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--secondary-bg); border-color: var(--border-strong); }
.btn.inverse { background: var(--accent-fg); color: var(--accent); border-color: var(--accent-fg); }
.btn.inverse:hover { background: var(--secondary-bg); }

/* hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; text-align: center; border-bottom: 1px solid var(--border); }
.hero .grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--border-strong) 1.5px, transparent 1.6px);
  background-size: 32px 32px; background-position: center;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 22%, var(--accent) 78%);
          mask-image: radial-gradient(ellipse at center, transparent 22%, var(--accent) 78%);
}
.hero .wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.hero h1 { max-width: 20ch; }
.hero .sub { max-width: 62ch; color: var(--text-muted); font-size: calc(var(--text-base) * 1.125); }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 720px; margin-top: 8px; padding: 0; list-style: none; }
.tag { display: inline-flex; align-items: stretch; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.tag::before { content: ""; width: 20px; background: var(--accent); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.tag span { padding: 4px 12px; min-width: 7.5ch; text-align: left; }
.tag.live span::after { content: "\2502"; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tag.live span::after { animation: none; } }

/* sections */
section { padding: 72px 0; border-bottom: 1px solid var(--border); }
section.tinted { background: var(--surface-muted); }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; max-width: 760px; }
.section-head p { color: var(--text-muted); }

.os-map { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: var(--text-sm); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.os-map caption { text-align: left; padding: 0 0 12px; color: var(--text-muted); caption-side: top; }
.os-map th, .os-map td { padding: var(--pad-compact) var(--pad-card); text-align: left; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.os-map thead th { background: var(--surface-muted); color: var(--text-muted); font-weight: var(--weight-medium); }
.os-map tr:last-child td { border-bottom: 0; }
.note { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: 40px; }

.flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 0 0 40px; padding: 0; list-style: none; font-size: var(--text-sm); }
.flow li { display: flex; flex-direction: column; align-items: center; }
.flow strong { display: inline-block; background: var(--accent); color: var(--accent-fg); border-radius: var(--radius-md); padding: var(--pad-control-y) var(--pad-control-x); }
.flow .arrow { color: var(--text-subtle); }

.cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards.three { grid-template-columns: repeat(3, 1fr); } .cards.four { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius-lg); padding: var(--pad-card); display: flex; flex-direction: column; gap: 12px; }
.card p { color: var(--text-muted); font-size: var(--text-sm); }
.card .btn { align-self: flex-start; margin-top: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* status pills: colour sits in the dot, text stays --text so every pair clears AA contrast */
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--pill-bg); color: var(--text); border-radius: var(--radius-full); padding: 2px 10px; font-size: var(--text-xs); font-weight: var(--weight-medium); white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--ok); }
.pill.bench::before { background: var(--info); }
.pill.wip::before { background: var(--warn); }

.advantages { display: grid; gap: 32px 40px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .advantages { grid-template-columns: repeat(2, 1fr); } }
.advantages h3 { margin-bottom: 8px; }
.advantages p { color: var(--text-muted); }

.proof { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.proof th, .proof td { padding: var(--pad-compact) var(--pad-card); text-align: left; border-bottom: 1px solid var(--border-subtle); vertical-align: top; font-size: var(--text-sm); }
.proof tr:last-child > * { border-bottom: 0; }
.proof th { font-weight: var(--weight-semibold); width: 22%; }
.proof td:nth-child(2) { width: 14%; }
.proof td:last-child { color: var(--text-muted); }
@media (max-width: 767px) {
  .proof, .proof tbody, .proof tr, .proof th, .proof td { display: block; width: auto !important; }
  .proof tr { padding: var(--pad-compact) 0; border-bottom: 1px solid var(--border-subtle); }
  .proof th, .proof td { border: 0; padding: 4px var(--pad-card); }
}

/* the one inverted band */
.cta-band { background: var(--accent-dark); color: var(--accent-fg); text-align: center; padding: 88px 0; border-bottom: 0; }
.cta-band .wrap { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.cta-band p { color: var(--border-strong); }

footer { padding: 40px 0 56px; font-size: var(--text-sm); color: var(--text-muted); }
footer .wrap { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 768px) { footer .wrap { grid-template-columns: 2fr 1fr 1fr; } }
footer h2 { font-size: var(--text-sm); color: var(--text); margin-bottom: 12px; letter-spacing: var(--tracking-wide); }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }

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