:root {
  --paper: #f7f3eb;
  --paper-2: #e8e2d6;
  --card: #fffdf8;
  --ink: #1c1712;
  --soft: #3a322b;
  --muted: #5c534a;
  --line: #d2c9bb;
  --sage: #1f3b31;
  --sage-deep: #163028;
  --accent: #6e3a22;
  --gold: #a68456;
  --tint: #e7efe9;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Segoe UI", "Helvetica Neue", "Liberation Sans", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 100% -8%, rgba(166, 132, 86, 0.28), transparent 55%),
    radial-gradient(700px 360px at -10% 20%, rgba(31, 59, 49, 0.08), transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

body::after {
  content: "";
  position: fixed;
  width: 38vw;
  height: 38vw;
  right: -8vw;
  top: -10vw;
  background: radial-gradient(circle, rgba(243, 215, 161, 0.55), transparent 68%);
  pointer-events: none;
  z-index: 0;
  animation: drift 16s ease-in-out infinite;
}

.chrome, main, .site-foot { position: relative; z-index: 1; }

h1, h2, h3, h4, .brand, .index-number, .path-line, .note-line {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.35rem; margin: 0.2rem 0 0.8rem; }
h2 { font-size: 1.7rem; margin: 0 0 0.8rem; }
h3 { font-size: 1.25rem; margin: 0 0 0.35rem; }
h4 { font-size: 1.15rem; margin: 0 0 0.25rem; }

p { margin: 0.6rem 0; }

a { color: var(--accent); }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: white;
  color: var(--ink);
  padding: 0.6rem 0.9rem;
  z-index: 30;
}

.skip:focus { top: 0.75rem; }

.chrome {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 243, 235, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.top {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.7rem 1.25rem 0.45rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.lockup { flex: 1 1 12rem; min-width: 0; }

.brand {
  margin: 0;
  font-size: 1.15rem;
}

.by {
  margin: 0;
  color: var(--muted);
}

.streak-chip {
  margin: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.9rem;
  border: 2px solid var(--sage);
  border-radius: 999px;
  color: var(--sage);
  background: white;
  font-weight: 700;
}

.sun { display: flex; animation: pulse 3.2s ease-in-out infinite; }

#progress { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem 0.75rem; }

.progress-label { margin: 0 0 0.35rem; }

.track {
  height: 12px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 99px;
  overflow: hidden;
}

.track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1f3b31, #3d6a55 70%, #a68456);
  position: relative;
  overflow: hidden;
}

.track span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-100%);
  animation: sheen 2.8s ease-in-out infinite;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 3rem;
}

body.wide main { max-width: 68rem; }

.deck, .quiet, .kicker, .byline, .date, .detail, .meter-label {
  color: var(--soft);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rules {
  padding-left: 1.3rem;
}

.rules li { margin: 0.55rem 0; }

summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
}

.name-field span, .question > label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

input[type="text"], select, textarea {
  width: 100%;
  min-height: 52px;
  font: inherit;
  color: var(--ink);
  background: white;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
}

textarea { min-height: 8rem; }

.question { margin: 1.35rem 0; }

.actions, .end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.actions {
  padding-bottom: calc(0.4rem + env(safe-area-inset-bottom));
}

.actions .btn { flex: 1 1 9rem; }

.btn, .text-btn {
  font: inherit;
  cursor: pointer;
}

.btn {
  min-height: 52px;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 2px solid var(--sage);
  background: var(--sage);
  color: white;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn:hover, .btn:focus-visible { background: var(--sage-deep); }

.btn.secondary {
  background: transparent;
  color: var(--sage);
}

.btn.secondary:hover, .btn.secondary:focus-visible {
  background: var(--tint);
}

.btn:disabled {
  background: var(--paper-2);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.text-btn {
  min-height: 48px;
  padding: 0.45rem 0.2rem;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.week {
  display: flex;
  gap: 0.4rem;
  padding: 0;
  margin: 0.8rem 0 0;
  list-style: none;
}

.week li {
  width: 2.4rem;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  font-weight: 700;
}

.week li.on {
  background: var(--sage);
  border-color: var(--sage);
  color: white;
}

.trail {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  border-left: 3px solid var(--line);
}

.trail li {
  position: relative;
  margin: 0 0 0.35rem;
  padding-left: 1rem;
}

.trail li::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 1rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--line);
}

.trail li.done::before { background: var(--sage); border-color: var(--sage); }
.trail li.current::before { border-color: var(--accent); background: white; }

.trail button, .trail span {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  text-align: left;
  border-radius: 12px;
  padding: 0.45rem 0.7rem;
}

.trail button {
  font: inherit;
  font-weight: 650;
  background: white;
  border: 2px solid transparent;
  cursor: pointer;
}

.trail li.current button { border-color: var(--accent); }
.trail span { color: var(--muted); }

.note-card, .callout, .honesty, .path-callout, .phase, .return-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  margin: 1rem 0;
}

.return-card {
  background: linear-gradient(180deg, #fffdf8, #f4ead7);
  box-shadow: 0 14px 32px rgba(110, 58, 34, 0.08);
}

.plate {
  margin: 0 0 0.9rem;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--sage);
  box-shadow: 0 18px 40px rgba(28, 23, 18, 0.1);
}

.plate img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transform-origin: center;
  animation: ken 18s ease-in-out infinite alternate;
}

.plate figcaption {
  margin: 0;
  padding: 0.75rem 1rem 0.9rem;
  color: #f7f3eb;
  font-family: var(--serif);
  font-size: 1.2rem;
}

.living {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 1rem;
  border-radius: 18px;
}

.glow, .walker {
  transform-box: fill-box;
  transform-origin: center;
}
.glow { animation: pulse 4s ease-in-out infinite; }
.walker { animation: bob 2.6s ease-in-out infinite; }

.stones {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.4rem 0 1rem;
  padding: 0;
}

.stones li {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--muted);
}

.stones li.done { background: var(--sage); border-color: var(--sage); color: white; }
.stones li.current {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(110, 58, 34, 0.16);
  animation: pulse 2.4s ease-in-out infinite;
}

.note-line { font-size: 1.55rem; margin-top: 0.2rem; }

.honesty { border-left: 6px solid var(--accent); }

.path-callout, .phase.here { border-color: var(--sage); box-shadow: inset 4px 0 0 var(--sage); }

.index-number {
  font-size: 5rem;
  color: var(--sage);
  margin: 0;
}

.index-label { font-size: 1.35rem; font-weight: 700; margin-top: 0; }

.gifts, .tools { padding-left: 1.2rem; }
.gifts li, .tools li { margin: 0.8rem 0; }

.cards {
  display: grid;
  gap: 1rem;
}

.cards > section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
}

article[data-item] + article[data-item] {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}

.meter {
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  overflow: hidden;
  background: white;
  margin-top: 0.7rem;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--sage);
}

.note { color: var(--accent); }

.disclaimer, .print-disclaimer, .site-foot {
  color: var(--soft);
}

.check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0.85rem 0;
  font-weight: 450;
}

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

.site-foot {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.site-foot p { margin: 0.2rem 0; }

.build-bar {
  height: 10px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 1.5rem;
}

.build-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sage);
  animation: fill 2s linear forwards;
}

@keyframes fill { to { width: 100%; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes ken {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}
@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-6%, 8%, 0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes sheen {
  0% { transform: translateX(-120%); }
  55%, 100% { transform: translateX(120%); }
}

.plate, .living, .return-card { animation: rise 0.7s ease both; }

dialog {
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  max-width: min(36rem, calc(100vw - 1.5rem));
  padding: 1.2rem;
}

dialog::backdrop { background: rgba(28, 23, 18, 0.45); }

#card {
  width: min(100%, 320px);
  height: auto;
  display: block;
  margin: 0 auto 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1[tabindex="-1"]:focus {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(3, 1fr); align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .build-bar span { width: 100%; }
}

@media print {
  body { background: white; font-size: 12pt; }
  body::after { display: none !important; }
  .no-print, .chrome, .site-foot, dialog { display: none !important; }
  main { max-width: none; padding: 0; }
  .report section { break-inside: auto; }
  .phase, article[data-item], .note-card { break-inside: avoid; }
  .meter span, .index-number { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print-disclaimer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    text-align: center;
    font-size: 10pt;
  }
  @page { margin: 0.6in 0.65in 0.8in; }
}
