/* Nessie design tokens + base styles. Modules style within these tokens;
   nobody hardcodes colors. Loch palette: deep water, mist, a sighting of
   green. */
:root {
  --bg: #f5f8f7;
  --surface: #ffffff;
  --surface-2: #eaf1ef;
  --ink: #14232b;
  --ink-soft: #4c6270;
  --line: #d5e0dd;
  --accent: #0e7a63;        /* loch green */
  --accent-ink: #ffffff;
  --deep: #123a4c;          /* deep water */
  --warn: #a35a00;
  --danger: #a3272f;
  --ok: #0e7a63;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(18, 58, 76, 0.10), 0 4px 16px rgba(18, 58, 76, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1a21;
    --surface: #14252e;
    --surface-2: #1b3039;
    --ink: #e5efec;
    --ink-soft: #93aab2;
    --line: #24404b;
    --accent: #2fb894;
    --accent-ink: #06231c;
    --deep: #9cc4d6;
    --warn: #e0a24a;
    --danger: #e0757c;
    --ok: #2fb894;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

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

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

h1, h2, h3 { line-height: 1.25; color: var(--ink); }
a { color: var(--accent); }
p { color: var(--ink); }
.muted { color: var(--ink-soft); }

/* Shell */
header.shell {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.shell .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
header.shell .brand-mark { color: var(--accent); }
header.shell nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  overflow-x: auto;
}
header.shell nav a {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
header.shell nav a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}
header.shell .auth-slot { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
header.shell .avatar { width: 28px; height: 28px; border-radius: 50%; }
header.shell .nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* Small screens: collapse the nav behind the ☰ toggle so it never overflows. */
@media (max-width: 760px) {
  header.shell .nav-toggle { display: block; margin-left: auto; }
  header.shell nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex: none;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 1rem 0.75rem;
    overflow-x: visible;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  }
  header.shell.nav-open nav { display: flex; }
  header.shell nav a { padding: 0.6rem 0.7rem; }
}

footer.shell {
  padding: 1.25rem 1rem 2rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* Components */
.btn {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
/* Sign in with Apple button — black on light, white on dark (Apple guidance). */
.btn-apple {
  background: #000;
  border-color: #000;
  color: #fff;
  font-weight: 600;
}
.btn-apple:hover { background: #1a1a1a; border-color: #1a1a1a; }
.signin-row { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-apple {
    background: #fff; border-color: #fff; color: #000;
  }
  :root:not([data-theme="light"]) .btn-apple:hover { background: #e6e6e6; border-color: #e6e6e6; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1rem;
}
.card h3 { margin-top: 0; }
.card-unavailable { border-style: dashed; color: var(--ink-soft); }
a.menu-card { display: block; text-decoration: none; color: inherit; }
a.menu-card:hover { border-color: var(--accent); }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.badge-ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge-soon { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.25rem;
  border-bottom: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: none; }
.checklist input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
}
.checklist .done { text-decoration: line-through; color: var(--ink-soft); }

.hero {
  position: relative;
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero p { max-width: 46ch; margin: 0 auto 1.5rem; color: var(--ink-soft); }
.hero > :not(.hero-nessie) { position: relative; z-index: 1; }
.hero-nessie {
  position: absolute;
  right: clamp(-60px, -3vw, -12px);
  top: 50%;
  transform: translateY(-54%);
  width: min(430px, 58vw);
  height: auto;
  color: var(--accent);
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
}

.promo-line {
  margin: 1rem auto 0;
  font-size: 0.9rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  display: inline-block;
  width: auto;
  max-width: 100%;
  padding: 0.35rem 1rem;
  white-space: nowrap;
}
.promo-line a { margin-left: 0.15rem; }

.sample-note {
  font-size: 0.8rem;
  color: var(--warn);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-wrap { overflow-x: auto; }
.chart-wrap svg { display: block; max-width: 100%; height: auto; }
