/* SPDX-License-Identifier: MPL-2.0 */
/* Gibela public site. Colours are the game's (game/gibela/app/theme/g_theme.gd): BG 10161d, PANEL 1b2430,
   PANEL_RAISED 263243, TEXT f4f7fa, TEXT_DIM b4c0cc, ACCENT ffc81b, ON_ACCENT 10161d. System fonts only. */

:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #10161d;
  --text-dim: #4a5665;
  --line: #d9dfe6;
  --accent: #ffc81b;
  --on-accent: #10161d;
  --link: #1f4f86;
  --mark: #10161d;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161d;
    --surface: #1b2430;
    --surface-2: #263243;
    --text: #f4f7fa;
    --text-dim: #b4c0cc;
    --line: #33445b;
    --link: #ffd659;
    --mark: #ffc81b;
  }
}

*, *::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: 17px/1.6 var(--font);
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 20px; }
.brand img { width: 34px; height: 34px; border-radius: 8px; display: block; }
.site-head nav { display: flex; gap: 18px; font-size: 15px; }
.site-head nav a { color: var(--text-dim); text-decoration: none; }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }

/* Hero */
.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-size: 14px; font-weight: 700; letter-spacing: 0.01em;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent); }
h1 { font-size: clamp(34px, 5.4vw, 54px); line-height: 1.08; margin: 18px 0 16px; letter-spacing: -0.02em; }
.lede { font-size: 19px; color: var(--text-dim); margin: 0 0 22px; max-width: 34em; }
.hero figure { margin: 0; }
.hero img.shot { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); }
.hero figcaption { font-size: 13px; color: var(--text-dim); margin-top: 8px; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { background: var(--surface-2); border-radius: 999px; padding: 4px 12px; font-size: 14px; }

/* Sections */
section { padding: 36px 0; }
h2 { font-size: 28px; line-height: 1.2; margin: 0 0 18px; letter-spacing: -0.01em; }
h3 { font-size: 19px; margin: 0 0 6px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card p { margin: 0; color: var(--text-dim); font-size: 16px; }
.card h3::before {
  content: ""; display: block; width: 28px; height: 4px; border-radius: 2px;
  background: var(--accent); margin-bottom: 12px;
}
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.two p { margin: 0 0 12px; }
ul.plain { padding-left: 1.2em; margin: 0; }
ul.plain li { margin: 4px 0; }

/* Legal / long text */
.doc { padding: 40px 0 56px; }
.doc h1 { font-size: clamp(30px, 4.6vw, 42px); margin-top: 0; }
.doc h2 { font-size: 23px; margin: 38px 0 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 18px; margin: 22px 0 6px; }
.doc p, .doc li { max-width: 46em; }
.doc li { margin: 6px 0; }
.meta { color: var(--text-dim); font-size: 15px; }
.summary { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 16px 20px; margin: 22px 0; }
.summary ul { margin: 8px 0 0; padding-left: 1.2em; }
.toc { columns: 2; column-gap: 32px; padding-left: 1.2em; margin-top: 0; font-size: 15px; }
.toc li { margin: 0 0 6px; break-inside: avoid; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; background: var(--surface); }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--text-dim); font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-foot p { margin: 0; }
.site-foot a { color: var(--text-dim); }

/* 404 */
.notfound { padding: 96px 0; text-align: center; }
.notfound img { width: 96px; height: 96px; border-radius: 20px; }

@media (max-width: 860px) {
  .hero { padding: 36px 0 24px; }
  .hero-grid, .two { grid-template-columns: 1fr; gap: 24px; }
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .grid { grid-template-columns: 1fr; }
  .toc { columns: 1; }
  .site-head nav { gap: 14px; }
  .lede { font-size: 17px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
