/* Wise Driving School. Two voices: the road sign (Overpass) and the
   state form (Public Sans). The red hero is the one loud thing. */

:root {
  --red: #b70205;
  --red-dark: #8f0204;
  --asphalt: #1e2225;
  --white: #fafbfb;
  --concrete: #e9eceb;
  --grey: #59626a;
  --yellow: #ffc61a;
  --rule: #cdd3d2;
  --rule-dark: #3a4146;
  --on-dark: #d3d8da;

  --sign: "Overpass", "Arial Narrow", Arial, sans-serif;
  --form: "Public Sans", system-ui, -apple-system, Arial, sans-serif;

  --radius: 6px;
  --gutter: clamp(20px, 4vw, 40px);
  --section: clamp(56px, 8vw, 104px);
  --control: 52px;
}

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

html, body { overflow-x: clip; }

html { scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--white);
  color: var(--asphalt);
  font: 400 1.0625rem/1.6 var(--form);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, address { margin: 0; padding: 0; }

ul, ol { list-style: none; }

h1, h2, h3 {
  font-family: var(--sign);
  overflow-wrap: break-word;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 5.2vw + 0.6rem, 4.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.01em;
  max-width: 16ch;
}

h2 {
  font-size: clamp(1.75rem, 1.6vw + 1.2rem, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.005em;
  max-width: 20ch;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

p { max-width: 68ch; text-wrap: pretty; }

.lead { font-size: 1.25rem; line-height: 1.5; max-width: 44ch; }

small, .small { font-size: 0.875rem; line-height: 1.5; color: var(--grey); }

strong { font-weight: 600; }

a { color: inherit; text-underline-offset: 0.18em; }

a:hover { color: var(--red); }

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

address { font-style: normal; }

[hidden] { display: none !important; }

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

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--asphalt);
  color: var(--white);
  border-radius: var(--radius);
}

.skip:focus-visible { top: 16px; color: var(--white); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control);
  padding: 0 22px;
  border: 2px solid var(--asphalt);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--asphalt);
  font: 700 1.0625rem/1 var(--sign);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover { background: var(--concrete); color: var(--asphalt); }

.btn:active { background: var(--rule); }

.btn--primary {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.btn--primary:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
  color: var(--white);
}

.btn--primary:active { background: var(--asphalt); border-color: var(--asphalt); }

.btn--small { min-height: 44px; padding: 0 16px; font-size: 0.9375rem; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- header ---------- */

.nav { border-bottom: 1px solid var(--rule); background: var(--white); }

.nav__bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
}

.nav__mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  font: 800 1.1875rem/1 var(--sign);
  text-decoration: none;
  white-space: nowrap;
}

.nav__mark:hover { color: var(--asphalt); }

.nav__logo {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
}

.nav__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  transform: scale(1.2);
  transform-origin: 50% 12%;
}

.nav__links { display: flex; gap: 4px; }

.nav__links a,
.nav__lang {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav__links a[aria-current="page"] {
  box-shadow: inset 0 -3px 0 var(--red);
}

.nav__lang {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0 14px;
}

.nav__menu { display: none; position: relative; }

.nav__menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  background: var(--asphalt);
  color: var(--white);
  font: 700 0.9375rem/1 var(--sign);
  cursor: pointer;
  list-style: none;
}

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

.nav__menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 40;
  display: grid;
  min-width: 15rem;
  padding: 8px;
  border: 2px solid var(--asphalt);
  border-radius: var(--radius);
  background: var(--white);
}

.nav__menu a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  font-weight: 600;
  text-decoration: none;
}

.nav__menu a[aria-current="page"] { background: var(--concrete); }

@media (max-width: 66rem) {
  .nav__links, .nav .btn--small { display: none; }
  .nav__menu { display: block; }
  .nav__bar { gap: 10px; min-height: 64px; }
}

@media (max-width: 26rem) {
  .nav__mark > span:last-child { display: none; }
}

/* ---------- hero: the side of his car ---------- */

.hero { background: var(--red); color: var(--white); }

.hero { position: relative; }

.hero__in {
  display: grid;
  align-items: center;
  min-height: clamp(420px, 44vw, 640px);
  padding-block: clamp(48px, 6vw, 88px);
}

.hero__text {
  display: grid;
  gap: 24px;
  justify-items: start;
  width: calc(50% - 24px);
}

/* the car fills the right half, edge to edge, down to the road */
.hero__photo {
  position: absolute;
  inset: 0 0 0 50%;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 60%;
}

.hero :focus-visible, .band :focus-visible, .foot :focus-visible {
  outline-color: var(--yellow);
}

.hero .btn--primary {
  border-color: var(--white);
  background: var(--white);
  color: var(--asphalt);
}

.hero .btn--primary:hover { background: var(--concrete); border-color: var(--concrete); }

.hero .btn:not(.btn--primary) {
  border-color: var(--white);
  background: transparent;
  color: var(--white);
}

.hero .btn:not(.btn--primary):hover { background: var(--red-dark); }

.photo {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--concrete);
}

.photo img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 56rem) {
  .hero__in { min-height: 0; }
  .hero__text { width: 100%; }
  .hero__photo { position: static; aspect-ratio: 3 / 2; }
}

/* the one moving thing: a centre line that draws across once */

.lane { height: 20px; background: var(--asphalt); }

.lane::before {
  content: "";
  display: block;
  height: 4px;
  translate: 0 8px;
  background: repeating-linear-gradient(
    90deg, var(--yellow) 0 56px, transparent 56px 96px);
  animation: lane 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 150ms both;
}

@keyframes lane {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .lane::before { animation: none; }
}

/* ---------- inner page heading ---------- */

.banner { padding-block: clamp(40px, 6vw, 80px) clamp(32px, 4vw, 56px); }

.banner__in { display: grid; gap: 20px; justify-items: start; }

.banner h1 { max-width: 18ch; }

/* ---------- sections ---------- */

.section { padding-block: var(--section); }

.section--band { background: var(--concrete); }

.cols {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.head { display: grid; gap: 14px; justify-items: start; }

.head--stack { margin-bottom: 36px; }

.prose { display: grid; gap: 18px; }
.prose > p { max-width: 62ch; }
.prose .facts { margin-top: 10px; }

@media (max-width: 56rem) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- lists ---------- */

.rows { border-top: 2px solid var(--asphalt); }

.rows > li, .rows > div {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 6px 32px;
  align-items: baseline;
  padding-block: 18px;
  border-bottom: 1px solid var(--rule);
}

/* real sequences only */
ol.rows { counter-reset: step; }

ol.rows > li {
  counter-increment: step;
  grid-template-columns: 44px minmax(0, 5fr) minmax(0, 7fr);
}

ol.rows > li::before {
  content: counter(step);
  font: 800 1.5rem/1 var(--sign);
  font-variant-numeric: tabular-nums;
}

.prices > div { grid-template-columns: minmax(0, 1fr) auto; }

.prices dd {
  font: 800 1.5rem/1.2 var(--sign);
  font-variant-numeric: tabular-nums;
}

.dates > li {
  grid-template-columns: 13rem minmax(0, 1fr) auto;
  align-items: center;
}

.dates time { font: 700 1.25rem/1.25 var(--sign); }

.check {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
  border-top: 2px solid var(--asphalt);
}

.check > li { padding-block: 14px; border-bottom: 1px solid var(--rule); }

.check--one { grid-template-columns: minmax(0, 1fr); }

.facts { display: grid; border-top: 2px solid var(--asphalt); }

.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
}

.facts dt { font-weight: 600; }

.facts dd { min-width: 0; overflow-wrap: anywhere; }

.head .facts { width: 100%; margin-top: 12px; }

.links { border-top: 2px solid var(--asphalt); }

.links a {
  display: block;
  padding-block: 16px;
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
}

.links small { display: block; font-weight: 400; }

@media (max-width: 56rem) {
  .rows > li, .rows > div, .dates > li {
    grid-template-columns: minmax(0, 1fr);
  }
  .prices > div { grid-template-columns: minmax(0, 1fr) auto; }
  ol.rows > li { grid-template-columns: 36px minmax(0, 1fr); }
  ol.rows > li > :last-child { grid-column: 2; }
  .dates .btn { justify-self: start; margin-top: 6px; }
  .check { grid-template-columns: minmax(0, 1fr); }
}

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

.faq { border-top: 2px solid var(--asphalt); }

.faq details { border-bottom: 1px solid var(--rule); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding-block: 14px;
  font: 700 1.25rem/1.25 var(--sign);
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  flex-shrink: 0;
  width: 28px;
  font: 700 1.5rem/1 var(--sign);
  text-align: center;
}

.faq details[open] summary::after { content: "\2212"; }

.faq details > div { display: grid; gap: 12px; padding-bottom: 20px; }

/* ---------- teen or adult switch ---------- */

.seg { display: inline-flex; gap: 8px; margin-bottom: 24px; }

.seg button {
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--asphalt);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--asphalt);
  font: 700 1rem/1 var(--sign);
  white-space: nowrap;
  cursor: pointer;
}

.seg button[aria-selected="true"] {
  background: var(--asphalt);
  color: var(--white);
}

html:not(.js) .seg { display: none; }

.panel h3 { margin-bottom: 12px; }

.js .panel h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

html:not(.js) .panel + .panel { margin-top: 40px; }

/* ---------- two addresses ---------- */

.places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.place { display: grid; gap: 12px; align-content: start; justify-items: start; }

.place + .place {
  padding-left: clamp(24px, 4vw, 56px);
  border-left: 2px solid var(--asphalt);
}

.place:first-child { padding-right: clamp(24px, 4vw, 56px); }

.place h3 { font-size: 1.75rem; font-weight: 800; }

@media (max-width: 56rem) {
  .places { grid-template-columns: minmax(0, 1fr); }
  .place:first-child { padding-right: 0; padding-bottom: 28px; }
  .place + .place {
    padding-left: 0;
    padding-top: 28px;
    border-left: 0;
    border-top: 2px solid var(--asphalt);
  }
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.split > div { display: grid; gap: 16px; justify-items: start; }

.split .facts { width: 100%; }

@media (max-width: 56rem) {
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- forms ---------- */

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

.field { display: grid; gap: 6px; align-content: start; }

.field--wide { grid-column: 1 / -1; }

fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }

.field label, .field legend {
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.field input, .field select, .field textarea {
  width: 100%;
  min-height: var(--control);
  padding: 10px 14px;
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--asphalt);
  font: inherit;
}

.field textarea { min-height: 128px; resize: vertical; }

.field [aria-invalid] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }

.choices { display: grid; gap: 8px; }

.choices label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--control);
  padding: 8px 14px;
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
}

.choices input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  min-height: 0;
  accent-color: var(--red);
}

.choices label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--asphalt); }

.form__help {
  grid-column: 1 / -1;
  min-height: 1lh;
  font-size: 0.9375rem;
  font-weight: 600;
}

@media (max-width: 56rem) {
  .form { grid-template-columns: minmax(0, 1fr); }
}

.fill {
  padding: 0 0.25em;
  border: 1px dashed currentColor;
  border-radius: 3px;
}

/* ---------- close and footer ---------- */

.band { background: var(--asphalt); color: var(--white); }

.band__in {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-block: clamp(48px, 6vw, 80px);
}

.band h2 { max-width: 22ch; }

.band .lead { margin-top: 10px; color: var(--on-dark); }

.band .btn:not(.btn--primary) {
  border-color: var(--white);
  background: transparent;
  color: var(--white);
}

.band .btn:not(.btn--primary):hover { background: var(--rule-dark); }

.foot {
  background: var(--asphalt);
  color: var(--on-dark);
  font-size: 0.875rem;
  line-height: 1.55;
}

.foot__in {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  padding-block: 40px 56px;
  border-top: 1px solid var(--rule-dark);
}

.foot__mark {
  margin-bottom: 10px;
  color: var(--white);
  font: 800 1.25rem/1.2 var(--sign);
}

.foot p { max-width: 62ch; }

.foot p + p { margin-top: 12px; }

.foot a:hover { color: var(--white); }

.foot nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  align-content: start;
}

.foot nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--white);
  text-decoration: none;
}

.foot nav a:hover { text-decoration: underline; }

@media (max-width: 56rem) {
  .foot__in { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- phone: call and text stay in reach ---------- */

.callbar { display: none; }

@media (max-width: 48rem) {
  .callbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px var(--gutter);
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--rule);
    background: var(--white);
  }
  body { padding-bottom: 76px; }
}
