/* The game's look: the colours of its menus (rcycling-client/src/home/constant.rs), its HUD
   panel, Barlow Condensed for titles and Nunito for text, the art of its home screen. */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(assets/fonts/BarlowCondensed-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(assets/fonts/BarlowCondensed-Bold.ttf) format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 200 1000; font-display: swap; src: url(assets/fonts/Nunito.ttf) format("truetype"); }

:root {
  --sky: #f4f5f7;
  --panel: #ffffff;
  --ink: #1d2330;
  --muted: #6b7385;
  --line: #e3e6ec;
  --chip: #eef0f4;
  --accent: #ffd100;
  --accent-hovered: #ffe359;
  --picked-row: #fffae6;
  --ridge: #dfe2ea;
  --road-edge: #2c3444;
  --bar: rgba(11, 11, 13, 0.92);
  --bar-text: #ccd4e0;
  --hud: rgba(11, 11, 13, 0.85);
  --zone-1: #bfbfc7; --zone-2: #66a6ff; --zone-3: #66d973; --zone-4: #ffd94d; --zone-5: #ff9933; --zone-6: #ff4d4d;
  --condensed: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--sky); color: var(--ink);
  font: 17px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  /* The footer's road stays at the bottom of a short page */
  min-height: 100vh; display: flex; flex-direction: column;
}
body > main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }

.wrap { width: min(var(--width), 100% - 32px); margin-inline: auto; }

/* ---- Top bar, as in the game ---- */
.bar {
  position: sticky; top: 0; z-index: 10; background: var(--bar); color: var(--bar-text);
  backdrop-filter: blur(8px);
}
.bar .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand img { width: 30px; height: 30px; }
.brand span { font: 800 25px/1 var(--text); letter-spacing: -0.03em; }
.bar nav { display: flex; gap: 4px; margin-right: auto; }
.bar nav a {
  font: 600 15px/1 var(--condensed); letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; padding: 21px 12px 18px; border-bottom: 3px solid transparent;
}
.bar nav a:hover { color: #fff; }
.bar nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }

/* ---- Buttons: the yellow of the game's buttons, square-ish like its chips ---- */
.button {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 18px/1 var(--condensed); letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; color: var(--ink); background: var(--accent);
  padding: 15px 26px; border-radius: 6px; border: 0; cursor: pointer;
}
.button:hover { background: var(--accent-hovered); }
.button.small { font-size: 15px; padding: 10px 16px; }
.button svg { width: 18px; height: 18px; }
.link-quiet {
  font: 600 16px/1 var(--condensed); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.link-quiet:hover { color: var(--ink); }

/* ---- Titles ---- */
.label {
  font: 600 14px/1 var(--condensed); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px;
}
h1, h2, h3 { font-family: var(--condensed); font-weight: 700; text-transform: uppercase; margin: 0; line-height: 0.95; }
h1 { font-size: clamp(48px, 7.4vw, 92px); letter-spacing: -0.01em; }
h2 { font-size: clamp(36px, 4.6vw, 56px); }
h3 { font-size: 30px; letter-spacing: 0.01em; }

/* ---- Home: the hero, on the art of the game's home screen ---- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(86vh, 780px);
  background: var(--sky) url(assets/hero.svg) right bottom / cover no-repeat;
}
.hero .wrap { padding: clamp(48px, 10vh, 110px) 0 260px; }
.hero h1 { max-width: 9.5em; }
.hero .lead { max-width: 30em; font-size: 19px; margin: 24px 0 32px; color: #3a4252; }
.hero .actions { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }

/* The HUD of a ride, on the road of the art */
.hud {
  position: absolute; left: max(16px, (100% - var(--width)) / 2); bottom: 22px;
  display: flex; background: var(--hud); color: #fff; border-radius: 4px;
  font-family: var(--condensed); font-variant-numeric: tabular-nums;
}
.hud div { padding: 10px 18px 8px; }
.hud div + div { border-left: 1px solid rgba(255, 255, 255, 0.12); }
.hud b { display: block; font-weight: 700; font-size: 34px; line-height: 1; }
.hud b small { font-size: 17px; font-weight: 600; margin-left: 3px; color: #aab2c0; }
.hud span { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: #8b93a5; text-transform: uppercase; }
.hud .watts { color: var(--zone-4); }

/* ---- The dashed line down the middle of the road, between sections ---- */
.road-line {
  height: 14px; background: var(--ink);
  background-image: repeating-linear-gradient(90deg, var(--sky) 0 26px, transparent 26px 48px);
  background-size: 100% 3px; background-position: 0 50%; background-repeat: no-repeat;
}

/* ---- Ride, train, race: text beside a piece of the game's menus ---- */
.ways { padding: 90px 0 100px; }
.ways-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.way .card { height: 196px; margin-bottom: 16px; }
.way h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.way h3::before { content: ""; width: 22px; height: 5px; background: var(--accent); }
.way p { color: #3a4252; margin: 0; }

/* The figures of a ride, as the game's HUD writes them */
.figures { display: grid; grid-template-columns: repeat(3, 1fr); padding: 30px 20px; }
.figures div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.figures b { display: block; font: 700 38px/1 var(--condensed); font-variant-numeric: tabular-nums; }
.figures b small { font-size: 17px; color: var(--muted); margin-left: 2px; }
.figures span { font: 600 12px/1 var(--condensed); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* A card of the game's menus: white, a thin line, rows */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line);
}
.card-head h4 { margin: 0; font: 700 20px/1 var(--condensed); letter-spacing: 0.04em; text-transform: uppercase; }
.card-head span { color: var(--muted); font-size: 14px; }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
  padding: 13px 20px; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row strong { font: 700 19px/1.1 var(--condensed); letter-spacing: 0.02em; text-transform: uppercase; }
.row small { grid-column: 1; color: var(--muted); font-size: 14px; line-height: 1.3; }
.row .km { grid-row: 1 / span 2; grid-column: 2; font: 700 24px/1 var(--condensed); font-variant-numeric: tabular-nums; }
.row .km small { font-size: 14px; color: var(--muted); margin-left: 2px; }
.row.picked { background: var(--picked-row); box-shadow: inset 4px 0 var(--accent); }
.chip {
  display: inline-block; background: var(--chip); border-radius: 999px; padding: 1px 9px;
  font: 600 13px/1.6 var(--condensed); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  margin-left: 8px; vertical-align: 2px;
}
.row .when { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 14px; }
.row .when time { font: 700 22px/1 var(--condensed); font-variant-numeric: tabular-nums; }

.workout { padding: 18px 20px 20px; }
.workout svg { width: 100%; height: auto; }
.zones { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; font: 600 13px/1 var(--condensed); letter-spacing: 0.08em; color: var(--muted); }
.zones span { display: inline-flex; align-items: center; gap: 6px; }
.zones span::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--z); }

/* ---- What you need ---- */
.need { background: var(--panel); border-block: 1px solid var(--line); padding: 90px 0; }
.need h2 { margin-bottom: 48px; }
.need ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.need li { padding: 0 28px 0 0; }
.need li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.need li b { display: block; font: 700 22px/1.1 var(--condensed); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 10px; }
.need li p { color: #3a4252; font-size: 16px; margin: 0; }

/* ---- Footer: the road at the bottom of the game's art ---- */
footer { color: #aab2c0; }
footer .edge { display: block; width: 100%; height: 70px; }
footer .road { background: var(--ink); padding: 20px 0 44px; margin-top: -1px; }
footer .wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
footer nav { display: flex; gap: 22px; margin-left: auto; }
footer nav a { font: 600 15px/1 var(--condensed); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
footer nav a:hover { color: #fff; }
footer .small { width: 100%; font-size: 14px; color: #6b7385; margin-top: 10px; }

/* ---- Download page ---- */
.page-head { padding: 80px 0 48px; }
.page-head h1 { font-size: clamp(44px, 6vw, 76px); }
.page-head .lead { max-width: 34em; font-size: 19px; color: #3a4252; margin: 20px 0 0; }
.systems { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-bottom: 80px; }
.system { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 30px 30px 26px; display: flex; flex-direction: column; }
.system-top { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.system-top svg { width: 34px; height: 34px; flex: none; }
.system h2 { font-size: 40px; }
.system .for { color: var(--muted); margin: 0 0 22px; }
.system .button { align-self: flex-start; }
.system ol { margin: 30px 0 0; padding: 26px 0 0; border-top: 1px solid var(--line); list-style: none; counter-reset: step; display: grid; gap: 20px; }
.system li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 0 12px; font-size: 16px; color: #3a4252; }
.system li::before {
  content: counter(step); grid-row: span 2;
  width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--accent);
  display: grid; place-items: center; font: 700 17px/1 var(--condensed);
}
.system li b { color: var(--ink); font: 700 19px/1.3 var(--condensed); text-transform: uppercase; letter-spacing: 0.02em; }
.system li p { margin: 2px 0 0; }
.path { font: 600 15px/1.4 var(--condensed); letter-spacing: 0.03em; background: var(--chip); padding: 1px 7px; border-radius: 4px; color: var(--ink); white-space: nowrap; }

.why { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; padding: 70px 0 90px; border-top: 1px solid var(--line); }
.why h2 { font-size: 34px; }
.why p { color: #3a4252; }

/* ---- Narrow screens ---- */
@media (max-width: 900px) {
  .ways-grid, .systems, .why { grid-template-columns: 1fr; }
  .ways-grid { gap: 56px; max-width: 460px; }
  .need ul { grid-template-columns: 1fr 1fr; gap: 36px 0; }
  .need li:nth-child(3) { padding-left: 0; border-left: 0; }
  .hud { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .bar .wrap { gap: 14px; }
  .brand span { display: none; }
  .bar nav a { padding-inline: 8px; }
  .bar .button.small { padding: 9px 12px; }
  .hero { background-size: 230% auto; min-height: 0; }
  .hero .wrap { padding: 44px 0 72vw; }
  .hero .lead { font-size: 17px; }
  .ways { padding: 64px 0 72px; }
  .need ul { grid-template-columns: 1fr; gap: 28px; }
  .need li, .need li + li { padding: 0; border: 0; }
  .system { padding: 24px 20px; }
  footer nav { margin-left: 0; }
}
