/* CarStatus, the public page. One stylesheet and no script: the page's server allows nothing else
   (README.md). The look is the sales video's: asphalt, a road, the car and its headlight. */

@font-face {
  font-family: "Barlow";
  src: url("/barlow-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/barlow-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/barlow-condensed-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  /* The video's colours, in OKLCH (the hex is the video's own value). */
  --asphalt: oklch(21.05% 0.0085 240.3); /* #15191c */
  --road: oklch(26.76% 0.0125 233); /* #20272b */
  --road-edge: oklch(32.65% 0.0151 232.2); /* #2d363b */
  --panel: oklch(25.19% 0.0115 237.1); /* #1d2327 */
  --line: oklch(37.66% 0.0178 238.5); /* #39434a */
  --paper: oklch(97.81% 0.0017 145.6); /* #f7f8f7 */
  --concrete: oklch(94.7% 0.0034 145.5); /* #eceeec */
  --rule: oklch(86% 0.006 150); /* a hairline on paper */
  --muted: oklch(76.06% 0.011 219.6); /* #aab3b6 */
  --ink-soft: oklch(43.33% 0.0132 235.1); /* #4a5257 */
  --teal: oklch(51.09% 0.0861 186.4); /* #0f766e */
  --teal-light: oklch(80.54% 0.0819 185.8); /* #7fd1c7 */
  --amber: oklch(81.14% 0.1656 85); /* #f2b705 */
  --amber-lit: oklch(87% 0.16 88);
  --amber-pressed: oklch(74% 0.16 82);

  /* What a band is made of. Asphalt is the default; the light bands swap these below. */
  --bg: var(--asphalt);
  --fg: var(--paper);
  --fg-soft: var(--muted);
  --hairline: var(--line);
  --accent: var(--teal-light);
  --focus: var(--amber);

  /* Type: one scale, fluid between a phone and a desk. */
  --step-0: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  --step-3: clamp(2.125rem, 1.5rem + 2.8vw, 3.75rem);
  --step-4: clamp(2.75rem, 1.25rem + 4.2vw, 5.25rem);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", Arial, sans-serif;

  /* Space between the parts of a band. How far two things stand apart says how much they have to
     do with each other, so the distances are few and named: a new part takes one of these. */
  --gap-title: 0.75rem; /* a small title to its text, a picture to its caption */
  --gap-head: 1.25rem; /* a headline to its sentence */
  --gap-action: 2rem; /* words to the button under them, a picture to its words */
  --gap-row: clamp(2.5rem, 2rem + 2vw, 3.5rem); /* one row of statements to the next */
  --gap-block: clamp(3rem, 2rem + 3vw, 4.5rem); /* a band's opening to what the band shows */
  --band: clamp(4rem, 2.5rem + 6vw, 8rem); /* a band's own top and bottom */
  --gap-column: clamp(2rem, 5vw, 4rem); /* one column to the next */
  --gutter: clamp(1rem, 4vw, 3rem);
  --shell: 80rem;
  --road-height: clamp(4.5rem, 3rem + 6vw, 8rem);
  --scene-top: clamp(4.5rem, 3rem + 7vw, 8rem); /* the height the car stands in, above its road */
}

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

html {
  /* A screen wider than a laptop's gets the whole page larger, in proportion, and not wider
     margins: the reader's own size up to 1440 px, a quarter more at 2560 px. Every length here is
     in rem, so the column, the type and the drawings grow together; the rem term keeps the
     reader's size and the browser's zoom. */
  font-size: clamp(100%, 0.6786rem + 0.357vw, 125%);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--paper);
  font: 500 var(--step-0) / 1.55 var(--text);
}

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

ol,
ul {
  padding: 0;
  list-style: none;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -6rem;
  z-index: 2;
  padding: 0.75rem 1rem;
  background: var(--paper);
  color: var(--asphalt);
  font-weight: 600;
}

.skip:focus {
  top: 1rem;
}

.shell {
  width: min(100% - 2 * var(--gutter), var(--shell));
  margin-inline: auto;
}

/* Bands. Each sets its own surface, so the text on it always has its contrast. */
.band {
  padding-block: var(--band);
  background: var(--bg);
  color: var(--fg);
}

.band--paper,
.band--concrete {
  --bg: var(--paper);
  --fg: var(--asphalt);
  --fg-soft: var(--ink-soft);
  --hairline: var(--rule);
  --accent: var(--teal);
  --focus: var(--teal);
}

.band--concrete {
  --bg: var(--concrete);
}

@media (prefers-color-scheme: dark) {
  .band--paper,
  .band--concrete {
    --bg: var(--panel);
    --fg: var(--paper);
    --fg-soft: var(--muted);
    --hairline: var(--line);
    --accent: var(--teal-light);
    --focus: var(--amber);
  }

  .band--concrete {
    --bg: var(--road);
  }
}

/* Type. */
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
}

h2 {
  font-size: var(--step-3);
}

h3 {
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.1;
}

/* A headline is the brightest thing on its band. The sentence that supports it is a step softer,
   and the words that carry the promise are lit again. */
.lead {
  max-width: 34ch;
  color: var(--fg-soft);
  font-size: var(--step-1);
  line-height: 1.4;
  text-wrap: pretty;
}

.lead strong {
  color: var(--fg);
  font-weight: 600;
}

.note {
  max-width: 62ch;
  color: var(--fg-soft);
  font-size: 1rem;
}

.stack > * + * {
  margin-top: var(--gap-head);
}

/* A band opens the same way everywhere: one headline and, where it needs one, one sentence under
   it, narrower than the headline. From a tablet up both are centred over what the band shows. */
.intro > * + * {
  margin-top: var(--gap-head);
}

.intro p {
  max-width: 36rem;
  color: var(--fg-soft);
  font-size: var(--step-1);
  line-height: 1.4;
  text-wrap: pretty;
}

/* Header. */
.top {
  padding-block: 1.25rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--paper);
  font: 700 1.75rem / 1 var(--display);
  text-decoration: none;
}

.logo b {
  color: var(--teal-light);
  font-weight: inherit;
}

.logo svg {
  width: 2.25rem;
  height: 2.25rem;
}

/* The one thing to press. Amber, the headlight's colour, used for nothing else that can be pressed. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.5rem 1.75rem;
  border-radius: 0.5rem;
  background: var(--amber);
  color: var(--asphalt);
  border: 0;
  font: 600 var(--step-1) / 1.2 var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}

.button:hover {
  background: var(--amber-lit);
}

.button:active {
  background: var(--amber-pressed);
  transform: translateY(1px);
}

.button:focus-visible {
  outline-color: var(--paper);
  border-radius: 0.5rem;
}

.ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.ask p {
  color: var(--fg-soft);
}

/* The second thing to do, beside the button: a plain link. */
.more {
  display: inline-flex;
  align-items: center;
  min-height: 3.25rem;
  font: 600 var(--step-1) / 1.2 var(--text);
}

/* Hero: the customer's question and its answer, and under them the sentence and the button with,
   across from them, the mail that answers. */
.hero {
  padding-block: clamp(1.5rem, 1rem + 3vw, 3.5rem) 0;
}

.hero__stage {
  position: relative;
  z-index: 2; /* above the scene: the beam passes behind the phone */
}

.hero__grid {
  display: grid;
  gap: var(--gap-block);
  margin-top: var(--gap-head);
}

.hero h1 span {
  display: block;
}

/* The question nobody answered is unlit, as an envelope nobody sent is. */
.hero__call {
  color: var(--muted);
}

.hero .lead {
  max-width: 44ch;
}

.hero .ask {
  margin-top: var(--gap-action);
}

.hero .note {
  margin-top: var(--gap-title);
}

.proof {
  max-width: 44ch;
  margin-top: var(--gap-action);
  padding-top: var(--gap-head);
  border-top: 1px solid var(--hairline);
  font-weight: 600;
}

/* The customer's phone, with the mail as it arrived. */
.phone {
  width: min(100%, 22rem);
  margin-inline: auto;
  padding: 0.75rem;
  border-radius: 2.75rem;
  background: var(--road-edge);
  box-shadow: 0 0 0 1px var(--line), 0 0 6rem oklch(81.14% 0.1656 85 / 0.2);
}

.phone img {
  width: 100%;
  border-radius: 2.1rem;
}

/* The road, the motif of the page: the car in the hero, the stops further down. */
.road {
  position: relative;
  height: var(--road-height);
  border-top: 0.5rem solid var(--road-edge);
  background: var(--road);
}

.road::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 0.375rem;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, var(--amber) 0 3rem, transparent 3rem 5.25rem);
}

/* The scene holds the car above its road and cuts the beam and the car's arrival at its own edges. */
.scene {
  position: relative;
  padding-top: var(--scene-top);
  overflow: hidden;
  overflow: clip;
}

.car {
  position: absolute;
  z-index: 1;
  bottom: calc(var(--road-height) * 0.58);
  left: max(var(--gutter), (100% - var(--shell)) / 2);
  width: clamp(11rem, 6rem + 22vw, 24rem);
  height: auto;
  overflow: visible;
  animation: arrive 1200ms cubic-bezier(0.16, 0.8, 0.24, 1) both;
}

.car__beam {
  animation: light 500ms 1000ms ease-out both;
}

.car__spokes {
  animation: roll 1200ms cubic-bezier(0.16, 0.8, 0.24, 1) both;
}

.car__spokes--rear {
  transform-origin: 100px 116px;
}

.car__spokes--front {
  transform-origin: 296px 116px;
}

@keyframes arrive {
  from {
    transform: translateX(-70vw);
  }
}

@keyframes roll {
  from {
    transform: rotate(-900deg);
  }
}

@keyframes light {
  from {
    opacity: 0;
  }
}

/* The stops of a repair, standing on the road. */
.stops {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: var(--gap-block);
}

.stops li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg);
  font: 700 clamp(1rem, 0.8rem + 1vw, 1.625rem) / 1.1 var(--display);
  text-align: center;
}

.stops li::after {
  content: "";
  flex: 1 0 clamp(1.5rem, 1rem + 2vw, 3rem);
  width: 2px;
  background: var(--hairline);
}

/* A notice nobody sent is an outline; one that went out is lit. */
.envelope {
  width: clamp(2.5rem, 1.5rem + 5vw, 5rem);
  height: auto;
  overflow: visible;
  fill: none;
  stroke: var(--fg-soft);
  stroke-width: 4;
  stroke-dasharray: 7 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.envelope--sent {
  fill: var(--paper);
  stroke: var(--teal);
  stroke-dasharray: none;
  filter: drop-shadow(0 0 0.75rem oklch(81.14% 0.1656 85 / 0.45));
}

/* A few statements side by side. No boxes, the space separates them. Each is a title and a text
   on two rows its whole row of statements shares: a title that takes a second line moves its
   neighbours' texts down with its own, so the texts of a row start on one line. A browser without
   subgrid lays each statement out by itself. */
.points {
  display: grid;
  gap: var(--gap-row) var(--gap-column);
  margin-top: var(--gap-block);
}

.points > div {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: var(--gap-title);
  align-content: start;
}

.points p {
  max-width: 38ch;
  color: var(--fg-soft);
}

/* The video. */
.film {
  margin-top: var(--gap-block);
}

.film video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  background: #000;
}

.film .note {
  margin-top: var(--gap-title);
}

/* The three steps: a real sequence, so they are numbered. */
.steps {
  display: grid;
  gap: var(--gap-block);
  margin-top: var(--gap-block);
  counter-reset: step;
}

.steps li {
  display: grid;
  gap: var(--gap-action) var(--gap-column);
  align-items: center;
  counter-increment: step;
}

.steps h3::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-size: var(--step-3);
  font-weight: 800;
  line-height: 1;
}

.steps h3 + p {
  margin-top: var(--gap-title);
  max-width: 34ch;
  color: var(--fg-soft);
}

.steps img {
  width: 100%;
  border-radius: 0.75rem;
  background: var(--asphalt);
}

/* The questions before starting, shown open (short answers need no folding): one row each, the
   question on the left and its answer on the right, so each can be read down its own column. */
.faq {
  max-width: 60rem;
  margin: var(--gap-block) auto 0;
  border-top: 1px solid var(--hairline);
}

.faq > div {
  display: grid;
  gap: var(--gap-title) var(--gap-column);
  padding-block: calc(var(--gap-row) / 2);
  border-bottom: 1px solid var(--hairline);
}

.faq dt {
  font: 700 var(--step-2) / 1.1 var(--display);
  text-wrap: balance;
}

.faq dd {
  max-width: 36rem;
  color: var(--fg-soft);
}

/* Closing and footer. */
.closing .ask {
  margin-top: var(--gap-action);
}

/* «Pedir una demo» opens this panel, with no script: a native popover, closed by Esc, a click
   outside or «Cerrar». A computer with no mail program opens nothing from a mailto link, so the
   panel offers the three places the same draft can open in, and writes the address. A browser
   without popovers shows it as a block at the end of the page. */
.demo {
  width: min(100% - 2 * var(--gutter), 28rem);
  max-height: calc(100% - 2 * var(--gutter));
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  border: 1px solid var(--hairline);
  border-radius: 0.75rem;
  background: var(--bg);
  color: var(--fg);
}

.demo::backdrop {
  background: oklch(21.05% 0.0085 240.3 / 0.7);
}

.demo h2 {
  font-size: var(--step-2);
}

.demo p {
  margin-top: var(--gap-title);
  color: var(--fg-soft);
}

.demo strong {
  color: var(--fg);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.demo ul {
  display: grid;
  gap: var(--gap-title);
  margin-top: var(--gap-action);
}

.demo li a {
  display: flex;
  align-items: center;
  min-height: 3.25rem;
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 0.5rem;
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}

.demo li a:hover {
  background: var(--hairline);
}

.demo__close {
  min-height: 2.75rem;
  margin-top: var(--gap-head);
  padding: 0.5rem 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.foot {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
}

.foot .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.5rem;
  align-items: center;
  justify-content: space-between;
}

/* Who backs the company: their lockup, white as their manual asks on a dark ground, and beside it
   the sentence their certificate gives. */
.foot .backing {
  justify-content: flex-start;
  gap: 1.25rem 2.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.backing img {
  width: 13rem;
}

.backing p {
  flex: 1 1 24rem;
  max-width: 62ch;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2rem;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* The legal pages: plain reading. */
.legal h1 {
  font-size: var(--step-3);
}

.legal h2 {
  margin-top: 3rem;
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.1;
}

.legal p,
.legal dl {
  max-width: 62ch;
  margin-top: 1rem;
  color: var(--fg-soft);
}

.legal dt {
  margin-top: 1rem;
  color: var(--fg);
  font-weight: 600;
}

.missing {
  min-height: 60vh;
  display: grid;
  align-content: center;
}

/* Six statements go two by two before they go three by three. */
@media (min-width: 40rem) {
  .points--six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 48rem) {
  .intro,
  .film .note {
    text-align: center;
  }

  .intro p {
    margin-inline: auto;
    text-wrap: balance;
  }

  .film .note {
    max-width: none;
  }

  .closing .ask {
    justify-content: center;
  }

  .points--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .faq > div {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: baseline;
  }

  .steps li {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }

  /* Even steps mirror: the picture goes right and keeps the wider column. */
  .steps li:nth-child(even) {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }

  .steps li:nth-child(even) > :first-child {
    order: 2;
  }
}

/* Wide enough for the phone to stand beside the sentence and the button, on the road and in the
   car's beam, and for six statements to go three by three. The headline stays over both columns:
   beside the phone its longer half would not fit on a line at the size a headline has. */
@media (min-width: 60rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(2.5rem, 5vw, 6rem);
    align-items: end;
  }

  .phone {
    width: clamp(18rem, 27vw, 24rem);
    margin-bottom: calc(-1 * var(--scene-top));
    padding-bottom: 0;
    border-radius: 2.75rem 2.75rem 0 0;
  }

  .phone img {
    border-radius: 2.1rem 2.1rem 0 0;
  }

  .points--six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .car,
  .car__beam,
  .car__spokes {
    animation: none;
  }

  .button {
    transition: none;
  }
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
