/* Oxford ZEZ landing page.
 *
 * One stylesheet, no framework, no build step. The deploy is a file sync, so
 * anything that needed compiling would need a toolchain on the web box.
 *
 * Colours come from the app: --accent is the brand green the map uses for
 * "outside the zone", which is the state the whole product is trying to keep you
 * in, and --danger is the red it uses for "inside".
 */

/* The app's two faces, self-hosted. Marcellus sets the display type, Libre
 * Baskerville the section headings and pull quotes, exactly as they do in the
 * app - the site and the product should not look like two companies. Subset to
 * Latin by make-assets.sh; all four faces together are under 100 kB.
 *
 * swap, not block: a serif fallback for a hundred milliseconds is a far smaller
 * problem than a headline that is not there at all. */
@font-face {
  font-family: "Marcellus";
  src: url("/assets/fonts/Marcellus-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/assets/fonts/LibreBaskerville-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/assets/fonts/LibreBaskerville-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/assets/fonts/LibreBaskerville-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --display: "Marcellus", "Iowan Old Style", Georgia, serif;
  --title: "Libre Baskerville", Georgia, "Times New Roman", serif;

  --accent: #0F7B5A;
  --accent-dark: #4FD1A5;
  --danger: #B3261E;
  --amber: #B26A00;

  --ink: #16211d;
  --ink-soft: #5b6b65;
  --page: #ffffff;
  --panel: #f4f7f5;
  --line: #dfe7e3;
  --footer: #0b3125;

  --wrap: 68rem;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9efec;
    --ink-soft: #a3b3ad;
    --page: #0e1512;
    --panel: #16211d;
    --line: #26332e;
    --accent: #4FD1A5;
    --danger: #ff6b5e;
    --amber: #e2a33c;
    /* The furniture is lit for a dark ground either way, so the footer does
     * not flip with the theme - only the page around it does. */
    --footer: #08251c;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

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

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 96px 0 80px;
  background:
    radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--page);
  border-bottom: 1px solid var(--line);
}

/* The aerial over the Radcliffe Camera, behind the type rather than beside it.
 * It is decorative: the page reads identically with the video blocked, which is
 * why it is aria-hidden and carries no controls. */
.hero-video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Desaturated a little so the brand green in the pills and the buttons is the
   * most saturated thing on the screen, rather than competing with a spring
   * afternoon over the quad. */
  filter: saturate(0.9);
}

/* Type over footage needs a floor under it, and one that survives both themes:
 * the video is the same in either, so the scrim is what makes the heading legible
 * against it. Two stops rather than a flat wash, so the top of the frame keeps
 * some of the sky. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--page) 30%, transparent) 0%,
    color-mix(in srgb, var(--page) 68%, transparent) 52%,
    var(--page) 100%
  );
}

/* Anybody who has asked their system to stop things moving gets the poster frame
 * and no motion at all. */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .hero {
    background-image:
      linear-gradient(to bottom,
        color-mix(in srgb, var(--page) 62%, transparent),
        var(--page)),
      url("/assets/oxford-hero.jpg");
    background-size: cover;
    background-position: center;
  }
}

/* --- Vehicle type picker ------------------------------------------------- */

/* The six drawings were decoration above a fourteen-row table. They are the
 * control now: the visitor arrives asking about one vehicle, so they say which,
 * and the table answers for that one. */
.vtypes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 22px 0 18px;
}

@media (max-width: 44rem) {
  .vtypes { grid-template-columns: repeat(3, 1fr); }
}

.vtype {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px 10px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

/* A fixed box for the drawing, whatever shape the drawing is.
 *
 * These six illustrations have six different aspect ratios - the lorry is nearly
 * square, the bus is a letterbox - so sizing them by width alone left every label
 * at a different height and the row of names laddered across the page. The box is
 * the same for all of them and the artwork is centred inside it, which puts the
 * labels on one line. */
.vtype img {
  width: 100%;
  max-width: 118px;
  height: 76px;
  object-fit: contain;
  object-position: center bottom;
}

/* And the label sits at the bottom of the tile rather than under its own image. */
.vtype span { margin-top: auto; }

.vtype:hover { border-color: var(--accent); }

.vtype[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--ink);
  font-weight: 700;
}

/* Keyboard users get the same ring the browser would give a link. */
.vtype:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The answer that is not in the table: the table is the zone, this is the six
 * charging locations, and they disagree for exactly the vehicles people assume
 * they agree on. */
.vresult {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.vnote { margin: 0; max-width: 42rem; color: var(--ink-soft); font-size: 0.95rem; }

.vcongestion {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  white-space: nowrap;
}

.vcongestion .label {
  font-family: var(--title);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.vcongestion strong { font-size: 1.15rem; color: var(--danger); }
.vcongestion strong.is-free { color: var(--accent); }

/* --- Streetscape --------------------------------------------------------- */

/* A row of the app's street furniture standing above the footer, in place of the
 * hairline rule that was there.
 *
 * It needs a surface. The lamp post, the sign pole, the bus shelter and the
 * traffic light are all drawn in white and pale grey - they are lit for a dark
 * backdrop, and on the page's white ground every one of them vanished, leaving a
 * traffic cone floating alone off to the right. The band gives them something to
 * stand on and a kerb to stand at, which is also simply what a street is. */
.streetscape {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(18px, 5vw, 54px);
  /* Room above and below. The furniture used to stand on the bottom edge with
   * the fade starting behind its heads, so the tall pieces were cropped by the
   * gradient and the short ones sat on a cut. */
  padding: clamp(36px, 5vw, 56px) clamp(20px, 5vw, 60px) clamp(30px, 4vw, 44px);
  /* Flat, not a fade. The gradient made the band read as a smear across the page
   * rather than as a surface, and it changed colour behind each drawing, so
   * nothing stood on the same ground. This is the app's dark brand green, the
   * same one the wizard's result screen uses, and it is the same in both themes:
   * the furniture is drawn lit for a dark ground, so it gets one. */
  background: var(--footer);
}

.streetscape img {
  height: clamp(56px, 9vw, 104px);
  width: auto;
  /* A cast shadow rather than a drawn one: the artwork's own shadows are baked
   * for a light ground and disappear on this band. */
  filter: drop-shadow(0 4px 7px rgb(0 0 0 / 0.45));
}

@media (max-width: 44rem) {
  /* Keeps the three that read at a glance and drops the rest, rather than
   * shrinking six drawings until none of them is legible. */
  .streetscape img:nth-child(n + 4) { display: none; }
}

.hero.compact { padding: 48px 0 32px; }

/* The lede centres itself with auto margins, which was right when the hero was a
 * centred column. Privacy and Terms are left-aligned prose, so it read as an
 * indent under the heading. */
.hero.compact .lede { margin-left: 0; }

.hero .icon {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.14);
}

.hero h1 {
  /* Over footage, not over the page colour. A soft halo in the page's own colour
   * keeps the counters open where a dark roofline runs behind a letter, without
   * the drop shadow look. */
  text-shadow: 0 1px 18px var(--page), 0 1px 3px var(--page);
}

.hero .lede { color: var(--ink); text-shadow: 0 1px 12px var(--page); }

h1 {
  margin: 20px 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  line-height: 1.12;
  /* Marcellus is already open and slightly wide; the negative tracking that
   * flatters a grotesque makes it look cramped. */
  letter-spacing: 0;
  text-wrap: balance;
}

.lede {
  max-width: 42rem;
  margin: 0 auto;
  font-size: 1.15rem;
  line-height: 1.62;
  color: var(--ink-soft);
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 26px;
}

.pill {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.pill strong { color: var(--ink); }

/* --- Sections ------------------------------------------------------------ */

main section { padding: 56px 20px; border-bottom: 1px solid var(--line); }

/* The last section runs straight into the footer band otherwise: its own padding
 * ends, the green begins, and the final question sits on the join with nothing
 * under it. The rule between them is redundant there too, now that the colour
 * change is the divider. */
main section:last-child {
  padding-bottom: clamp(56px, 7vw, 88px);
  border-bottom: none;
}

h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  letter-spacing: 0;
  text-wrap: balance;
}

h3 {
  margin: 0 0 6px;
  font-family: var(--title);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.35;
}

/* The amounts, which are the numbers the page exists to state. Libre Baskerville
 * has proper lining figures and they line up in a column. */
.amount {
  font-family: var(--title);
  font-variant-numeric: tabular-nums;
}

.note { color: var(--ink-soft); font-size: 0.95rem; }

/* --- Feature cards ------------------------------------------------------- */

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  margin-top: 26px;
}

.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.card p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }

/* --- Tables -------------------------------------------------------------- */

/* Wide content scrolls inside its own container rather than making the page
 * scroll sideways on a phone. */
.data {
  width: 100%;
  margin-top: 22px;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.data caption {
  text-align: left;
  padding-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.data th, .data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data thead th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.data tbody th { font-weight: 600; }

.data .amount { font-weight: 700; white-space: nowrap; }

@media (max-width: 46rem) {
  /* The amounts are sentences here - "£4 or £10 a day, discount possible" - and
   * holding them on one line pushed the table wider than the phone, so the ends
   * of them sat off the edge behind a scroll nobody knew was there. */
  .data .amount { white-space: normal; }
  .data th, .data td { padding-left: 10px; padding-right: 10px; }
}

.verdict-free .amount { color: var(--accent); }
.verdict-charged .amount { color: var(--danger); }
.verdict-depends .amount { color: var(--amber); }

/* --- FAQ ----------------------------------------------------------------- */

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-top: 10px;
  padding: 0 16px;
}

summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  float: right;
  color: var(--ink-soft);
  font-weight: 400;
}

details[open] summary::after { content: "−"; }

details p { margin: 0 0 16px; color: var(--ink-soft); }

/* --- Prose --------------------------------------------------------------- */

.prose { max-width: 46rem; padding-bottom: 48px; }
.prose h2 { margin-top: 34px; }
.prose p { color: var(--ink-soft); }

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

footer {
  padding: 4px 0 clamp(40px, 5vw, 64px);
  background: var(--footer);
  color: #9fc4b6;
  font-size: 0.9rem;
}

/* The small print is muted against the page above; on the dark ground it needs
 * to be muted against that instead, or it disappears entirely. */
footer .note { color: #86ab9c; }
footer a { color: #cfe9de; }

a { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* --- Maps ---------------------------------------------------------------- */

.map {
  margin: 26px 0 0;
}

.map img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.map figcaption {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.97rem;
  line-height: 1.6;
  max-width: 46rem;
}

.map figcaption strong { color: var(--ink); }

/* Attribution is a licence condition on the tiles, not decoration. Small, but
 * always rendered. */
.credit {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  opacity: 0.85;
}

/* --- Hero layout --------------------------------------------------------- */

/* Copy on the left, phones on the right. The old hero was a centred paragraph
 * with the screens four scrolls below it, which meant the thing being sold was
 * never on screen at the same time as the sentence selling it. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}

.hero-copy h1 { margin-top: 14px; }
.hero-copy .lede { margin-left: 0; margin-right: 0; }
.hero-copy .platforms { justify-content: flex-start; }

/* One column below the fold width: the phones go under the copy rather than
 * shrinking to thumbnails beside it. */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .hero-copy .platforms { justify-content: center; }
  .hero-copy .lede { margin-left: auto; margin-right: auto; }
}

/* --- Phone cluster ------------------------------------------------------- */

/* Three screens overlapping. The widths deliberately sum to more than the box -
 * that is what makes it a cluster rather than a row - but only just: overlap them
 * much further and the front phone covers the best half of both the others, and
 * the arrangement reads as one phone with debris behind it. */
.cluster {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 1 / 1.06;
}

.cluster .device {
  position: absolute;
  margin: 0;
}

.cluster .device img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  /* The captures are light-mode, so they keep their own ground on a dark page. */
  background: #fff;
  border: 1px solid rgb(0 0 0 / 0.10);
  box-shadow: 0 22px 48px rgb(0 0 0 / 0.28);
}

.cluster .c1 { left: 0;    top: 2%;    width: 40%; transform: rotate(-5deg); z-index: 1; }
.cluster .c2 { right: 0;   top: 2%;    width: 40%; transform: rotate(5deg);  z-index: 1; }
/* The map sits in front and lower, so it covers the ends of the other two rather
 * than the half worth looking at. */
.cluster .c3 { left: 50%;  bottom: 0;  width: 44%; transform: translateX(-50%); z-index: 3; }

/* --- Feature blocks ------------------------------------------------------ */

.features {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr));
  margin-top: 26px;
}

.feature {
  display: grid;
  grid-template-columns: minmax(150px, 200px) 1fr;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.feature .device img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.12);
}

/* Below this the two columns stop being two columns. A 150px phone beside a
 * text column leaves the text about eleven characters wide - a ribbon running
 * down the page, which is unreadable however good the words are. The screenshot
 * goes on top at a size worth looking at, and the copy runs full width under it. */
@media (max-width: 46rem) {
  .feature {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 16px;
  }

  .feature .device { width: 100%; max-width: 210px; }
  .feature .copy { max-width: 34rem; }
}

.feature h3 { margin: 6px 0 6px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }

/* The label is the index: it says which part of the app this is, so four blocks
 * scan as four places rather than four paragraphs. */
.chip {
  /* inline-flex and a stated line-height, because an inline-block with uppercase
   * small caps sits on its own baseline: the text rode high in the pill, and when
   * the column got narrow enough for it to wrap the second line pushed the
   * padding out of true altogether. It never wraps now, and the padding is even
   * on all four sides. */
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-family: var(--title);
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* --- The two schemes, side by side --------------------------------------- */

.standfirst {
  max-width: 46rem;
  color: var(--ink-soft);
}

.schemes {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  margin-top: 22px;
}

.scheme {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.scheme h3 { margin: 0 0 12px; }

/* Where, when, how much - as a list of answers rather than a paragraph to read
 * for them. */
.facts { margin: 0 0 16px; }

.facts > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.facts > div:first-child { border-top: none; }

.facts dt {
  font-family: var(--title);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.facts dd { margin: 0; color: var(--ink); font-size: 0.97rem; }

.two-tables {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  align-items: start;
}

/* --- Store badges and the waitlist --------------------------------------- */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 18px;
}

/* Each badge carries its own "coming soon" underneath. Apple and Google both
 * require their artwork unmodified, so the caption sits outside it rather than
 * being written across it. */
.store {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

.store img { height: 47px; width: auto; display: block; }

/* Taller by its own padding, so the visible badge matches Apple's 47px. */
.store img.play { height: 70px; margin: -11px -20px; }

.soon {
  font-family: var(--title);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.waitlist { margin-top: 22px; max-width: 27rem; }

.waitlist label {
  display: block;
  margin-bottom: 7px;
  font-family: var(--title);
  font-size: 0.92rem;
  color: var(--ink);
}

.waitlist-row { display: flex; gap: 8px; }

.waitlist input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--page);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.waitlist input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.waitlist button {
  padding: 11px 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.waitlist button:disabled { opacity: 0.6; cursor: default; }

.waitlist-status {
  margin: 8px 0 0;
  min-height: 1.2em;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.waitlist-status.is-ok { color: var(--accent); }
.waitlist-status.is-bad { color: var(--danger); }

@media (max-width: 860px) {
  /* The hero is centred at this width, so the badges and the form are too. */
  .stores { justify-content: center; }
  .waitlist { margin-left: auto; margin-right: auto; }
  .waitlist label { text-align: center; }
}
