/*
 * Deca2U, the public site.
 *
 * The palette is DRIVEN2U's own — the logo's slate and blue — and nothing else
 * is introduced. There is no alarm colour: this is a compliance product, and
 * the urgency is a date set in type rather than a red band.
 *
 * The structural device is the regulation's own. Article 6 letters a) to h) are
 * a real index that the people reading this page already use, so they carry the
 * fields section and the API register, and the two conditional letters are
 * visibly held apart because rendering them as required is the defect the
 * product exists to avoid.
 */

:root {
  --paper: #ffffff;
  --wash: #f2f5f9;
  --ink: #2b3648;
  --slate: #44546a;
  --muted: #6b7a90;
  --accent: #5b9bd5;
  --rule: #dce2ea;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --shell: 1180px;

  --display: "Archivo", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--slate);
  font-family: var(--body);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  max-width: var(--measure);
}

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

/* The eyebrow says which part of the regulation a section answers to, which is
   the only label these readers need. */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

/* ------------------------------------------------------------------ masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.875rem;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--slate);
  text-decoration: none;
}

.wordmark span {
  color: var(--accent);
}

.masthead nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9375rem;
}

.masthead nav a {
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}

.masthead nav a:hover,
.masthead nav a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

@media (max-width: 640px) {
  .masthead nav {
    display: none;
  }
}

/* ---------------------------------------------------------------------- hero */
.hero {
  padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 5rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
}

.hero h1 {
  font-size: clamp(2.1rem, 1.35rem + 2.9vw, 3.35rem);
  font-weight: 800;
}

.hero__lede {
  margin-top: 1.5rem;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--slate);
}

/* The date, stated once. No countdown: the obligation is a date in the BOE, and
   animating the seconds to it would read as a sales device. */
.deadline {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 2rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--wash);
}

.deadline strong {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.15rem;
  color: var(--ink);
  white-space: nowrap;
}

.deadline span {
  font-size: 0.9375rem;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.button--solid {
  background: var(--ink);
  color: #fff;
}

.button--solid:hover,
.button--solid:focus-visible {
  background: var(--slate);
}

.button--quiet {
  border-color: var(--rule);
  color: var(--ink);
}

.button--quiet:hover,
.button--quiet:focus-visible {
  border-color: var(--accent);
}

/* ------------------------------------------------------------------ the slip */
/* The artifact, because the artifact is the product: what a driver carries and
   what an officer scans at the roadside. */
.slip {
  border: 1px solid var(--rule);
  background: var(--paper);
  box-shadow: 0 1px 2px rgb(43 54 72 / 0.04), 0 12px 32px rgb(43 54 72 / 0.07);
  padding: 1.5rem;
  max-width: 26rem;
}

.slip__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.slip__title {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 112%;
  font-size: 0.9375rem;
  color: var(--ink);
  line-height: 1.3;
}

.slip__basis {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.slip__qr {
  width: 84px;
  height: 84px;
  flex: none;
}

.slip__qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.slip__fields {
  display: grid;
  grid-template-columns: 1.2rem 1fr;
  gap: 0.4rem 0.75rem;
  margin: 1rem 0 0;
  font-size: 0.8125rem;
}

.slip__fields dt {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.75rem;
}

.slip__fields dd {
  margin: 0;
  color: var(--slate);
}

.slip__url {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
  word-break: break-all;
}

/* -------------------------------------------------------------------- section */
.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-top: 1px solid var(--rule);
}

.section--wash {
  background: var(--wash);
}

.section__head {
  max-width: var(--measure);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__head h2 {
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem);
}

.section__head p {
  margin-top: 1rem;
}

/* -------------------------------------------------------------- the register */
/* The signature. Article 6 is a lettered list, so the page sets it as one: the
   letter on the rail, the field beside it, and the two conditional ones marked
   rather than mixed in. */
.register {
  border-top: 1px solid var(--rule);
}

.register__row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 15rem) minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  align-items: baseline;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 760px) {
  .register__row {
    grid-template-columns: 2.25rem minmax(0, 1fr);
  }
  .register__row .register__note,
  .register__row .register__tag {
    grid-column: 2;
  }
}

.register__letter {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink);
  font-weight: 500;
}

.register__row--conditional .register__letter {
  color: var(--accent);
}

.register__name {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 108%;
  color: var(--ink);
  font-size: 1.0625rem;
}

.register__note {
  color: var(--muted);
  font-size: 0.9375rem;
}

.register__tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------- cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1.5rem;
}

.section--wash .card {
  background: var(--paper);
}

.card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.6rem;
}

.card p {
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------------ api */
.api__layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

@media (max-width: 900px) {
  .api__layout {
    grid-template-columns: 1fr;
  }
  .api__index {
    position: static;
  }
}

.api__index {
  position: sticky;
  top: 5rem;
  font-size: 0.9375rem;
}

.api__index h3 {
  font-size: 0.75rem;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.api__index ul {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.api__index a {
  color: var(--muted);
  text-decoration: none;
}

.api__index a:hover,
.api__index a:focus-visible {
  color: var(--ink);
}

.endpoint {
  border-top: 1px solid var(--rule);
  padding-block: 1.75rem;
}

.endpoint:first-of-type {
  border-top: none;
  padding-top: 0;
}

.endpoint__sig {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--mono);
  font-size: 0.9375rem;
}

.verb {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  color: #fff;
  background: var(--slate);
}

.verb--get {
  background: var(--accent);
}

.verb--post {
  background: var(--ink);
}

.verb--patch,
.verb--delete {
  background: var(--muted);
}

.endpoint__path {
  color: var(--ink);
  font-weight: 500;
  word-break: break-all;
}

.endpoint p {
  margin-top: 0.6rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* --------------------------------------------------------------- code samples */
.sample {
  margin-top: 1.25rem;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.sample__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--wash);
}

.sample__tabs button {
  appearance: none;
  border: none;
  background: none;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 0.6rem 0.95rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.sample__tabs button[aria-selected="true"] {
  color: var(--ink);
  background: var(--paper);
  border-bottom-color: var(--accent);
}

.sample__tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.sample pre {
  margin: 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink);
  tab-size: 2;
}

.sample pre[hidden] {
  display: none;
}

/* ------------------------------------------------------------------- footer */
.footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

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