:root {
  color-scheme: dark;
  --background: #281b22;
  --text: #fff8f3;
  --muted: #e9d5cd;
  --accent: #ffdabd;
  --line: #ffe1d14a;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; }
html { scroll-behavior: smooth; }
a { color: inherit; }
main { max-width: 31rem; margin-inline: auto; }

.portrait {
  position: relative;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  aspect-ratio: 9 / 16;
  background: #524037;
}

.portrait-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #24161c24 0%, transparent 23%, transparent 38%, #26172060 58%, #281b22ed 100%);
}

.overlay {
  width: 100%;
  padding: 1rem clamp(1rem, 5vw, 2rem) max(.75rem, env(safe-area-inset-bottom));
  text-align: center;
  text-shadow: 0 2px 12px #211219;
}

.names {
  margin: 0;
  color: #fff0e7;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2 { font-family: Georgia, serif; font-weight: 400; }
h1 { font-size: clamp(1.85rem, 8vw, 3.1rem); line-height: 1.05; letter-spacing: -.045em; margin: .25rem 0 .35rem; }
.date { font-size: .875rem; margin: 0 0 .85rem; }
.date strong { color: var(--accent); }

.digits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .375rem; }
.digit {
  padding: .65rem .1rem .55rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: #29192369;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.digit strong { display: block; font-size: clamp(1.5rem, 7.7vw, 2.45rem); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.045em; }
.digit:first-child strong { color: var(--accent); }
.digit span { display: block; margin-top: .36rem; font-size: .64rem; }

.progress-head { display: flex; justify-content: space-between; gap: .5rem; margin: .8rem 0 .3rem; font-size: .7rem; }
.progress-head strong { color: var(--accent); }
.track { height: .25rem; border-radius: 1rem; overflow: hidden; background: #fff0e34d; }
.fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #e6a9a5, #ffe0b5); }
.plan-link { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; font-size: .78rem; text-underline-offset: .2em; }

.details { padding: 1.4rem clamp(1rem, 5vw, 2rem) max(2rem, env(safe-area-inset-bottom)); scroll-margin-top: max(.75rem, env(safe-area-inset-top)); }
.intro-row h2 { font-size: 1.8rem; margin: 0; }
.intro-row p, .milestone p, .notice, .settings-body p { color: var(--muted); font-size: .825rem; }
.intro-row p { margin: .25rem 0 1rem; }
.milestones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.milestone, .settings { padding: .85rem; background: #fff4ed09; border: 1px solid var(--line); border-radius: .85rem; }
.milestone.active { background: #ffb8a51c; border-color: #ffc3aa9c; }
.milestone time { color: var(--accent); font-size: .8rem; font-weight: 700; }
.milestone h3 { font-size: .9rem; margin: .3rem 0 .2rem; }
.milestone p { margin: 0; }
.notice { display: flex; gap: .6rem; margin: .9rem 0 1rem; }
.notice svg { flex: none; color: var(--accent); }
.settings-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.settings-head h2 { font: inherit; font-weight: 650; margin: 0; }
.settings-body { display: none; }
.settings.open .settings-body { display: block; }
.field { display: grid; gap: .35rem; margin-bottom: .65rem; font-size: .825rem; }
.field input, button { border: 1px solid var(--line); border-radius: .65rem; background: #ffdac314; color: var(--text); font: inherit; min-height: 44px; padding: .5rem .7rem; }
.field input { width: 100%; min-width: 0; font-size: 1rem; }
button { cursor: pointer; font-size: .8rem; }
.solid-btn { background: var(--accent); color: #281b22; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
