/* Layout: one narrow column with a fixed bottom tab bar. Five separate pages: Today (the answer), Dates (any year), Science, Astrology, Tips. */
:root {
  --bg: #EAEFF5;
  --panel: #F7F9FC;
  --fg: #0F1A2E;
  --muted: #55627A;
  --line: #CBD4E2;
  --yes: #C2410C;
  --yes-bg: #FBE4D6;
  --no: #0F766E;
  --no-bg: #D5EEEA;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1220; --panel: #121B2D; --fg: #E7ECF5; --muted: #9AA7BF; --line: #26324A;
    --yes: #FF9A63; --yes-bg: #2B1A12; --no: #5EE0C4; --no-bg: #0F2A27;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1220; --panel: #121B2D; --fg: #E7ECF5; --muted: #9AA7BF; --line: #26324A;
  --yes: #FF9A63; --yes-bg: #2B1A12; --no: #5EE0C4; --no-bg: #0F2A27;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.5 var(--body);
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  padding: 20px 0 0;
}
html { background: var(--bg); }
.wrap { max-width: 460px; margin-inline: auto; min-height: calc(100vh - 20px); min-height: calc(100dvh - 20px); display: flex; flex-direction: column;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap[data-state="yes"] { --state: var(--yes); --state-bg: var(--yes-bg); }
.wrap[data-state="no"]  { --state: var(--no);  --state-bg: var(--no-bg); }
.page { display: flex; flex-direction: column; gap: 20px; }

/* Tab bar */
.tabs { position: sticky; bottom: 0; z-index: 20; margin-top: auto; margin-inline: calc(50% - 50vw); width: 100vw; background: var(--panel); border-top: 1px solid var(--line);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.tabs-in { max-width: 460px; margin-inline: auto; display: flex; gap: 2px; }
.tabs a { flex: 1; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center;
  font: 600 0.7rem/1.1 var(--body); color: var(--muted); text-decoration: none; border-radius: 12px; padding: 4px 2px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a > * { pointer-events: none; }
.tabs a:active { background: var(--line); }
.tabs a[aria-current="page"] { color: var(--state); background: var(--state-bg); box-shadow: inset 0 3px 0 var(--state); font-weight: 800; }
.tabs a[aria-current="page"] svg { stroke-width: 2.3; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--state); outline-offset: 2px; }

/* Verdict (Today) */
.verdict { background: var(--state-bg); border-radius: 22px; padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 4px; }
h1 { margin: 0; font: 600 1.1rem/1.3 var(--display); letter-spacing: 0.005em; }
.answer { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(6.5rem, 36vw, 11rem); line-height: 0.86; letter-spacing: -0.035em; color: var(--state); padding-block: 0.06em 0.02em; }
.line { margin: 0; font-size: 1.05rem; line-height: 1.4; text-wrap: balance; }
.sub { margin: 0; font: 500 0.82rem/1.4 var(--mono); color: var(--muted); }
.countdown { margin: 8px 0 0; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.countdown[hidden] { display: none; }
.cd-label { font: 700 0.72rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cd-time { font: 800 clamp(1.6rem, 7.6vw, 2.2rem)/1.05 var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--state); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; }
h2 { margin: 0 0 2px; font: 700 0.78rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cap { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.4; }

svg { display: block; width: 100%; height: auto; }
.g-grid { stroke: var(--line); stroke-width: 1; }
.g-zero { stroke: var(--muted); stroke-width: 1; }
.g-line { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; }
.g-retro-line { fill: none; stroke: var(--yes); stroke-width: 2.25; stroke-linejoin: round; }
.g-retro-area { fill: var(--yes); fill-opacity: 0.22; stroke: none; }
.g-text { fill: var(--muted); font: 400 10px var(--mono); }
.g-tag { fill: var(--yes); font: 500 10px var(--mono); }
.g-dot { fill: var(--yes); }
.g-now { stroke: var(--fg); stroke-width: 1; stroke-dasharray: 3 3; }
.g-now-dot { fill: var(--panel); stroke: var(--fg); stroke-width: 2; }
.g-band { fill: var(--yes); fill-opacity: 0.85; }
.g-track { fill: var(--bg); stroke: var(--line); stroke-width: 1; }

dl.facts { margin: 6px 0 0; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-block: 10px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row dt { color: var(--muted); font-size: 0.9rem; }
.row dd { margin: 0; font: 500 0.95rem/1.3 var(--mono); text-align: right; font-variant-numeric: tabular-nums; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
button, input[type="date"] { font: 500 0.95rem var(--body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 0 14px; }
button { min-width: 44px; cursor: pointer; }
button:disabled { opacity: 0.4; cursor: default; }
input[type="date"] { flex: 1 1 150px; min-width: 0; font-family: var(--mono); font-size: 0.9rem; }
button:active { transform: translateY(1px); }

ul.windows { list-style: none; margin: 6px 0 0; padding: 0; }
ul.windows li { padding-block: 11px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
ul.windows li:first-child { border-top: 0; }
.w-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; align-items: baseline; }
.w-dates { font: 500 0.92rem var(--mono); font-variant-numeric: tabular-nums; }
.w-len { font: 500 0.82rem var(--mono); color: var(--muted); }
.w-sub { color: var(--muted); font-size: 0.88rem; }
.now-tag { display: inline-block; font: 700 0.66rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; background: var(--yes); color: var(--bg); padding: 3px 6px; border-radius: 6px; margin-left: 8px; vertical-align: 2px; }

.foot { margin: 0; font-size: 0.8rem; color: var(--muted); line-height: 1.45; }

/* Sub pages */
.ph { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.ph h1 { font: 800 clamp(2rem, 9vw, 2.6rem)/1.02 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.lede { margin: 0; font-size: 1.1rem; line-height: 1.45; text-wrap: pretty; }
.chip { display: inline-flex; align-items: center; gap: 8px; font: 500 0.78rem/1.2 var(--mono); padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--fg); }
.chip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip.yes { background: var(--yes-bg); } .chip.yes i { background: var(--yes); }
.chip.no { background: var(--no-bg); } .chip.no i { background: var(--no); }

.prose { display: flex; flex-direction: column; gap: 24px; }
.prose h3 { margin: 0 0 6px; font: 700 1.3rem/1.25 var(--display); text-wrap: balance; }
.prose p { margin: 0 0 10px; max-width: 65ch; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0; padding-left: 1.15em; max-width: 65ch; }
.prose li { margin-bottom: 7px; }
.prose li::marker { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font: 800 2.1rem/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; font-size: 0.85rem; color: var(--muted); line-height: 1.35; }

.callout { background: var(--state-bg); border-radius: 16px; padding: 14px 16px; }
.callout p { margin: 0; }

.yearbar { display: flex; align-items: center; gap: 8px; }
.yearbar output { flex: 1; text-align: center; font: 800 1.8rem/1 var(--display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

.group-h { margin: 14px 0 2px; font: 700 0.78rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.group-h:first-of-type { margin-top: 6px; }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding-block: 8px; border-top: 1px solid var(--line); cursor: pointer; }
.check:first-of-type { border-top: 0; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--state); }
.check span { line-height: 1.4; }
.check input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }

.credit { margin-top: 28px; margin-bottom: 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.credit p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.credit p a { color: var(--fg); text-underline-offset: 3px; }
.coffee { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; touch-action: manipulation; border-radius: 999px; background: var(--state); color: var(--panel); font: 700 0.95rem var(--body); text-decoration: none; }

@media (prefers-reduced-motion: reduce) { button:active { transform: none; } }

/* Load animation: Today and Dates pages. app.js adds .intro to #app on first render and removes it after ~3s. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes mr-tick { from { opacity: 0.35; transform: translateY(-0.18em); } }
  @keyframes mr-fadeup { from { opacity: 0; transform: translateY(10px); } }
  @keyframes mr-fade { from { opacity: 0; } }
  @keyframes mr-answer { from { opacity: 0; transform: translateY(14px) scale(0.94); } }
  @keyframes mr-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes mr-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes mr-grow { from { transform: scaleX(0); } }
  @keyframes mr-pop { from { opacity: 0; transform: scale(0); } }

  .cd-s { display: inline-block; animation: mr-tick 0.35s ease-out; }
  .intro .answer { transform-origin: left center; animation: mr-answer 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .intro .line { animation: mr-fadeup 0.5s 0.2s ease-out both; }
  .intro .sub { animation: mr-fadeup 0.5s 0.3s ease-out both; }
  .intro .countdown { animation: mr-fadeup 0.5s 0.4s ease-out both; }
  .intro .panel { animation: mr-fadeup 0.5s ease-out both; animation-delay: calc(300ms + var(--i, 0) * 90ms); }
  .intro .ph > * { animation: mr-fadeup 0.5s ease-out both; animation-delay: calc(var(--k, 0) * 90ms); }
  .intro .row, .intro ul.windows li { animation: mr-fade 0.4s ease-out both; animation-delay: calc(550ms + var(--j, 0) * 80ms); }

  .intro .w-dates { animation: mr-wipe 0.8s steps(22, end) both; animation-delay: calc(650ms + var(--j, 0) * 160ms); }
  .intro .now-tag { animation: mr-pop 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both; animation-delay: calc(1450ms + var(--j, 0) * 160ms); }
  .intro .g-grid, .intro .g-zero, .intro .g-text { animation: mr-fade 0.5s 0.4s ease-out both; }
  .intro .g-line { stroke-dasharray: 1; animation: mr-draw 1.4s 0.5s ease-out both; }
  .intro .g-retro-line { stroke-dasharray: 1; animation: mr-draw 0.9s 1.1s ease-out both; }
  .intro .g-retro-area { animation: mr-fade 0.7s 1.2s ease-out both; }
  .intro .g-dot { transform-box: fill-box; transform-origin: center; animation: mr-pop 0.4s 1.2s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
  .intro .g-track { animation: mr-fade 0.5s 0.4s ease-out both; }
  .intro .g-band { transform-box: fill-box; transform-origin: left center; animation: mr-grow 0.7s ease-out both; animation-delay: calc(0.7s + var(--b, 0) * 0.12s); }
  .intro .g-tag, .intro .g-now, .intro .g-now-dot { animation: mr-fade 0.5s 1.6s ease-out both; }
}
