:root {
  --ground: #1F2A5C;
  --ground-deep: #11173A;
  --cream: #F4EBDD;
  --cream-dim: #C9C6D6;
  --orange: #EE5A2F;
  --mustard: #F2B33D;
  --ink: #161616;
  --font: 'Bricolage Grotesque', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--cream);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  overflow-x: hidden;
}
a { color: var(--cream); }
a:hover { color: #FFFFFF; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }

.wrap { position: relative; max-width: 980px; margin: 0 auto; padding: 32px 16px 56px; }
@media (min-width: 720px) { .wrap { padding: 48px 40px 72px; } }

.top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 700; font-size: 15px; }
.top a { text-decoration: none; border-bottom: 2px solid currentColor; }

/* decorative scarf, top right */
.scarf-deco { position: absolute; top: -40px; right: -60px; width: 300px; height: 420px; pointer-events: none; z-index: 0; }
@media (max-width: 719px) { .scarf-deco { width: 180px; height: 260px; right: -70px; top: -30px; } }
.wrap > *:not(.scarf-deco) { position: relative; z-index: 1; }

.kicker { margin: 56px 0 4px; font-size: 16px; font-weight: 700; }
.big {
  margin: 0;
  font-weight: 800;
  font-size: clamp(96px, 26vw, 220px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.big small { font-size: 0.32em; letter-spacing: -0.02em; margin-left: 0.08em; }
.goal-line { margin: 14px 0 0; font-size: 20px; font-weight: 600; }

/* progress as a scarf */
.bar { position: relative; margin-top: 22px; height: 46px; background: var(--ground-deep); }
.bar-fill {
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--orange) 0 26px, var(--cream) 26px 52px);
  transition: width 900ms cubic-bezier(.2,.8,.2,1);
}
.bar-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--cream-dim); }

.section { margin-top: 64px; }
.section h2 { margin: 0 0 4px; font-size: 14px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--mustard); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 719px) { .stats { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.stat { border-top: 2px solid var(--cream); padding-top: 10px; }
@media (max-width: 719px) { .stat { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0 12px; } }
.stat-num { font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-num small { font-size: 0.4em; margin-left: 4px; }
.stat-label { font-size: 17px; font-weight: 600; margin-top: 6px; }
.stat-sub { font-size: 14px; color: var(--cream-dim); }

.places { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.place-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 72px; gap: 12px; align-items: center; font-weight: 700; }
.place-track { height: 18px; background: var(--ground-deep); }
.place-fill { height: 100%; background: var(--mustard); width: 0; transition: width 900ms cubic-bezier(.2,.8,.2,1); }
.place-kg { text-align: right; font-variant-numeric: tabular-nums; }

.log { margin-top: 12px; border-top: 2px solid var(--cream); }
.log-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 80px; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(244, 235, 221, 0.25); align-items: baseline; }
.log-date { font-size: 14px; color: var(--cream-dim); }
.log-what { font-weight: 600; }
.log-who { font-size: 14px; color: var(--cream-dim); font-weight: 400; }
.log-kg { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.empty { padding: 24px 0; color: var(--cream-dim); }

.foot { margin-top: 64px; padding-top: 14px; border-top: 2px solid var(--cream); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 14px; }
.status { color: var(--cream-dim); }

/* ---------- add page ---------- */
.add-title { margin: 40px 0 0; font-weight: 800; font-size: clamp(56px, 14vw, 104px); line-height: 0.9; letter-spacing: -0.035em; }
.field { margin-top: 32px; }
.field-label { display: block; margin: 0 0 10px; font-size: 14px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--mustard); }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  min-height: 52px;
  padding: 10px 20px;
  border: 2px solid var(--cream);
  background: transparent;
  color: var(--cream);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, color 120ms ease;
}
.choice:hover { background: rgba(244, 235, 221, 0.1); }
.choice:active { transform: translateY(1px); }
.choice[aria-pressed="true"] { background: var(--cream); color: var(--ground); box-shadow: 4px 4px 0 var(--orange); }

.kg-row { display: flex; align-items: stretch; gap: 10px; }
.step { width: 64px; min-height: 72px; border: 2px solid var(--cream); background: transparent; color: var(--cream); font-size: 32px; font-weight: 800; cursor: pointer; }
.step:hover { background: rgba(244, 235, 221, 0.1); }
.kg-input, .text-input {
  min-width: 0;
  border: 2px solid var(--cream);
  background: var(--ground-deep);
  color: var(--cream);
  padding: 8px 14px;
}
.kg-input { flex: 1 1 auto; width: 100%; font-size: 44px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.text-input { width: 100%; max-width: 260px; min-height: 52px; font-size: 18px; font-weight: 600; color-scheme: dark; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 20px 32px; }
.inline-fields .field { margin-top: 32px; }

.submit {
  margin-top: 40px;
  width: 100%;
  min-height: 68px;
  border: 0;
  background: var(--orange);
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 6px 6px 0 var(--ground-deep);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.submit:hover { transform: translate(-1px, -1px); box-shadow: 7px 7px 0 var(--ground-deep); }
.submit:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ground-deep); }
.submit:disabled { opacity: 0.6; cursor: wait; }
.error { margin-top: 14px; color: var(--mustard); font-weight: 700; min-height: 1.4em; }

.done { margin-top: 40px; padding: 28px 24px; background: var(--cream); color: var(--ground); box-shadow: 8px 8px 0 var(--orange); }
.done h2 { margin: 0; font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.done p { margin: 10px 0 0; font-size: 18px; }
.done-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn-dark { min-height: 52px; padding: 12px 20px; border: 2px solid var(--ground); background: var(--ground); color: var(--cream); font-weight: 800; font-size: 17px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn-ghost { min-height: 52px; padding: 12px 20px; border: 2px solid var(--ground); background: transparent; color: var(--ground); font-weight: 800; font-size: 17px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }

.mine { margin-top: 56px; }
.mine-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(244, 235, 221, 0.25); }
.undo { min-height: 44px; padding: 8px 14px; border: 2px solid var(--cream); background: transparent; color: var(--cream); font-weight: 700; cursor: pointer; }

.gate { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }
.gate .text-input { max-width: 280px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
