/* Shared by every page: design tokens, typography, header, buttons, cards and
   form basics. Page-specific styles live in schedule.css, profile.css and
   roster.css. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;   /* native scrollbars and controls follow the theme */
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f0eee9;
  --sunken: #fbfaf8;
  --text: #1d1c1a;
  --muted: #6b6862;
  --border: #e3e0da;
  --border-strong: #cfcbc3;
  --accent: #4450c4;          /* links and accent text */
  --accent-fill: #4f5bd5;     /* filled buttons and selected states */
  --on-accent: #ffffff;
  --chip-fg: #3a3834;
  --chip-on-bg: #e8eaff;
  --chip-on-border: #4f5bd5;
  --chip-on-fg: #263080;
  --note-bg: #f1f0fb;
  --note-border: #dcdaf2;
  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --warn: #9a5800;
  --warn-bg: #fff7e6;
  --err: #b91c1c;
  --field: #ffffff;
  /* schedule event kinds */
  --raid: #c2410c;
  --roster: #7c3aed;
  --signup: #15803d;
  --poll: #0369a1;
  --war: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111114;
    --surface: #18181c;
    --surface-2: #23232a;
    --sunken: #111114;
    --text: #ecebe8;
    --muted: #a09d95;
    --border: #26262d;
    --border-strong: #34343c;
    --accent: #a3aaff;
    --accent-fill: #4f5bd5;
    --chip-fg: #cfccc5;
    --chip-on-bg: #262a5c;
    --chip-on-border: #7c86ff;
    --chip-on-fg: #e4e6ff;
    --note-bg: #1f1e26;
    --note-border: #2e2d3a;
    --ok: #4ade80;
    --ok-bg: #15291d;
    --warn: #f5c27a;
    --warn-bg: #33280f;
    --err: #f59393;
    --field: #111114;
    --raid: #fb923c;
    --roster: #a78bfa;
    --signup: #4ade80;
    --poll: #38bdf8;
    --war: #f87171;
  }
}

/* ---------- page ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
main, footer { max-width: 920px; margin: 0 auto; padding: 0 16px; }
main.wide, footer.wide { max-width: 1120px; }
footer { padding: 32px 16px 48px; font-size: 13px; }

h1, h2, h3, h4, .brand { font-family: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif; }
h1 { font-size: 26px; margin: 28px 0 4px; }
h2 { font-size: 19px; margin: 36px 0 12px; }
h3 { font-size: 12px; letter-spacing: .08em; margin: 0 0 8px; color: var(--muted); }
h4 { font-size: 14px; margin: 22px 0 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
code { font-size: 13px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }

/* ---------- header ---------- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 1;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo { color: var(--accent); flex: none; }
.nav { display: flex; gap: 4px; margin-right: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { white-space: nowrap; color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav a[hidden] { display: none; }
.user { display: flex; align-items: center; gap: 8px; }
.user img { width: 28px; height: 28px; border-radius: 50%; }
.user span { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 10px;
  min-height: 44px; padding: 0 18px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.discord, .btn.primary { background: var(--accent-fill); color: var(--on-accent); }
.btn.discord:hover, .btn.primary:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border-strong); min-height: 40px; padding: 0 12px; font-size: 14px; font-weight: 500; }
.btn.danger-text { background: transparent; color: var(--err); padding: 0 10px; }
.btn:disabled { opacity: .6; cursor: default; }

/* ---------- cards ---------- */
.card { margin-top: 20px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.card.ok { background: var(--ok-bg); }
.card.warn { background: var(--warn-bg); }
.card[hidden] { display: none; }

/* member status pill (roster, responses) */
.pill-tag { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; border: 1px solid currentColor; white-space: nowrap; }
.pill-tag.done { color: var(--ok); }
.pill-tag.todo { color: var(--warn); }
.pill-tag.gone { color: var(--muted); }

/* ---------- forms ---------- */
select, input[type="text"], input[type="search"], textarea {
  font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 7px 10px;
}
select:focus-visible, input:focus-visible, textarea:focus-visible,
.btn:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

@media (max-width: 420px) {
  .nav { order: 3; width: 100%; }
}
