:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5c667a;
  --paper: #fffdf7;
  --card: #ffffff;
  --line: #e8dfcf;
  --gold: #f7b731;
  --green: #38a169;
  --blue: #3b82f6;
  --red: #ef4444;
  --shadow: 0 24px 60px rgba(54, 41, 16, 0.14);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #fff2b8 0, transparent 32rem), linear-gradient(135deg, #fffaf0 0%, #eef7ff 100%);
  color: var(--ink);
}
main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero { padding: 24px 0 36px; }
nav { display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--muted); font-size: 0.95rem; margin-bottom: 28px; }
nav a { color: var(--ink); text-decoration: none; font-weight: 800; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 450px); gap: 28px; align-items: center; }
.eyebrow { color: #9a5a00; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82rem; }
h1 { font-size: clamp(2.35rem, 7vw, 5.2rem); line-height: 0.94; margin: 0 0 18px; letter-spacing: -0.07em; }
.lede { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--muted); max-width: 58ch; line-height: 1.55; }
.preset-row, .custom-row, .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.preset-row { margin: 26px 0 18px; }
.pill, button { border: 0; font: inherit; cursor: pointer; }
.pill { border: 2px solid var(--line); background: rgba(255,255,255,0.82); color: var(--ink); padding: 11px 14px; border-radius: 999px; font-weight: 850; box-shadow: 0 8px 18px rgba(31, 41, 55, 0.06); }
.pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.custom-label { display: block; margin-bottom: 8px; font-weight: 900; }
input { width: 104px; border: 2px solid var(--line); border-radius: 14px; padding: 12px 12px; font: inherit; font-weight: 850; color: var(--ink); background: #fff; }
.timer-card, .info-card, .tips, .faq { background: rgba(255,255,255,0.92); border: 1px solid rgba(232, 223, 207, 0.95); border-radius: 30px; box-shadow: var(--shadow); }
.timer-card { padding: clamp(20px, 4vw, 34px); text-align: center; }
.progress-wrap { position: relative; width: min(78vw, 300px); margin: 0 auto 18px; }
.ring { width: 100%; display: block; transform: rotate(-90deg); }
.ring-bg, .ring-fill { fill: none; stroke-width: 18; }
.ring-bg { stroke: #f3ead8; }
.ring-fill { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 640.88; stroke-dashoffset: 0; transition: stroke-dashoffset 0.35s ease, stroke 0.35s ease; }
.time { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(3rem, 11vw, 5.4rem); font-weight: 950; letter-spacing: -0.08em; }
.timer-card h2 { font-size: clamp(1.45rem, 3vw, 2rem); margin: 8px 0; }
.timer-card p { color: var(--muted); line-height: 1.5; margin: 0 auto 16px; max-width: 34ch; }
.prompt-box { background: #fff7d6; border: 2px dashed #e6a200; border-radius: 18px; padding: 14px; margin: 16px 0 20px; font-size: 1.05rem; font-weight: 900; }
.primary, .secondary { border-radius: 16px; padding: 13px 18px; font-weight: 950; }
.primary { background: var(--green); color: white; min-width: 170px; box-shadow: 0 12px 24px rgba(56, 161, 105, 0.26); }
.secondary { background: #edf4ff; color: #17427b; }
.small { padding: 11px 13px; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.info-card, .tips, .faq { padding: clamp(20px, 3vw, 28px); }
h2 { letter-spacing: -0.03em; }
li { margin: 9px 0; color: var(--muted); line-height: 1.55; }
.tips { margin-bottom: 18px; }
.tip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tip-grid div { background: #f5fbff; border: 1px solid #dceeff; border-radius: 18px; padding: 16px; font-weight: 900; text-align: center; }
.faq { margin-bottom: 38px; }
details { border-top: 1px solid var(--line); padding: 15px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 950; }
details p { color: var(--muted); line-height: 1.6; }

body.running .ring-fill { stroke: var(--blue); }
body.final-minute .ring-fill { stroke: var(--red); }
body.done .ring-fill { stroke: var(--green); }

@media (max-width: 820px) {
  .hero-grid, .content-grid { grid-template-columns: 1fr; }
  nav { align-items: flex-start; flex-direction: column; }
  .tip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  main { width: min(100% - 20px, 1120px); }
  .preset-row .pill { width: 100%; }
  .primary, .secondary.small { flex: 1; }
  .actions .primary, .actions .secondary { width: 100%; }
  .tip-grid { grid-template-columns: 1fr; }
}
