/* In Their Shoes: the site's own look, loaded after engine/src/style.css.
   Idea: a household ledger. Lined paper, a wall calendar with the days crossed off, amounts written like in a
   notebook, one brick-red pen for what matters and one blue pen for what is noted. Calm, no decoration for its own sake. */

:root {
  --bg: #f1ede4;
  --surface: #fffdf7;
  --ink: #26221e;
  --muted: #6a6158;
  --line: #d9cfbf;
  --accent: #a6493a;      /* brick: today, choices, the main button */
  --accent-ink: #fff;
  --pen: #2f4a6b;         /* blue pen: links, notes, figures */
  --warm: #a6493a;
  --cold: #d5ccbd;
  --best: #2f6f52; --good: #2f4a6b; --ok: #8a6a1c; --bad: #a6493a;
  --past: #6f665c;
  --rule: rgba(47, 74, 107, .10);   /* the faint lines of ruled paper */
  --radius: 10px;
  --num: "Cascadia Mono", "Consolas", "DejaVu Sans Mono", "Menlo", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171614; --surface: #201e1b; --ink: #ebe5da; --muted: #a79e91; --line: #3a362f;
    --accent: #e08a74; --accent-ink: #1d100c; --pen: #9db8dc; --warm: #e08a74; --cold: #45403a;
    --best: #7cc7a0; --good: #9db8dc; --ok: #d8b663; --bad: #e08a74; --past: #a39a8d;
    --rule: rgba(157, 184, 220, .08);
  }
}
:root[data-theme="dark"] {
  --bg: #171614; --surface: #201e1b; --ink: #ebe5da; --muted: #a79e91; --line: #3a362f;
  --accent: #e08a74; --accent-ink: #1d100c; --pen: #9db8dc; --warm: #e08a74; --cold: #45403a;
  --best: #7cc7a0; --good: #9db8dc; --ok: #d8b663; --bad: #e08a74; --past: #a39a8d;
  --rule: rgba(157, 184, 220, .08);
}


/* ---------- page moods (engine v1.11.0 staging) ----------
   Scene entries set "page" (night, dawn, cold, warm, blackout and the site's own dusk below). The engine recolours
   the page and its accent; the ledger's own pens (--pen, --warm, --rule) follow here, so links, notes and figures
   stay readable on a dark mood in the light theme and on a light mood in the dark theme. */
/* dusk: the early winter evening, a slate violet between day and night (the light goes at four) */
html:root[data-page="dusk"] {
  --bg: #27242f; --surface: #322e3b; --ink: #eee8e2; --muted: #bdb3b0; --line: #4b4555;
  --accent: #e08a74; --accent-ink: #1d100c; --cold: #45403a;
  --best: #7cc7a0; --good: #9db8dc; --ok: #d8b663; --bad: #e08a74; --past: #a9a194;
  color-scheme: dark;
}
html:root[data-page="night"], html:root[data-page="blackout"], html:root[data-page="dusk"] {
  --pen: #a9c2e4; --warm: #e08a74; --rule: rgba(169, 194, 228, .08);
}
html:root[data-page="dawn"], html:root[data-page="cold"], html:root[data-page="warm"] {
  --pen: #2f4a6b; --warm: #a6493a; --rule: rgba(47, 74, 107, .10);
}

body { font-feature-settings: "onum" 0; }
a { color: var(--pen); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }

/* ---------- header ---------- */
.top { border-bottom: 2px solid var(--ink); padding: 16px 0 12px; }
.brand { color: var(--ink); font-weight: 700; letter-spacing: .12em; font-size: 12px; }
.brand::before {
  content: ""; display: inline-block; width: 22px; height: 12px; margin-right: 9px; vertical-align: -1px;
  /* two shoe soles, side by side */
  background:
    radial-gradient(ellipse 5px 6px at 5px 6px, var(--accent) 98%, transparent) no-repeat,
    radial-gradient(ellipse 5px 6px at 17px 6px, var(--ink) 98%, transparent) no-repeat;
}
.seg button { border-radius: 6px; font-weight: 600; letter-spacing: .04em; }

/* ---------- title screen ---------- */
.title { padding-top: 34px; }
.section h1 { font-size: clamp(34px, 7vw, 46px); line-height: 1.05; letter-spacing: -.015em; margin-bottom: 14px; text-wrap: balance; }
.section-blurb { font-size: 19px; line-height: 1.55; margin-bottom: 30px; max-width: 34em; text-wrap: pretty; }
.cards { gap: 22px; }
.story-card {
  border-radius: var(--radius); padding: 20px 22px 22px;
  box-shadow: 0 1px 0 var(--line), 0 10px 24px -18px rgba(38, 34, 30, .45);
  transition: transform .18s ease, box-shadow .18s ease;
}
.story-card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 var(--line), 0 16px 28px -18px rgba(38, 34, 30, .55); }
.card-scene { margin: 0 -22px 18px; border-bottom: 1px solid var(--line); }
.story-card h2 { font-size: 28px; letter-spacing: -.01em; margin-bottom: 8px; }
.story-card .blurb { font-size: 17.5px; line-height: 1.5; color: var(--ink); opacity: .86; margin-bottom: 12px; text-wrap: pretty; }
.tag { color: var(--pen); letter-spacing: .1em; margin-bottom: 8px; }
.story-card .meta { font-size: 12.5px; letter-spacing: .02em; }
.endings-map { margin-top: 8px; }
.endings-map li { border-radius: 6px; }
.endings-map li.unknown { min-width: 26px; opacity: .7; }
.primary, .secondary { border-radius: 8px; padding: 11px 24px; letter-spacing: .01em; transition: filter .15s, transform .15s; }
.primary:hover { filter: brightness(1.08); }
.primary:active, .secondary:active { transform: translateY(1px); }
.guides-link { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 16px; }
.guides-link a { font-weight: 600; }

/* ---------- status: the ledger corner ---------- */
.play .status {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px 12px; margin-bottom: 22px; gap: 10px 22px;
}
.stat-label { letter-spacing: .08em; font-weight: 600; }
.amount-value { font: 700 17px/1 var(--num); letter-spacing: -.02em; }
.stat.amount.low .amount-value { color: var(--bad); text-decoration: underline wavy 1px; text-underline-offset: 4px; }
.dot { width: 9px; height: 9px; border-radius: 2px; }
.dot.on { background: var(--pen); }

/* wall calendar: past days crossed off, today circled in red, due days underlined in blue */
.cal-head { gap: 4px 12px; }
.cal-today { font-size: 13px; color: var(--ink); }
.cal-next { color: var(--accent); font-weight: 600; }
.cal-grid { gap: 1px; max-width: 300px; }
.cal-day { font: 12px/24px var(--num); border-radius: 12px; position: relative; color: var(--ink); }
.cal-day.past { opacity: .5; }
.cal-day.past::after {
  content: ""; position: absolute; left: 28%; right: 28%; top: 50%; height: 1px; background: currentColor; transform: rotate(-38deg);
}
.cal-day.mark { box-shadow: none; font-weight: 700; color: var(--pen); text-decoration: underline 2px; text-underline-offset: 3px; }
.cal-day.today { background: none; color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 2px var(--accent); text-decoration: none; }

/* ---------- story text ---------- */
.text p { text-wrap: pretty; hanging-punctuation: first; }
.text p:first-child::first-letter { font-size: 1em; }
.echo { border-left-width: 2px; font-weight: 600; }
.chip { border-radius: 6px; font-family: var(--num); }

.choices { gap: 8px; margin-top: 24px; }
.choice {
  border-radius: var(--radius); padding: 13px 16px;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box;
  box-shadow: 0 1px 0 var(--line);
}
.choice:hover, .choice:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); transform: none; }
.num { border-radius: 5px; width: 22px; height: 22px; font-family: var(--num); background: transparent; }
.choice:hover .num, .choice:focus-visible .num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- ending card: a page from the notebook ---------- */
.ending-card {
  border-left-width: 1px; border-top: 4px solid var(--kind, var(--accent)); padding: 22px 24px 24px;
  box-shadow: 0 14px 30px -22px rgba(38, 34, 30, .5);
}
.ending-card .kind { letter-spacing: .12em; font-size: 11px; }
.ending-card h2 { font-size: 32px; letter-spacing: -.01em; margin: 8px 0 14px; }
.ending-card h3 { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); letter-spacing: .1em; font-size: 11.5px; }
.ending-card .lesson, .ending-card > p { text-wrap: pretty; }
.facts ul, .help ul, .traps ul, .learn ul { list-style: none; padding-left: 0; margin-top: 8px; }
.facts li {
  padding: 9px 0 9px 14px; border-left: 2px solid var(--pen); margin-bottom: 8px; font-size: 17px; line-height: 1.45;
}
.fact-source { display: block; margin-top: 2px; font: 12.5px/1.4 system-ui, sans-serif; opacity: 1; color: var(--muted); }
.help li, .traps li, .learn li { padding: 6px 0; border-bottom: 1px dotted var(--line); font-size: 16.5px; line-height: 1.45; margin: 0; }
.help li:last-child, .traps li:last-child, .learn li:last-child { border-bottom: 0; }
.trail ol { font-size: 15.5px; color: var(--muted); }

/* ---------- notes ---------- */
.guide h1 { font-size: clamp(30px, 6vw, 38px); letter-spacing: -.01em; text-wrap: balance; }
.guide h2 { font-size: 21px; margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--line); }
.guide .note { border-radius: var(--radius); }
.guide-list a { color: var(--ink); font-size: 21px; }
.guide-list a:hover { color: var(--pen); }
.guide-list li { padding: 16px 0; }
.sources { font-size: 15px; }
.sources li { margin-bottom: 4px; }

@media (max-width: 520px) {
  .story-card { padding: 16px 16px 18px; }
  .card-scene { margin: 0 -16px 14px; }
  .ending-card { padding: 18px 16px 20px; }
  .ending-card h2 { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) { .story-card { transition: none; } .story-card:hover { transform: none; } }
