/* ------------------------------------------------------------------ *
 * SiteRep stylesheet
 * ------------------------------------------------------------------ *
 * One file, no framework, no build step. Mobile-first throughout: the
 * research identifies phone use during a 45-second prep phase as a
 * primary use case and a success metric, so the narrow layout is the
 * real design and the desktop layout is the enhancement.
 * ------------------------------------------------------------------ */

:root {
  --bg: #0d1014;
  --surface: #151a21;
  --surface-2: #1c232c;
  --surface-3: #232c37;
  --line: #2a323d;
  --ink: #e7e9ee;
  --ink-2: #aeb6c2;
  --ink-3: #7b8494;
  --accent: #f0b429;
  --accent-ink: #1b1405;
  --accent-dim: #3a2f14;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #60a5fa;

  --radius: 10px;
  --radius-sm: 6px;
  --gutter: 16px;
  --measure: 66ch;
  --header-h: 56px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* The site is dark by design (it is used in a dark game's prep phase),
   but a light preference is honoured rather than fought. */
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --surface-3: #e3e8ee;
  --line: #d3dae2;
  --ink: #161b22;
  --ink-2: #47525f;
  --ink-3: #6b7684;
  --accent: #b47c05;
  --accent-ink: #ffffff;
  --accent-dim: #fdf3dc;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 650; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 3.5vw, 1.6rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 0.8125rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ------------------------------- layout --------------------------- */

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 720px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.center { text-align: center; }
.prose { max-width: var(--measure); }
.prose li { margin-bottom: 0.4em; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px;
}
.skip-link:focus { left: 0; }

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

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { font-weight: 750; letter-spacing: -0.02em; color: var(--ink); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink-2); padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 0.9375rem; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
@media (max-width: 600px) {
  .nav a.nav--optional { display: none; }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 56px; padding: 28px 0 40px;
  color: var(--ink-3); font-size: 0.875rem;
}
.site-footer a { color: var(--ink-2); }
.footer-cols { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-cols { grid-template-columns: repeat(3, 1fr); } }
.footer-cols h4 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: 6px; }
.disclaimer { margin-top: 24px; font-size: 0.75rem; line-height: 1.5; color: var(--ink-3); max-width: 70ch; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; min-height: 42px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
  font: inherit; font-weight: 550; font-size: 0.9375rem;
  cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn--ghost { background: transparent; }
.btn--danger { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); color: var(--bad); background: transparent; }
.btn--sm { padding: 6px 10px; min-height: 34px; font-size: 0.875rem; }
.btn--block { width: 100%; }

/* ------------------------------- cards ---------------------------- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.card--tight { padding: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ------------------------------- badges --------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--verified { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.badge--review   { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.badge--draft    { color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, var(--line)); }
.badge--outdated { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.badge--plain::before { display: none; }

/* ----------------------------- notices ---------------------------- */

.notice {
  border: 1px solid var(--line); border-left-width: 3px;
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 0.9375rem;
}
.notice--info { border-left-color: var(--info); }
.notice--warn { border-left-color: var(--warn); }
.notice--bad  { border-left-color: var(--bad); }
.notice--ok   { border-left-color: var(--ok); }
.notice p:last-child { margin-bottom: 0; }

/* ------------------------------- forms ---------------------------- */

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 0.875rem; color: var(--ink-2); margin-bottom: 5px; }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; min-height: 42px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: 0.8125rem; margin-top: 4px; display: block; }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; }
label.check input { width: auto; min-height: 0; margin-top: 3px; }

/* --------------------------- floor plans -------------------------- */

.plan {
  position: relative; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.plan svg.floorplan { display: block; width: 100%; height: auto; }
.plan[data-clickable="true"] svg polygon { cursor: pointer; }
.plan[data-clickable="true"] svg polygon:hover { fill: var(--surface-3); }
.plan--blind .room-label { display: none; }

.floor-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
/* A switcher with one option is not a switcher. */
.floor-tabs:has(button:only-child) { display: none; }
.floor-tabs button { flex: 1 1 auto; }
.floor-tabs button[aria-pressed="true"] {
  background: var(--accent-dim); border-color: var(--accent); color: var(--ink);
}

/* Markers are positioned as a percentage of the plan, so they track the
   SVG exactly at any size without any JS on resize. */
.marker {
  position: absolute; transform: translate(-50%, -50%);
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  border: 1.5px solid var(--accent); background: var(--bg); color: var(--accent);
  cursor: pointer;
}
.marker--muted { border-color: var(--ink-3); color: var(--ink-3); }
.marker--active { background: var(--accent); color: var(--accent-ink); }
.marker--pin { border-color: var(--bad); background: var(--bad); color: #fff; width: 16px; height: 16px; }
.marker:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ------------------------------ setups ---------------------------- */

.setup-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.setup-steps li {
  counter-increment: step; display: grid;
  grid-template-columns: 26px 1fr; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.setup-steps li:last-child { border-bottom: 0; }
.setup-steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-3); color: var(--ink-2);
  font-size: 0.75rem; font-weight: 700;
}
.setup-steps li[aria-current="true"]::before { background: var(--accent); color: var(--accent-ink); }
.setup-steps .why { display: block; color: var(--ink-2); font-size: 0.875rem; margin-top: 2px; }
.setup-steps .kind {
  display: inline-block; font-size: 0.6875rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ink-3); margin-right: 6px;
}

.source {
  font-size: 0.8125rem; color: var(--ink-3);
  border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px;
}

/* ------------------------------- quiz ----------------------------- */

.quiz-prompt { font-size: 1.15rem; font-weight: 600; text-align: center; margin: 0 0 12px; }
.quiz-options { display: grid; gap: 8px; grid-template-columns: 1fr; margin-top: 12px; }
@media (min-width: 520px) { .quiz-options { grid-template-columns: 1fr 1fr; } }
.quiz-options .btn { min-height: 48px; }
.quiz-options .btn[data-state="correct"] { border-color: var(--ok); color: var(--ok); }
.quiz-options .btn[data-state="wrong"] { border-color: var(--bad); color: var(--bad); }
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width 0.2s ease; }
.tally { display: flex; gap: 14px; font-variant-numeric: tabular-nums; font-size: 0.875rem; color: var(--ink-2); }

/* ------------------------------ tables ---------------------------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--ink-3); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.data tbody tr:hover { background: var(--surface-2); }

/* ------------------------------ pricing --------------------------- */

.price { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
.price small { font-size: 0.875rem; font-weight: 400; color: var(--ink-3); }
.plan-card { display: flex; flex-direction: column; }
.plan-card--featured { border-color: var(--accent); }
.plan-card ul { list-style: none; padding: 0; margin: 12px 0; }
.plan-card li { padding: 5px 0 5px 22px; position: relative; font-size: 0.9375rem; }
.plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); }
.plan-card li.no::before { content: "–"; color: var(--ink-3); }
.plan-card .btn { margin-top: auto; }

/* ------------------------------- misc ----------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 16px; border-radius: var(--radius); z-index: 60;
  max-width: calc(100vw - 32px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  font-size: 0.9375rem;
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

details.faq { border-bottom: 1px solid var(--line); padding: 12px 0; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "＋"; color: var(--accent); margin-right: 8px; }
details.faq[open] summary::before { content: "－"; }
details.faq .prose { padding-top: 8px; }

.breadcrumb { font-size: 0.8125rem; color: var(--ink-3); margin-bottom: 10px; }
.breadcrumb a { color: var(--ink-2); }

.stat { font-variant-numeric: tabular-nums; }
.stat b { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.stat span { font-size: 0.8125rem; color: var(--ink-3); }

@media print {
  .site-header, .site-footer, .btn, .nav { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .plan { border-color: #999; }
}
