/* Refyl: the carriageway seen from above. Asphalt ground, road paint, lanes. */
@font-face {
  font-family: "Road";
  src: url("fonts/big-shoulders-display-latin-900.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "Road";
  src: url("fonts/big-shoulders-display-latin-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --asphalt: #4E5154;
  --asphalt-deep: #313437;
  --paint: #EEEDE6;
  --paint-muted: #CFCEC6;
  --yellow: #F2C230;
  --on-yellow: #23221E;
  --green: #30D158;
  --on-green: #08130B;
  --stale: #FFBE5C;
  --line: 10px;
  --gutter: clamp(16px, 4vw, 56px);
  --road: "Road", "Arial Narrow", sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045 .09' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -14 0 0 0 10.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--paint-muted) var(--asphalt-deep); }
body {
  margin: 0;
  background: var(--asphalt) url("asphalt.webp");
  color: var(--paint);
  font: 17px/1.55 var(--text);
}
::selection { background: var(--yellow); color: var(--on-yellow); }
a { color: var(--paint); text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--yellow); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--yellow); color: var(--on-yellow); padding: 10px 14px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.skip:hover { color: var(--on-yellow); }
h1, h2, h3, .step b { text-wrap: balance; }
p, li { text-wrap: pretty; }
a, button, label, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Painted lettering: stretched tall like words on the road, slightly worn */
.paint {
  padding-top: 0.12em;
  font-family: var(--road);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.82;
  letter-spacing: 0.01em;
  color: var(--paint);
  -webkit-mask: var(--wear);
          mask: var(--wear);
}
.stretch { display: inline-block; transform: scaleY(1.65); transform-origin: 0 0; margin-bottom: 0.62em; }

/* Header: the kerb */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  border-bottom: var(--line) solid var(--paint);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span { font-family: var(--road); font-weight: 900; font-size: 30px; letter-spacing: 0.02em; text-transform: uppercase; }
.top nav { display: flex; gap: clamp(12px, 2.4vw, 28px); font-size: 15px; font-weight: 600; }
.top nav a { text-decoration: none; padding: 6px 0; border-bottom: 3px solid transparent; }
.top nav a[aria-current] { border-bottom-color: var(--yellow); }

/* The road: two lanes separated by a dashed centre line */
.road {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--line) minmax(0, 1.12fr);
  min-height: min(calc(100svh - 80px), 940px);
}
.centre { background: repeating-linear-gradient(var(--paint) 0 64px, transparent 64px 118px) 0 var(--drive, 0px); -webkit-mask: var(--wear); mask: var(--wear); }
.lane-l { padding: clamp(28px, 5vh, 64px) var(--gutter) 40px; display: flex; flex-direction: column; gap: 22px; }
.lane-r { position: relative; overflow: clip; background: linear-gradient(rgba(28, 30, 32, 0.4), rgba(28, 30, 32, 0.4)), url("asphalt.webp"); min-height: 520px; }

.hero-word { font-size: clamp(64px, 8.6vw, 128px); margin: 0; padding-top: 0.2em; }
.hero-word .stretch { margin-bottom: 1.1em; }
.intro { font-size: clamp(17px, 1.5vw, 20px); max-width: 32em; margin: 0; color: var(--paint); }
.intro small { display: block; margin-top: 6px; font-size: 14px; color: var(--paint-muted); }

/* Fuel lanes: radio inputs drawn as painted lanes with arrows */
.lanes { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.lanes legend { font-size: 14px; color: var(--paint-muted); margin-bottom: 8px; padding: 0; }
.lane { position: relative; display: block; cursor: pointer; }
.lane + .lane { border-left: 4px dashed var(--paint-muted); }
.lane input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.lane span {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px 12px;
  font-family: var(--road); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: 0.03em;
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s;
}
.lane svg { width: 18px; height: 48px; fill: currentColor; transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.lane:hover svg { transform: translateY(-4px); }
.lane input:checked + span { background: var(--yellow); color: var(--on-yellow); }
.lane input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 3px; }

.ask { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 800 19px/1 var(--text);
  padding: 15px 20px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--paint); color: var(--on-yellow);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s;
}
.btn:hover { color: var(--on-yellow); background: var(--yellow); transform: translateY(-2px); }
.btn.green { background: var(--green); color: var(--on-green); }
.btn.green:hover { color: var(--on-green); background: var(--green); }
/* not a control: a works-zone word painted in yellow until the app is live */
.soon { margin: 0; font-size: clamp(28px, 9vw, 64px); white-space: nowrap; color: var(--yellow); }
.soon .stretch { margin-bottom: 0.55em; }
.btn:active { transform: translateY(0); }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.city { display: flex; flex: 1 1 220px; min-width: 0; min-height: 52px; border: 3px solid var(--paint); }
.city input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--paint);
  font: 600 17px var(--text); padding: 0 14px; caret-color: var(--yellow);
}
.city input::placeholder { color: var(--paint-muted); }
.city input::-webkit-calendar-picker-indicator { display: none !important; }
.city input:focus { outline: none; }
.city:focus-within { border-color: var(--yellow); }
.city button { border: 0; background: var(--paint); color: var(--asphalt); font: 800 16px var(--text); padding: 0 16px; cursor: pointer; }
.city button:hover { background: var(--yellow); }

.status { min-height: 1.5em; margin: 0; font-size: 15px; color: var(--paint-muted); }
.status.err { color: var(--stale); }

/* Results: the cheapest nearby, painted like a road word, then the next ones */
.best[hidden], .results[hidden] { display: none; }
.best { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: end; }
.best .price { grid-row: span 2; font-size: clamp(76px, 7vw, 108px); color: var(--green); margin: 0; }
.best .price .stretch { margin-bottom: 0.5em; }
.best .unit { font-size: clamp(18px, 0.32em, 36px); margin-left: 4px; }
.best h2 { margin: 0; font-size: 21px; line-height: 1.2; }
.best p { margin: 0; color: var(--paint-muted); font-size: 15px; }
.delta { color: var(--paint); font-weight: 700; }
.go { margin-top: 6px; grid-column: 1 / -1; justify-self: start; }

.results { list-style: none; margin: 0; padding: 0; border-top: 4px solid var(--paint); }
.results li { border-bottom: 2px dashed var(--paint-muted); }
.results button {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left;
  background: none; border: 0; color: var(--paint); padding: 10px 2px; cursor: pointer; font: inherit;
}
.results button:hover .n { color: var(--yellow); }
.results button[aria-current="true"] .p { color: var(--yellow); }
.results button[aria-current="true"] .n::before { content: ""; display: inline-block; width: 0; height: 0; margin-right: 8px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid var(--yellow); vertical-align: 1px; }
.results .n { font-weight: 650; font-size: 16px; }
.results .m { grid-column: 1; font-size: 14px; color: var(--paint-muted); }
.results .p { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-family: var(--road); font-weight: 900; font-size: 34px; font-variant-numeric: tabular-nums; }
.stale-tag { color: var(--stale); }
.results .old .p { color: var(--paint-muted); -webkit-mask: var(--wear); mask: var(--wear); }

/* The price rail: every station on one line, cheapest at the left */
.rail { margin-top: auto; }
.rail canvas { width: 100%; height: 54px; display: block; }
.rail p { margin: 6px 0 0; font-size: 14px; color: var(--paint-muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rail b { color: var(--paint); font-variant-numeric: tabular-nums; }

/* Map: on desktop it stays in view beside the results while you scroll through them */
@media (min-width: 901px) {
  .map-wrap { position: sticky; top: 0; height: calc(100svh - 92px); min-height: 520px; }
}
/* Map */
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; cursor: crosshair; transform-origin: 50% 70%; }
.road { transform-origin: 50% 100%; will-change: transform; }
.map-foot { position: absolute; left: 20px; right: 20px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.legend { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--paint-muted); pointer-events: none; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.loading { margin: 0; font-size: 13px; color: var(--paint-muted); }
.loading[hidden] { display: none; }

/* Sections below the fold: each one is a stretch of road between solid lines */
.stretch-sec { border-top: var(--line) solid var(--paint); padding: clamp(48px, 8vw, 96px) var(--gutter); }
.sec-word { font-size: clamp(54px, 7vw, 96px); margin: 0 0 8px; }
.sec-lead { max-width: 38em; margin: 0 0 36px; font-size: 18px; }

/* "In auto": one phone, five steps. Desktop: the phone stays while the steps scroll past. */
.tour { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; }
.step {
  display: grid; grid-template-columns: 18px 1fr; gap: 18px; align-items: start; width: 100%;
  padding: 22px 0; border: 0; border-top: 2px dashed rgba(238, 237, 230, 0.28); background: none;
  color: var(--paint-muted); font: inherit; text-align: left; cursor: pointer;
  transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.steps li:last-child .step { border-bottom: 2px dashed rgba(238, 237, 230, 0.28); }
.step svg { width: 18px; height: 40px; fill: currentColor; opacity: 0.35; transition: opacity 0.25s, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.step b { display: block; font-family: var(--road); font-weight: 900; text-transform: uppercase; font-size: clamp(26px, 2.4vw, 34px); line-height: 1; letter-spacing: 0.02em; margin-bottom: 8px; color: var(--paint-muted); }
.step span { max-width: 34em; }
/* inactive steps read as worn paint, all text stays above 4.5:1 */
.step:not([aria-current]) b { -webkit-mask: var(--wear); mask: var(--wear); }
.step:hover, .step[aria-current] { color: var(--paint); }
.step[aria-current] b { color: var(--yellow); } /* selected = works yellow, 4.8:1 on asphalt */
.step[aria-current] svg { opacity: 1; color: var(--yellow); transform: translateY(-3px); }
.tour-phone { position: sticky; top: 10vh; width: min(100%, 38vh); justify-self: center; }
.phone {
  position: relative; aspect-ratio: 640 / 1354; border-radius: 15% / 7%; overflow: hidden;
  background: #0B0F12; border: 10px solid #0B0F12;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(238, 237, 230, 0.16);
}
.phone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.phone img.on { opacity: 1; }
.phone { scroll-margin-top: 20px; }
.phone-cap { display: none; margin: 14px 0 0; text-align: center; font-family: var(--road); font-weight: 900; text-transform: uppercase; font-size: 24px; line-height: 1; letter-spacing: 0.02em; color: var(--yellow); }

.does { display: grid; grid-template-columns: 1fr var(--line) 1fr; }
.does > div { padding: 0 clamp(20px, 4vw, 56px); }
.does > div:first-child { padding-left: 0; }
.does .solid { background: var(--paint); -webkit-mask: var(--wear); mask: var(--wear); padding: 0; }
.does h3 { font-family: var(--road); font-weight: 900; text-transform: uppercase; font-size: 40px; letter-spacing: 0.02em; margin: 0 0 14px; }
.does ul { list-style: none; margin: 0; padding: 0; }
.does li { padding: 10px 0; border-bottom: 2px dashed rgba(238, 237, 230, 0.28); }
.not li { text-decoration: line-through; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; }
.not li span { text-decoration: none; display: inline-block; color: var(--paint-muted); margin-left: 6px; }

.end { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px clamp(32px, 6vw, 80px); align-items: end; }
.end p { margin: 0 0 16px; max-width: 34em; }
.store-note { font-size: 14px; color: var(--paint-muted); margin-top: 10px; }

/* Read pages: privacy and support */
.prose { padding: clamp(36px, 6vw, 72px) var(--gutter) 80px; }
.prose > * { max-width: 680px; }
.prose .sec-word { max-width: none; }
.prose h2 { font-family: var(--road); font-weight: 900; text-transform: uppercase; font-size: 32px; letter-spacing: 0.02em; margin: 44px 0 6px; line-height: 1; }
.prose .updated { color: var(--paint-muted); font-size: 15px; margin: 0 0 28px; }
.prose code { font-size: 0.86em; overflow-wrap: anywhere; color: var(--paint-muted); }
.contact { margin: 8px 0 22px; }
.contact p { margin: 0 0 16px; }
details { border-bottom: 2px dashed rgba(238, 237, 230, 0.35); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; gap: 12px; align-items: baseline; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ""; flex: none; width: 10px; height: 10px; border-right: 3px solid var(--yellow); border-bottom: 3px solid var(--yellow); transform: rotate(-45deg); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
details[open] summary::before { transform: rotate(45deg); }
details p { margin: 10px 0 0 22px; color: var(--paint-muted); }

footer { border-top: var(--line) solid var(--paint); padding: 28px var(--gutter) 40px; font-size: 14px; color: var(--paint-muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; }
footer p { margin: 0; max-width: 46em; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { color: var(--paint-muted); }

@media (max-width: 900px) {
  .road { grid-template-columns: 1fr; min-height: 0; }
  .centre { height: var(--line); background: repeating-linear-gradient(90deg, var(--paint) 0 48px, transparent 48px 88px) var(--drive, 0px) 0; }
  .lane-r { min-height: 0; }
  .map-wrap { display: flex; flex-direction: column; }
  #map { position: relative; inset: auto; height: 112vw; max-height: 620px; }
  .map-foot { position: static; padding: 4px 20px 18px; }
  .rail { margin-top: 8px; }
  .does { grid-template-columns: 1fr; gap: 36px; }
  .does .solid { height: var(--line); }
  .does > div { padding: 0; }
  .end { grid-template-columns: 1fr; }
  .tour { grid-template-columns: 1fr; }
  .tour-phone { position: static; order: -1; width: min(300px, 78vw); margin: 0 auto; }
  .phone-cap { display: block; }
  .tour-copy { display: contents; }
  .tour .sec-word { order: -3; }
  .tour .sec-lead { order: -2; }
  .step { padding: 16px 0; }
}
@media (max-width: 480px) {
  .lane span { font-size: 17px; padding: 12px 2px 10px; }
  .lane svg { height: 38px; }
  .top nav { font-size: 14px; }
  .brand span { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
