:root {
  color-scheme: light;
  --ink: #24170f;
  --muted: #735f52;
  --coffee: #7a4526;
  --coffee-dark: #4a2818;
  --cream: #fff7e8;
  --foam: #f7ead8;
  --card: #ffffff;
  --line: #ead8c2;
  --gold: #d79741;
  --shadow: 0 24px 70px rgba(88, 49, 28, 0.17);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(177, 112, 58, 0.2), transparent 34rem),
    linear-gradient(135deg, var(--cream), #f4e0c4 72%, #ead0af);
  color: var(--ink);
}
main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero { padding: 28px 0 22px; }
nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 34px; color: var(--muted); font-size: 0.95rem; }
nav a { color: var(--coffee-dark); font-weight: 800; text-decoration: none; }
nav a:hover { text-decoration: underline; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 28px; align-items: stretch; }
.intro, .timer-card, .settings, .info-card, .faq { background: rgba(255,255,255,0.88); border: 1px solid rgba(234,216,194,0.95); border-radius: 28px; box-shadow: var(--shadow); }
.intro { padding: clamp(28px, 5vw, 54px); }
.eyebrow { margin: 0 0 12px; color: var(--coffee-dark); text-transform: uppercase; font-size: 0.78rem; font-weight: 900; letter-spacing: 0.14em; }
h1 { margin: 0; font-size: clamp(2.45rem, 7vw, 5.3rem); line-height: 0.92; letter-spacing: -0.07em; }
.lede { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.65; max-width: 58ch; }
.preset-row, .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
button, select, input { font: inherit; }
.pill, .secondary, .primary { border: 0; border-radius: 999px; padding: 13px 18px; font-weight: 900; cursor: pointer; transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease; }
.pill { background: #fff3e1; color: var(--coffee-dark); border: 1px solid #e8cdaa; }
.pill.active, .pill:hover { background: var(--coffee); color: white; transform: translateY(-1px); }
.timer-card { padding: clamp(24px, 4vw, 42px); display: flex; flex-direction: column; justify-content: center; text-align: center; min-height: 430px; }
.phase-name { color: var(--coffee-dark); font-weight: 1000; letter-spacing: 0.08em; text-transform: uppercase; }
.time-display { font-variant-numeric: tabular-nums; font-size: clamp(4.2rem, 14vw, 9.5rem); line-height: 1; font-weight: 1000; letter-spacing: -0.08em; margin: 16px 0; }
.progress-wrap { height: 18px; overflow: hidden; background: #efdec8; border-radius: 999px; border: 1px solid #dfc19e; }
#progressBar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--coffee-dark), var(--coffee), var(--gold)); border-radius: inherit; transition: width 0.2s linear; }
.brew-note { min-height: 54px; margin: 18px auto 0; color: var(--muted); line-height: 1.45; max-width: 44ch; }
.primary { background: var(--coffee); color: white; box-shadow: 0 12px 28px rgba(122, 69, 38, 0.28); }
.primary:hover, .secondary:hover { transform: translateY(-1px); }
.secondary { background: #fff3e1; color: var(--coffee-dark); border: 1px solid #dfc19e; }
.actions { justify-content: center; }
.settings, .content-grid, .faq { margin-top: 24px; }
.settings { padding: 26px; }
h2 { margin: 0 0 18px; font-size: clamp(1.55rem, 3vw, 2.2rem); letter-spacing: -0.04em; }
.settings-grid { display: grid; grid-template-columns: 1.15fr 0.7fr 0.7fr 0.8fr; gap: 14px; }
label { display: grid; gap: 8px; color: var(--muted); font-weight: 800; }
input, select { width: 100%; border: 1px solid #dfc19e; border-radius: 16px; padding: 13px 14px; background: white; color: var(--ink); font-weight: 900; }
.hint { color: var(--muted); line-height: 1.6; margin: 16px 0 0; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.info-card, .faq { padding: 26px; }
.info-card p, li, .faq p { color: var(--muted); line-height: 1.65; }
ol { padding-left: 22px; }
.guide-table { display: grid; gap: 10px; }
.guide-table > div { display: grid; grid-template-columns: 1fr 0.75fr 1.25fr; gap: 10px; align-items: center; padding: 12px; border-radius: 16px; background: #fff5e8; color: var(--muted); }
.guide-table strong { color: var(--ink); }
.faq { margin-bottom: 26px; }
details { border-top: 1px solid var(--line); padding: 16px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 900; color: var(--ink); }
footer { text-align: center; color: var(--muted); padding: 26px 16px 38px; }
.finished .time-display { color: var(--coffee-dark); }

@media (max-width: 820px) {
  main { width: min(100% - 22px, 680px); }
  nav { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .hero-grid, .content-grid, .settings-grid { grid-template-columns: 1fr; }
  .timer-card { min-height: 360px; }
  .guide-table > div { grid-template-columns: 1fr; }
  .pill, .secondary, .primary { width: 100%; }
}
