/* GPSLarp legal pages — /privacy/, /datenschutz/, /impressum/, /terms/
 *
 * Plain CSS, served verbatim from apps/web/public/. It cannot use
 * src/styles/tokens.css: public/ is copied byte-for-byte into dist/ and never
 * enters the Vite graph, so an @import into src/ would 404 in production.
 * Every value below is therefore hardcoded from apps/web/DESIGN.md, and if
 * that table changes this file has to be changed with it by hand.
 *
 * Deliberately NO webfont. The marketing page's Instrument Serif ships as
 * glyph subsets built from src/data/content.ts (`npm run fonts`), which do not
 * cover this vocabulary; and loading a font from a third-party CDN would make
 * every visitor's IP address reach that CDN, on the one page whose subject is
 * not doing that. Georgia carries the headings instead.
 */

:root {
  /* Dark is the brand default — DESIGN.md section 2. */
  --surface-primary: #161826;
  --surface-secondary: #232532;
  --text-primary: #e9e9ed;
  --text-secondary: #b2b6ca;
  --text-tertiary: #9397ab;
  --rule: #2b2f42;
  --rule-strong: #434867;
  --accent: #9184d9;
  --accent-ink: #161826;

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

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 42rem;
}

/* The palette inverts for a visitor whose system asks for light. Tonal steps
 * and hairlines are preserved; the accent darkens to keep contrast on white. */
@media (prefers-color-scheme: light) {
  :root {
    --surface-primary: #fbfbfc;
    --surface-secondary: #f0f0f4;
    --text-primary: #161826;
    --text-secondary: #3c405a;
    --text-tertiary: #5a5f78;
    --rule: #dcdce6;
    --rule-strong: #b6b8ca;
    --accent: #514398;
    --accent-ink: #ffffff;
  }
}

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

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

body {
  margin: 0;
  background: var(--surface-primary);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
}

/* --- skip link ----------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 10;
}

.skip:focus {
  left: 0;
}

/* --- shell --------------------------------------------------------------- */

.wrap {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 24px 0 20px;
  margin-bottom: 56px;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: baseline;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
}

.brand::after {
  content: "*";
  color: var(--accent);
  margin-left: 2px;
}

.masthead .links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.masthead .links a {
  color: var(--text-tertiary);
  text-decoration: none;
}

.masthead .links a:hover,
.masthead .links a[aria-current="page"] {
  color: var(--accent);
}

main {
  padding-bottom: 96px;
}

/* --- headings ------------------------------------------------------------ */

h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 16px;
}

h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 64px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

h2 .num {
  font-style: italic;
  color: var(--accent);
  font-size: 0.72em;
  margin-right: 0.5em;
}

h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 36px 0 12px;
}

h4 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 28px 0 8px;
}

/* --- text ---------------------------------------------------------------- */

p,
li {
  margin: 0 0 16px;
}

ul,
ol {
  padding-left: 1.25rem;
  margin: 0 0 16px;
}

li {
  margin-bottom: 8px;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--text-primary);
  background: var(--surface-secondary);
  padding: 1px 5px;
}

.lede {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin: 0 0 32px;
}

.meta span + span::before {
  content: "/";
  margin: 0 8px;
  color: var(--rule-strong);
}

/* --- placeholder marker --------------------------------------------------
 * A double-bracketed marker left in these pages is a fact nobody has supplied
 * yet. scripts/check_legal_placeholders.py fails while any survive; this style
 * exists so a human reading the rendered page sees the same gap the check
 * sees. (The marker syntax is deliberately not written out here: this file is
 * outside the check's scope today, and spelling it would plant a false
 * positive for whoever widens that scope.) */

.ph {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--accent);
  border-bottom: 1px dotted var(--accent);
  white-space: nowrap;
}

/* --- callout ------------------------------------------------------------- */

.note {
  border-left: 2px solid var(--accent);
  background: var(--surface-secondary);
  padding: 20px 24px;
  margin: 24px 0;
}

.note > :last-child {
  margin-bottom: 0;
}

.note h4 {
  margin-top: 0;
  color: var(--accent);
}

/* --- definition rows ----------------------------------------------------- */

dl.spec {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 0;
  margin: 24px 0;
  border-top: 1px solid var(--rule);
}

dl.spec dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--rule);
}

dl.spec dd {
  margin: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--text-secondary);
}

dl.spec dd > :last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  dl.spec {
    grid-template-columns: 1fr;
  }

  dl.spec dt {
    padding-bottom: 4px;
    border-bottom: 0;
  }

  dl.spec dd {
    padding-top: 0;
  }
}

/* --- tables --------------------------------------------------------------
 * Wide content scrolls inside its own box; the page body never scrolls
 * sideways. */

.scroll {
  overflow-x: auto;
  margin: 24px 0;
  border-top: 1px solid var(--rule);
}

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

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 14px 20px 14px 0;
  border-bottom: 1px solid var(--rule);
}

th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* --- table of contents --------------------------------------------------- */

.toc {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
  margin: 40px 0;
}

.toc h4 {
  margin-top: 0;
}

.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 40px;
}

.toc li {
  margin-bottom: 6px;
  font-size: 0.875rem;
  break-inside: avoid;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .toc ol {
    columns: 1;
  }
}

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

footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0 64px;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

footer .links a {
  text-decoration: none;
}

/* --- print ---------------------------------------------------------------
 * A legal page has to survive being printed and filed. Ink on white, no
 * navigation chrome, and link targets spelled out because a printed <a> is
 * otherwise a dead end. */

@media print {
  :root {
    --surface-primary: #ffffff;
    --surface-secondary: #ffffff;
    --text-primary: #000000;
    --text-secondary: #1a1a1a;
    --text-tertiary: #444444;
    --rule: #bbbbbb;
    --rule-strong: #888888;
    --accent: #000000;
    --accent-ink: #ffffff;
  }

  body {
    font-size: 10.5pt;
    line-height: 1.45;
  }

  .masthead .links,
  .toc,
  .skip,
  footer .links {
    display: none;
  }

  .wrap {
    max-width: none;
    padding: 0;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  .note {
    border: 1px solid var(--rule);
    border-left: 2px solid #000;
  }

  a {
    text-decoration: underline;
  }

  main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
    word-break: break-all;
  }

  .ph {
    border-bottom: 1px solid #000;
  }
}
