/* Potential Centre: coming-soon page
   World: the road. The hero is a stretch of asphalt with "Coming soon" painted on it
   and double yellow lines along the kerb; below, a centre line becomes the route the
   features sit on.
   Light page only: the logo is a JPEG on white, so it always sits on white.
   Shapes: road panel 28px, card 20px, inputs 12px, buttons and choices full pill.
   Gold (the logo star) is a fill or a line, never text on white. */

:root {
  --navy: #002a60;          /* logo "Potential" */
  --navy-deep: #001b40;
  --asphalt: #0f1d33;       /* navy-tinted road surface */
  --asphalt-line: #f3f5f9;  /* road paint */
  --on-asphalt: #ffffff;
  --on-asphalt-soft: #b6c1d4; /* 9.6:1 on asphalt */
  --gold: #f6b72c;          /* logo star, double yellow lines */
  --paper: #ffffff;
  --mist: #f0f3f8;
  --slate: #4f5668;         /* 7.3:1 on white */
  --line: #d6dce6;
  --line-strong: #8a93a3;
  --error: #b42318;

  --r-road: 28px;
  --r-card: 20px;
  --r-input: 12px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --gutter: max(20px, env(safe-area-inset-left));
  --max: 1200px;

  color-scheme: light;
  accent-color: var(--navy);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--gold); color: var(--navy-deep); }

h1, h2, h3, p { margin: 0; }
ol, ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

/* Shared press: every control answers a tap */
.top-cta, .submit, .choice span {
  transition-property: transform, background-color, border-color, color;
  transition-duration: 140ms, 150ms, 150ms, 150ms;
  transition-timing-function: var(--ease-out), ease, ease, ease;
}
.top-cta:active, .submit:active, .choice:active span { transform: scale(0.97); }

/* ---------- Header ---------- */

.top {
  max-width: var(--max);
  margin: 0 auto;
  height: 72px;
  padding: max(8px, env(safe-area-inset-top)) var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: block; margin-left: -6px; border-radius: 8px; }
.brand img { display: block; height: 46px; width: auto; mix-blend-mode: multiply; }

.top-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .top-cta:hover { background: var(--navy); color: var(--paper); }
}
@media (max-width: 420px) { .top-cta { display: none; } }

/* ---------- The road (hero) ---------- */

.road {
  position: relative;
  margin: 0 10px;
  border-radius: var(--r-road);
  background: var(--asphalt);
  color: var(--on-asphalt);
  overflow: hidden;
}
@media (min-width: 760px) { .road { margin: 0 20px; } }

.road-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 16px 54px;
  display: grid;
  gap: 24px;
}

@media (min-width: 1000px) {
  .road-inner {
    grid-template-columns: minmax(0, 1fr) 400px;
    column-gap: 64px;
    align-items: center;
    padding: 56px 40px 88px;
  }
}

/* Road lettering: tall, condensed, white paint, uppercase because road
   markings are. One line on phones, stacked on wide screens. */
.painted {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.22em;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(3.875rem, 1.6rem + 8.4vw, 9.5rem);
  line-height: 0.84;
  letter-spacing: 0.01em;
  color: var(--asphalt-line);
}
@media (min-width: 1000px) { .painted { flex-direction: column; } }

.word { display: block; }

.road h1 {
  margin-top: 26px;
  max-width: 18ch;
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.75rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lede {
  margin-top: 12px;
  max-width: 44ch;
  color: var(--on-asphalt-soft);
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.125rem);
  text-wrap: pretty;
}

/* Double yellow lines along the kerb */
.kerb {
  position: absolute;
  left: 20px; right: 20px; bottom: 20px;
  height: 12px;
  background: linear-gradient(var(--gold) 0 4px, transparent 4px 8px, var(--gold) 8px 12px);
  border-radius: 2px;
  transform-origin: left;
}
@media (min-width: 1000px) { .kerb { left: 40px; right: 40px; bottom: 30px; } }

/* ---------- Sign-up card ---------- */

.signup {
  padding: 22px 18px 20px;
  border-radius: var(--r-card);
  background: var(--paper);
  color: var(--navy);
  box-shadow: 0 24px 48px -20px rgb(0 0 0 / 0.5), 0 2px 6px rgb(0 0 0 / 0.18);
}
@media (min-width: 1000px) { .signup { padding: 28px 26px 26px; } }

.signup-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.015em; }

form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }

label, legend { font-size: 0.9375rem; font-weight: 600; padding: 0; }
legend { margin-bottom: 6px; }

input[type="text"], input[type="email"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-input);
  background: var(--paper);
  color: var(--navy);
  caret-color: var(--navy);
  font: inherit;
  font-size: 1rem; /* 16px stops iOS zooming on focus */
  transition-property: border-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease;
}
input[type="text"]:focus-visible, input[type="email"]:focus-visible {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgb(0 42 96 / 0.18);
}
input[aria-invalid="true"] { border-color: var(--error); }
input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px rgb(180 35 24 / 0.18); }

.error { color: var(--error); font-size: 0.875rem; font-weight: 500; }
.error:empty { display: none; }

.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}
.choice input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--paper); font-weight: 600; }
.choice input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Small phones: keep all three roles on one row */
@media (max-width: 400px) {
  .choices { gap: 5px; }
  .choice span { padding: 0 11px; font-size: 0.875rem; }
}

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.submit {
  margin-top: 2px;
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: var(--paper);
  font-size: 1.0625rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.submit[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.submit:disabled { cursor: progress; }

@media (hover: hover) and (pointer: fine) {
  .submit:hover { background: var(--navy-deep); }
  .choice:hover input:not(:checked) + span { border-color: var(--navy); }
}

.form-status { color: var(--error); font-size: 0.9375rem; font-weight: 500; }
.form-status:empty { display: none; }

.done { display: grid; justify-items: start; gap: 8px; padding: 6px 0; }
.done[hidden] { display: none; }
.done:focus { outline: none; }
.done h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.done p { color: var(--slate); }

/* ---------- The route ---------- */

.route {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px var(--gutter) 40px;
}
@media (min-width: 1000px) { .route { padding-top: 112px; } }

.route h2, .ask h2 {
  font-size: clamp(1.875rem, 1.3rem + 2.2vw, 2.875rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}

.stops {
  --line-x: 11px;
  position: relative;
  margin-top: 40px;
  padding-left: 48px;
  display: grid;
  gap: 40px;
}

/* the centre line */
.stops::before {
  content: "";
  position: absolute;
  left: var(--line-x); top: 6px; bottom: 6px;
  width: 4px;
  margin-left: -2px;
  background: repeating-linear-gradient(180deg, var(--navy) 0 22px, transparent 22px 40px);
  transform-origin: top;
}

.stop { position: relative; }

/* the stop marker sits on the line */
.stop::before {
  content: "";
  position: absolute;
  left: calc(var(--line-x) - 48px - 9px);
  top: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--navy);
  transition-property: background-color, transform;
  transition-duration: 300ms;
  transition-timing-function: var(--ease-out);
}
.stop.seen::before { background: var(--gold); }

.old { color: var(--slate); font-size: 1.0625rem; font-weight: 500; }
.old s { text-decoration: none; position: relative; }
.old s::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; top: 55%;
  height: 2px;
  background: var(--navy);
  transform-origin: left;
}

.stop h3 { margin-top: 6px; font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.stop > p:last-child { margin-top: 6px; color: var(--slate); max-width: 40ch; text-wrap: pretty; }

/* Wide screens: the line runs down the middle and stops alternate either side */
@media (min-width: 860px) {
  .stops {
    --gap: 64px;
    padding-left: 0;
    grid-template-columns: 1fr 1fr;
    column-gap: calc(var(--gap) * 2);
    row-gap: 0;
  }
  .stops::before { left: 50%; }
  .route h2 { text-align: center; }
  .stops { margin-top: 56px; }
  .stop:nth-child(odd) { grid-column: 1; text-align: right; }
  .stop:nth-child(odd) > p:last-child { margin-left: auto; }
  .stop:nth-child(even) { grid-column: 2; }
  .stop:nth-child(1) { grid-row: 1; }
  .stop:nth-child(2) { grid-row: 2; margin-top: -24px; }
  .stop:nth-child(3) { grid-row: 3; margin-top: 8px; }
  .stop:nth-child(4) { grid-row: 4; margin-top: -24px; }
  .stop:nth-child(odd)::before { left: auto; right: calc(-1 * var(--gap) - 9px); }
  .stop:nth-child(even)::before { left: calc(-1 * var(--gap) - 9px); }
  .stop:nth-child(odd) .old s::after { transform-origin: right; }
}

/* ---------- Questions ---------- */

.ask {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px var(--gutter) 88px;
}
.ask p { margin-top: 12px; color: var(--slate); font-size: 1.0625rem; max-width: 48ch; }
.ask a { color: var(--navy); font-weight: 700; overflow-wrap: anywhere; }

@media (min-width: 860px) {
  .ask { text-align: center; padding: 72px var(--gutter) 120px; }
  .ask p { margin-inline: auto; }
}

/* ---------- Footer ---------- */

.foot { border-top: 1px solid var(--line); padding: 22px var(--gutter) max(22px, env(safe-area-inset-bottom)); }
.foot p { max-width: var(--max); margin: 0 auto; color: var(--slate); font-size: 0.875rem; }

/* ---------- Motion ----------
   1. Page load (one sequence): the road settles, the lettering is painted on
      left to right, the copy and card follow, then the yellow lines are drawn.
   2. Scroll (one moment): the centre line draws as you travel down the route,
      and each stop's old way is struck through as you reach it.
   Reduced motion keeps fades and drops all movement. */

@media (prefers-reduced-motion: no-preference) {
  .road { animation: settle 600ms var(--ease-out) both; }
  .word { animation: paint 720ms var(--ease-in-out) both; }
  .word:nth-child(1) { animation-delay: 260ms; }
  .word:nth-child(2) { animation-delay: 520ms; }
  .enter { animation: rise 640ms var(--ease-out) both; animation-delay: calc(var(--i) * 90ms + 520ms); }
  .kerb { animation: draw-x 1000ms var(--ease-in-out) 900ms both; }

  .js .old s::after { transform: scaleX(0); transition: transform 520ms var(--ease-in-out) 160ms; }
  .js .stop.seen .old s::after { transform: scaleX(1); }

  @supports (animation-timeline: view()) {
    .stops::before {
      animation: draw-y linear both;
      animation-timeline: view();
      animation-range: entry 20% cover 70%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .road, .word, .enter, .kerb { animation: fade 300ms ease both; }
}

@keyframes settle { from { opacity: 0; transform: translateY(16px) scale(0.985); } }
@keyframes paint  { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rise   { from { opacity: 0; transform: translateY(14px); } }
@keyframes draw-x { from { transform: scaleX(0); } }
@keyframes draw-y { from { transform: scaleY(0); } }
@keyframes fade   { from { opacity: 0; } }
