/*
 * Team Roke base stylesheet, shared by teamroke.ca, BGPeh, Phisheh, Dig Brother
 * and Meet Me Room.
 *
 * The master copy lives in the teamroke repository (shared/base.css).
 * scripts/sync.py copies it into each site as base.css, and each site loads its
 * own copy before its style.css. Don't edit a copy: edit this file, then sync.
 *
 * It holds only what the sites have in common: the colour tokens for light and
 * dark mode, the reset, small text helpers, Phisheh's mail grades and the
 * "A Team Roke project" footer. Each site's style.css sets its own --accent and --link, and keeps its
 * own logo, header and layout.
 */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #61656d;
  --line: #e2e2de;
  --hover: #f0f0ec;
  --chip: #eef0f2;
  --accent: #1d1f23;
  --link: #1971c2;
  --roke: #c8102e;
  /* The family's four colours, for the dots in the Team Roke mark: TEssa, AMy, ROwan, KEvin. */
  --roke-te: #8c44b0; --roke-am: #2b8a3e; --roke-ro: #1971c2; --roke-ke: #c8102e;
  /* Phisheh's grades for forged mail; see .grade below. */
  --grade-strong: #1971c2; --grade-partial: #e0a000; --grade-weak: #c2410c;
  --grade-open: #8a1c1c; --grade-error: #9aa0a6; --on-grade: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
/* Dark mode follows the system unless the page sets data-theme="light". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #1d2024;
    --text: #e8e9eb;
    --muted: #a3a8b0;
    --line: #30343a;
    --hover: #262a2f;
    --chip: #2a2e34;
    --accent: #e8e9eb;
    --link: #4d9be6;
    --roke: #ff6b6b;
    --roke-te: #c084fc; --roke-am: #51cf66; --roke-ro: #4d9be6; --roke-ke: #ff6b6b;
    --grade-strong: #4d9be6; --grade-partial: #e0a82e; --grade-weak: #f07a3a;
    --grade-open: #d9534f; --on-grade: #15171a;
    --shadow: none;
    color-scheme: dark;
  }
}
/* The same dark values, for a page that sets data-theme="dark" itself. */
:root[data-theme="dark"] {
  --bg: #15171a; --surface: #1d2024; --text: #e8e9eb; --muted: #a3a8b0; --line: #30343a;
  --hover: #262a2f; --chip: #2a2e34; --accent: #e8e9eb; --link: #4d9be6; --roke: #ff6b6b;
  --roke-te: #c084fc; --roke-am: #51cf66; --roke-ro: #4d9be6; --roke-ke: #ff6b6b;
  --grade-strong: #4d9be6; --grade-partial: #e0a82e; --grade-weak: #f07a3a;
  --grade-open: #d9534f; --on-grade: #15171a;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
}
a { color: var(--link); }
code { font: 0.92em var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/*
 * Phisheh's grades for forged mail, as a badge, so every site that shows one
 * draws it the same way: .grade plus strong ("Off the hook"), partial ("In the
 * net"), weak ("Easy bait"), open ("Wide open") or error ("No answer"). Blue,
 * amber, orange-red and dark red stay apart for colour-blind readers.
 */
.grade {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; white-space: nowrap;
  color: var(--on-grade);
}
.grade.strong { background: var(--grade-strong); }
.grade.partial { background: var(--grade-partial); color: #1d1f23; }
.grade.weak { background: var(--grade-weak); }
.grade.open { background: var(--grade-open); }
.grade.error { background: var(--grade-error); color: #1d1f23; }

/*
 * The Team Roke footer, on every site: "A Team Roke project", then the other
 * sites in the family. scripts/sync.py writes its HTML from shared/sites.json.
 */
.teamroke {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px 16px 32px;
  font-size: 0.85rem; text-align: center;
}
.teamroke a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); text-decoration: none;
}
.teamroke a:hover { color: var(--text); }
.teamroke a:hover span { text-decoration: underline; }
.teamroke-by svg { width: 18px; height: 18px; flex: none; }
.teamroke .mark-ink { stroke: currentColor; }
.teamroke .mark-te { fill: var(--roke-te); }
.teamroke .mark-am { fill: var(--roke-am); }
.teamroke .mark-ro { fill: var(--roke-ro); }
.teamroke .mark-ke { fill: var(--roke-ke); }
.teamroke-sites {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
}
.teamroke-sites img { width: 22px; height: 22px; flex: none; }
.teamroke-sites b { color: var(--text); font-weight: 600; }
