:root {
  /* The app's own palette */
  --cream: #f5f0e8;
  --paper: #fbf8f2;
  --card: #eee6d8;
  --sage: #e2e4d4;
  --board: #56613f;
  --board-line: rgb(245 240 232 / 0.18);
  --olive: #737f53;
  --ink: #2e3128;
  --ink-2: #625f50;
  --on-board: #f5f0e8;
  --on-board-2: #d9dcc5;
  --pin: #a8774c;
  --pin-ink: #85593a;
  --wake: #fcf1c7;
  --wake-2: #f1d48e;
  --paper-hover: #fff;
  --board-hover: #4a5436;
  --sage-hover: #d5d8c2;

  --display: "Playfair Display SC", "Playfair Display", Georgia, serif;
  --text: "Playfair Display", Georgia, serif;
  --script: "Parisienne", "Playfair Display", cursive;
  --wordmark: "Birthstone", "Parisienne", cursive;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 78rem;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--olive) var(--cream);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--text);
  font-size: clamp(1.0625rem, 0.4vw + 0.98rem, 1.1875rem);
  line-height: 1.6;
  caret-color: var(--pin);
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--olive); color: var(--paper); }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid var(--pin);
  outline-offset: 3px;
  border-radius: 0.5rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem; top: 1rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-pill);
  transform: translateY(calc(-100% - 2rem));
  transition: transform 0.2s var(--ease-out);
}
.skip:focus { transform: none; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* ---------- Pills (the app's buttons) ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 3.5rem;
  padding: 0.85rem 1.75rem 0.95rem;
  border-radius: var(--radius-pill);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease-out), transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.pill__icon { width: 1.05em; height: 1.05em; fill: currentColor; flex: none; }

.pill--cream {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 1px rgb(30 34 22 / 0.12), 0 8px 24px -10px rgb(30 34 22 / 0.45);
}
.pill--cream:hover { background: var(--paper-hover); transform: translateY(-1px); box-shadow: 0 2px 2px rgb(30 34 22 / 0.12), 0 14px 30px -12px rgb(30 34 22 / 0.5); }
.pill--cream:active { transform: translateY(0); }

.pill--olive {
  background: var(--board);
  color: var(--paper);
  box-shadow: 0 1px 1px rgb(30 34 22 / 0.14), 0 8px 22px -10px rgb(30 34 22 / 0.5);
}
.pill--olive:hover { background: var(--board-hover); transform: translateY(-1px); box-shadow: 0 2px 2px rgb(30 34 22 / 0.14), 0 14px 28px -12px rgb(30 34 22 / 0.55); }
.pill--olive:active { transform: translateY(0); }

.pill--small { min-height: 2.75rem; padding: 0.55rem 1.2rem 0.65rem; font-size: 1rem; }

/* the store buttons: our own pills carrying each store's mark */
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.store { gap: 0.75rem; padding: 0.55rem 1.5rem 0.6rem 1.25rem; text-align: left; }
.store__logo { width: 1.6rem; height: 1.6rem; flex: none; }
.store__text { display: grid; line-height: 1.05; }
.store__small { font-family: var(--text); font-weight: 400; font-size: 0.75rem; letter-spacing: 0.02em; opacity: 0.8; }
.store__big { font-size: 1.1875rem; }

/* ---------- Route board (first viewport) ---------- */

/* the hero sits on the cream ground; its colours run through local tokens */
.board {
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --line: rgb(46 49 40 / 0.18);
  background: var(--cream);
  color: var(--fg);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.board__inner {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  margin-right: auto;
}

.brand__mark,
.close__mark {
  display: block;
  background: var(--board);
  -webkit-mask: url("assets/Naptime_white.png") center / 128% no-repeat;
          mask: url("assets/Naptime_white.png") center / 128% no-repeat;
}
.brand__mark { width: 3.5rem; height: 2.75rem; }
.close__mark { background: var(--on-board); }

.brand__word {
  font-family: var(--wordmark);
  font-size: 2.15rem;
  line-height: 1;
  padding-top: 0.2rem;
}

.topbar__links {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-size: 1.0625rem;
}
.topbar__links a { text-decoration: none; color: var(--fg-2); transition: color 0.2s; }
.topbar__links a:hover { color: var(--fg); text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  padding-top: clamp(2rem, 3.5vw, 3rem);
}

.hero__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.5rem, 3.6vw + 0.9rem, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.012em;
}
.hero__title span { display: block; white-space: nowrap; }

.hero__lede {
  max-width: 34em;
  margin: 1.25rem 0 0;
  color: var(--fg-2);
  font-size: clamp(1.125rem, 0.5vw + 1rem, 1.3125rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.6rem;
}

/* ---------- The timetable ---------- */

.route {
  margin-top: clamp(2rem, 3.5vw, 2.75rem);
  font-variant-numeric: oldstyle-nums tabular-nums;
}

.route__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 2px solid var(--fg);
}

.route__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.625rem;
  line-height: 1.1;
}

.route__sample {
  margin-left: 0.4rem;
  font-weight: 400;
  font-size: 1rem;
  color: var(--fg-2);
}

.route__pause {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--fg-2);
  font: 400 0.9375rem/1 var(--display);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.route__pause:hover { color: var(--fg); border-color: var(--fg-2); }
.route__pause svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.route__pause .icon-play { display: none; fill: currentColor; stroke: none; }
.route__pause[aria-pressed="true"] .icon-pause { display: none; }
.route__pause[aria-pressed="true"] .icon-play { display: block; }

.route__cols,
.stop {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 6.5rem 10.5rem;
  column-gap: 1.1rem;
  align-items: center;
}

.route__cols {
  padding: 0.7rem 0 0.55rem;
  font-family: var(--display);
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  color: var(--fg-2);
  border-bottom: 1px solid var(--line);
}
.route__cols > span:first-child { grid-column: 1 / 3; }
.route__cols > span:last-child { text-align: right; }

.route__rows { margin: 0; padding: 0; list-style: none; }
.route__rows li { border-bottom: 1px solid var(--line); }

.stop {
  position: relative;
  width: 100%;
  min-height: 4.125rem;
  padding: 0.55rem 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
}

/* the yellow wake layer, revealed with a wipe */
.stop::before {
  content: "";
  position: absolute;
  inset: 0 -1rem;
  z-index: -1;
  border-radius: 1.1rem;
  background: var(--wake);
  clip-path: inset(0 100% 0 0 round 1.1rem);
  transition: clip-path 0.55s var(--ease-out);
}

.stop__icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--sage);
  transition: background-color 0.3s;
}
.stop__icon svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.stop__name {
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.15;
}

.stop__radius {
  font-family: var(--display);
  font-size: 1.125rem;
  color: var(--fg-2);
}

.stop__status {
  justify-self: end;
  font-family: var(--display);
  font-size: 1.125rem;
  color: var(--fg-2);
  white-space: nowrap;
}

.stop:hover .stop__icon { background: var(--sage-hover); }
.stop:not([aria-pressed="true"]):hover .stop__status,
.stop:not([aria-pressed="true"]):focus-visible .stop__status { color: var(--fg); }

/* live row */
.stop[aria-pressed="true"] .stop__icon { background: var(--board); color: var(--on-board); }
.stop[aria-pressed="true"] .stop__status {
  color: var(--fg);
  font-weight: 700;
  font-size: 1.3125rem;
}
.stop[aria-pressed="true"] .stop__status::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin: 0 0.55rem 0.15rem 0;
  border-radius: 50%;
  background: var(--fg);
  vertical-align: middle;
}

.digits { display: inline-block; }
.digits.is-rolling { animation: roll 0.32s var(--ease-out); }

/* wake state */
.stop.is-waking { color: var(--ink); }
.stop.is-waking::before { clip-path: inset(0 0 0 0 round 1.1rem); }
.stop.is-waking .stop__radius { color: var(--ink-2); }
.stop.is-waking .stop__icon { background: var(--wake-2); color: var(--ink); }
.stop.is-waking .stop__icon svg { animation: ring 0.9s ease-in-out 2; transform-origin: 50% 20%; }
.stop.is-waking .stop__status { color: var(--ink); font-weight: 900; font-size: 1.375rem; }
.stop.is-waking .stop__status::before { background: var(--pin); animation: none; }

@keyframes roll {
  from { transform: translateY(-0.3em); opacity: 0.4; filter: blur(1.5px); }
  to   { transform: translateY(0); opacity: 1; filter: blur(0); }
}
@keyframes ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-14deg); }
  40% { transform: rotate(11deg); }
  60% { transform: rotate(-7deg); }
  80% { transform: rotate(4deg); }
}

/* ---------- Phones ---------- */

.hero__phone {
  margin: 0;
  align-self: center;
  justify-self: center;
  width: min(100%, 21rem);
}

.phone {
  position: relative;
  padding: 0.6rem;
  border-radius: 2.9rem;
  background: #23261e;
  box-shadow:
    0 2px 4px rgb(20 24 14 / 0.25),
    0 30px 60px -20px rgb(20 24 14 / 0.55),
    inset 0 0 0 1px rgb(255 255 255 / 0.08);
}
.phone img { border-radius: 2.35rem; background: var(--card); }

.phone--small {
  padding: 0.4rem;
  border-radius: 2rem;
  box-shadow: 0 2px 3px rgb(20 24 14 / 0.18), 0 18px 36px -18px rgb(20 24 14 / 0.45);
}
.phone--small img { border-radius: 1.65rem; }

/* ---------- How it works: the route line ---------- */

.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 2.6vw + 1rem, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.how {
  background: var(--board);
  color: var(--on-board);
  padding-block: clamp(4rem, 8vw, 7rem);
}

/* the route runs down the page; each step is a stop on it */
.line {
  --marker: 1.25rem;
  position: relative;
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  padding: 0 0 0 2.75rem;
  list-style: none;
}
.line::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: calc(var(--marker) / 2 - 2px);
  width: 4px;
  border-radius: 2px;
  background: rgb(217 220 197 / 0.45);
}

.line__stop { position: relative; padding-bottom: 3rem; }
.line__stop:last-child { padding-bottom: 0; }

.line__marker {
  position: absolute;
  left: -2.75rem;
  top: 0.35rem;
  width: var(--marker);
  height: var(--marker);
  border-radius: 50%;
  background: var(--board);
  border: 4px solid var(--on-board);
  transition: background-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.line__stop--wake .line__marker { border-color: var(--pin); background: var(--wake-2); }
.line__stop.is-active .line__marker { background: var(--on-board); transform: scale(1.2); }
.line__stop--wake.is-active .line__marker { background: var(--wake-2); transform: scale(1.35); }

.line__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.625rem, 1.2vw + 1.2rem, 2.25rem);
  line-height: 1.1;
}

.line__text {
  margin: 0.6rem 0 0;
  max-width: 26em;
  color: var(--on-board-2);
  font-size: clamp(1.0625rem, 0.4vw + 0.98rem, 1.25rem);
  line-height: 1.55;
}

.line__stop .phone { max-width: 15rem; margin-top: 1.5rem; }

/* the pinned phone: its screen is one strip of screenshots; --pos picks
   which one is on screen */
.how__screens {
  position: relative;
  aspect-ratio: 720 / 1560;
  border-radius: 2.35rem;
  overflow: hidden;
  background: var(--card);
}
.how__track {
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--pos, 0) * -100%));
  will-change: transform;
}
.how__track.is-snapping,
.line.is-snapping { transition: transform 0.55s var(--ease-out); }
.how__shot {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 !important;
}

@media (min-width: 47.5625rem) {
  .how { padding-bottom: 0; }

  .how__scroll {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2rem, 6vw, 6rem);
  }

  /* the phone stays in the middle of the screen while the steps scroll past */
  .how__stage {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .how__phone {
    width: min(100%, 20rem, calc((100svh - 6rem) / 2.2));
  }

  /* the extra room above the first step and below the last lets the phone
     hold on its first and last screen for a moment after pinning */
  .line { margin-top: 0; padding-block: 65svh 65svh; }
  .line::before { top: calc(65svh + 0.6rem); bottom: calc(65svh + 0.6rem); }
  .line__stop { padding-bottom: 0; will-change: opacity, transform; }
  .line__stop + .line__stop { margin-top: 30svh; }
  .line__stop .phone { display: none; }
}

/* ---------- Common questions ---------- */

.faq {
  padding-block: clamp(4rem, 8vw, 7rem);
  background: var(--card);
}

.faq__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 2rem clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.faq__list {
  border-top: 2px solid var(--ink);
  font-variant-numeric: oldstyle-nums tabular-nums;
}

.faq__cols,
.qa__q {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9.5rem 1.4rem;
  column-gap: 1.25rem;
  align-items: center;
}

.faq__cols {
  padding: 0.7rem 0 0.55rem;
  border-bottom: 1px solid rgb(46 49 40 / 0.18);
  font-family: var(--display);
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.faq__cols span:last-child { grid-column: 2 / 4; text-align: right; padding-right: 2.65rem; }

.qa { border-bottom: 1px solid rgb(46 49 40 / 0.18); }

.qa__q {
  padding: 1.2rem 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3125rem;
  line-height: 1.25;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s;
}
.qa__q::-webkit-details-marker { display: none; }

.qa__status {
  justify-self: end;
  font-weight: 400;
  font-size: 1.125rem;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.2s;
}
.qa[open] .qa__status { color: var(--ink); font-weight: 700; }
.qa__q:hover { color: var(--board); }

.qa__icon {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: var(--pin-ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  transition: transform 0.35s var(--ease-out);
}
.qa[open] .qa__icon { transform: rotate(45deg); }

.qa__a {
  margin: -0.35rem 0 1.4rem;
  max-width: 36em;
  color: var(--ink-2);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* ---------- Footer: the end of the line, one olive field ---------- */

.footer {
  background: var(--board);
  color: var(--on-board-2);
  padding-block: 2.25rem 1.5rem;
  font-size: 1rem;
}

.footer a { font-family: var(--display); }

/* home: the last stop, the route and the links fill one screen */
.footer--full {
  box-sizing: border-box;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-block: clamp(3rem, 8svh, 6rem) 1.75rem;
}
.footer--full > .wrap { flex: 1; display: flex; flex-direction: column; }
.footer--full .terminus { margin-block: auto; }
.footer--full .close__title { font-size: clamp(2.3rem, 3.4vw + 1rem, 4.5rem); }
.footer--full .footer__route { margin-top: clamp(3rem, 8svh, 6rem); }

/* the route's last stop: one timetable row, the install is its action */
.terminus {
  display: grid;
  border-top: 2px solid var(--on-board);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem clamp(1.5rem, 3vw, 3rem);
  padding-block: clamp(1.75rem, 3.5vw, 2.75rem);
  border-bottom: 1px solid var(--board-line);
}

.close__mark { width: clamp(5rem, 8vw, 7.5rem); height: clamp(4rem, 6.4vw, 6rem); }

.close__title {
  margin: 0;
  color: var(--on-board);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 2.8vw + 1rem, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* a dashed route from Work to your stop, with the bus driving it */
.footer__route {
  position: relative;
  container-type: inline-size;
  padding-top: 2.2rem;
  margin-bottom: 1.75rem;
}
.footer__route::before {
  content: "";
  position: absolute;
  top: calc(2.2rem + 0.45rem - 1px);
  left: 0.45rem;
  right: 0.55rem;
  border-top: 2px dashed rgb(245 240 232 / 0.4);
}

.footer__stops {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}
.footer__stops li { display: flex; flex-direction: column; gap: 0.5rem; }
.footer__stops li:first-child { align-items: flex-start; }
.footer__stops li:last-child { align-items: flex-end; }
.footer__stops li::before {
  content: "";
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--board);
  border: 3px solid var(--on-board);
}
.footer__stop--end { color: var(--on-board); font-weight: 700; }
.footer__stops .footer__stop--end::before { width: 1.1rem; height: 1.1rem; margin-top: -0.1rem; background: var(--wake-2); border-color: var(--pin); }

.footer__bus {
  position: absolute;
  top: 0;
  left: 0;
  width: 3.25rem;
  height: 2.2rem;
  background: var(--on-board);
  -webkit-mask: url("assets/Naptime_white.png") center / 128% no-repeat;
          mask: url("assets/Naptime_white.png") center / 128% no-repeat;
  animation: drive 14s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes drive {
  0%   { transform: translateX(0); opacity: 0; }
  6%   { opacity: 1; }
  78%  { transform: translateX(calc(100cqw - 3.25rem)); opacity: 1; }
  92%  { transform: translateX(calc(100cqw - 3.25rem)); opacity: 1; }
  100% { transform: translateX(calc(100cqw - 3.25rem)); opacity: 0; }
}

.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 2rem clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.footer__word { display: block; font-family: var(--wordmark); font-size: 2.15rem; color: var(--on-board); line-height: 1; }
.footer__brand p { margin: 0.6rem 0 0; font-size: 1.0625rem; }
.footer__legal { margin-top: 0.35rem !important; font-size: 0.9375rem; }

.footer__head {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  color: var(--on-board-2);
}
.footer__col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.2rem; }
.footer__col a { color: var(--on-board); text-decoration: none; font-size: 1.0625rem; }
.footer__col a:hover { text-decoration: underline; }

.footer__side { display: grid; justify-items: end; gap: 0.9rem; }

/* the social marks, beige line glyphs straight on the olive field */
.socials { display: flex; gap: 0.5rem; }
.insta {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--on-board);
  border-radius: 0.5rem;
  transition: color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.insta svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.insta:hover { color: var(--paper-hover); transform: translateY(-2px) rotate(-6deg); }

/* the same marks in ink, on the light coming-soon note */
.socials--note { margin: 0.9rem 0 0 -0.4rem; }
.socials--note .insta { color: var(--ink); }
.socials--note .insta:hover { color: var(--olive); }

/* ---------- Legal pages ---------- */

.board--doc { padding-bottom: 0; }

/* short legal pages keep the footer on the floor of the viewport */
.page-doc { min-height: 100svh; display: flex; flex-direction: column; }
.page-doc .doc { flex: 1 0 auto; }

.doc {
  width: min(100% - 2 * var(--gutter), 46rem);
  margin-inline: auto;
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(4rem, 8vw, 7rem);
}

.doc__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 3vw + 1.2rem, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.doc__meta {
  margin: 0.9rem 0 0;
  padding-bottom: 1.4rem;
  border-bottom: 2px solid var(--ink);
  font-family: var(--display);
  color: var(--ink-2);
}

.doc__body { margin-top: 2.25rem; max-width: 68ch; }
.doc__body p { margin: 0 0 1.1rem; }
.doc__body h2 {
  margin: 2.75rem 0 1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}
.doc__body h3 {
  margin: 1.8rem 0 0.7rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--ink-2);
}
.doc__body ul { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.doc__body li { margin-bottom: 0.45rem; }
.doc__body > :first-child { margin-top: 0; }

/* the contents list is plain, unlinked text */
.doc__body .doc__toc { list-style: none; padding-left: 0; }
.doc__body .doc__toc li { margin-bottom: 0.25rem; font-family: var(--display); }
.doc__body p,
.doc__body li { overflow-wrap: break-word; }

/* a to-do that cannot be mistaken for the final text */
.todo {
  padding: 1.4rem 1.6rem 1.5rem;
  border-radius: 1.1rem;
  background: var(--wake);
  box-shadow: inset 0 0 0 1px var(--wake-2);
}
.todo__label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.125rem;
}
.todo p { margin: 0; }
.todo p + p { margin-top: 0.7rem; }

.doc__other { margin-top: 2.5rem; font-family: var(--display); }

/* the support form */
.form { display: grid; gap: 1.25rem; }
.form__field { display: grid; gap: 0.4rem; }
.form label { font-family: var(--display); font-weight: 700; }
.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--ink-2);
  border-radius: 0.9rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.form textarea { resize: vertical; min-height: 9rem; }
.form input:focus-visible,
.form select:focus-visible,
.form textarea:focus-visible { outline: 2px solid var(--pin); outline-offset: 2px; border-radius: 0.9rem; }
.form__submit { justify-self: start; border: 0; cursor: pointer; }
.form__status { margin: 0; color: var(--ink-2); }
.form__status:empty { display: none; }

/* the launch sign-up on the coming-soon page */
.signup { margin-top: 2.75rem; }
.doc__body .signup__title { margin: 0; }
.form .signup__error { margin: 0; color: var(--pin-ink); font-size: 0.95rem; }
.signup__error:empty { display: none; }
.form input[aria-invalid="true"] { border-color: var(--pin-ink); box-shadow: inset 0 0 0 1px var(--pin-ink); }
.form__submit:disabled { opacity: 0.6; cursor: progress; transform: none; }
.doc__body .signup__note { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

/* ---------- Responsive ---------- */

@media (max-width: 68rem) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); }
  .route__cols, .stop { grid-template-columns: 3rem minmax(0, 1fr) 5.5rem 9rem; column-gap: 0.85rem; }
  .faq__grid { grid-template-columns: 1fr; }
}

@media (max-width: 47.5rem) {
  .topbar { gap: 1rem; }
  .topbar__links { display: none; }
  .brand__mark { width: 3rem; height: 2.4rem; }
  .brand__word { font-size: 1.9rem; }

  .hero { grid-template-columns: 1fr; padding-top: 2.25rem; }
  .hero__title { font-size: clamp(2.5rem, 10.5vw, 3.5rem); }
  .hero__title { text-wrap: balance; }
  .hero__title span { display: inline; white-space: normal; }
  .hero__actions .pill { width: 100%; }
  .hero__actions { gap: 0.9rem; justify-content: center; }
  .hero__actions .badges { justify-content: center; width: 100%; }
  .badges .store { flex: 1 1 12rem; justify-content: center; }

  .route__cols { display: none; }
  .route__cols, .stop {
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    column-gap: 0.85rem;
  }
  .stop__icon { width: 2.75rem; height: 2.75rem; }
  .stop__name { font-size: 1.25rem; }
  .stop { grid-template-rows: auto auto; row-gap: 0.1rem; }
  .stop__icon, .stop__status { grid-row: 1 / 3; }
  .stop__name { grid-column: 2; grid-row: 1; align-self: end; }
  .stop__radius { grid-column: 2; grid-row: 2; align-self: start; font-size: 1rem; }
  .stop__radius::before { content: "Alarm at "; }
  .stop__status { font-size: 1rem; }
  .stop[aria-pressed="true"] .stop__status { font-size: 1.125rem; }
  .stop.is-waking .stop__status { font-size: 1.1875rem; }
  .stop::before { inset: 0 -0.6rem; }

  /* the first screen is the hero alone: no phone, at least one screen tall */
  .hero__phone { display: none; }
  .board:not(.board--doc) { min-height: 100svh; display: flex; flex-direction: column; }
  .board:not(.board--doc) .board__inner { flex: 1; display: flex; flex-direction: column; }
  .hero { flex: 1; align-content: center; }

  /* How it works: the title, the route and the phone are pinned to one
     screen; scrolling down slides the route sideways and snaps the phone
     through the screenshots, then lets go into the next section */
  .how {
    --how-steps: 4;
    --how-hold: 25svh; /* scroll held on the first and last screen; HOLD in script.js */
    --step-w: 72vw;
    height: calc(100svh + 2 * var(--how-hold) + (var(--how-steps) - 1) * 75svh);
    padding-block: 0;
    overflow-x: clip; /* the route runs off the screen edges, not the gutter */
  }
  .how > .wrap {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    padding-block: 1.5rem 1.25rem;
  }
  .how .section-title { font-size: clamp(1.75rem, 8vw, 2.25rem); }

  .how__scroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .line {
    order: 1;
    display: flex;
    width: max-content;
    margin: 1.25rem 0 0;
    padding: 0;
    transform: translateX(var(--line-x, 0px));
    will-change: transform;
  }
  .line::before {
    top: calc(var(--marker) / 2 - 2px);
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 4px;
  }
  .line__stop {
    flex: 0 0 var(--step-w);
    width: var(--step-w);
    padding: 2.1rem 1.25rem 0 0;
    opacity: 0.4;
    transition: opacity 0.3s var(--ease-out);
  }
  .line__stop.is-active { opacity: 1; }
  .line__marker { left: 0; top: 0; }
  .line__name { font-size: 1.5rem; }
  .line__text { margin-top: 0.4rem; font-size: 1.0625rem; line-height: 1.45; }
  .line__stop .phone { display: none; }

  .how__stage {
    order: 2;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .how__phone {
    height: 100%;
    aspect-ratio: 740 / 1580;
    padding: 0.45rem;
    border-radius: 2.1rem;
  }
  .how__screens { height: 100%; aspect-ratio: auto; border-radius: 1.7rem; }


  .qa__q { font-size: 1.1875rem; grid-template-columns: minmax(0, 1fr) 1.4rem; row-gap: 0.25rem; }
  .qa__text { grid-column: 1; }
  .qa__status { grid-column: 1; grid-row: 2; justify-self: start; font-size: 1rem; }
  .qa__icon { grid-column: 2; grid-row: 1 / 3; }
  .faq__cols { display: none; }

  .terminus { grid-template-columns: 1fr; justify-items: start; }
  .terminus__action { width: 100%; }

  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand, .footer__side { grid-column: 1 / -1; }
  .footer__side { justify-items: start; grid-auto-flow: column; justify-content: space-between; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .line__stop { opacity: 1 !important; transform: none !important; }
  .footer__bus { animation-name: none; transform: translateX(calc(50cqw - 1.6rem)); }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
