:root {
  color-scheme: light dark;
  --paper: #FBF7F1;
  --card: #FFFFFF;
  --ink: #1E1B18;
  --muted: #6B635B;
  --line: #E7DFD4;
  --soft: #F3EBE0;
  --accent: #B5441B;
  --accent-ink: #FFFFFF;
  --done: #2F7A4B;
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15130F;
    --card: #1E1B17;
    --ink: #F2ECE4;
    --muted: #A79E93;
    --line: #322C25;
    --soft: #262119;
    --accent: #E8794A;
    --accent-ink: #1A0F08;
    --done: #6CC28E;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 20px; }

/* Home */
.site-head { padding: calc(36px + env(safe-area-inset-top)) 0 4px; }
.site-head h1 { font-size: 40px; line-height: 1.1; margin: 0 0 8px; }
.site-head p { margin: 0; color: var(--muted); }
.list { display: grid; gap: 14px; padding: 24px 0 56px; }
.card {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  transition: transform .12s ease, border-color .12s ease;
}
.card:active { transform: scale(.985); }
.card:hover { border-color: var(--accent); }
.card h2 { font-size: 22px; line-height: 1.2; margin: 8px 0 6px; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.meta { font-size: 14px; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.tags span {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--soft);
  border-radius: 999px;
  padding: 3px 9px;
}

/* Recipe overview */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.back { display: inline-block; padding: 13px 0; text-decoration: none; font-weight: 600; color: var(--accent); }
.recipe { padding-top: 22px; padding-bottom: 24px; }
.recipe h1 { font-size: 34px; line-height: 1.12; margin: 12px 0 10px; }
.summary { color: var(--muted); margin: 0 0 18px; }
.facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 0 0 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.facts div { padding: 12px 14px; }
.facts div + div { border-left: 1px solid var(--line); }
.facts dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; }
.recipe section { margin-top: 30px; }
.recipe h2 { font-size: 24px; margin: 0 0 12px; }
.equipment { margin: 0; color: var(--muted); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; cursor: pointer; }
.checklist input {
  flex: none; width: 22px; height: 22px; margin: 1px 0 0;
  accent-color: var(--done);
}
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 22px 46px; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 15px;
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 15.5px; top: 38px; bottom: 6px;
  width: 1px; background: var(--line);
}
.steps h3 { font-size: 19px; margin: 3px 0 4px; }
.steps p { margin: 0; }
.pill {
  display: inline-block; margin-top: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--soft); border-radius: 999px; padding: 3px 10px;
}

.notes { margin: 0; padding-left: 20px; }
.notes li { margin-bottom: 8px; }
.notes li::marker { color: var(--accent); }

.pair {
  display: flex; align-items: center; gap: 10px;
  margin-top: 30px; padding: 16px 18px;
  text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.pair span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pair b { flex: 1; font-family: var(--serif); font-size: 18px; }
.pair i { font-style: normal; font-size: 26px; color: var(--accent); line-height: 1; }

.cta-bar {
  position: sticky; bottom: 0; z-index: 5;
  padding: 18px 0 calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--paper) 40%);
}
.btn {
  display: block; text-align: center; text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 17px;
  padding: 15px 18px; border-radius: 14px; border: 0;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); margin-top: 10px; }

/* Cooking mode */
.cook {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--paper);
}
.cook-bar {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
}
.close {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  text-decoration: none; font-size: 26px; line-height: 1;
  background: var(--soft);
}
.cook-title {
  text-align: center; font-weight: 600; font-size: 14px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px;
}
.count { text-align: right; font-weight: 600; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { height: 4px; background: var(--line); }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }

.track {
  flex: 1; min-height: 0;
  display: flex;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%; width: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow-y: auto;
  padding: 26px 24px 28px;
}
.slide-inner { max-width: 640px; margin: 0 auto; }
.kicker {
  margin: 0 0 6px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
.slide h2 { font-size: 32px; line-height: 1.15; margin: 0 0 16px; }
.step-text { font-size: 23px; line-height: 1.5; margin: 0 0 24px; }
.slide .equipment { margin-bottom: 10px; }
.slide .checklist label { font-size: 18px; }
.hint { margin: 22px 0 0; color: var(--muted); font-weight: 600; }
.done .notes { margin-bottom: 26px; }

.timer-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 18px var(--sans);
  color: var(--accent); background: transparent;
  border: 2px solid var(--accent); border-radius: 14px;
  padding: 13px 18px; cursor: pointer;
}
.timer-btn[disabled] { opacity: .5; }

.timers {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 0 12px;
}
.timers:empty { display: none; }
.timers:not(:empty) { padding-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 15px var(--sans); font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 8px 7px 14px; cursor: pointer;
}
.chip b { font-weight: 700; }
.chip .x {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--soft); font-size: 15px;
}
.chip.ring { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); animation: pulse 1s ease-in-out infinite; }
.chip.ring .x { background: rgba(255,255,255,.25); }
@keyframes pulse { 50% { transform: scale(1.05); } }

.cook-nav {
  display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.cook-nav button {
  font: 700 17px var(--sans);
  padding: 15px; border-radius: 14px; cursor: pointer;
  background: var(--soft); color: var(--ink); border: 0;
}
.cook-nav button.primary { background: var(--accent); color: var(--accent-ink); }
.cook-nav button[disabled] { opacity: .4; }

@media (min-width: 720px) {
  .site-head h1 { font-size: 48px; }
  .recipe h1 { font-size: 42px; }
  .slide { padding-top: 48px; }
  .slide h2 { font-size: 40px; }
  .step-text { font-size: 26px; }
  .cook-nav, .cook-bar { max-width: 680px; width: 100%; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Home: menu card */
.card-event { border-color: var(--accent); background: linear-gradient(135deg, var(--soft), var(--card) 70%); }
.list-head { font-size: 15px; font-family: var(--sans); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 0; }

/* Dinner party */
.dish-lasagna { --dish: #B5441B; }
.dish-bread { --dish: #C08A1E; }
.dish-salad { --dish: #4F8A4B; }
@media (prefers-color-scheme: dark) {
  .dish-lasagna { --dish: #E8794A; }
  .dish-bread { --dish: #E0B04A; }
  .dish-salad { --dish: #79B873; }
}
.party { padding-top: 22px; padding-bottom: 48px; }
.party h1 { font-size: 34px; line-height: 1.12; margin: 12px 0 10px; }
.party h2 { font-size: 24px; margin: 0 0 6px; }
.party section { margin-top: 30px; }
.menu { display: grid; gap: 8px; margin: 4px 0 18px; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.menu-item i { width: 10px; height: 10px; border-radius: 50%; background: var(--dish); flex: none; }
.menu-item b { flex: 1; font-family: var(--serif); font-size: 17px; }
.menu-item span { color: var(--accent); font-size: 22px; line-height: 1; }
.menu-item em { font-style: normal; font-size: 13px; color: var(--muted); }
.serve-control {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 10px; background: var(--soft); border-radius: 14px;
}
.serve-control div { text-align: center; line-height: 1.2; }
.serve-control div span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.serve-control b { font-size: 20px; }
.serve-control button {
  font: 700 15px var(--sans); color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; cursor: pointer;
}
.hint-small { font-size: 14px; color: var(--muted); margin: 0 auto 10px; }
.wrap-wide { max-width: 980px; margin-left: auto; margin-right: auto; }

.gantt-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--card);
}
.gantt { position: relative; padding-bottom: 8px; }
.g-head, .g-row, .g-group { display: flex; }
.g-label {
  position: sticky; left: 0; z-index: 3; flex: none;
  width: var(--gl, 132px); padding: 0 8px 0 14px;
  background: var(--card); border-right: 1px solid var(--line);
  font-size: 13px; line-height: 30px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.g-track { position: relative; flex: none; height: 30px; }
.g-tick {
  position: absolute; top: 8px; transform: translateX(-50%);
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.g-tick.hour { font-weight: 700; color: var(--ink); }
.g-tick.first { transform: none; }
.g-group .g-label {
  font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--dish); line-height: 32px; padding-top: 4px;
  display: flex; align-items: center; gap: 7px;
  overflow: visible; background: transparent; border-right-color: transparent;
}
.g-group .g-label i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dish); }
.g-group .g-track { height: 36px; }
.g-row .g-label { color: var(--ink); }
.g-bar {
  position: absolute; top: 5px; height: 20px;
  background: var(--dish); border-radius: 6px;
  text-decoration: none; color: #fff;
  display: flex; align-items: center; padding: 0 6px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden;
}
@media (prefers-color-scheme: dark) { .g-bar { color: #15130F; } }
.g-markers { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 2; }
.g-mark { position: absolute; top: 26px; bottom: 0; border-left: 2px dashed var(--muted); }
.g-mark.guests span, .g-mark.serve span { display: none; }
.g-mark span {
  position: absolute; top: 2px; left: 4px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
  padding: 1px 4px; border-radius: 4px; color: #fff; background: #2F7AD6;
}
.g-mark.serve { border-left: 2px solid var(--accent); }
.g-mark.now { top: 0; border-left: 2px solid #2F7AD6; }
.g-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px auto 0; font-size: 13px; color: var(--muted); }
.g-legend span { display: inline-flex; align-items: center; gap: 6px; }
.g-legend i { width: 16px; height: 0; border-top: 2px dashed var(--muted); }
.g-legend i.serve { border-top: 2px solid var(--accent); }
.g-legend i.now { border-top: 2px solid #2F7AD6; }

.runlist { list-style: none; margin: 10px 0 0; padding: 0; }
.runlist li {
  display: grid; grid-template-columns: 74px 12px 1fr; gap: 10px; align-items: start;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.runlist time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.runlist li > i { width: 10px; height: 10px; border-radius: 50%; background: var(--dish); margin-top: 7px; }
.runlist b { display: block; font-weight: 600; }
.runlist b a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
.runlist span { font-size: 13px; color: var(--muted); }
.runlist li.ev { grid-template-columns: 74px 1fr; background: var(--soft); border-radius: 10px; padding: 11px 12px; margin: 6px -12px; border-bottom: 0; }
.runlist li.ev b { color: var(--accent); }
@media (min-width: 720px) { .party h1 { font-size: 42px; } }
