/* SPDX-FileCopyrightText: Veredictum contributors
   SPDX-License-Identifier: Apache-2.0 */

/* The Veredictum landing page.
   Palette: assets/brand/tokens.css, copied here because the deployed page
   loads no file outside website/landing/. When tokens.css changes, the
   `--ver-*` block below changes with it.
   Self-contained: system fonts, no external request, light and dark via
   prefers-color-scheme, relative URLs only. */

:root {
  /* Brand, from assets/brand/tokens.css. */
  --ver-teal: #258bb0;
  --ver-teal-deep: #1b6e92;
  --ver-teal-field: #14566f;
  --ver-orange: #ff861c;
  --ver-parchment: #f6decd;
  --ver-paper: #fff9f2;
  --ver-ink: #363636;

  /* Light theme: the paper a verdict is written on. */
  --bg: var(--ver-paper);
  --surface: #fffdfa;
  --surface-warm: #fdf1e6;
  --text: var(--ver-ink);
  --heading: #1f2a30;
  --muted: #6a6259;
  --border: #e8dccf;
  --rule: #d9c9b6;
  --link: var(--ver-teal-deep);
  --link-hover: var(--ver-teal-field);
  --accent: var(--ver-teal);
  --signal: #c25c00;
  --code-bg: #14566f;
  --code-text: #f3ece4;
  --code-muted: #a9c4d1;
  --shadow: 0 1px 2px rgba(31, 42, 48, 0.06), 0 10px 30px rgba(31, 42, 48, 0.07);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --max: 1080px;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101c22;
    --surface: #15252d;
    --surface-warm: #182b34;
    --text: #e6ded4;
    --heading: #f4efe8;
    --muted: #9fb0b9;
    --border: #243b46;
    --rule: #2c4753;
    --link: #6cc0e0;
    --link-hover: #9ad6ee;
    --accent: #6cc0e0;
    --signal: #ff9f47;
    --code-bg: #0b171d;
    --code-text: #e6ded4;
    --code-muted: #7d98a4;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--accent);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
}

/* ── Masthead ─────────────────────────────────────────────────────────────── */
.masthead {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 64px;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--heading);
  text-decoration: none;
}

.wordmark img {
  width: 32px;
  height: 32px;
}

.masthead nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.masthead nav a {
  color: var(--muted);
  text-decoration: none;
}

.masthead nav a:hover {
  color: var(--link);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.35rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
}

.btn-solid {
  background: var(--ver-teal-deep);
  border-color: var(--ver-teal-deep);
  color: #fff;
}

.btn-solid:hover {
  background: var(--ver-teal-field);
  border-color: var(--ver-teal-field);
  color: #fff;
}

.btn-outline {
  border-color: var(--rule);
  color: var(--heading);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--link);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2.75rem, 7vw, 5rem) 0 clamp(2.25rem, 5vw, 3.5rem);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    58% 50% at 50% 0%,
    color-mix(in srgb, var(--ver-teal) 14%, transparent),
    transparent 72%
  );
}

.hero > * {
  position: relative;
}

.seal {
  width: clamp(132px, 22vw, 184px);
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--heading);
  margin: 0 auto 1rem;
  max-width: 24ch;
}

.hero .lede {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  max-width: 60ch;
  margin: 0 auto 1.9rem;
}

.hero .actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero .facts {
  margin: 1.9rem auto 0;
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 5vw, 3.25rem);
  flex-wrap: wrap;
}

.fact {
  text-align: center;
}

.fact .n {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1;
  color: var(--ver-teal-deep);
  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  .fact .n {
    color: var(--accent);
  }
}

.fact .l {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Sections ─────────────────────────────────────────────────────────────── */
section {
  padding: clamp(2.75rem, 6vw, 4.25rem) 0;
}

section + section {
  border-top: 1px solid var(--border);
}

.head {
  max-width: 62ch;
  margin: 0 0 2.25rem;
}

.head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.eyebrow {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 0.6rem;
}

.head h2 {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.8vw, 1.95rem);
  line-height: 1.25;
  color: var(--heading);
  margin: 0 0 0.7rem;
}

.head p {
  color: var(--muted);
  margin: 0;
}

/* ── The origin note ──────────────────────────────────────────────────────── */
.origin {
  background: var(--surface-warm);
}

.origin blockquote {
  margin: 0 auto;
  max-width: 56ch;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.5;
  color: var(--heading);
}

.origin blockquote em {
  color: var(--signal);
  font-style: italic;
}

.origin cite {
  display: block;
  margin-top: 1.1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-style: normal;
  color: var(--muted);
}

/* ── Stage strip ──────────────────────────────────────────────────────────── */
.stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  counter-reset: stage;
}

.stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--ver-teal-deep);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.5rem;
}

.stage h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  color: var(--heading);
  margin: 0 0 0.5rem;
}

.stage h3::before {
  counter-increment: stage;
  content: counter(stage) ". ";
  color: var(--signal);
}

.stage p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.stage p + p {
  margin-top: 0.7rem;
}

/* ── Plain prose blocks + tables ──────────────────────────────────────────── */
.prose {
  max-width: 68ch;
}

.prose p {
  margin: 0 0 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}

td strong {
  color: var(--heading);
}

/* ── Quick start ──────────────────────────────────────────────────────────── */
.quickstart {
  background: var(--surface-warm);
}

.code {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code + .code {
  margin-top: 1.1rem;
}

.code figcaption {
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--code-text) 14%, transparent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--code-muted);
}

.code pre {
  margin: 0;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  color: var(--code-text);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

.code .cmt {
  color: var(--code-muted);
}

.code .p {
  color: var(--ver-orange);
  font-weight: 700;
}

.after-code {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 68ch;
}

/* ── Link cards ───────────────────────────────────────────────────────────── */
/* 280px keeps the six cards at three per row on a desktop width, so the last
   row is full instead of ragged. */
.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
}

.link-card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}

.link-card:hover {
  border-color: var(--accent);
}

.link-card b {
  display: block;
  color: var(--heading);
  font-family: var(--serif);
  font-size: 1.02rem;
}

.link-card span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 0 2.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

footer .wordmark {
  margin-bottom: 0.9rem;
}

footer p {
  max-width: 74ch;
  margin: 0 0 0.7rem;
}

footer .fine {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .masthead nav {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .masthead nav .hide-sm {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
