/*
 * ddgbc.com — shared styles for the static pages.
 * System fonts on purpose: a privacy page that pulls a web font from a CDN
 * would hand every visitor's IP address to that CDN.
 */
:root {
  --paper: #f6f7fb;
  --surface: #ffffff;
  --ink: #141833;
  --muted: #565c7a;
  --line: #dcdfea;
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #ebeafd;
  /* The ddgbc logo's notification dot; used for nothing else. */
  --signal: #ef4444;
  --keep: #0f766e;
  --leave: #b45309;

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --measure: 68ch;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-plate: 28px;
  --radius-control: 999px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1120;
    --surface: #121a2e;
    --ink: #e6e8f2;
    --muted: #a3a9c4;
    --line: #26304a;
    --brand: #8b85ff;
    --brand-ink: #0b1120;
    --brand-soft: #1c2142;
    --signal: #ff6b6b;
    --keep: #5eead4;
    --leave: #fbbf24;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

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

.brand svg {
  width: 32px;
  height: 32px;
}

/* ddgbc logo, inline so it follows the theme. Standalone copies: assets/ddgbc-*.svg. */
.brand svg.logo {
  width: auto;
  height: 40px;
}

.logo .lg-tile {
  fill: var(--brand);
}

.logo .lg-d {
  stroke: var(--brand-ink);
}

.logo .lg-ink {
  stroke: var(--ink);
}

.logo .lg-brand {
  stroke: var(--brand);
}

.logo .lg-signal {
  fill: var(--signal);
}

.lang {
  display: flex;
  gap: 4px;
  font-size: 0.9375rem;
}

.lang a,
.lang span {
  padding: 4px 10px;
  border-radius: var(--radius-control);
  text-decoration: none;
}

.lang span {
  background: var(--brand-soft);
  color: var(--ink);
  font-weight: 600;
}

.site-footer {
  margin-top: 96px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* A pseudo-element, so the rule spans the content column rather than the gutters. */
.site-footer::before {
  content: '';
  display: block;
  border-top: 1px solid var(--line);
  margin-bottom: 28px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 12px;
}

.site-footer p {
  margin: 0;
}

/* ---------- type ---------- */

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 13ch;
}

h2 {
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  font-weight: 750;
}

h3 {
  font-size: 1.1875rem;
  font-weight: 700;
}

.lead {
  font-size: clamp(1.125rem, 1.8vw, 1.3125rem);
  color: var(--muted);
  max-width: 34em;
  margin: 24px 0 0;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-control);
  border: 2px solid var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button[aria-disabled='true'] {
  cursor: default;
  color: var(--muted);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  padding-top: clamp(32px, 7vw, 88px);
  padding-bottom: clamp(8px, 3vw, 40px);
}

/* The QR is a real, scannable code for the web app — the one bold element. */
.qr-plate {
  justify-self: end;
  width: 100%;
  max-width: 340px;
  margin: 0;
}

.qr-plate .plate {
  padding: 22px;
  background: #ffffff;
  border-radius: var(--radius-plate);
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px -24px rgba(20, 24, 51, 0.35);
}

.qr-plate img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
}

.qr-plate figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: center;
}

/* On a phone the visitor is already where the QR would take them. */
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .qr-plate {
    display: none;
  }
}

/* ---------- sections ---------- */

.section {
  padding-top: 56px;
  border-top: 1px solid var(--line);
  margin-top: 56px;
}

.section > h2 {
  margin-bottom: 28px;
}

.section-intro {
  color: var(--muted);
  max-width: var(--measure);
  margin: -12px 0 28px;
}

.spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 40px;
  margin: 0;
}

.spec dt {
  font-weight: 700;
  margin-bottom: 6px;
}

.spec dd {
  margin: 0;
  color: var(--muted);
}

/* "What stays on the phone / what leaves it" — the honest version of a privacy pitch. */
.ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
}

.ledger > div {
  padding: 24px 28px 28px;
}

.ledger > div + div {
  border-left: 1px solid var(--line);
}

.ledger h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ledger h3::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--keep);
}

.ledger .leaves h3::before {
  background: var(--leave);
}

.ledger ul {
  margin: 0;
  padding-left: 1.1em;
}

.ledger li + li {
  margin-top: 8px;
}

.ledger p {
  margin: 16px 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.ledger-note {
  margin: 20px 0 0;
  max-width: var(--measure);
  color: var(--muted);
}

@media (max-width: 760px) {
  .ledger {
    grid-template-columns: 1fr;
  }
  .ledger > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

.platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 40px;
}

.platforms p {
  margin: 8px 0 0;
  color: var(--muted);
}

/* ---------- hub (site root) ---------- */

.hub {
  padding-top: clamp(24px, 6vw, 80px);
}

.hub h1 {
  max-width: 16ch;
}

.project {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 56px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: 720px;
}

.project svg {
  width: 72px;
  height: 72px;
}

.project h2 {
  font-size: 1.5rem;
}

.project p {
  margin: 8px 0 0;
  color: var(--muted);
}

/* ---------- legal / long-form ---------- */

/* Left-aligned with the header; each block keeps a readable measure. */
.doc {
  padding-top: clamp(24px, 5vw, 56px);
}

.doc > * {
  max-width: var(--measure);
}

.doc h1 {
  font-size: clamp(2.125rem, 5vw, 3.25rem);
  max-width: none;
}

.doc .meta {
  color: var(--muted);
  margin: 16px 0 0;
}

.doc .summary {
  margin: 32px 0 8px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--brand-soft);
}

.doc .summary p {
  margin: 0;
}

.doc .summary p + p {
  margin-top: 10px;
}

.doc h2 {
  font-size: 1.5rem;
  margin: 48px 0 12px;
  scroll-margin-top: 24px;
}

.doc h3 {
  margin: 28px 0 8px;
}

.doc p,
.doc li {
  max-width: var(--measure);
}

.doc ul {
  padding-left: 1.2em;
}

.doc li + li {
  margin-top: 6px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.9688rem;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
}

.doc th {
  font-weight: 700;
}

.table-scroll {
  overflow-x: auto;
}

.doc .toc {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  columns: 2 220px;
  column-gap: 32px;
}

.doc .toc li {
  break-inside: avoid;
  margin: 0 0 6px;
}

/* ---------- 404 ---------- */

.notfound {
  padding-top: clamp(48px, 10vw, 120px);
}

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