/* holdmy.bike: the V2 design system on the web (docs/05-design-system.md).
   Paper, ink and one orange accent for what is live; 1 px rules instead of cards and shadows. */

@font-face {
  font-family: "Manrope";
  src: url("/fonts/Manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #FAFAF7;
  --ink: #17181A;
  --ink2: #6B6C69;
  --hairline: #E4E4DF;
  --rule: #C9C9C3;
  --silhouette: #EFEFEA;
  --past: #ECECE7;
  --friend: #A3A39E;
  --accent: #FF4D1C;
  --accent-text: #D63A0E;
  --gutter: 20px;
  color-scheme: light;
}

@media (min-width: 720px) {
  :root { --gutter: 40px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

p, h1, h2, figure { margin: 0; }

a { color: inherit; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.muted { color: var(--ink2); }
.small { font-size: 13px; }

.label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink2);
}

.lead {
  font-size: 18px;
  line-height: 1.55;
  max-width: 34em;
}

.section-title {
  font-size: clamp(30px, 4.4vw, 48px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: 2px;
}

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-word { width: 129px; height: 10.5px; flex: none; }

.top-status {
  font-size: 13px;
  color: var(--ink2);
  white-space: nowrap;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 88px;
}

.hero-text { display: grid; gap: 20px; align-content: start; }

h1 {
  font-size: clamp(42px, 6.6vw, 76px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 9em;
}

.facts {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--hairline);
  max-width: 30em;
}

.facts li {
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
}

@media (min-width: 940px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: 64px;
    padding-top: 72px;
    padding-bottom: 120px;
  }
}

/* The live ride, as the app draws it */

.ride {
  border: 1px solid var(--hairline);
  border-radius: 32px;
  padding: 22px 18px 20px;
  max-width: 440px;
  width: 100%;
  justify-self: center;
}

.ride-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

.ride-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  font-size: 13px;
}

@media (min-width: 400px) {
  .ride { padding: 24px 22px 22px; }
  .ride-head { font-size: 14px; }
}

.ride-name { font-weight: 500; }

.chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  vertical-align: 1px;
}

.readout {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  padding-top: 8px;
}

.readout-num {
  font-size: clamp(104px, 30vw, 136px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.readout-unit {
  font-size: 30px;
  font-weight: 300;
  color: var(--ink2);
}

.ruler { display: block; width: 100%; height: auto; overflow: visible; }
.ruler text { font-family: "Manrope", sans-serif; font-size: 11px; fill: var(--ink2); }

.ride-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.gauge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}

.gauge + .gauge { border-left: 1px solid var(--hairline); padding-left: 18px; }

.crank { width: 56px; height: 56px; flex: none; }
.heart { width: 44px; height: 44px; flex: none; margin: 6px; }

.gauge-num { font-size: 30px; font-weight: 300; line-height: 1; }
.gauge-unit { font-size: 13px; color: var(--ink2); margin-left: 5px; }

.ride-land { display: block; width: 100%; height: auto; }

.ride-foot { display: grid; gap: 2px; }

/* Motion: only what means something (cadence, pulse, the live dot) */

.spin { transform-box: fill-box; transform-origin: center; animation: spin 0.66s linear infinite; }
.beat { transform-box: fill-box; transform-origin: center; animation: beat 0.37s ease-in-out infinite alternate; }
.breathe { transform-box: fill-box; transform-origin: center; animation: breathe 2.4s ease-in-out infinite; }
.bob { animation: bob 0.66s ease-in-out infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes beat { to { transform: scale(1.75); } }
@keyframes breathe { 50% { transform: scale(1.3); } }
@keyframes bob { 50% { transform: translateY(-1.6px); } }

@media (prefers-reduced-motion: reduce) {
  .spin, .beat, .breathe, .bob { animation: none; }
}

/* Features */

.features {
  display: grid;
  gap: 24px;
  padding-bottom: clamp(72px, 10vw, 104px);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--ink);
}

.grid article {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--hairline);
}

.grid h2 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.grid p { font-size: 15px; color: var(--ink2); max-width: 30em; }

@media (min-width: 720px) {
  .grid { grid-template-columns: 1fr 1fr; column-gap: 40px; }
}

@media (min-width: 1040px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; column-gap: 48px; }
}

/* Workout landscape */

.landscape {
  display: grid;
  gap: 20px;
  padding-bottom: clamp(72px, 10vw, 112px);
}

.land { margin-top: 28px; }

.land-art {
  position: relative;
  height: clamp(130px, 19vw, 210px);
}

.land-art > svg:first-child {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.land-target {
  position: absolute;
  right: 0;
  top: calc(20.45% - 22px);
  font-size: 13px;
  color: var(--accent-text);
}

.land-n {
  position: absolute;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--ink2);
}

/* The rider stands on the second hill (top at y 22.5 of 110) with the position line through its middle. */
.land-rider {
  position: absolute;
  top: calc(20.45% - 29px);
  width: 40px;
  height: 30px;
  margin-left: -20px;
  overflow: visible;
}

.land-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
}

/* Closing and footer */

.closing {
  display: grid;
  gap: 16px;
  padding-top: 56px;
  padding-bottom: clamp(88px, 11vw, 120px);
  border-top: 1px solid var(--ink);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 40px;
  border-top: 1px solid var(--hairline);
}

.foot-brand { display: flex; align-items: center; gap: 14px; }
.foot-mark { width: 52px; height: 52px; flex: none; }
.foot-word { display: block; width: 172px; height: 14px; }

/* 404 */

.missing {
  display: grid;
  gap: 20px;
  align-content: center;
  min-height: 100vh;
  padding-top: 40px;
  padding-bottom: 80px;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  text-underline-offset: 4px;
}

.foot-domain {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink2);
}
