/* Adder's Crosswords — chrome + landing/play styling.
   Standalone (these pages live in a separate repo and can't import adderoaks/style.css),
   so the palette mirrors adderoaks' tokens for a native feel. The Exolve widget itself
   is themed by vendor/exolve-m.css; this file styles only the page chrome around it. */

:root {
  --bg: #0f0f13;
  --text: #f0eee8;
  --text-muted: #9a9690;
  --border: rgba(255, 255, 255, 0.10);
  --border-hover: rgba(255, 255, 255, 0.22);
  --header-bg: rgba(15, 15, 19, 0.78);
  --card-bg: rgba(255, 255, 255, 0.03);
  --shadow-card: 0 2px 14px rgba(0, 0, 0, 0.45);
  --accent: #5fa8d3;
  --radius-card: 18px;
  --radius-sm: 10px;
  --t-fast: 0.15s ease;
  --t-card: 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

:root[data-theme="light"] {
  --bg: #f5f3ef;
  --text: #1a1814;
  --text-muted: #5a5550;
  --border: rgba(0, 0, 0, 0.10);
  --border-hover: rgba(0, 0, 0, 0.20);
  --header-bg: rgba(245, 243, 239, 0.82);
  --card-bg: rgba(0, 0, 0, 0.02);
  --shadow-card: 0 2px 14px rgba(0, 0, 0, 0.10);
  --accent: #1e6091;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f3ef;
    --text: #1a1814;
    --text-muted: #5a5550;
    --border: rgba(0, 0, 0, 0.10);
    --border-hover: rgba(0, 0, 0, 0.20);
    --header-bg: rgba(245, 243, 239, 0.82);
    --card-bg: rgba(0, 0, 0, 0.02);
    --shadow-card: 0 2px 14px rgba(0, 0, 0, 0.10);
    --accent: #1e6091;
  }
}

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

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

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--t-card), color var(--t-card);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 12px 22px;
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid var(--border);
}
.site-name {
  font-weight: 650;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}
.site-name:hover { color: var(--accent); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.theme-toggle:hover { border-color: var(--border-hover); background: var(--card-bg); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: inline; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  max-width: 980px;
  margin: 3rem auto 0;
  padding: 1.4rem 1.2rem 2.4rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ── Landing page ───────────────────────────────────────────────────────── */
.index-main { max-width: 760px; margin: 0 auto; padding: 2.4rem 1.2rem 0; }
.xw-title { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.01em; }
.xw-intro { color: var(--text-muted); margin: 0.5rem 0 1.8rem; max-width: 54ch; }

.puzzle-list { list-style: none; display: grid; gap: 1rem; }
.puzzle-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.15rem 1.25rem;
  transition: border-color var(--t-fast), transform var(--t-card);
}
.puzzle-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.pz-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.8rem; }
.pz-title { font-size: 1.3rem; font-weight: 650; }
.pz-title a { color: var(--text); text-decoration: none; }
.pz-title a:hover { color: var(--accent); }
.pz-meta { color: var(--text-muted); font-size: 0.85rem; }
.pz-dot { opacity: 0.5; }
.pz-blurb { margin-top: 0.45rem; color: var(--text-muted); font-size: 0.95rem; }

.pz-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1.1rem;
  margin-top: 0.9rem;
}
.pz-btn {
  display: inline-block;
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}
.pz-play {
  background: var(--accent);
  color: #08151d;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.pz-play:hover { filter: brightness(1.08); }
.pz-print { color: var(--text-muted); font-size: 0.88rem; }
.pz-print a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  margin-left: 0.35rem;
}
.pz-print a:hover { border-bottom-color: currentColor; }

/* ── Play page ──────────────────────────────────────────────────────────── */
/* Match the print PDFs: a Helvetica/Arial sans-serif for the whole puzzle page.
   The grid + clues themselves are set via Exolve's font-family option in the spec. */
body.play-page { font-family: Helvetica, Arial, sans-serif; }
/* Wide enough that Exolve floats the clue panes to the RIGHT of the grid on
   desktop (it needs ~400px beside the grid); it drops them below on narrow screens. */
.play-main { max-width: 1400px; margin: 0 auto; padding: 1rem 0.8rem 0; }

/* Remove Exolve's own print UI — the repo's print PDFs are used instead.
   exolve-m.css loads after this file, so !important is required. */
.play-page .xlv-small-print { display: none !important; }
.play-crumbs { padding: 0 0.6rem 0.4rem; font-size: 0.9rem; }
.play-crumbs a { color: var(--text-muted); text-decoration: none; }
.play-crumbs a:hover { color: var(--accent); }
.xword-wrap { color: var(--text); }   /* light-on-dark text → Exolve picks its dark scheme */
.play-print {
  text-align: center;
  margin-top: 1.4rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.play-print a { color: var(--accent); text-decoration: none; }
.play-print a:hover { text-decoration: underline; }

/* ── Solving-options panel ──────────────────────────────────────────────── */
.xw-settings {
  max-width: 640px;
  margin: 1.4rem auto 0;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  font-size: 0.92rem;
}
.xw-settings summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.3rem 0;
}
.xw-settings summary:hover { color: var(--accent); }
.xw-settings label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.55rem 0;
  line-height: 1.45;
}
.xw-settings input[type="checkbox"] { margin-top: 0.2rem; flex-shrink: 0; }
.xw-keys { color: var(--text-muted); font-size: 0.86rem; margin: 0.6rem 0 0.3rem; }
.xw-keys kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82em;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.4em;
}
