/* Shared look of baselinegame.net: the home page, /patch-notes and the legal pages
   (docs/legal/site/*.html). Faction colours are the game's own (apps/world/src/data/portals.ts
   FACTION_COLORS), ground is the brand's #0b0c0e. System fonts only: the CSP allows no font files. */

:root {
  color-scheme: dark;
  --bg: #0b0c0e;
  --bg-raised: #111419;
  --surface: #151920;
  --line: #262b33;
  --line-strong: #353b45;
  --text: #d8dbe0;
  --text-dim: #9aa1ab;
  --white: #ffffff;
  --axiom: #3fc9ee;
  --drift: #ffa32e;
  --focus: #8fe3ff;
  --radius: 14px;
  --gutter: 16px;
  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  overflow-wrap: break-word;
}

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

a { color: var(--axiom); text-underline-offset: 0.18em; }
a:hover { color: var(--focus); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--white);
  color: var(--bg);
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { top: 8px; }

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

[hidden] { display: none !important; }

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

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 12, 14, 0.86);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 0.95rem;
}
.brand:hover { color: var(--white); }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.site-nav { display: flex; align-items: center; gap: 4px 16px; }
.site-nav .button { white-space: nowrap; }
/* A 360 px phone has no room for the word mark beside both links; the logo stays, the name is
   still read out. */
@media (max-width: 389px) {
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
.site-nav a:not(.button) {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:not(.button):hover,
.site-nav a[aria-current="page"] { color: var(--white); text-decoration: underline; }

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--white);
  font: 600 1rem/1.2 var(--font);
  text-decoration: none;
  text-align: center;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.button:hover { color: var(--white); border-color: var(--axiom); background: rgba(63, 201, 238, 0.08); }
.button-primary {
  border: 0;
  color: #06080a;
  background: linear-gradient(100deg, var(--axiom) 0%, #9fd8d0 50%, var(--drift) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 28px -10px rgba(63, 201, 238, 0.55);
}
.button-primary:hover { color: #06080a; background: linear-gradient(100deg, #6fd8f4 0%, #b8e3dc 50%, #ffb95c 100%); }
.button-small { min-height: 38px; padding: 6px 16px; font-size: 0.92rem; }
.button .arrow { font-weight: 400; }

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

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text-dim);
  font-size: 0.93rem;
}
.site-footer .wrap { padding-top: 32px; padding-bottom: 40px; }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
}
.footer-title {
  margin: 0 0 8px;
  color: var(--white);
  font: 600 0.78rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 2px 0; }
.footer-links a, .site-footer p a { color: var(--text); }
.site-footer p { margin: 0 0 8px; }
.footer-credit { margin-top: 28px !important; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.85rem; }

/* ---------- reading pages: legal text and patch notes ---------- */

.page { max-width: 760px; margin: 0 auto; padding: 32px var(--gutter) 0; }
.page h1 { color: var(--white); font-size: 1.75rem; line-height: 1.25; margin: 0 0 16px; }
.page h2 { color: var(--white); font-size: 1.25rem; line-height: 1.3; margin: 32px 0 8px; }
.page h3 { color: var(--white); font-size: 1.05rem; margin: 24px 0 4px; }
.page strong { color: var(--white); }
.page hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.page li { margin: 4px 0; }
.page table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.page th, .page td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 28px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.legal-nav a[aria-current="page"] { color: var(--white); font-weight: 600; text-decoration: none; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--axiom);
  font: 600 0.78rem/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* patch notes (/patch-notes) */
.notes-intro { color: var(--text-dim); margin: 0 0 8px; }
.notes-status { color: var(--text-dim); padding: 24px 0; }
.note {
  margin: 28px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}
.note:focus { outline: none; }
.note.is-target .note-title a { color: var(--axiom); }
.note.is-target { border-top-color: var(--axiom); }
.note-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.page .note-title { margin: 0; font-size: 1.3rem; }
.note-title a { color: var(--white); text-decoration: none; }
.note-title a:hover { text-decoration: underline; }
.note-date { color: var(--text-dim); font: 0.85rem/1.5 var(--mono); letter-spacing: 0.04em; }
.note-body ul { padding-left: 1.25em; }
.note-body li::marker { color: var(--axiom); }
.page .note-section {
  margin: 20px 0 4px;
  color: var(--drift);
  font: 600 0.8rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
