:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --ink: #1d1a16;
  --muted: #6b6359;
  --line: #e6ddcf;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --gold: #b7791f;
  --live: #15803d;
  --door: #f3ebde;
  --door-locked: repeating-linear-gradient(135deg, #f3ebde 0 10px, #efe5d5 10px 20px);
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 4px 14px rgb(60 40 10 / 0.07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110e;
    --surface: #1d1915;
    --ink: #f3ede4;
    --muted: #a99f92;
    --line: #342d25;
    --accent: #f97316;
    --accent-ink: #1a0d03;
    --gold: #e0b354;
    --live: #4ade80;
    --door: #26201a;
    --door-locked: repeating-linear-gradient(135deg, #221c17 0 10px, #1f1a15 10px 20px);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2 { line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3rem); margin: 0.4em 0; }
h2 { font-size: 1.3rem; margin: 1.8em 0 0.7em; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.top {
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 14px 16px;
}
.brand { font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.top nav a:hover { color: var(--accent); }
main { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }

.hero { padding: 28px 0 8px; max-width: 760px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 1.12rem; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
  padding: 10px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

.pill { display: inline-block; font-size: 0.78rem; padding: 2px 9px; border-radius: 999px; background: var(--door); color: var(--muted); }
.pill.live { background: color-mix(in srgb, var(--live) 18%, transparent); color: var(--live); }
.price { font-weight: 700; color: var(--gold); font-size: 0.85rem; }

.cal-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cal-card {
  display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.cal-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.cal-card.running { border-color: color-mix(in srgb, var(--live) 45%, var(--line)); }
.cal-emoji { font-size: 1.8rem; line-height: 1; }
.cal-name { font-weight: 800; font-size: 1.05rem; }
.cal-dates { font-size: 0.85rem; color: var(--muted); }
.cal-blurb { font-size: 0.92rem; }
.cal-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

.today-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.today-card {
  display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius); text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.today-name { font-weight: 800; font-size: 1.1rem; color: var(--accent); }

.cal-head .crumbs, .crumbs { font-size: 0.88rem; color: var(--muted); margin: 18px 0 0; }
.years { font-size: 0.92rem; }
.flash { background: color-mix(in srgb, var(--live) 14%, transparent); padding: 10px 14px; border-radius: 10px; }

.doors { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); margin: 22px 0; }
.door {
  position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 4px; min-height: 132px; padding: 10px;
  border-radius: 12px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); overflow: hidden;
}
.door-n { font-weight: 900; font-size: 1.5rem; line-height: 1; color: var(--gold); }
.door-date { font-size: 0.8rem; color: var(--muted); }
.door-foot { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.door.locked { background: var(--door-locked); }
.door.locked:hover { border-color: var(--accent); }
.door.locked:not(.taken) .door-foot { color: var(--accent); }
.door.locked.taken { opacity: 0.75; }
.door.open { background: var(--surface); box-shadow: var(--shadow); }
.door.open .door-n { position: absolute; top: 8px; right: 10px; font-size: 0.95rem; }
.door-logo img, .door-logo .mono { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.mono { display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 900; font-size: 1.2rem; }
.door-name { font-weight: 700; font-size: 0.92rem; line-height: 1.2; overflow-wrap: anywhere; }
.door.today { outline: 3px solid var(--accent); outline-offset: 2px; }
.door.house .door-name { color: var(--muted); }

.cal-actions { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel h2 { margin-top: 0; }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; }
input, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%;
}
form.inline input { flex: 1 1 200px; width: auto; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.door-big { max-width: 640px; margin: 24px auto; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; box-shadow: var(--shadow); }
.door-big.locked { background: var(--door-locked); }
.door-big-n { font-size: 4rem; font-weight: 900; color: var(--gold); margin: 0; line-height: 1; }
.door-big-logo { display: inline-grid; width: 88px; height: 88px; border-radius: 20px; object-fit: cover; font-size: 2.4rem; }
.highlights { text-align: left; max-width: 460px; margin: 0 auto 16px; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.2rem; }
.door-nav { display: flex; justify-content: space-between; max-width: 640px; margin: 0 auto; }
.share { text-align: center; }

.book-form { display: grid; gap: 14px; max-width: 680px; }
.book-form label { display: grid; gap: 4px; font-weight: 600; }
.book-form label small { font-weight: 400; color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
legend { font-weight: 700; padding: 0 6px; }
.door-pick { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.pick input { position: absolute; opacity: 0; }
.pick span { display: grid; text-align: center; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.pick small { color: var(--muted); font-size: 0.72rem; }
.pick input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pick input:checked + span small { color: inherit; }
.pick input:focus-visible + span { outline: 2px solid var(--accent); }
.pick.off span { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.err { color: #dc2626; font-weight: 600; font-size: 0.88rem; }
.err.block { background: color-mix(in srgb, #dc2626 12%, transparent); padding: 10px 14px; border-radius: 10px; }

.message { max-width: 640px; margin: 40px auto; }
.prose { max-width: 720px; }
.site-footer { max-width: 1120px; margin: 0 auto; padding: 20px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
