/* Highbar site. Same world as the app ("The Meet Scoreboard", DESIGN.md):
   navy ground, board-white numerals, teal PRs, and amber only on things you can press. */

@font-face { font-family: 'Big Shoulders'; src: url('/fonts/BigShoulders_900Black.ttf') format('truetype'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Big Shoulders'; src: url('/fonts/BigShoulders_700Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/Barlow_500Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/Barlow_700Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --bg: #0c1220;
  --surface: #16203a;
  --well: #0f182c;
  --line: #2a3654;
  --text: #f5f3ee;
  --muted: #b4bdd0;
  --faint: #8e99b3;
  --accent: #ffb627;
  --accent-soft: #3a3320;
  --pr: #5eead4;
  --up: #7ee0a8;
  --light-off: #2c3858;
  --display: 'Big Shoulders', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 17px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.mark { font: 900 30px/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; color: var(--text); text-decoration: none; }
.top nav { display: flex; gap: 22px; }
.top nav a { font: 700 15px/1 var(--body); text-decoration: none; padding: 12px 0; }

/* Hero */
.hero { display: grid; gap: 40px; padding: 24px 0 56px; }
.hero h1 {
  margin: 0;
  font: 900 clamp(56px, 15vw, 112px)/0.9 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
.lede { margin: 22px 0 0; max-width: 34ch; color: var(--muted); font-size: 19px; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
/* Not links yet, so not amber: the stores are "coming soon". */
.store {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-height: 56px; padding: 8px 18px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface);
}
.store b { font: 900 22px/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.store span { font: 700 12px/1.3 var(--body); text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); }

/* Phone: a drawing of the real workout screen, set with the app's own tokens */
.phone {
  justify-self: center;
  width: min(100%, 340px);
  border-radius: 40px;
  padding: 12px;
  background: #05080f;
  border: 1px solid #222c45;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}
.screen { border-radius: 30px; overflow: hidden; background: var(--bg); font-size: 14px; }
.scr-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
.round { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--accent); display: grid; place-items: center; flex: none; }
.round svg { width: 16px; height: 16px; }
.scr-title { flex: 1; min-width: 0; }
.scr-title b { display: block; font: 900 19px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.scr-title span { font-size: 12px; color: var(--muted); }
.pill-btn { font: 900 14px/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); border: 1.5px solid var(--accent); border-radius: 10px; padding: 9px 10px; }
.segs { display: flex; gap: 3px; padding: 0 16px 10px; }
.segs i { flex: 1; height: 4px; border-radius: 2px; background: var(--light-off); }
.segs i.on { background: var(--text); }

.done-row { margin: 0 12px; display: flex; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.done-row b { flex: 1; font: 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up { display: inline-flex; align-items: center; gap: 3px; color: var(--up); font: 700 12px/1 var(--body); }
.up svg { width: 12px; height: 12px; }

.card { margin: 8px 12px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 10px 6px 4px; }
.card h3 { margin: 2px 8px 6px; font: 900 18px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.cols, .row { display: grid; grid-template-columns: 30px 46px 1fr 40px; align-items: center; padding: 0 8px; }
.cols { font: 700 10px/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); padding-bottom: 4px; }
.cols span:nth-child(3) { text-align: right; }
.row { min-height: 38px; border-radius: 9px; border: 2px solid transparent; }
.row .n { font: 700 15px/1 var(--display); color: var(--faint); }
.row .last { font-size: 11px; color: var(--muted); }
.row .v { text-align: right; font: 900 19px/1 var(--display); font-variant-numeric: tabular-nums; display: flex; justify-content: flex-end; align-items: center; gap: 5px; }
.row.planned .v { color: var(--faint); }
.row.cur { background: var(--text); border-color: var(--accent); color: var(--bg); }
.row.cur .n, .row.cur .last { color: var(--bg); }
.tag { font: 700 9px/1 var(--body); letter-spacing: 0.1em; background: var(--pr); color: var(--bg); border-radius: 99px; padding: 4px 5px 3px; }
.lights { display: flex; gap: 3px; justify-content: flex-end; }
.lights i { width: 7px; height: 7px; border-radius: 50%; background: var(--light-off); }
.row.lit .lights i { background: var(--text); box-shadow: 0 0 5px var(--text); }
.row.pr .lights i { background: var(--pr); box-shadow: 0 0 5px var(--pr); }
.row.cur .lights i { background: #b9c2d3; box-shadow: none; }

.pad { margin-top: 10px; background: var(--surface); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 12px 12px 14px; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28); }
.pad .lbl { font: 700 10px/1.2 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pad .why { font: 700 12px/1.3 var(--body); color: #c9d1e3; margin-top: 2px; }
.trays { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.tray { background: var(--well); border-radius: 12px; padding: 6px 6px 8px; text-align: center; }
.tray b { display: block; font: 900 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.tray small { display: block; font: 700 9px/1.4 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.steps i { height: 32px; border: 1.5px solid var(--accent); border-radius: 9px; display: grid; place-items: center; color: var(--accent); font: 700 18px/1 var(--display); font-style: normal; }
.act { display: grid; grid-template-columns: 50px 1fr; gap: 8px; margin-top: 8px; }
.wu { border: 1.5px solid var(--accent); border-radius: 10px; display: grid; place-items: center; color: var(--accent); font: 900 18px/1 var(--display); }
.log { background: var(--accent); color: var(--bg); border-radius: 12px; display: grid; place-items: center; height: 52px; font: 900 24px/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }

/* The board: four plain facts, set like a scoreboard */
.board { border-top: 1px solid var(--line); padding: 56px 0 24px; }
.board h2 { margin: 0 0 28px; font: 900 clamp(32px, 7vw, 48px)/1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.facts { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.fact { padding: 22px 20px 24px; border-top: 1px solid var(--line); }
.fact:first-child { border-top: 0; }
.fig { font: 900 64px/0.95 var(--display); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.fig.up-fig { color: var(--up); }
.fig.up-fig svg { width: 38px; height: 38px; }
.fig sup { font-size: 0.42em; letter-spacing: 0.04em; position: relative; top: -0.55em; margin-left: -5px; }
.fact h3 { margin: 10px 0 6px; font: 700 13px/1.2 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.fact p { margin: 0; color: var(--muted); max-width: 40ch; }
.eg { margin-left: 6px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 99px; font-size: 10px; letter-spacing: 0.12em; color: var(--faint); vertical-align: 1px; }

/* Footer */
.foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0 40px; display: grid; gap: 14px; color: var(--faint); font-size: 15px; }
.foot .links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot .links a { font-weight: 700; text-decoration: none; padding: 6px 0; }

/* Simple pages (support, privacy, delete account) */
.page { max-width: 720px; padding-bottom: 24px; }
.page h1 { font: 900 clamp(44px, 11vw, 72px)/0.95 var(--display); text-transform: uppercase; margin: 24px 0 18px; }
.page h2 { font: 900 26px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; margin: 36px 0 8px; }
.page p, .page li { color: var(--muted); }
.page strong { color: var(--text); }
.page table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.page th, .page td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; color: var(--muted); }
.page th { color: var(--text); background: var(--surface); }

/* One authored moment: the judging lights come on in turn, as in the app */
@media (prefers-reduced-motion: no-preference) {
  .row.lit .lights i, .row.pr .lights i { animation: light 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .row:nth-of-type(2) .lights i { animation-delay: 500ms; }
  .row:nth-of-type(2) .lights i:nth-child(2) { animation-delay: 610ms; }
  .row:nth-of-type(2) .lights i:nth-child(3) { animation-delay: 720ms; }
  .row:nth-of-type(3) .lights i { animation-delay: 900ms; }
  .row:nth-of-type(3) .lights i:nth-child(2) { animation-delay: 1010ms; }
  .row:nth-of-type(3) .lights i:nth-child(3) { animation-delay: 1120ms; }
  .row .tag { animation: tag 420ms cubic-bezier(0.3, 1.5, 0.5, 1) 1300ms both; }
}
@keyframes light { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes tag { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (min-width: 760px) {
  .wrap { padding: 0 32px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact { border-top: 0; border-left: 1px solid var(--line); }
  .fact:nth-child(odd) { border-left: 0; }
  .fact:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (min-width: 980px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; align-items: center; padding: 40px 0 80px; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .fact:nth-child(n) { border-left: 1px solid var(--line); border-top: 0; }
  .fact:first-child { border-left: 0; }
}

/* Page to page: a short cross-fade instead of a cut (browsers that support it; none with reduced motion). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
}

/* The phone demo: set 3 logs itself on a loop (motion.js). Without JS or with reduced motion it stays still. */
.row.demo { position: relative; transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease; }
.row.demo .v { position: relative; }
.row.demo .n, .row.demo .last { transition: color 220ms ease; }
.row.demo.done { background: transparent; border-color: transparent; color: var(--text); }
.row.demo.done .n { color: var(--faint); }
.row.demo.done .last { color: var(--muted); }
.row.demo.done .lights i { background: var(--text); box-shadow: 0 0 5px var(--text); animation: light 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.row.demo.done .lights i:nth-child(2) { animation-delay: 110ms; }
.row.demo.done .lights i:nth-child(3) { animation-delay: 220ms; }
.flash { position: absolute; right: 0; top: 19px; white-space: nowrap; font: 700 9px/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: #c9d1e3; opacity: 0; transition: opacity 600ms ease; }
.flash.show { opacity: 1; transition-duration: 150ms; }
.log { position: relative; overflow: hidden; transition: transform 120ms ease; }
.log.press { transform: scale(0.97); }
.tap { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(12, 18, 32, 0.32); opacity: 0; pointer-events: none; }
.log.press .tap { animation: tap 460ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes tap { from { transform: scale(0.2); opacity: 0.7; } to { transform: scale(2.6); opacity: 0; } }
.num { font-variant-numeric: tabular-nums; }
