/* SM Motors: certificat d'immatriculation */

@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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;
}
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4;
}
@font-face {
  font-family: "Azeret Mono";
  src: url("assets/fonts/azeret-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* noir et or */
  --paper: #0b0a08;
  --paper-deep: #16130d;
  --coupon: #14110b;
  --coupon-deep: #211b10;
  --ink: #f1e4bd;
  --ink-soft: #bfae82;
  --code: #c9a54a;
  --rule: #3f3520;
  --rule-strong: #8a7234;
  --guilloche: #c9a54a;
  --blue: #d4af37;
  --blue-deep: #a8862a;
  --red: #e0404f;
  --on-gold: #0b0a08;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Azeret Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(1rem, 2.4vw, 2rem);
  --cert-pad: clamp(1rem, 2vw, 1.75rem);
  --inset: calc(var(--gutter) + var(--cert-pad) + 1px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  scrollbar-color: var(--rule-strong) var(--paper-deep);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 50% at 85% 0%, rgb(212 175 55 / 0.14), transparent 70%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgb(212 175 55 / 0.08), transparent 70%),
    url("assets/paper-guilloche.svg");
  background-size: 100% 100%, 100% 100%, 160px 40px;
  background-attachment: fixed, fixed, scroll;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
  font-kerning: normal;
  font-variant-numeric: tabular-nums;
  caret-color: var(--blue);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue); color: var(--on-gold); }

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { margin: 0; font-weight: 800; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }

/* Field codes: the document's own labelling system */
.code {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--code);
  text-transform: uppercase;
  font-style: normal;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 50;
  padding: 0.5rem 0.875rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ───────── Masthead ───────── */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--rule-strong);
  backdrop-filter: saturate(1.2);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  text-decoration: none;
  min-width: 0;
}
.wordmark__name {
  font-size: 1.125rem;
  font-weight: 850;
  font-stretch: 125%;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}
.wordmark__trade {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masthead__nav { display: flex; gap: 0.25rem; }
.masthead__nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.masthead__nav a:hover { border-color: var(--rule-strong); background: var(--paper-deep); }


/* ───────── Certificate (first viewport) ───────── */

.cert {
  position: relative;
  isolation: isolate;
  margin: clamp(0.75rem, 1.6vw, 1.5rem) var(--gutter) 0;
  padding: var(--cert-pad);
  border: 1px solid var(--rule-strong);
  outline: 1px solid var(--rule-strong);
  outline-offset: 4px;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}

.cert__security {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.guilloche {
  position: absolute;
  right: -14%;
  top: -22%;
  width: min(68vw, 980px);
  aspect-ratio: 1;
  height: auto;
  pointer-events: none;
}
.guilloche path { stroke: var(--guilloche); }

.cert__band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 1.5rem 1.75rem;
  padding-bottom: clamp(0.875rem, 1.6vw, 1.25rem);
}

/* microprint: the certificate's security rule */
.microprint {
  overflow: hidden;
  white-space: nowrap;
  padding: 1px 0 2px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  font: 600 0.3125rem/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--code);
  user-select: none;
}

.hook {
  max-width: 22ch;
  font-size: clamp(2rem, 3.6vw, 3.5rem);
  line-height: 1.02;
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.cert__meta { display: grid; gap: 0.375rem; justify-items: end; text-align: right; }
.cert__meta div { display: flex; gap: 0.625rem; align-items: baseline; }
.cert__meta dd { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-soft); }
/* numbering-machine serial */
.cert__meta .serial {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
}

/* Visa: round ink seal, blue (red stays with vehicle status) */
.visa {
  display: block;
  width: 5.5rem;
  aspect-ratio: 1;
  color: var(--blue);
  opacity: 0.88;
  transform: rotate(var(--tilt, -8deg));
  mix-blend-mode: screen;
}
.visa svg { display: block; width: 100%; height: 100%; overflow: visible; }

.cert__body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1rem, 2.4vw, 2.25rem);
  padding-top: clamp(1rem, 2vw, 1.5rem);
}

/* Photo field */
.cert__photo {
  position: relative;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}
.cert__photo img {
  width: 100%;
  height: 100%;
  min-height: 18rem;
  max-height: calc(100svh - 18.5rem);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 50% 62%;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
}
.cert__photo img, .cert__photo video { grid-row: 1; grid-column: 1; }
.cert__photo video {
  width: 100%;
  height: 100%;
  min-height: 18rem;
  max-height: calc(100svh - 18.5rem);
  aspect-ratio: 3 / 2;
  object-fit: contain;
  border: 1px solid var(--ink);
  background: #000;
}
.cert__photo [hidden] { display: none; }

/* Photo or film switch, set like the make filter */
.view { display: inline-flex; margin-left: auto; align-self: center; }
.view[hidden] { display: none; }
.view__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.75rem;
  font: 700 0.75rem/1 var(--sans);
  font-stretch: 125%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.view__btn + .view__btn { border-left: 0; }
.view__btn:hover { border-color: var(--ink); }
.view__btn[aria-pressed="true"] { color: var(--on-gold); background: var(--blue); border-color: var(--blue); cursor: default; }
.view__play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.3125rem 0 0.3125rem 0.5rem;
  border-color: transparent transparent transparent currentColor;
}

.cert__photo figcaption {
  display: flex;
  gap: 0.625rem;
  align-items: baseline;
  padding-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* Field block */
.cert__fields {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 1.8vw, 1.5rem);
  min-width: 0;
}

/* D.1 / D.3 sit inline with their values, like every other field */
.carname {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: baseline;
  row-gap: 0.25rem;
}
.carname__make {
  font-size: 1rem;
  font-weight: 700;
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.carname__model {
  font-size: clamp(2.25rem, 4.2vw, 4.25rem);
  line-height: 0.95;
  font-weight: 850;
  font-stretch: 125%;
  letter-spacing: -0.03em;
}
.carname__model[data-long] { font-size: clamp(2rem, 3.3vw, 3.25rem); }
.carname__model[data-long="xl"] { font-size: clamp(1.75rem, 2.35vw, 2.375rem); line-height: 1; }

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
}
.fields > div {
  padding: 0.5rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
.fields > div:nth-child(odd) { border-right: 1px solid var(--rule); }
.fields > div:nth-child(even) { padding-left: 0.875rem; }
.fields dt {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.fields dd {
  font-size: 1.0625rem;
  font-weight: 650;
  font-stretch: 108%;
}
.fields .plate { font-family: var(--mono); font-weight: 600; letter-spacing: 0.04em; }

/* Obs.: the examiner's remarks, set as running text under the ruled fields */
.remarks {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: baseline;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.remarks [data-field] { max-width: 62ch; text-wrap: pretty; }

/* ───────── Visit form ───────── */

.visit {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--ink);
  background: color-mix(in srgb, var(--paper) 92%, var(--blue));
}
.visit__title {
  display: flex;
  gap: 0.625rem;
  align-items: baseline;
  font-size: 1rem;
  font-weight: 750;
}
.visit__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.input { display: grid; gap: 0.25rem; min-width: 0; }
.input > span { font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.input i { font-style: normal; font-weight: 400; }
.input input,
.input select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.625rem;
  font: 500 1rem/1.2 var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-bottom: 2px solid var(--rule-strong);
  border-radius: 0;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.input select {
  appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(-45deg, transparent 50%, var(--ink) 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.input input:hover, .input select:hover { border-bottom-color: var(--ink); }
.input input:focus-visible, .input select:focus-visible {
  outline: none;
  border-bottom-color: var(--blue);
  background-color: var(--paper-deep);
}
.input input[aria-invalid="true"] { border-bottom-color: var(--red); }
.input input::-webkit-calendar-picker-indicator { opacity: 0.6; cursor: pointer; }

.btn {
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  font: 750 1rem/1.1 var(--sans);
  font-stretch: 112%;
  color: var(--on-gold);
  background: var(--blue);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 0 1px 0 var(--blue-deep), 0 6px 14px -8px rgb(212 175 55 / 0.45);
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.btn:hover { background: var(--blue-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--rule-strong); box-shadow: none; cursor: not-allowed; }
.btn.is-busy { opacity: 0.75; cursor: progress; }
.btn--wide { width: 100%; }

.visit__status { font-size: 0.875rem; min-height: 1.25em; color: var(--ink-soft); }
.visit__status:empty { display: none; }
.visit__status.is-error { color: var(--red); }
.visit__status.is-done { color: var(--blue); font-weight: 650; }


/* sold: the form gives way to a notice */
.visit__sold { display: none; font-size: 0.9375rem; color: var(--ink-soft); }
.visit.is-sold .visit__row { display: none; }
.visit.is-sold .visit__sold { display: block; }
.visit__sold a { color: var(--blue); font-weight: 650; }

/* ───────── Stock ledger ───────── */

.ledger {
  position: relative;
  margin-top: clamp(4rem, 8vw, 7rem);
  padding: clamp(2.5rem, 5vw, 4.5rem) var(--inset) clamp(2rem, 4vw, 3.5rem);
  background: var(--coupon);
}
/* perforated tear line */
.ledger::before,
.close::before {
  content: "";
  position: absolute;
  inset: -6px 0 auto;
  height: 12px;
  background: radial-gradient(circle at 6px 6px, var(--paper) 3.5px, transparent 4px) 0 0 / 14px 12px repeat-x;
}

.ledger__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 34rem);
  gap: 1rem 3rem;
  align-items: end;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--ink);
}
.ledger__head h2 {
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 1;
  font-stretch: 125%;
  letter-spacing: -0.03em;
}
.ledger__head p { color: var(--ink-soft); max-width: 46ch; }

/* make filter: one ruled field per manufacturer, logo printed in the ink */
.makes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.makes__label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  margin-right: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.make {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.375rem 0.875rem;
  font: 700 0.8125rem/1 var(--sans);
  font-stretch: 125%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.make:hover { background: var(--coupon-deep); border-color: var(--blue); }
.make__logo {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
}
.make__count {
  font: 600 0.6875rem/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--code);
}
.make[aria-pressed="true"] { color: var(--on-gold); background: var(--blue); border-color: var(--blue); }
.make[aria-pressed="true"] .make__count { color: var(--on-gold); }
.coupon[hidden] { display: none; }

/* each row is a stub: punched on the left, torn along the dashed line */
.coupon {
  position: relative;
  display: grid;
  grid-template-columns: clamp(8rem, 16vw, 14rem) minmax(0, 1.4fr) minmax(0, 1.6fr) auto;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.25rem);
  padding: 1rem 0 1rem 1.75rem;
  border-bottom: 1px dashed var(--rule-strong);
  box-shadow: 0 0 0 -1px rgb(0 0 0 / 0);
  transition:
    background-color 200ms var(--ease-out),
    transform 420ms var(--ease-in-out),
    box-shadow 420ms var(--ease-in-out);
}
/* a stub about to be chosen rises a hair off the ledger; no tilt, no spring */
@media (hover: hover) {
  .coupon:hover {
    z-index: 1;
    transform: scale(1.025);
    box-shadow: 0 18px 36px -16px rgb(0 0 0 / 0.8), 0 4px 10px -4px rgb(0 0 0 / 0.55);
  }
}
.coupon::before {
  content: "";
  position: absolute;
  left: 0.375rem;
  top: 50%;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: -0.375rem;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 1px 1px rgb(0 0 0 / 0.6), 0 0 0 1px var(--rule);
}
.coupon:hover { background: var(--coupon-deep); }
.coupon[aria-current="true"] { background: color-mix(in srgb, var(--coupon-deep) 70%, var(--paper)); }

.coupon img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--ink);
}
.coupon__name { display: grid; }
.coupon__make {
  font-size: 0.8125rem;
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.coupon__model {
  font-size: clamp(1.375rem, 2.4vw, 2.125rem);
  font-weight: 850;
  font-stretch: 125%;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.coupon__facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0.25rem 2rem; }
.coupon__facts div { display: grid; }
.coupon__facts dd { font-weight: 650; }


.coupon__open {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  font: 700 0.9375rem/1.1 var(--sans);
  color: var(--blue);
  background: transparent;
  border: 1.5px solid var(--blue);
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.coupon__open::after { content: ""; position: absolute; inset: 0; }
.coupon__open:hover { background: var(--blue); color: var(--on-gold); }
.coupon__open:disabled {
  color: var(--ink-soft);
  border: 1px dashed var(--rule-strong);
  background: transparent;
  cursor: default;
}

.ledger__note { padding-top: 1.25rem; font-size: 0.875rem; color: var(--ink-soft); }

/* ───────── Stations: the 504's restoration log ───────── */

.stations {
  padding: clamp(5rem, 11vw, 10rem) var(--inset) clamp(4rem, 8vw, 7rem);
}
.stations__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1rem 4rem;
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.stations__intro h2 {
  grid-row: span 2;
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 1;
  font-stretch: 125%;
  letter-spacing: -0.03em;
}
.stations__intro p { max-width: 52ch; color: var(--ink-soft); }
.stations__case { display: flex; gap: 0.625rem; align-items: baseline; font-size: 0.875rem; }

.log {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.log thead th {
  padding: 0 1rem 0.625rem 0;
  font: 600 0.6875rem/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--code);
  border-bottom: 2px solid var(--ink);
}
.log tbody tr { border-bottom: 1px solid var(--rule); }
.log tbody th,
.log td { padding: 0.75rem 1rem 0.75rem 0; vertical-align: middle; text-align: left; }
.log tbody th {
  width: 15rem;
  font-size: 1.125rem;
  font-weight: 800;
  font-stretch: 112%;
  white-space: nowrap;
}
.log tbody th .code { display: inline-block; width: 1.5rem; }
.log td { color: var(--ink-soft); font-size: 0.9375rem; max-width: 42ch; }
.log .log__num { font-family: var(--mono); font-size: 0.875rem; color: var(--ink); white-space: nowrap; width: 7rem; }
.log__visa { width: 6.5rem; padding-block: 0.25rem; }
.log__visa .visa { width: 4.75rem; margin-block: -0.5rem; }
.log tbody tr:nth-child(3n) .visa { opacity: 0.7; }
.log tbody tr:nth-child(4n+1) .visa { opacity: 0.95; }
.log tfoot th,
.log tfoot td {
  padding: 0.875rem 1rem 0 0;
  border-top: 2px solid var(--ink);
  font-weight: 800;
  text-align: left;
}
.log tfoot .log__num { font-weight: 600; }

/* ───────── Dossier contents ───────── */

.dossier {
  margin: 0 var(--inset);
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--rule-strong);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 2rem 4rem;
}
.dossier h2 {
  font-size: clamp(1.625rem, 2.8vw, 2.5rem);
  line-height: 1.05;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.dossier__list > div {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 0.25rem 2rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule);
}
.dossier__list > div:first-child { border-top: 2px solid var(--ink); }
.dossier__list dt { display: flex; gap: 0.75rem; align-items: baseline; font-weight: 750; }
.dossier__list dd { color: var(--ink-soft); }

/* ───────── Close: the detachable coupon ───────── */

.close {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  padding: clamp(3.5rem, 7vw, 6rem) var(--inset);
  background: var(--coupon);
  border-top: 1px dashed var(--rule-strong);
}
.close__cut {
  position: absolute;
  top: -0.6rem;
  right: var(--inset);
  padding: 0 0.5rem;
  background: var(--paper);
  line-height: 1.2;
}
.close h2 {
  font-size: clamp(2.75rem, 6.5vw, 6rem);
  line-height: 0.95;
  font-stretch: 125%;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}
.close__text > p { max-width: 42ch; color: var(--ink-soft); font-size: 1.125rem; }
.close__facts { margin-top: 2.25rem; display: grid; gap: 1rem; }
.close__facts div { display: grid; gap: 0.125rem; }
.close__facts em { font-style: normal; color: var(--ink-soft); }

.close .visit { background: color-mix(in srgb, var(--coupon) 90%, var(--blue)); }

/* ───────── Account: login / sign-up ───────── */

.masthead__nav a[aria-current="page"] { border-color: var(--rule-strong); }

.account {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin-top: clamp(2.5rem, 6vw, 5rem);
  padding: clamp(3rem, 6vw, 5rem) var(--inset);
  background: var(--coupon);
}
.account::before {
  content: "";
  position: absolute;
  inset: -6px 0 auto;
  height: 12px;
  background: radial-gradient(circle at 6px 6px, var(--paper) 3.5px, transparent 4px) 0 0 / 14px 12px repeat-x;
}
.account h1 {
  font-size: clamp(2.75rem, 6.5vw, 6rem);
  line-height: 0.95;
  font-stretch: 125%;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}
.account__text > p { max-width: 42ch; color: var(--ink-soft); font-size: 1.125rem; }
.account__text > .account__aside { margin-top: 1.5rem; font-size: 0.9375rem; }

.account__card [hidden] { display: none; }
.account__notice {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: var(--ink);
  border: 1px solid var(--red);
}
.account__title { font-size: 1.375rem; font-stretch: 112%; letter-spacing: -0.01em; }
.account__lead { font-size: 0.9375rem; color: var(--ink-soft); }
.account__form--solo { border-top: 1px solid var(--ink); }
.account__forgot { justify-self: start; margin-top: -0.375rem; font-size: 0.875rem; color: var(--blue); font-weight: 600; }
.account__link {
  justify-self: start;
  padding: 0;
  font: 650 0.9375rem/1.4 var(--sans);
  color: var(--blue);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  cursor: pointer;
}
.account__link:disabled { opacity: 0.6; cursor: progress; }
.account__who { display: grid; gap: 0.75rem; padding-block: 0.25rem 0.5rem; }
.account__who div { display: grid; gap: 0.125rem; }
.account__who dt { font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.account__who dd { font-weight: 650; overflow-wrap: anywhere; }

.btn--ghost { color: var(--ink); background: transparent; border: 1px solid var(--rule-strong); box-shadow: none; }
.btn--ghost:hover { background: var(--paper-deep); border-color: var(--ink); }
.btn--danger { color: var(--on-gold); background: var(--red); box-shadow: none; }
.btn--danger:hover { background: color-mix(in srgb, var(--red) 82%, black); }

/* account deletion: set apart below a rule, confirmed in two steps */
.account__danger { display: grid; gap: 0.875rem; padding-top: 1rem; border-top: 1px dashed var(--rule-strong); }
/* lifted toward white so the small link clears 4.5:1 on the gold-tinted card */
.account__link--danger { color: color-mix(in srgb, var(--red) 75%, white); }
.account__confirm { display: grid; gap: 0.875rem; padding: 0.875rem 1rem; border: 1px solid var(--red); }
.account__confirm p { font-size: 0.9375rem; }
.account__confirm-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; }

/* signed in: a small gold dot after the account link */
.masthead__nav a.is-signed-in::after {
  content: "";
  align-self: center;
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: var(--blue);
}

.tabs { display: flex; border-bottom: 1px solid var(--rule-strong); }
.tab {
  flex: 1;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  font: 700 1rem/1.1 var(--sans);
  font-stretch: 112%;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--blue); }

.account__form[hidden] { display: none; }
.account__form { border-top: 0; padding: 1.25rem; gap: 1rem; background: color-mix(in srgb, var(--coupon) 90%, var(--blue)); }
.account__hint { margin-top: -0.625rem; font-size: 0.8125rem; color: var(--ink-soft); }
.account__switch { font-size: 0.9375rem; color: var(--ink-soft); }
.account__switch a { color: var(--blue); font-weight: 650; }

.input__pw { position: relative; display: block; }
.input__pw input { padding-right: 5.5rem; }
.input__reveal {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  min-width: 2.75rem;
  padding: 0 0.75rem;
  font: 600 0.8125rem/1 var(--sans);
  color: var(--blue);
  background: none;
  border: 0;
  cursor: pointer;
}
.input__reveal:hover { text-decoration: underline; text-underline-offset: 0.22em; }

.check { display: flex; gap: 0.625rem; align-items: flex-start; font-size: 0.9375rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 1.125rem; height: 1.125rem; margin: 0.2rem 0 0; flex: none; accent-color: var(--blue); }
.check input[aria-invalid="true"] { outline: 2px solid var(--red); outline-offset: 2px; }

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

/* ───────── Colophon ───────── */

.colophon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 2rem 4rem;
  padding: 2.5rem var(--inset) 3rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
  border-top: 2px solid var(--ink);
}
.colophon__demo { max-width: 52ch; }
.colophon__demo strong { color: var(--ink); }
.colophon__credits ul { display: grid; gap: 0.25rem; margin-top: 0.5rem; }
.colophon__note { margin-top: 0.5rem; }
.colophon__legal { grid-column: 1 / -1; }
.colophon__legal a { color: var(--blue); font-weight: 650; }

/* ───────── Privacy policy: the dossier's annex ───────── */

.privacy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 2rem 4rem;
  align-items: start;
  margin: 0 var(--inset);
  padding: clamp(3.5rem, 7vw, 6rem) 0 clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--rule-strong);
}
.privacy__head { position: sticky; top: 5rem; display: grid; gap: 1rem; }
.privacy__head h2 {
  font-size: clamp(1.625rem, 2.8vw, 2.5rem);
  line-height: 1.05;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.privacy__lead { max-width: 36ch; color: var(--ink-soft); }
.privacy__updated { font-size: 0.875rem; color: var(--ink-soft); }
.privacy__toc ol { display: grid; border-top: 2px solid var(--ink); }
.privacy__toc a {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}
.privacy__toc a:hover { color: var(--blue); }
.privacy__toc .code { min-width: 1.25rem; }

.privacy__body { display: grid; max-width: 68ch; }
.privacy__art {
  display: grid;
  gap: 0.875rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 4.5rem;
}
.privacy__art:first-child { border-top: 2px solid var(--ink); }
.privacy__art h3 {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 1.25rem;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}
.privacy__art h4 { margin: 0.5rem 0 0; font-size: 0.9375rem; font-weight: 750; }
.privacy__art p, .privacy__art li, .privacy__art dd, .privacy__art td { color: var(--ink-soft); }
.privacy__art strong { color: var(--ink); font-weight: 650; }
.privacy__art ul { display: grid; gap: 0.5rem; }
.privacy__art ul li { position: relative; padding-left: 1.125rem; }
.privacy__art ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 0.4375rem;
  height: 1px;
  background: var(--code);
}
.privacy__art a { color: var(--blue); font-weight: 600; }
.privacy__id { display: grid; }
.privacy__id div {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--rule);
}
.privacy__id dt { font-size: 0.875rem; font-weight: 650; }
.privacy__table { overflow-x: auto; }
.privacy__table table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.privacy__table th, .privacy__table td { padding: 0.625rem 1rem 0.625rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.privacy__table thead th { font-family: var(--mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--code); border-bottom: 2px solid var(--ink); }
.privacy__table tbody th { font-weight: 650; width: 55%; }

/* placeholders left for the owner to fill: impossible to miss, and to ship by mistake */
.todo {
  padding: 0.1875rem 0.5rem;
  line-height: 1.9;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--blue) 18%, transparent);
  outline: 1px dashed var(--blue);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* the summary only follows the reader when it fits the screen */
@media (max-height: 820px) {
  .privacy__head { position: static; }
}
@media (max-width: 860px) {
  .privacy { grid-template-columns: 1fr; }
  .privacy__head { position: static; }
}
@media (max-width: 600px) {
  .privacy__id div { grid-template-columns: 1fr; }
  .privacy__table thead { display: none; }
  .privacy__table tr { display: grid; gap: 0.25rem; padding: 0.625rem 0; border-bottom: 1px solid var(--rule); }
  .privacy__table th, .privacy__table td, .privacy__table tbody th { padding: 0; border: 0; width: auto; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ───────── Certificate re-issue: the photo's flight ───────── */

/* the coupon photo, lifted off its stub; position and size are driven from main.js */
.flight {
  position: fixed;
  z-index: 50;
  margin: 0;
  object-fit: cover;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
  pointer-events: none;
  box-shadow: 0 2px 6px -2px rgb(0 0 0 / 0.5);
  transition: box-shadow 360ms var(--ease-in-out);
}
.flight.is-lifted { box-shadow: 0 28px 56px -18px rgb(0 0 0 / 0.85), 0 8px 18px -8px rgb(0 0 0 / 0.6); }

.cert__photo img.is-awaiting { visibility: hidden; }
.cert__fields { transition: opacity 380ms var(--ease-in-out); }
.cert__fields.is-reissuing { opacity: 0; transition-duration: 220ms; }

/* ───────── Responsive ───────── */

@media (max-width: 1100px) {
  .coupon { grid-template-columns: 9rem minmax(0, 1fr) auto; grid-template-areas: "img name name" "img facts open"; row-gap: 0.5rem; }
  .coupon img { grid-area: img; }
  .coupon__name { grid-area: name; }
  .coupon__facts { grid-area: facts; }
  .coupon__open { grid-area: open; }
  .log td:nth-child(2) { font-size: 0.875rem; }
}

@media (max-width: 860px) {
  .wordmark__trade { display: none; }
  .cert__band { grid-template-columns: minmax(0, 1fr) auto; }
  .hook { grid-column: 1 / -1; }
  .cert__meta { justify-items: start; text-align: left; }
  .cert__body { grid-template-columns: 1fr; }
  .cert__photo img, .cert__photo video { max-height: none; }
  .guilloche { width: 140vw; right: -60%; top: -10%; }
  .ledger__head, .stations__intro, .dossier, .close, .colophon { grid-template-columns: 1fr; }
  .stations__intro h2 { grid-row: auto; }
  /* the log becomes one ruled entry per station */
  .log thead { display: none; }
  .log, .log tbody, .log tfoot { display: block; }
  .log tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name visa" "work visa" "date visa";
    column-gap: 1rem;
    padding: 1rem 0;
  }
  .log tbody tr:first-child { border-top: 2px solid var(--ink); }
  .log tbody th, .log td { padding: 0; width: auto; }
  .log tbody th { grid-area: name; white-space: normal; }
  .log td:nth-child(2) { grid-area: work; padding-block: 0.25rem 0.375rem; }
  .log td:nth-child(3) { grid-area: date; display: inline; }
  .log td:nth-child(4) { grid-area: date; justify-self: end; }
  .log__visa { grid-area: visa; align-self: center; }
  .log tfoot tr { display: flex; justify-content: space-between; border-top: 2px solid var(--ink); padding-top: 0.875rem; }
  .log tfoot th, .log tfoot td { border: 0; padding: 0; }
}

@media (max-width: 600px) {
  :root { --gutter: 0.5rem; --cert-pad: 0.875rem; }
  body { font-size: 1rem; }
  .masthead { padding-inline: 1rem; padding-block: 0.5rem; flex-wrap: wrap; row-gap: 0.25rem; gap: 0.5rem; }
  .masthead__nav a { align-items: center; min-height: 2.75rem; padding: 0.375rem 0.4rem; font-size: 0.8125rem; }
  .masthead__nav { gap: 0; margin-right: -0.4rem; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .masthead__nav .code { display: none; }
  .wordmark__name { font-size: 0.9375rem; }
  .cert { outline-offset: 3px; }
  .visa { width: 4.25rem; }
  .visit__row { grid-template-columns: 1fr; }
  .coupon {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    grid-template-areas: "img name" "facts facts" "open open";
    padding: 1.125rem 0 1.125rem 1.5rem;
  }
  .coupon::before { left: 0.25rem; }
  .makes__label { width: 100%; }
  .make { padding-inline: 0.625rem; }
  .coupon__open { width: 100%; }
  .log__visa .visa { width: 4rem; }
  .dossier__list > div { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .coupon:hover { transform: none; }
}

/* ───────── Espace client : demandes de visite, réglages ───────── */

.account__block { display: grid; gap: 0.75rem; padding-top: 1rem; border-top: 1px dashed var(--rule-strong); }
.account__subtitle { display: flex; gap: 0.625rem; align-items: baseline; font-size: 1rem; font-weight: 750; }
.account__hint--flat { margin-top: 0; }
.account__inline { color: var(--blue); font-weight: 650; }

.rdv { display: grid; gap: 0.75rem; }
.rdv__item {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.875rem;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
}
.rdv__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.rdv__car { font-size: 1.0625rem; font-weight: 750; }
.rdv__when { font-size: 0.875rem; color: var(--ink-soft); }
.rdv__status {
  padding: 0.25rem 0.5rem;
  font: 700 0.6875rem/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid currentColor;
}
.rdv__status--confirmed { color: var(--blue); }
.rdv__status--done { color: var(--ink); }
.rdv__status--declined, .rdv__status--cancelled { color: color-mix(in srgb, var(--red) 75%, white); }
.rdv__item .account__link { margin-top: 0.25rem; font-size: 0.875rem; }

.account__more { padding-top: 0.25rem; border-top: 1px dashed var(--rule-strong); }
.account__more summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}
.account__more summary::-webkit-details-marker { display: none; }
.account__more summary::before { content: "+"; width: 1rem; font: 700 1rem/1 var(--mono); color: var(--blue); }
.account__more[open] summary::before { content: "−"; }
.account__more summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.account__sub { display: grid; gap: 0.875rem; padding: 0.5rem 0 0.5rem; }
