/* RoadCoach: one stylesheet for every page.

   Order: fonts, tokens, base, layout (wrap, grid, tiles), shared parts (labels, buttons), header, hero and road,
   footer, then each page's own parts. Each part keeps its breakpoints beside it.

   Specificity is kept flat: one class, or a class and an element, almost everywhere; a state class (.compact, .play)
   or a parent class adds one more. Later rules in this file only override earlier ones for a stated reason.
   No !important.

   Breakpoints are the approved site's, kept as they are (not rationalised): 380, 520, 560, 600, 760/761, 960/961,
   999/1000, 1060 and 1199 wide, and 520/521 tall. Added after acceptance, for the owner's decisions: 607/608 and 674
   wide (sideways phones, Q10), and 639/640 wide with 699/700 tall (where Expand shows, Q15), and 789/790 wide (the title's heading, Q16). Features are limited to what the approved site already relied on
   (no cascade layers, nesting or :has()), as the LG TV's browser may not have them. */


/* ---------- Fonts ---------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* A local font adjusted to Inter's size and line metrics, so nothing moves when Inter arrives */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Roboto");
  size-adjust: 107%;
  ascent-override: 90.5%;
  descent-override: 22.5%;
  line-gap-override: 0%;
}


/* ---------- Tokens ---------- */

:root {
  /* Colours: the approved palette (brand usage guide) */
  --bg: #F7F9FC;            /* Background */
  --surface: #FFFFFF;       /* Surface */
  --text: #16202D;          /* Text */
  --muted: #606A78;         /* Secondary text */
  --line: #DBE0E8;          /* Border */
  --line-strong: #B7BEC8;   /* Border strong */
  --subtle: #EDF0F5;        /* Subtle fill */
  --navy-50: #F3F7FE;
  --navy-100: #E5EEFB;
  --navy-200: #CBDAF1;
  --navy-300: #A5BCDE;
  --navy-400: #7594C0;
  --navy-500: #4E70A0;
  --navy: #1D3557;          /* Navy 700, the brand colour */
  --navy-800: #122643;
  --navy-900: #0A182D;      /* the demo's title fade, player bar and Expand layer use it as rgba(10, 24, 45, …) */
  --accent: #2A53B3;        /* Cobalt: only for what to tap next (links, focus) */
  --focus: #2A53B3;

  /* Type: Inter, with the metric-matched fallback */
  --font: "Inter", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* Type scale (screen), size / line height. Weights 400, 600 and 700 only. */
  --display: 40px; --display-lh: 44px;
  --h1: 32px; --h1-lh: 38px;
  --h2: 24px; --h2-lh: 30px;
  --h3: 20px; --h3-lh: 26px;
  --lead: 20px; --lead-lh: 30px;
  --body: 16px; --body-lh: 24px;
  --small: 14px; --small-lh: 20px;
  --label: 12px; --label-lh: 16px;

  /* Shape */
  --radius: 8px;            /* tiles and cards */
  --radius-control: 6px;    /* buttons and icon squares */

  /* Layout */
  --safe-top: env(safe-area-inset-top, 0px);
  --gutter: clamp(20px, 5vw, 48px);       /* the page's side margins */
  --head-gap: clamp(8px, 2vw, 24px);      /* space above the header row at the top of the page */
  --head-row: 60px;                       /* the header row */
}


/* ---------- Base ---------- */

html {
  box-sizing: border-box;
  padding-top: var(--safe-top);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
  scroll-padding-top: calc(var(--safe-top) + 96px);   /* focused and linked-to elements clear the fixed header */
}
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  padding-top: calc(var(--head-gap) + var(--head-row));   /* the fixed header's space */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* The strip under the status bar and notch stays page-coloured, above the header */
body::before { content: ""; position: fixed; inset: 0 0 auto; z-index: 20; height: var(--safe-top); background: var(--bg); }

/* Paragraphs avoid a single word on the last line */
p, li { text-wrap: pretty; }
::selection { background: var(--navy-100); color: var(--text); }

a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

/* The top 24px of the page: js/site.js compacts the header once this has scrolled away */
.top-mark { position: absolute; top: 0; left: 0; width: 1px; height: 24px; pointer-events: none; }

/* Read by screen readers, not shown */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }


/* ---------- Layout: wrap, grid and tiles ---------- */

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

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; padding: 12px 0 16px; }
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tile {
  display: flex; flex-direction: column; gap: 10px;
  padding: 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.tile h2, .tile h3 { margin: 0; font-size: var(--h3); line-height: var(--h3-lh); font-weight: 600; letter-spacing: -0.01em; }
.tile p { margin: 0; color: var(--muted); font-size: var(--body); line-height: var(--body-lh); }

.span2 { grid-column: span 6; }   /* half the row */
@media (max-width: 760px) {
  .span2 { grid-column: 1 / -1; }
}


/* ---------- Shared parts ---------- */

/* Label: 12/16, 700, capitals, +8% tracking, navy, after the road dash. (".tile .label" so a label that is a tile's
   heading or paragraph wins over ".tile h3" and ".tile p".) */
.label, .tile .label {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0;
  color: var(--navy); font-size: var(--label); line-height: var(--label-lh); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.label::before { content: ""; flex: none; width: 20px; height: 4px; margin-top: 6px; border-radius: 1px; background: var(--navy); }

/* Link with an arrow whose words (.ul) get an underline that draws in on hover; always shown on touch screens and on
   keyboard focus */
.draw-link .ul { background: linear-gradient(currentColor, currentColor) 0 100% / 0% 2px no-repeat; }
@media (hover: hover) {
  .draw-link:hover .ul { background-size: 100% 2px; }
}
@media (hover: none) {
  .draw-link .ul { background-size: 100% 2px; }
}
.draw-link:focus-visible .ul { background-size: 100% 2px; }
@media (prefers-reduced-motion: no-preference) {
  .draw-link .ul { transition: background-size .35s ease; }
}

/* Outline button */
.btn-line {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-control);
  background: var(--surface); color: var(--navy);
  font-size: 0.875rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: border-color .2s ease;
}
.btn-line:hover, .btn-line:focus-visible { border-color: var(--navy); }
.btn-line:focus-visible { border-radius: var(--radius-control); }   /* the focus ring keeps the button's corners (over a:focus-visible) */


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

/* Fixed, not sticky: in iOS's bounce at the end of a page a sticky header stays inside its parent, so its contents slid
   away and left only the glass bar. It sits a gap below the top of the page and slides up into the compact bar
   (.compact, set by js/site.js) once the top 24px has scrolled away. */
.site-head {
  position: fixed; z-index: 10; left: 0; right: 0; top: calc(var(--safe-top) + var(--head-gap));
  pointer-events: none;   /* only the logo and the social links take clicks; the page shows and clicks through the rest */
  transition: top .3s ease;
}
.site-head.compact { top: var(--safe-top); }

/* The glass bar. It's always there, reaching up to the top of the screen; over the plain page at the top it can't be
   seen. (A bar that faded in on .compact let the page show through for a moment in a fast scroll, as the class follows
   the scroll a frame late.) When compact it is 64px tall, with no bottom line, and the 60px row is centred in it. */
.site-head::before {
  content: ""; position: absolute; left: 0; right: 0;
  top: calc(-1 * var(--head-gap)); height: calc(var(--head-gap) + var(--head-row));
  background: rgba(247, 249, 252, .72);
  -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
}
.site-head.compact::before { height: calc(var(--head-gap) + 64px); }

.head-in {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: var(--head-row);
  transition: transform .3s ease;
}
.site-head.compact .head-in { transform: translateY(2px); }

/* Logo: the full logo, swapped for the symbol when compact */
.brand { position: relative; display: inline-flex; align-items: center; height: 44px; border-radius: var(--radius-control); pointer-events: auto; }
.brand:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.logo-full { display: block; width: 177.11px; height: 26px; overflow: visible; transition: opacity .25s ease; }
.logo-mini { position: absolute; left: 0; top: 50%; display: block; width: 31.69px; height: 26px; margin-top: -13px; opacity: 0; transition: opacity .25s ease; }
.site-head.compact .logo-full { opacity: 0; pointer-events: none; }
.site-head.compact .logo-mini { opacity: 1; }
@media (max-width: 560px) {
  .logo-full { width: 149.86px; height: 22px; }
  .logo-mini { width: 26.82px; height: 22px; margin-top: -11px; }
}

/* On hover (or a tap on touch screens, .play) the two pages fan out from the spine, widening the road between them.
   The logo is the master file placed three times, each copy clipped to one part (left page, right page, name). The
   clips meet along the centre of the road, so each page is the master artwork rotated about the spine point
   (8.947% across, at the bottom), never distorted. */
.logo-full .pg { transform-box: view-box; transform-origin: 8.947% 100%; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
@media (hover: hover) {
  .brand:hover .pl { transform: rotate(-7deg); }
  .brand:hover .pr { transform: rotate(7deg); }
}
.brand.play .pl, .brand:focus-visible .pl { transform: rotate(-7deg); }
.brand.play .pr, .brand:focus-visible .pr { transform: rotate(7deg); }

/* Social links: a "Follow us" pill */
.social { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.social-label {
  color: var(--muted); font-size: var(--label); line-height: var(--label-lh); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
  transition: opacity .25s ease;
}
.site-head.compact .social-label { opacity: 0; }
@media (max-width: 560px) {
  .social-label { display: none; }
}
.social-pill {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  transform-origin: right center; transition: transform .3s ease;
}
.site-head.compact .social-pill { transform: scale(0.86); }
.social-pill a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px;
  color: var(--navy);
  transition: background-color .2s ease;
}
.social-pill a:hover { background: var(--subtle); }
.social-pill a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Reduced motion: every change the header makes as it compacts is instant, and the logo doesn't fan out */
@media (prefers-reduced-motion: reduce) {
  .site-head, .head-in, .logo-full, .logo-mini, .logo-full .pg, .social-label, .social-pill { transition: none; }
  .brand:hover .pg, .brand.play .pg, .brand:focus-visible .pg { transform: none; }
}

/* Until the page has loaded (the "preload" class, set and cleared by the script in each page's <head>), the header has
   no transitions, so a reload part-way down shows it in place instead of sliding into it */
.preload .site-head, .preload .site-head *, .preload .site-head::before { transition: none; }


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

.hero {
  grid-column: 1 / -1;
  position: relative; overflow: hidden;
  justify-content: center; gap: 16px;
  margin-bottom: 10px;
  padding: clamp(32px, 6vw, 64px) clamp(32px, 6vw, 72px) clamp(76px, 8vw, 96px);
  /* pages behind the hero, like a closed book */
  box-shadow: 0 7px 0 -3px var(--surface), 0 7px 0 -2px var(--line), 0 14px 0 -6px var(--surface), 0 14px 0 -5px var(--line);
}
.hero h1 {
  max-width: 18ch; margin: 0;
  font-size: var(--display); line-height: var(--display-lh); font-weight: 700; letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero .lede { max-width: 42ch; color: var(--muted); font-size: var(--lead); line-height: var(--lead-lh); }
@media (max-width: 560px) {
  .hero h1 { font-size: var(--h1); line-height: var(--h1-lh); }
  .hero .lede { font-size: var(--body); line-height: var(--body-lh); }
}

/* The heroes of the privacy and 404 pages */
.page-hero { gap: 14px; padding-bottom: clamp(72px, 8vw, 88px); }
.page-hero .lede { max-width: 56ch; }
.page-hero .btn-line { align-self: flex-start; margin-bottom: 10px; }
@media (max-width: 560px) {
  .hero { padding-bottom: 32px; }
}


/* ---------- The road ---------- */

/* Along the foot of the hero: the start dot, the dashes, then the destination ring and its label.
   js/site.js spaces the dashes so every gap is equal (--road-p, --road-s and the edge fades --road-fa and --road-fb),
   draws the road in when the page opens and drives it on hover (--road-x). */
.road-row {
  position: absolute; left: 0; right: 0; bottom: 30px;
  display: flex; align-items: center;
  padding: 0 clamp(32px, 6vw, 72px);
}
.road-row .orig { flex: none; display: flex; align-items: center; margin: 0; }
.road-row .dot { display: block; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--navy); }
.road-row .dashes {
  flex: 1 0 48px; height: 4px; margin-left: 16px;
  background: linear-gradient(90deg, var(--navy) 0 44px, transparent 44px 100%) var(--road-s, 0px) 0 / var(--road-p, 80px) 4px repeat-x;
}
.road-row .dest {
  flex: none; display: flex; align-items: center; gap: 8px;
  margin: 0 0 0 16px;
  color: var(--navy); font-size: var(--small); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1;
  white-space: nowrap;
}
.road-row .dest i { flex: none; width: 14px; height: 14px; border: 4px solid var(--navy); border-radius: 50%; background: var(--surface); }
.road-row .dl { display: flex; flex-direction: column; line-height: 1.1; }
.road-row .dl small { margin-bottom: 3px; color: var(--muted); font-size: var(--label); font-weight: 600; letter-spacing: 0.08em; }

/* Phones: the road sits in the card's flow, one line from the start dot to the ring (so the road arrives at the
   ring), and the label stacks above the ring, right-aligned */
@media (max-width: 560px) {
  .road-row { position: relative; left: auto; right: auto; bottom: auto; margin-top: 45px; padding: 0; }
  .road-row .dot { width: 12px; height: 12px; }
  .road-row .dashes { flex: 1 1 0; min-width: 0; margin-left: 12px; }
  .road-row .dest { position: relative; gap: 6px; margin-left: 12px; }
  .road-row .dest i { width: 12px; height: 12px; border-width: 3px; }
  .road-row .dl { position: absolute; right: 0; bottom: calc(100% + 10px); align-items: flex-end; text-align: right; }
}

/* With motion allowed, the dashes are drawn by ::before so the script can drive them with a transform, and their ends
   fade out within the end gaps */
@media (prefers-reduced-motion: no-preference) {
  .road-row .dashes {
    position: relative; overflow: hidden; background-image: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--road-fa, 20px), #000 calc(100% - var(--road-fb, 20px)), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--road-fa, 20px), #000 calc(100% - var(--road-fb, 20px)), transparent);
  }
  .road-row .dashes::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--road-p, 80px)); right: 0;
    background: linear-gradient(90deg, var(--navy) 0 44px, transparent 44px 100%) var(--road-s, 0px) 0 / var(--road-p, 80px) 4px repeat-x;
    transform: translateX(var(--road-x, 0px)); will-change: transform;
  }
}
@media (max-width: 560px) and (prefers-reduced-motion: no-preference) {
  .road-row .dashes {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--road-fa, 8px), #000 calc(100% - var(--road-fb, 16px)), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--road-fa, 8px), #000 calc(100% - var(--road-fb, 16px)), transparent);
  }
}

/* The road draw-in: the script in <head> sets .road-js (motion allowed) to hide the road and ring before the first
   paint; js/site.js takes over from it. If that script never runs, road-show brings them back after 2.5s. */
.road-js .road-row .dashes { clip-path: inset(0 100% 0 0); }
.road-js .road-row .dest i { opacity: 0; }
.road-js .road-row .dashes, .road-js .road-row .dest i { animation: road-show 0s 2.5s forwards; }
@keyframes road-show { to { clip-path: none; opacity: 1; } }


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

.site-foot { padding-bottom: clamp(20px, 4vw, 40px); }
.foot-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* Company facts, in the style of the theory test facts */
.fc-cols { position: relative; z-index: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.fc-cols > div { padding: 26px 28px 66px; border-left: 1px solid var(--line); }
.fc-cols > div:first-child { border-left: 0; }
.fc-cols dt, .fc-cols dd { text-wrap: pretty; }
.fc-n {
  margin: 12px 0 0;
  color: var(--text); font-size: var(--h2); line-height: var(--h2-lh); font-weight: 700; letter-spacing: -0.015em; font-variant-numeric: tabular-nums;
}
.fc-s { margin: 6px 0 0; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }

/* The bar: the Roaches ridge rises out of it, drawn over the foot of the columns, so the column rules stop where they
   meet it */
.fc-bar {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 28px;
  background: var(--subtle);
}
.fc-bar > * { position: relative; }
.ridge-top { position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); display: block; width: 100%; height: 56px; pointer-events: none; }
.ridge-top path:first-child { fill: var(--subtle); }
.ridge-top path:last-child { stroke: var(--line-strong); }
.f-logo { display: block; flex: none; width: 129.4px; height: 19px; }
/* the sign-off, set apart from the logo by space and a fine rule, so the two don't read as one sentence */
.fc-made {
  flex: 1; margin: 0 0 0 12px; padding-left: 24px; transform: translateY(1px);
  color: var(--muted); font-size: var(--small); line-height: var(--small-lh);
}
.fc-made::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 18px; margin-top: -9px; background: var(--line-strong); }
.fc-bar .btn-line { box-shadow: 0 1px 2px rgba(22, 32, 45, .08); }

/* Phones and small tablets: one column of facts, and the page link as a text link with the same growing underline as
   "Get in touch" (always underlined on touch screens) */
@media (max-width: 760px) {
  .fc-cols { grid-template-columns: minmax(0, 1fr); }
  .fc-cols > div { padding: 22px 24px; border-left: 0; border-top: 1px solid var(--line); }
  .fc-cols > div:first-child { border-top: 0; }
  .fc-cols > div:last-child { padding-bottom: 54px; }
  .ridge-top { height: 40px; }
  .fc-bar { row-gap: 10px; padding: 30px 24px 20px; }
  .fc-made { flex: 1 1 100%; margin-left: 0; padding-left: 0; transform: none; }
  .fc-made::before { display: none; }
  .fc-bar .btn-line {
    height: auto; min-height: 44px; margin: -6px 0 -10px; padding: 0; gap: 6px;
    border: 0; background: none; box-shadow: none; color: var(--accent);
  }
  .fc-bar .btn-line .ul { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat; }
}
@media (max-width: 760px) and (hover: hover) {
  .fc-bar .btn-line .ul { background-size: 0% 2px; }
  .fc-bar .btn-line:hover .ul, .fc-bar .btn-line:focus-visible .ul { background-size: 100% 2px; }
}
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .fc-bar .btn-line .ul { transition: background-size .35s ease; }
}


/* ---------- Home page ---------- */

/* Where the home tiles sit: 12 columns on desktop, fewer rows of wider tiles below 1200, 960 and 760px */
.lead, .stack, .stat, .both { grid-column: span 6; }
.intro, .contact { grid-column: span 4; }
.tpanel { grid-column: span 3; }
.stat { grid-row: span 2; }
@media (min-width: 961px) {
  .lead { grid-row: span 2; }
}
@media (max-width: 1199px) {
  .stat, .both { grid-column: 1 / -1; }
  .stat { grid-row: auto; }
  .tpanel { grid-column: span 6; }
}
@media (max-width: 960px) {
  .lead, .contact { grid-column: 1 / -1; }
  .intro { grid-column: span 6; }
}
@media (max-width: 760px) {
  .lead, .stack, .intro, .contact, .tpanel { grid-column: 1 / -1; }
  .contact { order: 1; }   /* after the demo, just above the footer */
}

/* Hero: "Walk in ready." in Navy 500 (cobalt is kept for actions); three clean lines on phones */
.home-hero h1 em { font-style: normal; color: var(--navy-500); }
.home-hero h1 .nw { white-space: nowrap; }
.home-hero .lede b { color: var(--text); font-weight: 600; }
@media (max-width: 520px) {
  .home-hero h1 span.nw { white-space: normal; }
  .home-hero h1 .ph, .home-hero h1 em.nw { display: block; }
}
/* The text paints over the L plate; on wide screens the intro keeps to three lines and the rule under it matches */
.home-hero > h1, .home-hero > .lede, .home-hero > .platforms { position: relative; }
.home-hero .road-row { z-index: 1; }
@media (min-width: 761px) and (max-width: 999px) {
  .home-hero .lede, .home-hero .platforms { max-width: 450px; }
}
@media (min-width: 1000px) {
  .home-hero .lede, .home-hero .platforms { max-width: 600px; }
}

/* The watermark L plate in the hero's empty side */
.wm-plate {
  position: absolute; right: -36px; top: 42%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: clamp(200px, 21vw, 250px); aspect-ratio: 1;
  border-radius: 8%; box-shadow: inset 0 0 0 3px var(--subtle);
  pointer-events: none;
}
.wm-plate b { color: var(--subtle); font-size: clamp(150px, 16.5vw, 196px); font-weight: 700; line-height: 1; letter-spacing: -0.04em; transform: translateY(-3%); }
@media (max-width: 760px) {
  .wm-plate { display: none; }
}

/* "Coming soon to iPhone | Android", under a fine rule */
.platforms {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  max-width: 520px; margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line);
}
.platforms-label { color: var(--navy-500); font-size: var(--label); line-height: var(--label-lh); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.platform { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.platform svg { flex: none; color: var(--navy-500); }
.platform-sep { width: 1px; height: 18px; background: var(--line); }
@media (max-width: 560px) {
  .platform-sep { display: none; }
}
@media (max-width: 520px) {
  .platforms-label { flex-basis: 100%; }   /* the label on its own line, the two platforms under it */
  .platform-sep { display: block; }
}

/* Feature tiles: Revision plan is the tall lead tile, Mock tests and Hazard perception stack beside it */
.ficon {
  display: flex; align-self: flex-start; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-bottom: 4px;
  border-radius: var(--radius-control); background: var(--navy-100); color: var(--navy);
}
.lead { justify-content: center; background: var(--navy-100); border-color: var(--navy-200); }
.lead .ficon { background: var(--surface); }
@media (min-width: 761px) {
  .lead h3 { font-size: var(--h1); line-height: var(--h1-lh); font-weight: 700; letter-spacing: -0.02em; }
  .lead p { max-width: 34ch; }
}
@media (min-width: 961px) {
  .lead { justify-content: flex-end; min-height: 300px; padding: 32px; }
  .lead .ficon { margin-bottom: auto; }
}
.try-link {
  align-self: flex-start; display: flex; align-items: center; gap: 6px; margin-top: 6px;
  color: var(--accent); font-size: var(--body); line-height: var(--body-lh); font-weight: 600; text-decoration: none;
}

/* Get in touch: a navy tile, its address underlined as the tile is hovered */
.contact { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.contact p { color: var(--navy-200); }
.contact a { color: #FFFFFF; font-weight: 600; }
.contact a:focus-visible { outline-color: #FFFFFF; }
.mail { padding-bottom: 2px; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0% 2px no-repeat; }
.mail:focus-visible { background-size: 100% 2px; }
@media (hover: hover) {
  .contact:hover .mail { background-size: 100% 2px; }
}
@media (hover: none) {
  .mail { background-size: 100% 2px; }
}
@media (prefers-reduced-motion: no-preference) {
  .mail { transition: background-size .35s ease; }
}

/* Pass rate: the figure and headline centred between the label and the source line */
.stat { justify-content: space-between; gap: 18px; }
.stat-main { flex: 1; display: flex; flex-direction: column; }
.stat .big {
  margin: auto 0 0; padding-top: 22px;
  color: var(--navy); font-size: clamp(3rem, 6.4vw, 4.5rem); font-weight: 700; letter-spacing: -0.02em; line-height: 0.95; font-variant-numeric: tabular-nums;
}
.stat .big small { font-size: 0.45em; letter-spacing: -0.02em; }
.stat h2 { margin: 14px 0 6px; text-wrap: balance; }
.stat-main > p:last-child { margin-bottom: auto; padding-bottom: 12px; }

/* Source line: the caption wraps as it needs to; the link stays on the first line, at the right. Phones get the
   shorter wording ("April 2025 to March 2026" / "GOV.UK") so it fits on one row. */
.srcline { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.srcline p { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }
.srcline a {
  flex: none; display: flex; align-items: center; gap: 4px;
  color: var(--accent); font-size: var(--small); line-height: var(--small-lh); font-weight: 600; text-decoration: none; white-space: nowrap;
}
@media (max-width: 560px) {
  .srcline { align-items: baseline; }
  .srcline .m-long { display: none; }
}

/* The two parts of the test, each with its pass mark on a bar */
.tpanel { gap: 4px; padding-bottom: 24px; }
.tpanel .n {
  display: flex; align-items: baseline; gap: 8px; margin: 18px 0 0;
  color: var(--text); font-size: var(--display); line-height: var(--display-lh); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.tpanel .unit { color: var(--muted); font-size: var(--body); font-weight: 600; letter-spacing: 0; }
.tpanel .d { margin: 6px 0 20px; }
.tpanel .pm { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.tpanel .pm-k { margin: 14px 0 0; color: var(--muted); font-size: var(--label); line-height: var(--label-lh); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.tpanel .pm-n {
  margin: 4px 0 0;
  color: var(--text); font-size: var(--h2); line-height: var(--h2-lh); font-weight: 700; letter-spacing: -0.015em; font-variant-numeric: tabular-nums;
}
.frac { margin-left: 2px; color: var(--muted); font-size: 0.6em; font-weight: 600; letter-spacing: -0.01em; }

/* Pass-mark bar: --pass is the pass mark; the bar fills once when its panel comes into view (js/site.js adds .in;
   "pass-js" is set in <head> when motion is allowed). The numbers don't move. */
.passbar { position: relative; height: 8px; margin: 12px 0 2px; border-radius: 4px; background: var(--subtle); }
.passbar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--pass); border-radius: 4px; background: var(--navy); }
.passbar .mark { position: absolute; left: var(--pass); top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--navy-500); }
.pass-mc { --pass: 86%; }     /* 43 of 50 */
.pass-hp { --pass: 58.7%; }   /* 44 of 75 */
@media (prefers-reduced-motion: no-preference) {
  .passbar .fill { transform-origin: left center; transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
  .pass-js .passbar:not(.in) .fill { transform: scaleX(0); }
}

/* "You must pass both parts in the same sitting": a label under the panels, in a borderless tile */
.both { align-self: start; flex-direction: row; align-items: center; gap: 12px; padding: 2px 4px 0; background: transparent; border-color: transparent; color: var(--navy); }
@media (max-width: 760px) {
  .both { padding: 4px 6px 8px; }
}


/* ---------- The hazard perception demo (#try) ---------- */

/* The section: the clip (with the title screen over it until it starts), the timeline under it, the controls, then how
   the real test scores. js/demo.js runs it: [data-state] is idle, playing or done, and .ready is set once the street
   has been drawn. Every part of every state is in the HTML; the script only fills in text and switches state. */
.tryit {
  --try-gap: 24px;   /* between the section's parts; the controls row (the row layout) adds 4px to it */
  grid-column: 1 / -1; gap: var(--try-gap); padding: 32px; scroll-margin-top: 96px;
  /* the five scoring bands, from the top band (5 points) down */
  --band-5: var(--navy); --band-4: var(--navy-500); --band-3: var(--navy-400); --band-2: var(--navy-300); --band-1: var(--navy-200);
}
@media (max-width: 760px) {
  .tryit { --try-gap: 20px; padding: 22px; }
}

/* The frame: the clip, the timeline and the controls, as one grid. In the wide layout the controls are a player bar
   on the clip (in the clip's own grid area, at its foot); in the row layout they're a row under the timeline (see
   "The two layouts" below). The header row is for Expand only. */
.hp-frame {
  position: relative; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "clip" "tl" "ctrl";
  /* the navy fades over the clip: the title screen's from the left, the player bar's from the foot */
  --title-fade: linear-gradient(90deg, rgba(10, 24, 45, .92) 0, rgba(10, 24, 45, .8) 38%, rgba(10, 24, 45, .2) 70%, rgba(10, 24, 45, 0) 100%);
  --bar-fade: linear-gradient(180deg, rgba(10, 24, 45, 0) 0, rgba(10, 24, 45, .6) 30%, rgba(10, 24, 45, .86) 70%);
}
.hp-exhead { grid-area: head; display: none; }

/* The clip. Until the canvas draws, the stage shows the street's colour bands, then the still fades in over them.
   Everything over the canvas (the title screen, "Loading the street…", the score card, the tap rings) and the player
   bar after the clip are positioned without a z-index, so they paint in source order. (With the bar on a z-index,
   Chrome sometimes painted the title's fade past the clip's rounded corners.) */
.tryit .stage {
  grid-area: clip; position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px;
  background: #4b4e53 linear-gradient(180deg, #4f413e 0 6.15%, #b7b5af 6.15% 25.4%, #4b4e53 25.4% 74.6%, #c2c0b8 74.6% 93.85%, #6f4c43 93.85%);
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tryit[data-state="done"] .stage { cursor: default; }
/* The canvas's shape is the engine's framing (--view, set by js/demo.js); until then, the one it will start with */
.tryit .stage canvas { position: relative; display: block; width: 100%; height: auto; aspect-ratio: var(--view, 720 / 260); }
/* The opening frame, under the canvas until the street is drawn over it (the same framing as the canvas's first
   frame, so nothing jumps). js/site.js adds .in once it has loaded. */
.tryit .hp-still { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s ease; }
.tryit .hp-still.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .tryit .hp-still { transition: none; }
}
/* phones: the phone framing (430 x 212 of the 720 x 260 street, from x 26, y 24), its colour bands and its still. The
   engine uses it wherever the clip is under 560px wide: on phones held sideways the clip is inset in the card (the wide
   layout, below), 90vw - 48px wide inside its border, so that's up to 674px wide. */
@media (max-width: 600px), (min-width: 608px) and (max-width: 674px) and (max-height: 520px) {
  .tryit .stage { background-image: linear-gradient(180deg, #b7b5af 0 19.8%, #4b4e53 19.8% 80.2%, #c2c0b8 80.2%); }
  .tryit .stage canvas { aspect-ratio: var(--view, 430 / 212); }
  .tryit .hp-still { left: -6.05%; top: -11.32%; width: 167.44%; height: 122.64%; }
}
/* "Loading the street…", only if the street takes more than 0.8s; gone once it's drawn */
.tryit .hp-load {
  position: absolute; left: 0; right: 0; bottom: 12px;
  color: #FFFFFF; font-size: var(--small); line-height: var(--small-lh); font-weight: 600; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  pointer-events: none;
  animation: hp-load-in .3s ease .8s both;
}
.tryit.ready .hp-load { display: none; }
@keyframes hp-load-in { from { opacity: 0; } to { opacity: 1; } }
/* Where a tap or click lands on the clip, a ring (js/demo.js reuses the three in turn) */
.tryit .tap { position: absolute; left: var(--x); top: var(--y); display: none; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 2px solid #FFFFFF; border-radius: 50%; pointer-events: none; }
.tryit .tap.on { display: block; animation: hp-tap .5s ease-out forwards; }
@keyframes hp-tap { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.3); opacity: 0; } }

/* The title screen: the heading over the street on a navy fade, with Start in it in the wide layout, until the clip
   starts */
.tryit .tf-head {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 32px 45% 32px 32px;
  background: var(--title-fade);
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s;
}
.tryit:not([data-state="idle"]) .tf-head { opacity: 0; visibility: hidden; }
.tryit .tf-head .label { color: var(--navy-200); }
.tryit .tf-head .label::before { border-radius: 2px; background: var(--navy-200); }
.tryit .tf-head h2 {
  margin: 12px 0 0;
  color: #FFFFFF; font-size: var(--h1); line-height: var(--h1-lh); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance;
}
.tryit .tf-head p:not(.label) { max-width: 34ch; margin-top: 10px; color: var(--navy-200); }
#try-h:focus { outline: none; }   /* the heading takes focus on arrival (for keyboard and screen reader users); it isn't a control */
/* The title's Start, white on the fade. Shown only while idle in the wide layout: the row layout has the Start in the
   row under the timeline, and once the clip has run, Try again is in the player bar. */
.tryit .tf-head .hp-go { margin-top: 18px; border-color: #FFFFFF; background: #FFFFFF; color: var(--navy); pointer-events: auto; }
.tryit .tf-head .hp-go:hover { border-color: var(--navy-50); background: var(--navy-50); }
.tryit .tf-head .hp-go:focus-visible { outline-color: #FFFFFF; }
.tryit:not([data-state="idle"]) .tf-head .hp-go { display: none; }   /* at once, so the title fades out without it */
@media (max-width: 1060px) {
  .tryit .tf-head { padding: 22px 38% 22px 24px; }
  .tryit .tf-head h2 { font-size: var(--h2); line-height: var(--h2-lh); }
  .tryit .tf-head p:not(.label) { margin-top: 6px; }
  .tryit .tf-head .hp-go { margin-top: 12px; }
}
/* 761 to 789px wide: the heading runs a little wider so it stays on one line, as it does from 790px up; on two lines
   it left only about 15px above the label and below Start. (The owner's decision, Q16 in REBUILD-NOTES.md.) */
@media (max-width: 789px) {
  .tryit .tf-head { padding-right: 30%; }
}
/* Phones held sideways: the clip is only about 200 to 230px tall, so the title screen is smaller still, with room
   round it: no label (the heading says what the clip is), the heading on one line at h3, and a 40px Start. (The
   owner's decisions, Q12 and Q14 A in REBUILD-NOTES.md.) */
@media (min-width: 608px) and (max-width: 760px) and (max-height: 520px) {
  .tryit .tf-head { padding-right: 24%; }
  .tryit .tf-head .label { display: none; }
  .tryit .tf-head h2 { font-size: var(--h3); line-height: var(--h3-lh); }
  .tryit .tf-head .hp-go { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .tryit .tf-head { transition: none; }
}

/* The timeline: the hero's road, from a start dot to a destination ring, with the playhead as a cobalt ring.
   The script slides the navy progress over the grey dashes with transforms, so playing never re-lays out the page.
   After the clip the two scoring windows are revealed, each with its hazard's name centred under it on a bracket. */
.tryit .tl { grid-area: tl; margin-top: 18px; padding: 0 22px; }
.tryit .track { position: relative; height: 26px; }
.tryit .track::before, .tryit .track::after { content: ""; position: absolute; top: 6px; width: 14px; height: 14px; border-radius: 50%; }
.tryit .track::before { left: -22px; background: var(--navy); }
.tryit .track::after { right: -22px; background: var(--surface); border: 4px solid var(--navy); }
.tryit .rail, .tryit .prog { position: absolute; left: 0; right: 0; top: 11px; height: 4px; }
.tryit .rail { background: repeating-linear-gradient(90deg, var(--line-strong) 0 22px, transparent 22px 36px); }
.tryit .prog { overflow: hidden; transform: translateX(-100%); }
.tryit .prog-fill { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, var(--navy) 0 22px, transparent 22px 36px); transform: translateX(100%); }
.tryit .head { position: absolute; left: 0; top: 5px; z-index: 2; width: 16px; height: 16px; margin-left: -8px; border: 4px solid var(--accent); border-radius: 50%; background: var(--surface); }
.tryit[data-state="done"] .head { opacity: 0; }
/* The scoring windows: where each one starts and how long it is, as fractions of the clip (--w1-at, --w1-span,
   --w2-at, --w2-span), are set on the timeline by js/demo.js */
.tryit .bands { position: absolute; top: 2px; z-index: 1; display: flex; gap: 2px; height: 22px; }
.tryit .bands.w1 { left: calc(var(--w1-at) * 100%); width: calc(var(--w1-span) * 100%); }
.tryit .bands.w2 { left: calc(var(--w2-at) * 100%); width: calc(var(--w2-span) * 100%); }
.tryit .bands span {
  flex: 1; display: grid; place-items: center;
  font-size: var(--label); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums;
  opacity: 0; transform: scaleY(.4); transition: opacity .25s ease, transform .25s ease;
}
/* each window's bands, from 5 points down: navy 700, 500, 400, 300 and 200, numbered in white or navy 900 (4.5:1 or
   more); they unfold one after another, the second window after the first */
.tryit .bands span:nth-child(1) { border-radius: 4px 0 0 4px; background: var(--band-5); color: #FFFFFF; }
.tryit .bands span:nth-child(2) { background: var(--band-4); color: #FFFFFF; transition-delay: 70ms; }
.tryit .bands span:nth-child(3) { background: var(--band-3); color: var(--navy-900); transition-delay: 140ms; }
.tryit .bands span:nth-child(4) { background: var(--band-2); color: var(--navy-900); transition-delay: 210ms; }
.tryit .bands span:nth-child(5) { border-radius: 0 4px 4px 0; background: var(--band-1); color: var(--navy-900); transition-delay: 280ms; }
.tryit .bands.w2 span:nth-child(1) { transition-delay: 200ms; }
.tryit .bands.w2 span:nth-child(2) { transition-delay: 270ms; }
.tryit .bands.w2 span:nth-child(3) { transition-delay: 340ms; }
.tryit .bands.w2 span:nth-child(4) { transition-delay: 410ms; }
.tryit .bands.w2 span:nth-child(5) { transition-delay: 480ms; }
.tryit[data-state="done"] .bands span { opacity: 1; transform: none; }
@media (max-width: 960px) {
  .tryit .bands span { font-size: 0; }   /* too narrow for their numbers: shades only */
}
/* The flags where you clicked, drawn by js/demo.js. It reaches 2px before the track and 14px past it (a flag's
   pennant points right), and 10px above it. */
.tryit .flags { position: absolute; left: -2px; top: -10px; z-index: 3; width: calc(100% + 16px); height: 36px; pointer-events: none; }
/* START and END under the ends, labelled like the hero road's "Launching / Early 2027" */
.tryit .tl-keys { position: relative; height: 40px; margin: 12px -22px 0; color: var(--muted); font-size: 12px; }
.tryit .tl-keys span { position: absolute; white-space: nowrap; }
.tryit .tk-s, .tryit .tk-e { line-height: 1; }
.tryit .tk-s { left: 0; }
.tryit .tk-e { right: 0; text-align: right; }
.tryit .tl-keys small { display: block; color: var(--muted); font-size: var(--label); line-height: var(--label-lh); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.tryit .tl-keys b { display: block; color: var(--navy); font-size: 16px; line-height: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tryit .tl-keys .wk {
  top: -6px;
  color: var(--navy); font-size: var(--small); line-height: var(--small-lh); font-weight: 600; text-align: center;
  opacity: 0; transition: opacity .25s ease;
}
.tryit .tl-keys .wk::before { content: ""; display: block; height: 7px; margin: 0 1px 5px; border: 1.5px solid var(--navy-200); border-top: 0; border-radius: 0 0 3px 3px; }   /* the bracket */
.tryit .tl-keys .wk.w1 { left: calc(22px + (100% - 44px) * var(--w1-at)); width: calc((100% - 44px) * var(--w1-span)); }
.tryit .tl-keys .wk.w2 { left: calc(22px + (100% - 44px) * var(--w2-at)); width: calc((100% - 44px) * var(--w2-span)); }
.tryit[data-state="done"] .wk { opacity: 1; }
/* in the row layout (upright and small phones, below) */
@media (max-width: 607px), (max-width: 760px) and (min-height: 521px) {
  .tryit .tl-keys .wk { font-size: var(--label); line-height: var(--label-lh); }
  .tryit[data-state="done"] .tl-keys { height: 70px; }   /* the names over START and END */
  .tryit[data-state="done"] .tk-s, .tryit[data-state="done"] .tk-e { top: 34px; }
}

/* Buttons */
.hp-btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--navy); border-radius: var(--radius-control); background: var(--navy); color: #FFFFFF;
  font: inherit; font-size: 16px; font-weight: 600; white-space: nowrap;
  cursor: pointer;
}
.hp-btn:hover { background: var(--navy-800); }
.hp-btn.line { border-color: var(--line-strong); background: var(--surface); color: var(--navy); }
.hp-btn.line:hover { border-color: var(--navy); background: var(--surface); }
.hp-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.hp-btn[hidden] { display: none; }
.hp-btn.play::before { content: ""; border-left: 9px solid currentColor; border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent; }   /* play triangle */
.hp-go:disabled { cursor: progress; }   /* the street is still loading: the same look, so nothing changes colour when it's ready */
/* Arriving from "See how it's scored": Start pops and two cobalt rings pulse out from it */
.tryit.hp-arrive .hp-go { animation: hp-pop .5s cubic-bezier(.3, 1.6, .5, 1), hp-go-ring 1.1s cubic-bezier(.2, .7, .2, 1) 2; }
@keyframes hp-pop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
@keyframes hp-go-ring { 0% { box-shadow: 0 0 0 0 rgba(42, 83, 179, .6); } 100% { box-shadow: 0 0 0 16px rgba(42, 83, 179, 0); } }
@media (prefers-reduced-motion: reduce) {
  .tryit.hp-arrive .hp-go { animation: none; }
}
/* "Flag a hazard": you click or tap the clip itself, as in the real test, so this button is only shown when it has
   keyboard focus (like a skip link), for keyboard and switch users */
.tryit #hz:not(:focus-visible) { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }

/* The controls: Start or Try again, Flag a hazard, the hint and Expand */
.hp-ctrl { grid-area: ctrl; min-width: 0; }
.tryit .hint { margin: 0; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }
.hint-play, .hint-done { display: none; }
.tryit[data-state="playing"] .hint-idle, .tryit[data-state="done"] .hint-idle { display: none; }
.tryit[data-state="playing"] .hint-play, .tryit[data-state="done"] .hint-done { display: inline; }
.tryit kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--navy); font: inherit; font-size: 12px; font-weight: 600; }
/* touch screens say "Tap" where a mouse or trackpad says "Click" */
.tryit .tp { display: none; }
@media (hover: none) {
  .tryit .kb { display: none; }
  .tryit .tp { display: inline; }
}

/* The two layouts of the clip's controls and result. js/demo.js (wideLayout()) uses the same media queries.
   - The wide layout: wider than 760px, and phones held sideways that are 608px wide or more (520px or shorter). The
     controls are a player bar on the clip, the title screen has its own Start, and the result is a card over the clip.
     (Sideways phones: the owner's decision, Q10 in REBUILD-NOTES.md.)
   - The row layout: upright phones, and smaller phones held sideways (the original iPhone SE, 568 x 320). The controls
     are a row under the timeline, the title sits at the top of the clip, and the result is under the controls (or in
     the score sheet).

   The wide layout's player bar: a slim dark band along the foot of the clip, like a video player's. It keeps to the
   clip's rounded corners and hides 2.2s into the clip (.bar-hide, set by js/demo.js) until the mouse moves or a
   control takes focus. While idle it holds only Expand, with no band; while the score card is open it's hidden, and
   once the card is closed (.res-closed) it's back, with Try again and your score. */
@media (min-width: 761px), (min-width: 608px) and (max-height: 520px) {
  .hp-ctrl { grid-area: clip; align-self: end; position: relative; margin: 0 1px 1px; overflow: hidden; border-radius: 0 0 11px 11px; cursor: pointer; }
  .tryit .controls {
    display: flex; align-items: center; gap: 12px;
    padding: 26px 12px 10px;
    background: var(--bar-fade);
    cursor: default;
    transition: opacity .3s ease, transform .3s ease;
  }
  .tryit .controls.bar-hide { opacity: 0; transform: translateY(8px); pointer-events: none; }
  .tryit[data-state="idle"] .controls { background: none; }
  .tryit[data-state="idle"] .controls #go, .tryit[data-state="idle"] .controls .hint { display: none; }
  .tryit[data-state="done"]:not(.res-closed) .hp-ctrl { display: none; }
  .tryit .controls .hp-btn { height: 36px; min-height: 36px; padding: 0 14px; gap: 8px; }
  .tryit .controls #go { border-color: #FFFFFF; background: #FFFFFF; color: var(--navy); }
  .tryit .controls #go:hover { background: var(--navy-50); }
  .tryit .controls .line { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .14); color: #FFFFFF; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .tryit .controls .line:hover { border-color: #FFFFFF; background: rgba(255, 255, 255, .24); }
  .tryit .controls .hp-btn:focus-visible { outline-color: #FFFFFF; }
  .tryit .controls .hp-ex { justify-content: center; width: 36px; margin-left: auto; padding: 0; }
  .tryit .controls .hint { flex: 1; min-width: 0; color: #FFFFFF; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
  .tryit .controls kbd { border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .14); color: #FFFFFF; }
}
@media (min-width: 761px) and (prefers-reduced-motion: reduce), (min-width: 608px) and (max-height: 520px) and (prefers-reduced-motion: reduce) {
  .tryit .controls { transition: none; }
}

/* The row layout: a row under the timeline. A full-width Start (or Try again) with Expand beside it and the hint
   under them; while the clip plays, just the hint with Expand beside it; after it, no hint. */
@media (max-width: 607px), (max-width: 760px) and (min-height: 521px) {
  .hp-ctrl { margin-top: calc(var(--try-gap) + 4px); }
  .tryit .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .tryit .controls .hp-btn { min-height: 44px; padding: 0 14px; }   /* the site's standard button height (Apple's minimum touch target) */
  .tryit .controls #go, .tryit .controls #hz { flex: 1 1 auto; justify-content: center; }
  .tryit .controls .hp-ex { flex: none; justify-content: center; width: 44px; padding: 0; }
  .tryit .controls .hint { flex: 1 1 100%; order: 9; }
  .tryit[data-state="playing"] .controls .hint { flex: 1 1 0; order: 0; align-self: center; }
  .tryit[data-state="playing"] .controls .hp-ex { order: 1; }
  .tryit[data-state="done"] .controls .hint { display: none; }   /* the score says it all, and the timeline is above here */
}

/* The result. js/demo.js fills it into every place it can show; which one shows depends on the screen:
   - everywhere but upright phones (wider than 760px, or 520px tall or shorter): the score card, over the clip's last
     frame. Smaller phones held sideways (607px wide or less) have the row layout's controls but this card too (the
     owner's decision, Q17 in REBUILD-NOTES.md).
   - upright phones (760px and narrower, 521px and taller): the score sheet, then the score bar once it's closed.
     js/demo.js sets .use-sheet on the section here (in browsers with <dialog>).
   - upright phones in browsers without <dialog> (iOS before 15.4): the sheet's panel, standing in the page under the
     controls (below the score sheet's rules) */

/* Each hazard's row (in the card and the sheet): its name, " · starts when…" when it scored
   nothing, and its points */
.hp-why { color: var(--muted); }
.hp-rows b { color: var(--navy); white-space: nowrap; }

/* The score card: the score in a navy panel, then the verdict, the coaching line, both hazards and Try again. It
   fades in when the clip ends and closes with ×, Esc or a click on the dimmed clip around it (.res-closed), and the
   player bar comes back. Hidden, it's out of the tab order and the accessibility tree; shown, screen readers get its
   two buttons (the live result reads out the rest). */
.hp-end {
  position: absolute; inset: 0;
  display: grid; place-items: center; padding: 16px;
  background: rgba(10, 24, 45, .55);
  cursor: pointer;
  opacity: 0; visibility: hidden; pointer-events: none;
}
.tryit[data-state="done"]:not(.res-closed) .hp-end { opacity: 1; visibility: visible; pointer-events: auto; }
@media (prefers-reduced-motion: no-preference) {
  .hp-end { transition: opacity .3s ease, visibility 0s .3s; }                     /* hidden once it has faded out */
  .tryit[data-state="done"]:not(.res-closed) .hp-end { transition: opacity .3s ease; }   /* shown at once, fading in */
}
.hp-card {
  position: relative; width: min(100%, 480px);
  display: grid; grid-template-columns: minmax(140px, max-content) minmax(0, 1fr);
  overflow: hidden; border-radius: 14px; box-shadow: 0 16px 40px rgba(10, 24, 45, .35);   /* no background of its own: each half paints its own, so no white bleeds round the navy corners */
  cursor: default;
}
.hp-card-l { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 20px 18px; background: var(--navy); }
.hp-card-r { min-width: 0; padding: 18px 20px; background: var(--surface); }
.tryit .hp-card-k { margin: 0; color: var(--navy-200); font-size: var(--label); line-height: var(--label-lh); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.tryit .hp-card-n { display: flex; align-items: baseline; gap: 6px; margin: 0; color: #FFFFFF; white-space: nowrap; }   /* "10 of 10" stays on one line; the panel widens to fit */
.hp-card-n b { font-size: 40px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hp-card-n span { color: var(--navy-200); font-size: 16px; font-weight: 600; }
.tryit .hp-card-v { margin: 0; padding-right: 40px; color: var(--navy); font-size: var(--h3); line-height: var(--h3-lh); font-weight: 600; letter-spacing: -0.01em; }   /* room for × beside it */
.tryit .hp-card-m { margin: 4px 0 0; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }
.hp-card .hp-rows { margin: 12px 0 14px; padding: 0; list-style: none; }
.hp-card li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); color: var(--text); font-size: var(--small); line-height: var(--small-lh); }
.hp-card .hp-btn { min-height: 40px; padding: 0 16px; }
.hp-card .hp-rows[hidden] + .hp-btn { margin-top: 14px; }   /* "Too many clicks." has no rows */
.hp-x {
  position: absolute; top: 10px; right: 10px;
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: var(--radius-control); background: none; color: var(--muted);
  cursor: pointer;
}
.hp-x:hover { background: var(--subtle); color: var(--navy); }
.hp-x:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
@media (max-width: 1060px) {
  /* tablets: the clip is only about 220 to 280px tall, so the card tightens up and drops the "starts when" notes */
  .hp-end { padding: 10px; }
  .hp-card { grid-template-columns: minmax(116px, max-content) minmax(0, 1fr); }
  .hp-card-l { padding: 14px; }
  .hp-card-r { padding: 12px 16px; }
  .tryit .hp-card-v { font-size: var(--body); line-height: var(--body-lh); }
  .hp-card .hp-rows { margin: 8px 0 10px; }
  .hp-card li { padding: 3px 0; }
  .hp-card .hp-why { display: none; }
  .hp-card .hp-btn { min-height: 36px; }
}
/* Phones held sideways: the clip is only about 200 to 250px tall, so the card is slimmer still, with 20px clear round
   it: no hazard rows (your flags are on the timeline under the clip), 440px wide. The smaller ones (607px wide or
   less, Q17) have the same card. "Too many clicks." has no rows
   anyway, so every result has the same gap above Try again; its coaching line is longer, so that card (.no-rows, set by
   js/demo.js) runs wider, to keep its 20px. (The owner's decisions, Q10 and Q11 in REBUILD-NOTES.md.) */
@media (max-width: 760px) and (max-height: 520px) {
  .hp-end { padding: 20px; }
  .hp-card { width: min(100%, 440px); }
  .hp-end.no-rows .hp-card { width: min(100%, 520px); }
  .hp-card-r { padding: 12px 16px 14px; }
  .hp-card .hp-rows { display: none; }
  .hp-card .hp-btn, .hp-card .hp-rows[hidden] + .hp-btn { margin-top: 12px; }
}
/* upright phones have the score sheet instead (below) */
@media (max-width: 760px) and (min-height: 521px) {
  .hp-end { display: none; }
}

/* The score sheet. The page first brings the clip and timeline to the top, so your flags show above it, then it
   slides up from the foot of the screen (.in). A native modal dialog: the page behind is inert, and Esc or the back
   gesture closes it. So does a tap above it, a tap on its handle, a drag of the handle more than 70px (.dragging,
   with --drag the distance) or its own Try again. It speaks the score bar's language (label, score and verdict, pass
   bar), so the bar reads as the sheet folded down. */
html.hp-sheet-lock { overflow: hidden; }   /* the page doesn't scroll behind it */
.hp-sheet {
  position: fixed; inset: auto 0 0;
  width: 100%; max-width: none; max-height: calc(100dvh - 120px);
  margin: 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border: 0; border-radius: 18px 18px 0 0; background: var(--surface); color: var(--text);
  box-shadow: 0 -8px 30px rgba(10, 24, 45, .2);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(105%);
}
.hp-sheet.in { transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .hp-sheet { transition: transform .34s cubic-bezier(.2, .8, .2, 1); }
  .hp-sheet.out { transition-duration: .22s; transition-timing-function: cubic-bezier(.4, 0, 1, 1); }
}
.hp-sheet.dragging { transform: translateY(var(--drag)); transition: none; }   /* after .in and .out: it follows the finger */
.hp-sheet::backdrop { background: rgba(10, 24, 45, .18); }
.hp-sheet-grab { display: block; width: 100%; height: 22px; margin: 0 0 6px; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; }
.hp-sheet-grab span { display: block; width: 40px; height: 5px; margin: 0 auto; border-radius: 3px; background: var(--line-strong); }
.hp-sheet-grab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 6px; }
.hp-sres:focus { outline: none; }   /* it takes focus as the sheet opens, so screen readers start at the score; no ring for that */
.hp-sheet .sb-n { color: var(--text); font-size: var(--h1); line-height: var(--h1-lh); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hp-sheet .sb-n b { font-weight: inherit; }
.hp-sheet .frac { font-size: .55em; letter-spacing: 0; }
.hp-sheet .sb-v { color: var(--navy); font-size: 15px; line-height: 20px; font-weight: 700; text-align: right; }
.hp-sheet .sr-tip { margin: 14px 0 0; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }
.sr-rows { margin: 12px 0 0; padding: 0; list-style: none; }
.sr-rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--text); font-size: 15px; line-height: 20px; }
.sr-rows b { flex: none; color: var(--navy); font-size: 16px; font-variant-numeric: tabular-nums; }
.sr-rows .hp-of { color: var(--muted); font-size: 12px; font-weight: 600; }
.hp-sheet .hp-btn { justify-content: center; width: 100%; margin-top: 16px; }

/* The score bar: once the sheet has closed, your score stays under the controls, and a tap brings the sheet back.
   Built from the theory test panels' parts (road-dash label, number, pass bar) with a footer action like the 44.8%
   tile's source line. Its bar fills each time it appears. It only shows where the sheet is used (.use-sheet): turn the
   phone sideways and the score card has the score instead, so it never shows twice (the owner's decision, Q8 in
   REBUILD-NOTES.md). */
.hp-sbar {
  display: flex; flex-direction: column; align-items: stretch;
  width: 100%; margin: 0; padding: 16px 18px 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
  font: inherit; text-align: left;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.hp-sbar[hidden], .tryit:not(.use-sheet) .hp-sbar { display: none; }
.hp-sbar:active { background: var(--navy-50); }
.hp-sbar:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hp-sbar .sb-n { color: var(--text); font-size: var(--h2); line-height: var(--h2-lh); font-weight: 700; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.hp-sbar .sb-v { color: var(--navy); font-size: var(--small); line-height: var(--small-lh); font-weight: 600; text-align: right; }
.hp-sbar .sb-foot {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin: 16px -18px 0; padding: 12px 18px 14px; border-top: 1px solid var(--line);
  color: var(--accent); font-size: var(--small); line-height: var(--small-lh); font-weight: 600;
}
/* the sheet's and the bar's shared parts: the score with the verdict beside it, and the pass bar (--pass, set by
   js/demo.js, is the score out of 10), which fills as the sheet comes up and as the bar appears */
.tryit .sb-mid { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 12px 0 0; }
.sb-track { position: relative; display: block; height: 8px; margin-top: 12px; overflow: hidden; border-radius: 4px; background: #E6EAF0; }
.sb-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--pass, 0%); border-radius: 4px; background: var(--navy); transform-origin: left center; }
@media (prefers-reduced-motion: no-preference) {
  .hp-sheet.in .sb-fill { animation: hp-sb-fill 1.1s cubic-bezier(.2, .7, .2, 1) .2s backwards; }
  .hp-sbar .sb-fill { animation: hp-sb-fill 1.1s cubic-bezier(.2, .7, .2, 1) .15s backwards; }   /* it restarts whenever the bar goes from hidden to shown */
}
@keyframes hp-sb-fill { from { transform: scaleX(0); } }

/* Upright phones in browsers without <dialog> (iOS before 15.4), where the sheet can't open: its panel stands in the
   page under the controls once the clip has ended, spaced like the score bar, without its handle or its own Try again
   (Try again is just above it). The live result stays off screen, reading the result out. (The owner's decision, Q18
   in REBUILD-NOTES.md: it replaced a card with the score in a navy band.) */
@media (max-width: 760px) and (min-height: 521px) {
  .tryit:not(.use-sheet) .hp-sheet { display: none; }
  .tryit[data-state="done"]:not(.use-sheet) .hp-sheet {
    position: static; display: block; max-height: none; margin-top: 14px; padding: 16px 18px;
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; overflow: visible; transform: none;
  }
  .tryit[data-state="done"]:not(.use-sheet) .hp-info { padding-top: 0; }
  .tryit:not(.use-sheet) .hp-sheet-grab, .tryit:not(.use-sheet) #sheet-again { display: none; }
}

/* The live result: read out by screen readers when the clip starts and ends (except where the score sheet is used,
   which is named and described instead). Never on screen. */
.tryit .result { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* How the real test scores: three worked examples drawn like the timeline, the totals, and the source line */
.hp-info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 14px; }
.tryit .hp-kick {
  display: flex; align-items: center; gap: 10px; margin: 0;
  color: var(--navy); font-size: var(--label); line-height: var(--label-lh); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.tryit .hp-kick::before { content: ""; flex: none; width: 20px; height: 4px; border-radius: 1px; background: var(--navy); }
.tryit .hp-kick::after { content: ""; flex: 1; height: 1px; margin-left: 4px; background: var(--line); }   /* runs into a rule */
.hp-cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.hp-case {
  min-width: 0; display: flex; flex-direction: column; gap: 12px;
  padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.hp-case.bad { background: var(--bg); }
.hp-case h4 { margin: 0; color: var(--navy); font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: 0; }
.tryit .hp-case p { margin: 0; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }
.tryit .hp-case .hp-res { display: flex; align-items: baseline; gap: 6px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.hp-res b { color: var(--navy); font-size: var(--h2); line-height: var(--h2-lh); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bad .hp-res b { color: var(--muted); }
/* the little timeline: grey dashes, the five scoring bands, and flags where the clicks were */
.hp-mini { position: relative; height: 40px; margin-top: 4px; }
.hp-mini::before { content: ""; position: absolute; left: 0; right: 0; top: 24px; height: 3px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 12px, transparent 12px 20px); }
.hp-win { position: absolute; top: 16px; left: 28%; display: flex; gap: 2px; width: 46%; height: 18px; }
.hp-win i { flex: 1; }
.hp-win i:nth-child(1) { border-radius: 3px 0 0 3px; background: var(--band-5); }
.hp-win i:nth-child(2) { background: var(--band-4); }
.hp-win i:nth-child(3) { background: var(--band-3); }
.hp-win i:nth-child(4) { background: var(--band-2); }
.hp-win i:nth-child(5) { border-radius: 0 3px 3px 0; background: var(--band-1); }
.bad .hp-win { filter: grayscale(1); opacity: .45; }
.hp-fl { position: absolute; top: 4px; width: 10px; height: 32px; }
.hp-fl::before { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 32px; border-radius: 1px; background: var(--accent); }
.hp-fl::after { content: ""; position: absolute; left: 2px; top: 0; border-left: 8px solid var(--accent); border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; }
.hp-fl.stray::before { background: var(--line-strong); }
.hp-fl.stray::after { border-left-color: var(--line-strong); }
.bad .hp-fl::before { background: var(--muted); }
.bad .hp-fl::after { border-left-color: var(--muted); }
/* where the flags are: a click as it starts; a stray click then one in the window; clicks in a rhythm */
.early .hp-fl { left: 31%; }
.stray-first .hp-fl { left: 41%; }
.stray-first .stray { left: 9%; }
.pattern .hp-fl:nth-child(2) { left: 4%; }
.pattern .hp-fl:nth-child(3) { left: 16%; }
.pattern .hp-fl:nth-child(4) { left: 28%; }
.pattern .hp-fl:nth-child(5) { left: 40%; }
.pattern .hp-fl:nth-child(6) { left: 52%; }
.pattern .hp-fl:nth-child(7) { left: 64%; }
.pattern .hp-fl:nth-child(8) { left: 76%; }
.pattern .hp-fl:nth-child(9) { left: 88%; }
/* the totals, as one pale band split into three */
.hp-foot { display: flex; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--navy-50); }
.hp-foot li { flex: 1; min-width: 0; padding: 12px 18px; color: var(--text); font-size: var(--small); line-height: var(--small-lh); }
.hp-foot li + li { border-left: 1px solid var(--line); }
.hp-foot b { color: var(--navy); font-weight: 600; }
.hp-src { margin-top: 4px; }

/* The row layout: the clip runs to the card's edges and the title sits at the top of it */
@media (max-width: 607px), (max-width: 760px) and (min-height: 521px) {
  .tryit .stage { margin: -22px -22px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 7px 7px 0 0; }   /* its corners follow the card's (8px less the 1px border) */
  .tryit .tf-head {
    justify-content: flex-start; padding: 18px 22px;
    background: linear-gradient(180deg, rgba(10, 24, 45, .92) 0, rgba(10, 24, 45, .86) 60%, rgba(10, 24, 45, .35) 100%);
  }
  .tryit .tf-head h2 { max-width: 16ch; margin-top: 10px; font-size: var(--h3); line-height: var(--h3-lh); }
  .tryit .tf-head p:not(.label), .tryit .tf-head .hp-go { display: none; }
}
/* Phones: the examples stack */
@media (max-width: 760px) {
  .tryit .hp-kick::after { display: none; }
  .hp-cases { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hp-case { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "h r" "m m" "p p"; gap: 8px 12px; padding: 14px 16px 16px; }
  .hp-case h4 { grid-area: h; align-self: center; }
  .hp-case .hp-mini { grid-area: m; margin-top: 0; }
  .tryit .hp-case p:not(.hp-res) { grid-area: p; }
  .tryit .hp-case .hp-res { grid-area: r; align-self: center; margin: 0; padding: 0; border: 0; }
  .hp-res b { font-size: var(--h3); line-height: var(--h3-lh); }
  .hp-foot { flex-direction: column; }
  .hp-foot li + li { border-left: 0; border-top: 1px solid var(--line); }
}

/* Expand, the theatre view, on screens 640px wide and 700px tall or more, where it makes the clip bigger (1.2 to 2.5
   times its area on the page). On phones, and on shorter or narrower windows, the clip on the page is already as big
   as the screen allows, so there's no Expand button (the owner's decision, Q15 in REBUILD-NOTES.md); js/demo.js uses
   the same test, and closes Expand if the window leaves that range. The section becomes a navy layer over the page (.hp-expanded, set by
   js/demo.js) showing just the clip, the timeline and the controls. It's a modal while it's open: the rest of the page
   is inert and doesn't scroll (html.hp-lock), and .hp-hold takes the section's place, so the page underneath stays
   exactly where it was. A header row holds "Scoring demo" and the close button, which is never at the screen's edge
   (TVs crop their edges); the timeline sits on a white dock; in the row layout the controls turn white on navy. The clip
   grows out of its place on the page and shrinks back into it (js/demo.js). The street is framed 2:1 here instead of
   2.77:1, so the cars come out bigger. */
@media (max-width: 639px), (max-height: 699px) {
  .tryit #hp-ex { display: none; }
}
html.hp-lock { overflow: hidden; scrollbar-gutter: stable; }   /* the page doesn't scroll, and doesn't shift as its scrollbar goes */
.hp-hold { display: none; grid-column: 1 / -1; height: var(--hold); }   /* --hold: the section's height, set by js/demo.js */
.tryit.hp-expanded + .hp-hold { display: block; }
.tryit.hp-expanded {
  --ex-r: 2;              /* the clip's shape, width / height (the engine's Expand framing) */
  --ex-chrome: 176px;     /* the height of everything in the layer except the clip and the layer's own padding */
  position: fixed; inset: 0; z-index: 1000;
  justify-content: flex-start; align-items: center;
  padding: max(14px, 2vw, env(safe-area-inset-top, 0px)) max(24px, 3vw, env(safe-area-inset-right, 0px)) max(14px, 2vw, env(safe-area-inset-bottom, 0px)) max(24px, 3vw, env(safe-area-inset-left, 0px));
  border: 0; border-radius: 0; background: var(--navy-900);
  overflow: auto; overscroll-behavior: contain;
}
/* Centred in the layer, or from its top when it's too tall, so the close button and the clip are never out of reach:
   the spare space goes to the outer margins of the first and last parts in the layer's flow, and there's none when
   it's too tall. (justify-content: center would push a column that's too tall off the top of the screen as well as
   the bottom, where it can't be scrolled to.) The frame is first; the score's part is last, except where it's taken out of the flow (the frame, below). */
.tryit.hp-expanded .hp-frame { margin-top: auto; }
.tryit.hp-expanded .hp-info { margin-bottom: auto; }
/* The clip as large as fits beside everything else in the layer, at its shape (100vh for browsers without dvh) */
.tryit.hp-expanded .hp-frame, .tryit.hp-expanded .hp-info {
  width: 100%;
  max-width: min(100%, calc((100vh - var(--ex-chrome) - 2 * max(14px, 2vw)) * var(--ex-r)));
  max-width: min(100%, calc((100dvh - var(--ex-chrome) - 2 * max(14px, 2vw)) * var(--ex-r)));
}
.tryit.hp-expanded .hp-kick, .tryit.hp-expanded .hp-cases, .tryit.hp-expanded .hp-foot, .tryit.hp-expanded .hp-src { display: none; }
.tryit.hp-expanded .hp-info { padding-top: 0; }
/* the score sheet comes up over the foot of the layer, so the layer's contents lift to the top first (.hp-sheet-up) */
.tryit.hp-expanded.hp-sheet-up .hp-frame { margin-top: 0; }
.tryit.hp-expanded .stage { margin: 0; border: 0; border-radius: 10px; }
.tryit.hp-expanded .tf-head .label { display: none; }   /* the header row already says Scoring demo */
.tryit.hp-expanded #hp-ex { display: none; }   /* one way out: the close button (or Esc, or a click on the dark layer) */
/* The header row: the road-dash label in Navy 200, and the close button, 44px square */
.tryit.hp-expanded .hp-exhead { display: flex; align-items: center; gap: 12px; height: 60px; }
.hp-exhead .label { align-items: center; color: var(--navy-200); }
.hp-exhead .label::before { margin-top: 0; background: currentColor; }   /* centred on the line */
.hp-exclose {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-left: auto; padding: 0;
  border: 1px solid rgba(255, 255, 255, .32); border-radius: var(--radius-control); background: rgba(255, 255, 255, .1); color: #FFFFFF;
  cursor: pointer;
}
.hp-exclose:hover { background: rgba(255, 255, 255, .2); }
.hp-exclose:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
/* The timeline on its white dock, drawn behind it so the timeline keeps its own geometry */
.tryit.hp-expanded .tl { position: relative; isolation: isolate; margin: 26px 22px 14px; }
.tryit.hp-expanded .tl::before { content: ""; position: absolute; inset: -14px -22px -12px; z-index: -1; border-radius: 10px; background: var(--surface); }
/* The wide layout (wider than 760px, and phones held sideways 608px wide or more): the player bar and the score card
   are on the clip */
@media (min-width: 761px), (min-width: 608px) and (max-height: 520px) {
  .tryit.hp-expanded .hp-ctrl { margin: 0; border-radius: 0 0 10px 10px; }   /* the clip has no border here */
  .tryit.hp-expanded .hp-info { position: absolute; }   /* the score shows on the clip; the (empty) live result mustn't make the layer scroll */
  .tryit.hp-expanded .hp-frame { margin-bottom: auto; }   /* so the frame is last in the flow */
}
/* The row layout: the controls row sits straight on the dark layer: Start or Try again turns white with navy text, the
   rest light */
@media (max-width: 607px), (max-width: 760px) and (min-height: 521px) {
  .tryit.hp-expanded .controls #go { border-color: #FFFFFF; background: #FFFFFF; color: var(--navy); }
  .tryit.hp-expanded .controls #go:hover { border-color: var(--navy-50); background: var(--navy-50); }
  .tryit.hp-expanded .controls .line { border-color: rgba(255, 255, 255, .32); background: rgba(255, 255, 255, .1); color: #FFFFFF; }
  .tryit.hp-expanded .controls .hp-btn:focus-visible { outline-color: #FFFFFF; }
  .tryit.hp-expanded .controls .hint { color: var(--navy-200); }
  .tryit.hp-expanded .controls kbd { border-color: rgba(255, 255, 255, .5); background: transparent; color: #FFFFFF; }
}


/* ---------- Privacy page ---------- */

.page-hero .updated { margin: -4px 0 0; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }

.ptile h2 { margin-bottom: 4px; }
.ptile p { margin-bottom: 8px; }
.ptile p:last-child { margin-bottom: 0; }
.ptile strong { color: var(--text); font-weight: 600; }
.ptile a { color: var(--accent); }

/* Lists in GOV.UK style, with the brand's road-dash bullet (10x4 navy). The dash sits on the first line and is centred
   on its x-height (vertical-align: middle) at any size; wrapped lines hang 22px in. role="list" on each list keeps it
   announced as a list in Safari VoiceOver, which drops lists styled with list-style: none. */
.ptile ul { margin: 0 0 8px; padding: 0; list-style: none; }
.ptile li { padding-left: 22px; color: var(--muted); font-size: var(--body); line-height: var(--body-lh); }
.ptile li + li { margin-top: 8px; }   /* so a wrapped line can't be mistaken for the next item */
.ptile li::before { content: ""; display: inline-block; width: 10px; height: 4px; margin: 0 12px 0 -22px; border-radius: 1px; background: var(--navy); vertical-align: middle; }

.credits { grid-column: 1 / -1; }
.cr-url { overflow-wrap: anywhere; font-size: 0.875em; }   /* the licences' addresses as plain text: credited without linking out */


/* ---------- 404 page ---------- */

.nf-hero { min-height: clamp(380px, 52vh, 520px); }
.nf-hero h1 { max-width: 16ch; }
.nf-btn { margin-top: 8px; }
@media (max-width: 560px) {
  .nf-hero { min-height: 0; }   /* the road sits in the card's flow, so the card fits its content like the other pages */
}
