:root {
  color-scheme: light dark;
  --bg: #f7f5f2;
  --surface: #ffffff;
  --fg: #1a1a1a;
  --muted: #5f5b57;
  --accent: #b3261e;
  --accent-soft: #f4e4e2;
  --ok: #1f6f43;
  --ok-soft: #e6f2ea;
  --rule: #e2ddd7;
  --field: #fbfaf8;
  --focus: #1a4d8f;
  --shadow: 0 1px 2px rgb(26 26 26 / 6%), 0 8px 24px rgb(26 26 26 / 5%);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --surface: #1d1b19;
    --fg: #f2efeb;
    --muted: #b8b1a9;
    --accent: #ff8a80;
    --accent-soft: #3a2522;
    --ok: #8fd3a8;
    --ok-soft: #1f2e25;
    --rule: #35312e;
    --field: #24211f;
    --focus: #8ab4ff;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 44rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}

.brand {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--fg); }

.inline { display: inline; margin: 0; }

.linklike {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.linklike:hover { color: var(--fg); }

.shell {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.footer {
  max-width: 44rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.8125rem;
}

.footer p { margin: 0; }

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lede {
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 34rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.hero { padding-top: 2rem; }
.hero h1 { margin-bottom: 1.25rem; }

.actions { margin-top: 1.75rem; }

.button {
  display: inline-block;
  border: 1px solid var(--fg);
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.button-quiet {
  background: transparent;
  color: var(--fg);
  border-color: var(--rule);
}

.button-quiet:hover { background: var(--surface); color: var(--fg); border-color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: var(--shadow);
}

.narrow { max-width: 30rem; }

.stack { display: grid; gap: 1.1rem; margin-top: 1.5rem; }

.field { display: grid; gap: 0.4rem; font-weight: 600; font-size: 0.9375rem; }
.field small { font-weight: 400; color: var(--muted); font-size: 0.8125rem; }

input[type="email"],
input[type="date"],
input[type="number"],
select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--field);
  color: var(--fg);
  font: inherit;
  font-weight: 400;
}

input:focus,
select:focus { border-color: var(--focus); }

input[readonly] { color: var(--muted); }

.check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--muted);
}

.check input { margin-top: 0.2rem; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }

.alert {
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.alert-error { background: var(--accent-soft); color: var(--accent); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

.today { display: grid; gap: 1.25rem; }

.date {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.countdown { padding: 1rem 0 0.5rem; }

.countdown-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.countdown-number {
  margin: 0.35rem 0 0;
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.countdown-word {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
  color: var(--muted);
}

.countdown-note { margin: 0.75rem 0 0; color: var(--muted); max-width: 26rem; }

progress.life {
  width: 100%;
  height: 0.65rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--rule);
  appearance: none;
}

progress.life::-webkit-progress-bar { background: var(--rule); border-radius: 999px; }
progress.life::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.life::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

.progress-caption { margin: 0; color: var(--muted); font-size: 0.875rem; }

.placeholder {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}

.placeholder p { max-width: 34rem; }

.rule { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

@media (max-width: 480px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .shell { padding-top: 2rem; }
}

.quote {
  margin: 1.5rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--rule);
}

.quote blockquote {
  margin: 0;
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.55;
}

.quote figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.block {
  padding: 1.15rem 0 0;
  border-top: 1px solid var(--rule);
  margin-top: 1.5rem;
}

.block .eyebrow { margin-bottom: 0.45rem; }

.block-text {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.5;
}

.block-task {
  background: var(--ok-soft);
  border: 0;
  border-radius: var(--radius);
  padding: 1.15rem;
}

.block-task .eyebrow { color: var(--ok); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.1em 0.3em;
}
