/* Brand kit: near black #080808, cream #F4E9D5, muted red #C0403F, charcoal #111111.
   Space Grotesk for headings and mileage, Inter for everything else. Fonts are served from this site. */
@font-face { font-family: "Space Grotesk"; src: url(/fonts/space-grotesk.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --black: #080808;
  --cream: #f4e9d5;
  --bg: #f4e9d5;
  --card: #fff;
  --ink: #111111;
  --soft: #62594a;
  --line: rgba(17, 17, 17, .22);
  --hair: rgba(17, 17, 17, .1);
  --tint: rgba(17, 17, 17, .08);
  --red: #c0403f;
  --red-text: #a23130; /* the brand red, darkened so small text passes contrast on cream */
  --display: "Space Grotesk", "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.47 "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  overflow-x: clip;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
h1, h2, h3, .num, .total, .trio dd, .math b { font-family: var(--display); }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(192, 64, 63, .55); outline-offset: 2px; }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  height: 60px; padding: 0 max(16px, calc((100vw - 980px) / 2));
  background: rgba(8, 8, 8, .88); color: var(--cream); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(244, 233, 213, .12);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brand img { height: 32px; width: auto; }
.brand span { text-transform: uppercase; letter-spacing: .16em; font-size: 13px; font-weight: 600; padding-top: 4px; }
#account { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.who { font-weight: 600; }
.link { background: none; border: 0; padding: 12px 0; color: var(--cream); font-size: 14px; white-space: nowrap; }
.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }

main { max-width: 980px; margin: 0 auto; padding: 0 16px 96px; display: grid; gap: 24px; }
.card { background: var(--card); border-radius: 22px; padding: 32px; min-width: 0; }
.card > h2, .how > h2, .join > h2 { font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.muted { color: var(--soft); font-size: 14px; margin-top: 4px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--soft); }

/* buttons */
.primary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; background: var(--red); color: #fff; border: 0; border-radius: 980px;
  font-weight: 500; text-decoration: none; transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.primary.small { min-height: 32px; padding: 0 14px; font-size: 14px; }
.ghost {
  min-height: 40px; min-width: 84px; padding: 0 16px; background: var(--tint); border: 0; border-radius: 980px;
  font-weight: 500; font-size: 14px; transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.primary:active, .ghost:active:not(:disabled) { transform: scale(.97); }
.primary:disabled { opacity: .6; cursor: default; }
.ghost:disabled { background: none; color: var(--soft); cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: #cb4a49; }
  .ghost:hover:not(:disabled) { background: rgba(17, 17, 17, .14); }
}

/* homepage */
/* full-width black band, like the original artwork */
.hero {
  margin: 0 calc(50% - 50vw) 16px; padding: 24px max(16px, calc((100vw - 980px) / 2)) 40px;
  background: var(--black); color: var(--cream);
  display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 24px 40px; align-items: center;
}
.hero .logo { width: 100%; height: auto; }
.hero > div { display: grid; gap: 14px; justify-items: start; }
.hero .eyebrow { color: var(--red); letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
.hero h1 { font-size: clamp(40px, 5.6vw, 64px); line-height: 1.04; font-weight: 700; letter-spacing: -.035em; }
.lead { font-size: clamp(18px, 2vw, 21px); line-height: 1.4; color: rgba(244, 233, 213, .72); max-width: 26em; margin-bottom: 8px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: left; }
.steps li { position: relative; background: var(--cream); border-radius: 22px; padding: 32px 28px 36px; }
.steps .no { position: absolute; top: 24px; right: 28px; font-family: var(--display); font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -.04em; color: rgba(17, 17, 17, .14); }
.steps .icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(192, 64, 63, .12); color: var(--red-text); margin-bottom: 24px; }
.steps h3 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.steps p { color: var(--soft); }
.math { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.math b { display: block; font-size: clamp(44px, 9vw, 96px); line-height: 1; font-weight: 700; letter-spacing: -.04em; }
.math span { color: rgba(255, 255, 255, .85); font-size: 19px; }
.join { display: grid; gap: 28px; justify-items: center; }
.join .logo { width: 180px; height: auto; margin-bottom: -28px; }
.join > h2 { font-size: clamp(32px, 5vw, 48px); font-weight: 700; letter-spacing: -.03em; }
.auth { display: grid; gap: 18px; width: min(440px, 100%); }
.auth .primary { width: 100%; }

/* forms */
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
label small { font-weight: 400; color: var(--soft); }
input, select {
  width: 100%; min-height: 48px; padding: 10px 14px; font-size: 17px; font-weight: 400;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
input:focus, select:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 4px rgba(192, 64, 63, .18); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--tint); border-radius: 10px; padding: 2px; }
.tabs button { background: none; border: 0; border-radius: 8px; min-height: 40px; font-size: 14px; font-weight: 500; }
.tabs button[aria-selected="true"] { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
.error { color: var(--red); font-size: 14px; font-weight: 500; }

/* leaderboard */
.board { margin-top: 12px; }
.board li {
  display: grid; grid-template-columns: 28px 1fr 96px 110px 96px 84px; gap: 8px 12px; align-items: center;
  padding: 16px 0; border-top: 1px solid var(--hair);
}
.board.public li { grid-template-columns: 28px 1fr 96px 110px 96px; }
.board.public .act { display: none; }
.board li:first-child { border-top: 0; }
.board .bar { grid-column: 2 / -1; }
.intro .board li { animation: rise 420ms var(--ease-out) backwards; }
.intro .board li:nth-child(2) { animation-delay: 40ms; }
.intro .board li:nth-child(3) { animation-delay: 80ms; }
.intro .board li:nth-child(4) { animation-delay: 120ms; }
.intro .board li:nth-child(n+5) { animation-delay: 160ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.rank { font-weight: 600; color: var(--soft); }
.name { font-weight: 600; font-size: 19px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.total { font-weight: 700; font-size: 21px; letter-spacing: -.02em; text-align: right; }
.board li:first-child .total { font-size: 28px; }
.avg { text-align: right; color: var(--soft); font-size: 14px; }
.total small, .avg small { font-weight: 400; font-size: 13px; color: var(--soft); letter-spacing: 0; }
.pace, .act { text-align: right; }
.tag { font-size: 14px; font-weight: 600; color: var(--soft); padding-right: 16px; }
.chip { font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.good, .status.good { color: var(--ink); }
.chip.late, .status.late { color: var(--red-text); }

.bar { position: relative; display: block; height: 12px; background: rgba(17, 17, 17, .12); border-radius: 6px; }
.bar i { display: block; height: 100%; border-radius: 6px; transition: width 600ms var(--ease-out); }
.bar i.good { background: var(--ink); }
.bar i.late { background: var(--red); }
/* pace marker: cream halo keeps it visible on top of a dark bar */
.bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--ink); box-shadow: 0 0 0 1.5px var(--card); }
.bar.thin { height: 6px; }
.bar.thin b { top: -3px; bottom: -3px; }

/* you */
.banner { background: var(--ink); color: var(--cream); padding: 14px 20px; border-radius: 16px; font-weight: 500; margin-top: 24px; }
main > .card:first-child { margin-top: 24px; }
.big { font-size: 28px; font-weight: 600; margin: 4px 0 18px; letter-spacing: -.02em; }
.big .num { font-size: clamp(64px, 14vw, 112px); line-height: 1; font-weight: 700; letter-spacing: -.045em; }
.big .of { color: var(--soft); }
.status { margin-top: 14px; font-weight: 600; }
.trio { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 28px 0; padding: 24px 0; border-block: 1px solid var(--hair); }
.trio dt { font-size: 14px; color: var(--soft); }
.trio dd { font-size: 34px; font-weight: 700; letter-spacing: -.03em; }
.log { display: grid; grid-template-columns: 190px 1fr auto; gap: 12px; align-items: end; }
.log .error { grid-column: 1 / -1; }

/* day grid */
.scroll { overflow-x: auto; margin-top: 16px; }
.grid { border-collapse: collapse; font-size: 13px; }
.grid th, .grid td { padding: 2px; text-align: center; min-width: 44px; height: 44px; }
.grid thead th { color: var(--soft); font-weight: 500; }
.grid thead th.today { color: var(--red-text); font-weight: 700; }
.grid tbody th { position: sticky; left: 0; background: var(--card); text-align: left; padding-right: 12px; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; }
.grid .zero { color: rgba(17, 17, 17, .3); }
.cell { width: 100%; height: 40px; border: 0; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink); transition: transform 140ms var(--ease-out); }
.cell.l1 { background: rgba(17, 17, 17, .08); }
.cell.l2 { background: rgba(17, 17, 17, .22); }
.cell.l3 { background: var(--ink); color: var(--cream); }
.cell:active { transform: scale(.94); }

/* feed and comments */
.feed { margin-top: 8px; }
.feed li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-top: 1px solid var(--hair); }
.feed li:first-child { border-top: 0; }
.feed .row { flex: 1; text-align: left; background: none; border: 0; padding: 14px 0; min-width: 0; overflow-wrap: anywhere; }
.feed b { font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .feed button.row:hover { color: var(--red-text); } }
time { color: var(--soft); font-size: 13px; white-space: nowrap; }

dialog {
  width: min(480px, calc(100vw - 32px)); border: 0; border-radius: 22px; padding: 28px; background: var(--card); color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .24);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
@starting-style { dialog[open] { opacity: 0; transform: scale(.96); } }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
dialog h2 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0 14px; }
dialog form { display: grid; gap: 12px; }
dialog .primary { width: 100%; }
.close { float: right; background: none; border: 0; padding: 8px 0 8px 12px; color: var(--red-text); font-size: 14px; }
.comments { display: grid; gap: 10px; margin-bottom: 20px; max-height: 40vh; overflow-y: auto; overflow-wrap: anywhere; }
.comments b { font-weight: 600; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: rgba(29, 29, 31, .92); color: #fff; padding: 12px 20px; border-radius: 980px; font-size: 15px; font-weight: 500;
  max-width: calc(100vw - 32px); transition: opacity 200ms ease, transform 240ms var(--ease-out);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 8px; gap: 0; }
  .hero .logo { width: min(300px, 78vw); justify-self: center; }
  .hero > div { justify-items: center; }
  .brand span { display: none; }
  #account { gap: 14px; }
  .card { padding: 24px 18px; border-radius: 18px; }
  .steps { grid-template-columns: 1fr; gap: 12px; }
  .steps .icon { margin-bottom: 14px; }
  .trio { grid-template-columns: 1fr 1fr; gap: 16px 10px; }
  .trio dd { font-size: 26px; }
  .log { grid-template-columns: 1fr 1fr; }
  .log .primary { grid-column: 1 / -1; }
  /* phone: name and total on the first line, pace and Nudge on the second, so names get the room */
  .board li, .board.public li { grid-template-columns: 24px 1fr auto; }
  .board .avg { display: none; }
  .board .pace { grid-column: 2; grid-row: 2; text-align: left; }
  .board .act { grid-column: 3; grid-row: 2; }
  .board .bar { grid-row: 3; }
  .tag { padding-right: 0; }
  .who { display: none; }
  .name { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro .board li { animation: none; }
  .bar i, dialog, .primary, .ghost, .cell { transition: none; }
}
.hero h1 span { white-space: nowrap; }

/* countdown */
.timer { display: grid; gap: 6px; margin-top: 18px; }
.countdown { display: flex; gap: 20px; min-height: 58px; }
.countdown span { display: grid; font-size: 13px; color: var(--soft); min-width: 2.6em; }
.countdown b { font-family: var(--display); font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.hero .timer { margin: 0 0 8px; }
.hero .timer .eyebrow { color: rgba(244, 233, 213, .72); letter-spacing: 0; text-transform: none; font-size: 14px; }
.hero .countdown span { color: rgba(244, 233, 213, .6); }
.hero .countdown b { color: var(--cream); }

/* sign-up: city and state side by side */
.pair { display: grid; grid-template-columns: 1fr 92px; gap: 12px; }
.hint { color: var(--soft); font-size: 14px; margin-top: -10px; }
.from { font-family: "Inter", sans-serif; font-weight: 400; font-size: 14px; color: var(--soft); margin-left: 10px; letter-spacing: 0; }

/* my logs for the picked day */
.log + .muted { margin-top: 12px; }
#mylogs { margin-top: 16px; }
.logs li { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--hair); min-height: 48px; }
.logs li:first-child { margin-top: 6px; }
.logs b { font-weight: 600; min-width: 5em; }
.logs time { flex: 1; }
.remove { color: var(--red-text); padding: 12px 0 12px 12px; }

/* notifications */
.badge { background: var(--red); color: #fff; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 980px; text-decoration: none; white-space: nowrap; }
.notices { outline: 2px solid var(--red); outline-offset: -2px; }
.notices .ghost { margin-top: 12px; }

@media (max-width: 720px) {
  .countdown { gap: 14px; }
  .countdown b { font-size: 28px; }
  .hero .countdown { justify-content: center; }
  .from { display: block; margin: 0; }
}

/* agreement checkbox */
.agree { grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-weight: 400; font-size: 14px; line-height: 1.45; }
.agree input { width: 22px; height: 22px; min-height: 0; padding: 0; margin: 0; accent-color: var(--red); }
.agree a, .legal a { color: var(--red-text); }

/* footer and legal pages */
.foot { padding: 36px max(16px, calc((100vw - 980px) / 2)) 44px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: 14px; background: var(--black); color: rgba(244, 233, 213, .6); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { color: var(--cream); padding: 6px 0; }
.legal { display: block; max-width: 680px; padding-top: 48px; }
.legal h1 { font-size: clamp(32px, 6vw, 48px); line-height: 1.1; letter-spacing: -.03em; margin-bottom: 8px; }
.legal h2 { font-size: 21px; letter-spacing: -.01em; margin: 32px 0 8px; }
.legal p, .legal ul { margin-bottom: 12px; }
.legal ul { list-style: disc; padding-left: 22px; }

/* fun fact unlocked by total miles */
.fact { margin-top: 16px; padding: 14px 16px; background: var(--cream); border-radius: 14px; }
.fact b { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--red-text); }
.fact span { color: var(--soft); font-size: 14px; white-space: nowrap; }

.trio dd small { font-family: "Inter", sans-serif; font-size: 14px; font-weight: 400; color: var(--soft); letter-spacing: 0; }

/* badges: earned ones are solid, the rest are outlines waiting to be filled */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 20px 8px; margin-top: 20px; }
.badges li { display: grid; justify-items: center; gap: 8px; text-align: center; font-size: 13px; line-height: 1.3; color: var(--soft); }
.medal { display: grid; place-content: center; width: 68px; height: 68px; border-radius: 50%; border: 2px dashed var(--line); font-size: 11px; line-height: 1.1; }
.medal b { font-family: var(--display); font-size: 20px; letter-spacing: -.02em; }
.badges .earned { color: var(--ink); font-weight: 600; }
.badges .earned .medal { border: 0; background: var(--ink); color: var(--card); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--red); font-weight: 400; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---- homepage bands: full-width sections with their own color, so the page has rhythm ---- */
main.home { gap: 0; padding-bottom: 0; }
main.home .hero { margin-bottom: 0; }
.band { margin: 0 calc(50% - 50vw); padding: 96px max(16px, calc((100vw - 980px) / 2)); }
.band.white { background: #fff; }
.band.red { background: var(--red); color: #fff; padding-block: 72px; }
.band.dark {
  background: var(--black); color: var(--cream);
  --ink: #f4e9d5; --soft: rgba(244, 233, 213, .66); --hair: rgba(244, 233, 213, .12); --line: rgba(244, 233, 213, .3); --card: #161616; --red-text: #e0605f;
}
.sec-head { text-align: center; margin-bottom: 48px; }
.sec-head .eyebrow { color: var(--red-text); letter-spacing: .14em; text-transform: uppercase; font-size: 13px; margin-bottom: 12px; }
.sec-head h2 { font-size: clamp(32px, 5vw, 54px); line-height: 1.05; font-weight: 700; letter-spacing: -.035em; }
.sub { color: var(--soft); font-size: clamp(17px, 2vw, 21px); margin-top: 14px; }
.note { color: var(--soft); font-size: 13px; text-align: center; margin-top: 24px; }

.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile { background: var(--card); border: 1px solid var(--hair); border-radius: 22px; padding: 28px; display: flex; flex-direction: column; min-width: 0; }
.tile.wide { grid-column: span 2; }
.tile h3 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 6px; }
.tile > p { color: var(--soft); }
.tile .demo { margin-top: auto; padding-top: 28px; }
.tile .big { margin: 0 0 14px; }
.tile .big .num { font-size: 64px; }
.tile .status { font-size: 15px; }
.tile .badges { display: flex; gap: 14px; margin-top: auto; }
.tile .fact { background: rgba(244, 233, 213, .08); margin-top: auto; padding: 16px; }
.tile .fact b { margin-bottom: 4px; }
.tile .feed .row { padding: 12px 0; font-size: 15px; }
.band.dark .bar { background: rgba(244, 233, 213, .16); }
.band.dark .bar b { background: var(--red); box-shadow: none; width: 3px; }

/* Sections fade up as they scroll into view. CSS only: browsers without scroll timelines just show them. */
@keyframes reveal { from { opacity: 0; transform: translateY(24px); } }
@supports (animation-timeline: view()) {
  .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
}

@media (max-width: 720px) {
  .band { padding-block: 64px; }
  .band.red { padding-block: 48px; }
  .sec-head { margin-bottom: 32px; }
  .bento { grid-template-columns: 1fr; gap: 14px; }
  .tile.wide { grid-column: auto; }
  .tile { padding: 24px 20px; }
  .math span { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* People who turn down transparency or turn up contrast get a solid top bar and stronger lines. */
@media (prefers-reduced-transparency: reduce) {
  .top { background: var(--black); backdrop-filter: none; -webkit-backdrop-filter: none; }
  #toast { background: var(--ink); }
}
@media (prefers-contrast: more) {
  :root { --soft: #3d372d; --hair: rgba(17, 17, 17, .4); --line: rgba(17, 17, 17, .6); }
  .top { background: var(--black); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .card, .tile, .steps li { outline: 1px solid var(--line); }
}
