/* Prof Romandie
   Palette from the Swiss classroom: fountain-pen ink, cahier lines, red correction pen, yellow highlighter.
   One typeface, Atkinson Hyperlegible Next, chosen for readers dealing with paperwork in a second language. */

@font-face {
  font-family: "Atkinson Next";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2-variations");
  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: "Atkinson Next";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Next";
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2-variations");
  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;
}

:root {
  --paper: #ffffff;
  --ink: #1b2559;      /* blue-black fountain-pen ink */
  --ink-2: #4a5583;    /* faded ink, secondary text */
  --line: #c9d5eb;     /* cahier ruling */
  --grid: #e6ecf7;     /* 5 mm squares */
  --wash: #f2f5fb;
  --red: #b5172a;      /* correction pen, warnings only */
  --mark: #fff07a;     /* highlighter, key figures only */
  --mark-ink: inherit;
  --ok: #1e7547;       /* checked sources */
  --font: "Atkinson Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 66ch;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10152e;
    --ink: #e9edfb;
    --ink-2: #aeb7dc;
    --line: #2f3a6e;
    --grid: #182046;
    --wash: #161d40;
    --red: #ff8a8a;
    --mark: #f2dd58;
    --mark-ink: #10152e;
    --ok: #82d6a8;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--line);
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

mark {
  background: var(--mark);
  color: var(--mark-ink);
  padding: 0 0.18em;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--paper); padding: 8px 14px; border: 2px solid var(--ink); z-index: 10; }
.skip:focus { left: 8px; }

.todo { background: var(--mark); outline: 2px dashed var(--red); outline-offset: 1px; padding: 0 0.25em; }

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

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand b { font-weight: 780; }
.brand .mk { flex: none; }

.langs { display: flex; gap: 2px; }
.langs a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--ink-2);
}
.langs a:hover { color: var(--ink); background: var(--wash); }
.langs a[aria-current] { background: var(--ink); color: var(--paper); }

/* ------------------------------------------------------------------ home */

.hero {
  border-block: 1px solid var(--line);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: -1px -1px;
  padding-block: 64px 72px;
}

.display {
  font-size: clamp(2.375rem, 1.3rem + 4vw, 4rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
  font-weight: 790;
  max-width: 15ch;
  margin: 0;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.125rem, 1.02rem + 0.4vw, 1.3125rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 22px 0 0;
  text-wrap: pretty;
}

/* the line: five stops, drawn once on load */
.route {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  position: relative;
}
.route::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 21px;
  height: 6px;
  border-radius: 3px;
  background: var(--ink);
  transform-origin: left center;
  animation: draw-x 1.2s cubic-bezier(0.65, 0, 0.25, 1) both;
}
.station { position: relative; animation: appear 0.45s ease-out both; animation-delay: calc(0.18s * var(--i)); }
.st { display: block; text-decoration: none; text-align: center; padding: 0 8px 6px; border-radius: 8px; }
.st:hover .st-title { text-decoration-color: currentColor; }
.stop {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  border: 6px solid var(--ink);
  background: var(--paper);
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.st:hover .stop { background: var(--ink); color: var(--paper); }
.st-title {
  display: block;
  margin-top: 14px;
  font-weight: 760;
  font-size: 1.0625rem;
  line-height: 1.25;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--line);
}
.st-fig {
  display: inline-block;
  margin-top: 12px;
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  background: var(--mark);
  color: var(--mark-ink);
  padding: 0 0.22em;
  border-radius: 2px;
}
.st-note { display: block; margin-top: 6px; font-size: 0.9375rem; line-height: 1.35; color: var(--ink-2); }

@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 64px;
  padding-block: 64px 48px;
}
.home-grid h2, .author h2 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 10px; }
.home-grid p { margin: 0 0 12px; max-width: 58ch; }

.author {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-block: 40px 72px;
  border-top: 1px solid var(--line);
}
.author img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--ink); }
.author p { margin: 0 0 12px; max-width: 62ch; }

/* ------------------------------------------------------------------ article */

.article { max-width: calc(var(--measure) + 48px); margin: 0 auto; padding: 8px 24px 72px; }

.crumbs { font-size: 0.9375rem; color: var(--ink-2); margin: 8px 0 22px; }

.steps { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 30px; }
.steps ol { list-style: none; display: flex; align-items: center; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; }
.steps li + li::before { content: ""; width: 22px; height: 4px; background: var(--line); }
.steps li:has(a.done) + li::before, .steps li:has(a.done) + li:has(a[aria-current])::before { background: var(--ink); }
.steps a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--paper);
  font-size: 0.8125rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink-2);
}
.steps a.done { border-color: var(--ink); color: var(--ink); }
.steps a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.steps-label { font-size: 0.9375rem; color: var(--ink-2); }

.title {
  font-size: clamp(2rem, 1.45rem + 2.4vw, 2.875rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 790;
  margin: 0;
  text-wrap: balance;
}
.dek { font-size: 1.25rem; line-height: 1.45; color: var(--ink-2); margin: 16px 0 0; text-wrap: pretty; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 0.9375rem; color: var(--ink-2); margin: 18px 0 0; }
.ok { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 650; }

.prose { margin-top: 8px; }
.prose > p, .prose > ul, .prose > ol { max-width: var(--measure); }
.prose h2 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.012em; margin: 2.1em 0 0.45em; }
.prose h3 { font-size: 1.1875rem; margin: 1.6em 0 0.3em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: 0.4em 0; padding-left: 0.15em; }
.prose ol > li::marker { font-weight: 800; }
.prose strong { font-weight: 720; }

.prose table { border-collapse: collapse; width: 100%; margin: 1.2em 0 0.6em; font-variant-numeric: tabular-nums; font-size: 1.0625rem; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { font-weight: 760; border-bottom: 2px solid var(--ink); }
.prose td:not(:first-child), .prose th:not(:first-child) { text-align: right; }

aside.bref {
  margin: 30px 0 10px;
  padding: 18px 22px 8px;
  background: var(--wash);
  border-left: 5px solid var(--ink);
  border-radius: 0 8px 8px 0;
}
aside .lbl { font-weight: 780; margin: 0 0 6px; }
aside.bref ul { margin: 0 0 10px; padding-left: 1.15em; }
aside.bref li { margin: 0.35em 0; }

aside.exp {
  margin: 30px 0;
  padding: 2px 0 2px 22px;
  border-left: 3px dashed var(--ink);
}
aside.exp .lbl { display: flex; align-items: center; gap: 10px; }
aside.exp .lbl img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); }
aside.exp p:last-child { margin-bottom: 0; }

aside.warn {
  margin: 26px 0;
  padding: 14px 20px 4px;
  border-left: 5px solid var(--red);
  background: color-mix(in srgb, var(--red) 7%, var(--paper));
  border-radius: 0 8px 8px 0;
}
aside.warn .lbl { color: var(--red); }

.checklist { list-style: none; padding: 0; margin: 18px 0 8px; border-top: 1px solid var(--line); max-width: var(--measure); }
.checklist li { margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.checklist label { display: flex; gap: 14px; align-items: flex-start; padding: 12px 4px; cursor: pointer; }
.checklist input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
  border: 2.5px solid var(--ink);
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: var(--paper);
  cursor: pointer;
}
.checklist input:checked { background: var(--ink); }
.checklist input:checked::after {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 3px solid var(--paper);
  border-bottom: 3px solid var(--paper);
  transform: translateY(-2px) rotate(-45deg);
}
.checklist input:checked + span { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-2); }
.checklist-note { font-size: 0.9375rem; color: var(--ink-2); }

.sources { margin-top: 56px; padding-top: 18px; border-top: 3px solid var(--ink); }
.sources h2 { font-size: 1.1875rem; margin: 0 0 10px; }
.sources ol { margin: 0; padding-left: 1.4em; font-size: 1rem; }
.sources li { margin: 0.45em 0; }
.src-note { font-size: 0.9375rem; color: var(--ink-2); margin: 12px 0 0; }

.next {
  display: block;
  margin-top: 44px;
  padding: 20px 24px 22px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  text-decoration: none;
}
.next:hover { background: var(--wash); }
.next .k { display: block; font-size: 0.9375rem; color: var(--ink-2); }
.next .t { display: block; margin-top: 4px; font-size: 1.375rem; line-height: 1.25; font-weight: 780; letter-spacing: -0.01em; }

.ai-note { margin-top: 30px; font-size: 0.9375rem; color: var(--ink-2); }

.nf { padding-left: 1.2em; }

/* ------------------------------------------------------------------ footer */

.foot { border-top: 1px solid var(--line); background: var(--wash); }
.foot-in {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 1.6fr;
  gap: 24px 40px;
  padding-block: 36px 48px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.foot p { margin: 0; }
.foot .brand { color: var(--ink); }
.foot .tag { display: block; margin-top: 10px; }
.foot-links { display: flex; flex-direction: column; gap: 6px; }
.foot-note .ok { margin-top: 10px; display: flex; }

/* ------------------------------------------------------------------ small screens */

@media (min-width: 821px) {
  .st-title { min-height: 2.5em; }
}

@media (max-width: 820px) {
  .route { grid-template-columns: 1fr; margin-top: 44px; }
  .route::before { left: 21px; right: auto; top: 24px; bottom: 30px; width: 6px; height: auto; transform-origin: center top; animation-name: draw-y; }
  .st { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 18px; text-align: left; padding: 0 0 26px; }
  .stop { grid-row: 1 / span 3; margin: 0; }
  .st-title { margin-top: 11px; }
  .st-fig { justify-self: start; margin-top: 8px; }
  .home-grid { grid-template-columns: 1fr; gap: 32px; padding-block: 48px 32px; }
  .foot-in { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body { font-size: 1.0625rem; }
  .wrap { padding-inline: 18px; }
  .article { padding-inline: 18px; }
  .hero { padding-block: 44px 48px; }
  .brand { font-size: 1.0625rem; }
  .langs a { padding: 6px 9px; }
  .author { grid-template-columns: 1fr; gap: 16px; }
  .author img { width: 96px; height: 96px; }
  .prose table { font-size: 0.9375rem; }
  .prose th, .prose td { padding: 8px 6px; }
}

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

@media print {
  .langs, .steps, .next, .foot, .skip { display: none; }
  .hero { background: none; }
  a { text-decoration: none; }
  .sources a::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
