:root {
  --paper: #f5f8f2;
  --card: #ffffff;
  --ink: #142019;
  --muted: #56675a;
  --line: #d6e1cf;
  --green: #109f55;
  --green-deep: #0b7a41;
  --lime: #94fd54;
  --tomato: #ff6a45;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: 600 1rem/1 var(--body); text-decoration: none;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-lime:hover { background: #a9ff74; }
.btn-line { border: 2px solid rgba(255,255,255,.55); color: #fff; }
.btn-line:hover { border-color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #24372b; }
.btn-small { min-height: 40px; padding: 0 18px; font-size: .9375rem; }

/* Header */
.top { position: absolute; inset: 0 0 auto; z-index: 2; }
.top-row { display: flex; align-items: center; justify-content: space-between; padding-block: 18px; }
.wordmark { font: 800 1.75rem/1 var(--display); letter-spacing: -0.03em; text-decoration: none; color: #fff; }
.wordmark span { color: var(--lime); }
.wordmark-small { font-size: 1.375rem; color: var(--ink); }
.wordmark-small span { color: var(--green); }

/* Hero */
.hero { background: var(--green); color: #fff; padding: 112px 0 72px; overflow: hidden; }
.hero-grid { display: grid; gap: 48px; align-items: center; grid-template-columns: 1.3fr 1fr; }
.hero h1 { font-size: clamp(2.75rem, 6vw, 4.75rem); }
.lede { margin-top: 24px; max-width: 34em; font-size: 1.1875rem; color: #e6f7ec; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.fine { margin-top: 14px; font-size: .9375rem; color: #c4ebd3; }

.hero-demo { position: relative; display: grid; gap: 16px; justify-items: end; }
.receipt, .duel { background: var(--card); color: var(--ink); border-radius: 22px; box-shadow: 0 24px 48px -20px rgba(8, 60, 32, .55); }
.receipt { width: min(420px, 100%); padding: 24px; transform: rotate(-1.5deg); }
.duel { width: min(360px, 92%); padding: 20px 22px; margin-right: 32px; transform: rotate(1.25deg); }

.receipt-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; }
.receipt-when { font-size: .875rem; color: var(--muted); }
.receipt-meal { font-size: 1.5rem; line-height: 1.1; margin-top: 4px; max-width: 11em; }

.dial { position: relative; flex: none; width: 92px; height: 92px; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial circle { fill: none; stroke-width: 12; }
.dial-track { stroke: #e7efe2; }
.dial-fill { stroke: var(--green); stroke-linecap: round; stroke-dasharray: var(--v) 100; }
.dial-num { position: absolute; inset: 0; display: grid; place-items: center; font: 800 2rem/1 var(--display); font-variant-numeric: tabular-nums; }

.macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 22px 0 0; padding: 16px 0; border-block: 1px dashed var(--line); }
.macros div { margin: 0; }
.macros dt { font-size: .75rem; color: var(--muted); }
.macros dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.streak { margin-top: 14px; font-size: .9375rem; color: var(--muted); }
.streak strong { color: var(--ink); }

.duel-title { font-size: 1.125rem; }
.board { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.board li { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.who { display: grid; line-height: 1.25; }
.who small { font-size: .8125rem; color: var(--muted); }
.tally { display: flex; align-items: center; gap: 10px; }
.tally i { display: block; height: 10px; width: calc(var(--n) * 28px); border-radius: 999px; background: var(--tomato); }
.me .tally i { background: var(--green); }
.tally b { font: 800 1.25rem/1 var(--display); width: 1ch; text-align: right; }
.duel-foot { margin-top: 12px; font-size: .875rem; color: var(--muted); }

/* Sections */
.section-title { font-size: clamp(2rem, 4.5vw, 3.25rem); }
.how { padding: 96px 0 80px; }
.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 20px; border-top: 3px solid var(--ink); }
.steps h3 { font-size: 1.75rem; display: flex; gap: 12px; align-items: baseline; }
.steps h3::before { content: counter(step); font-size: 1rem; color: var(--green-deep); }
.steps p { margin-top: 10px; color: var(--muted); max-width: 30em; }

.score { background: var(--card); border-block: 1px solid var(--line); padding: 88px 0; }
.score-grid { display: grid; gap: 32px; grid-template-columns: 1fr 1.4fr; grid-template-areas: "t bar" "t legend"; align-items: start; }
.score-grid > div:first-child { grid-area: t; }
.score-lede { margin-top: 16px; color: var(--muted); max-width: 26em; }
.bar { grid-area: bar; display: flex; height: 72px; border-radius: 16px; overflow: hidden; }
.bar-part { display: flex; align-items: center; padding-left: 16px; font: 800 1.5rem/1 var(--display); }
.bar-part.p60 { flex: 60; background: var(--green); color: #fff; }
.bar-part.p30 { flex: 30; background: var(--lime); }
.bar-part.p10 { flex: 10; background: var(--ink); color: #fff; padding-left: 10px; font-size: 1.125rem; }
.legend { grid-area: legend; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.legend div { padding-left: 14px; border-left: 4px solid; }
.legend .p60 { border-color: var(--green); }
.legend .p30 { border-color: var(--lime); }
.legend .p10 { border-color: var(--ink); }
.legend dt { font-weight: 600; }
.legend dd { margin: 4px 0 0; font-size: .9375rem; color: var(--muted); }

.games { padding: 96px 0; }
.game-list { margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.game { padding: 24px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.game h3 { font-size: 1.375rem; }
.game p { margin-top: 8px; color: var(--muted); font-size: .9375rem; }
.game-duel { background: var(--ink); border-color: var(--ink); color: #fff; }
.game-duel p { color: #b9c8bd; }

.close { background: var(--ink); color: #fff; padding: 72px 0; }
.close-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.close h2 { font-size: clamp(2rem, 5vw, 3.5rem); }

.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; padding: 28px 0 40px; font-size: .875rem; color: var(--muted); }
.foot p:last-child { margin-left: auto; }

/* The one moment of motion: the score fills on load */
@media (prefers-reduced-motion: no-preference) {
  .dial-fill { animation: fill 1.1s cubic-bezier(.2,.8,.2,1) .3s both; }
  @keyframes fill { from { stroke-dasharray: 0 100; } }
  .tally i { animation: grow .9s cubic-bezier(.2,.8,.2,1) .9s both; transform-origin: left; }
  @keyframes grow { from { transform: scaleX(0); } }
}

@media (max-width: 900px) {
  .hero { padding-top: 96px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-demo { justify-items: center; }
  .duel { margin-right: 0; }
  .steps, .legend { grid-template-columns: 1fr; gap: 28px; }
  .score-grid { grid-template-columns: 1fr; grid-template-areas: "t" "bar" "legend"; }
  .game-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .receipt { transform: none; padding: 20px; }
  .duel { transform: none; width: 100%; }
  .macros { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
  .game-list { grid-template-columns: 1fr; }
  .tally i { width: calc(var(--n) * 18px); }
  .foot p:last-child { margin-left: 0; }
}
