@import url("fonts.css");

/* ============================================================
   RECUEIL — home / cover of abdellah-hassani.fr
   Direction: a fine-press drafting proof that binds three
   coloured project volumes. Light = drafting cover.
   Dark = lit instrument console (a second reading of one object).
   Rules: hairline rules, mono eyebrows, numbered leaves, flat
   notched "accession plates". No gradients (bar the marker wash),
   no shadow-cards, no browser mockups. Zero external request.
   ============================================================ */

:root {
  color-scheme: light;

  --paper: #eaebe6;
  --paper-2: #f3f4ef;
  --ink: #1a1d22;
  --ink-soft: #40444b;
  --ink-mute: #656a71; /* AA-contrast (4.5:1) on the drafting paper */
  --line: #cbcdc5;
  --line-soft: #dcddd6;

  --accent: #1b3b6b;
  --accent-strong: #12294d;
  --accent-2: #c6482d; /* vermilion — the single hot mark */
  --marker: rgba(198, 72, 45, 0.18);

  /* the three volumes quote each sub-site's own colour */
  --spine-huffzip: #0c9284;
  --spine-greffier: #8c2f39;
  --spine-askmydocs: #0e5a6b;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --maxw: 1180px;
  --gutter: clamp(1.15rem, 4.5vw, 3rem);
  --frame: clamp(0.7rem, 1.6vw, 1.4rem); /* proof-frame inset */
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}
p {
  margin: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease;
}
a:hover {
  color: var(--accent-strong);
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 480;
  line-height: 1.04;
  letter-spacing: -0.014em;
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}
::selection {
  background: var(--marker);
  color: var(--ink);
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Living neural-network field, painted behind all content */
.neural-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  z-index: 200;
}
.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
  color: var(--paper);
}

/* ---------- Mono utilities ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Proof frame: crop marks + registration + slug ---------- */
.proof {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  color: var(--ink-mute);
}
.proof .crop {
  position: absolute;
  width: 14px;
  height: 14px;
  opacity: 0.55;
}
.proof .crop::before,
.proof .crop::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.proof .crop::before {
  width: 1px;
  height: 14px;
}
.proof .crop::after {
  height: 1px;
  width: 14px;
}
.proof .tl {
  top: var(--frame);
  left: var(--frame);
}
.proof .tr {
  top: var(--frame);
  right: var(--frame);
}
.proof .tr::before {
  right: 0;
}
.proof .tr::after {
  right: 0;
}
.proof .bl {
  bottom: var(--frame);
  left: var(--frame);
}
.proof .bl::before {
  bottom: 0;
}
.proof .bl::after {
  bottom: 0;
}
.proof .br {
  bottom: var(--frame);
  right: var(--frame);
}
.proof .br::before {
  right: 0;
  bottom: 0;
}
.proof .br::after {
  right: 0;
  bottom: 0;
}
.proof .reg {
  position: absolute;
  top: calc(var(--frame) - 3px);
  right: calc(var(--frame) + 28px);
  width: 20px;
  height: 20px;
  opacity: 0.5;
}
.proof .reg circle,
.proof .reg line {
  stroke: currentColor;
  stroke-width: 1;
  fill: none;
}
.proof .slug {
  position: absolute;
  top: calc(var(--frame) - 3px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  opacity: 0.42;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .proof .slug {
    display: none;
  }
}
@media (max-width: 720px) {
  .proof .reg {
    display: none;
  }
  .proof .crop {
    width: 10px;
    height: 10px;
  }
}

/* ---------- Masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.masthead.is-scrolled {
  border-bottom-color: var(--ink);
}
.masthead-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 60px;
  padding-top: calc(var(--frame) + 4px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand:hover {
  color: var(--ink);
}
.brand .mk {
  width: 24px;
  height: 24px;
  flex: none;
}
.brand b {
  font-weight: 560;
  font-style: italic;
  color: var(--accent);
}
.masthead-nav {
  margin-left: auto;
  display: flex;
  gap: 1.15rem;
}
.masthead-nav a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
}
.masthead-nav a:hover {
  color: var(--accent);
}
.masthead-nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent-2);
}
.masthead-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 2px;
  overflow: hidden;
}
.lang-switch button {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  border: none;
  background: transparent;
  color: var(--ink-mute);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}
.lang-switch button + button {
  border-left: 1px solid var(--line);
}
.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
/* ---------- Section scaffolding: numbered leaves ---------- */
main {
  position: relative;
  z-index: 1;
}
/* faint spine threading down the left margin, launched from the hero */
.spine-rail {
  display: none;
}

.leaf {
  position: relative;
  z-index: 1;
  padding-block: clamp(2.6rem, 6vw, 5rem);
}
.leaf + .leaf {
  border-top: 1px solid var(--line);
}
.section-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 1rem;
}
.section-head .name {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}
.section-head .meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  text-align: right;
}
/* list sections (parcours / études / compétences) carry a full-size title */
.section-head.head-lg {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.9rem;
}
.section-head.head-lg .name {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 480;
  letter-spacing: -0.015em;
  text-transform: none;
  line-height: 1.02;
}
.folio {
  display: none;
}

/* ---------- Buttons / arrowed links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.66rem 1.05rem;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.btn svg {
  width: 1em;
  height: 1em;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.btn-ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.arrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 2px;
  white-space: nowrap;
}
.arrow::after {
  content: " ↗";
}
.arrow:hover {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

/* ---------- Accession plate (the home's fingerprint) ---------- */
.plate {
  --notch: 22px;
  position: relative;
  background: var(--line);
  padding: 1px;
  clip-path: polygon(
    0 0,
    calc(100% - var(--notch)) 0,
    100% var(--notch),
    100% 100%,
    0 100%
  );
}
.plate-in {
  position: relative;
  background: var(--paper-2);
  height: 100%;
  clip-path: polygon(
    0 0,
    calc(100% - var(--notch)) 0,
    100% var(--notch),
    100% 100%,
    0 100%
  );
}
.plate .acc {
  position: absolute;
  bottom: 9px;
  left: 10px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  padding: 2px 6px;
  border-radius: 2px;
}

/* ---------- Frontispice / hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(1.5rem, 4vw, 3rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 5vw, 4rem);
  align-items: center;
}
.hero-text .eyebrow {
  display: block;
  margin-bottom: 1.3rem;
}
.namelock {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(3.2rem, 11vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.028em;
  margin: 0;
}
.namelock .given {
  display: block;
  color: var(--ink);
}
.namelock .family {
  display: block;
  font-style: italic;
  color: var(--accent);
}
.hero-discipline {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  line-height: 1.28;
  color: var(--ink-soft);
  max-width: 30ch;
}
.hero-discipline em {
  font-style: italic;
  color: var(--ink);
}
.edition-rule {
  margin-top: 1.6rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.hero-cta {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.telemetry {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.4rem;
  align-items: center;
}
.telemetry .t {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.25rem 0.5rem;
}
.telemetry .t b {
  color: var(--accent);
  font-weight: 700;
}

/* portrait plate */
.portrait-figure {
  margin: 0;
  width: 100%;
  max-width: 380px;
  margin-inline: auto;
}
.portrait-plate {
  --notch: 30px;
  width: 100%;
}
.photo {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portrait-plate .frontispiece {
  aspect-ratio: 4 / 5;
}
.portrait-cap {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* AI band: signal → neural network → decision (the field, made literal) */
.ai-band {
  margin: clamp(2rem, 5vw, 3.4rem) 0 0;
}
.ai-net {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
}
.nn-edge {
  stroke: var(--ink);
  stroke-width: 1;
  opacity: 0.1;
  fill: none;
}
.nn-node {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.4;
}
.nn-active {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Input image: framed, cat/dog line art cross-fading */
.img-frame {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  opacity: 0.22;
}
.img-tick {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  opacity: 0.55;
}
.cls {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cls .solid {
  fill: var(--ink);
  stroke: none;
}
.cls-dog {
  opacity: 0;
} /* resting state resolves to "cat" */
.feed line {
  stroke: var(--ink);
  stroke-width: 1;
  opacity: 0.12;
}

/* Output: two class-probability bars */
.out-link {
  fill: none;
  stroke: var(--ink-mute);
  stroke-width: 1.2;
  opacity: 0.5;
}
.lbl {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.06em;
}
.lbl-cat {
  fill: var(--accent);
}
.lbl-dog {
  fill: var(--ink-mute);
}
.bar-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.2;
}
.bar-fill {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: left center;
}
.bar-cat {
  transform: scaleX(0.92);
}
.bar-dog {
  transform: scaleX(0.1);
}
.win {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.win-dog {
  opacity: 0;
} /* resting state resolves to "cat" */
.ai-cap {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.ai-cap span:nth-child(1) {
  text-align: left;
  padding-left: 2%;
}
.ai-cap span:nth-child(2) {
  text-align: center;
}
.ai-cap span:nth-child(3) {
  text-align: right;
  padding-right: 7%;
}
@media (max-width: 620px) {
  .ai-cap {
    font-size: 0.55rem;
  }
}

/* ---------- 01 Colophon / About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  gap: clamp(1.6rem, 5vw, 3.6rem);
  align-items: start;
}
.about-body p + p {
  margin-top: 1rem;
}
.about-body .lede {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  line-height: 1.32;
  color: var(--ink);
  margin-bottom: 1.3rem;
}
.about-body p {
  color: var(--ink-soft);
  max-width: 62ch;
}
.verso-fig {
  max-width: 320px;
  margin-inline: 0;
}
.verso-plate {
  --notch: 26px;
  width: 100%;
}
.verso-plate .verso {
  aspect-ratio: 3 / 4;
}
.ethos {
  margin-top: 1.6rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: grid;
  gap: 0.55rem;
}
.ethos li {
  list-style: none;
  display: flex;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.ethos li::before {
  content: "→";
  color: var(--accent-2);
}

/* ---------- 02 Les Œuvres — the centrepiece index ---------- */
.works {
  margin-top: 0.5rem;
}
.volume {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(1.2rem, 3.5vw, 2.6rem);
  align-items: start;
  padding: clamp(1.6rem, 3.5vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
}
.volume:last-child {
  border-bottom: 1px solid var(--line);
}
.volume .spine {
  width: 4px;
  align-self: stretch;
  background: var(--vol, var(--accent));
  border-radius: 2px;
}
.volume[data-vol="huffzip"] {
  --vol: var(--spine-huffzip);
  --vol-ink: #0a7266; /* AA-contrast teal for text (the bright teal is for the spine bar) */
}
.volume[data-vol="greffier"] {
  --vol: var(--spine-greffier);
  --vol-ink: var(--spine-greffier);
}
.volume[data-vol="askmydocs"] {
  --vol: var(--spine-askmydocs);
  --vol-ink: var(--spine-askmydocs);
}
.vol-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.vol-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--vol-ink, var(--accent));
  font-weight: 700;
  text-transform: uppercase;
}
.vol-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.vol-thesis {
  margin-top: 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  line-height: 1.35;
  color: var(--ink);
  max-width: 40ch;
}
.vol-summary {
  margin-top: 0.85rem;
  color: var(--ink-soft);
  font-size: 0.96rem;
  max-width: 54ch;
}
.vol-stats {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.vol-stats .stat .v {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
}
.vol-stats .stat .l {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  max-width: 22ch;
}
.vol-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.shot-fig {
  margin: 0;
}
.shot-plate {
  --notch: 20px;
  width: 100%;
}
.shot-link {
  display: block;
  position: relative;
  outline-offset: 3px;
}
.shot-link:focus-visible {
  outline: 2px solid var(--vol-ink, var(--accent));
}
.shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* "opens the live site" cue — reveals in the project's own colour on hover */
.shot-cue {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--vol-ink, var(--accent));
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0;
  transform: translateY(-4px) scale(0.85);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}
@media (hover: hover) {
  .shot-link:hover .shot img,
  .shot-link:focus-visible .shot img {
    transform: scale(1.04);
  }
  .shot-link:hover .shot-cue,
  .shot-link:focus-visible .shot-cue {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Per-project ML micro-visualisations ---------- */
.ml-viz {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}
.ml-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 108px;
  overflow: visible;
}
.ml-cap {
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.ml-cap b {
  color: var(--accent);
  font-weight: 500;
}

/* HuffZip — a Huffman tree with a code path lit root→leaf */
.mlz-tree .t-edge {
  stroke: var(--ink);
  opacity: 0.28;
  stroke-width: 1.4;
}
.mlz-tree .bit {
  font-family: var(--font-mono);
  font-size: 8px;
  fill: var(--ink-mute);
}
.mlz-tree .tnode,
.mlz-tree .leafn {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.4;
}
.mlz-tree .t-path {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.js .mlz-tree .t-path {
  stroke-dasharray: 26 170;
  animation: mlzTree 3s linear infinite;
}
@keyframes mlzTree {
  from { stroke-dashoffset: 196; }
  to { stroke-dashoffset: 0; }
}
.js .mlz-tree .f0 { animation: mlNode 3s ease-in-out infinite; }
.js .mlz-tree .f1 { animation: mlNode 3s ease-in-out infinite 0.4s; }
.js .mlz-tree .f2 { animation: mlNode 3s ease-in-out infinite 0.8s; }
@keyframes mlNode {
  0%, 55%, 100% { fill: var(--paper); stroke: var(--ink); }
  22% { fill: var(--accent); stroke: var(--accent); }
}

/* Greffier — a page scanned by attention, fields lit as they are read */
.mlz-grid .ln {
  fill: var(--ink);
  opacity: 0.26;
}
.js .mlz-grid .hi1 { animation: mlLine 3.2s ease-in-out infinite 0.5s; }
.js .mlz-grid .hi2 { animation: mlLine 3.2s ease-in-out infinite 1.9s; }
@keyframes mlLine {
  0%, 45%, 100% { fill: var(--ink); opacity: 0.26; }
  16% { fill: var(--accent); opacity: 0.95; }
}
.mlz-grid .scan {
  fill: var(--accent-2);
  opacity: 0.13;
}
.js .mlz-grid .scan {
  animation: mlScan 3.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
@keyframes mlScan {
  0% { transform: translateY(0); }
  100% { transform: translateY(84px); }
}

/* Greffier — a handwritten page is read and turned into a JSON record */
.mlz-json .page {
  fill: #ffffff;
  stroke: var(--line);
  stroke-width: 1.4;
}
.mlz-json .hw {
  fill: none;
  stroke: #14181a;
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.9;
}
.mlz-json .scan {
  fill: var(--accent-2);
  opacity: 0.12;
}
.js .mlz-json .scan {
  animation: mlScanJson 3.6s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
@keyframes mlScanJson {
  0%, 100% { transform: translateY(0); }
  45%, 55% { transform: translateY(72px); }
}
.mlz-json .jbrace {
  font-family: var(--font-mono);
  font-size: 12px;
  fill: var(--ink-soft);
}
.mlz-json .jkey {
  font-family: var(--font-mono);
  font-size: 8px;
  fill: var(--accent);
}
.mlz-json .jval {
  fill: var(--ink);
  opacity: 0.82;
}
.js .mlz-json .jrow {
  opacity: 0;
  animation: jrowIn 3.6s ease-in-out infinite;
}
.js .mlz-json .r0 { animation-delay: 0.6s; }
.js .mlz-json .r1 { animation-delay: 1s; }
.js .mlz-json .r2 { animation-delay: 1.4s; }
@keyframes jrowIn {
  0%, 12% { opacity: 0; }
  24%, 88% { opacity: 1; }
  100% { opacity: 0; }
}

/* AskMyDocs — a query retrieves the best-matching documents */
.mlz-rag .link {
  stroke: var(--ink);
  opacity: 0.22;
  stroke-width: 1.2;
}
.mlz-rag .q {
  fill: var(--accent);
}
.mlz-rag .doc {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.4;
}
.js .mlz-rag .lm1 { animation: mlLink 3s ease-in-out infinite; }
.js .mlz-rag .lm2 { animation: mlLink 3s ease-in-out infinite 0.5s; }
@keyframes mlLink {
  0%, 100% { stroke: var(--ink); opacity: 0.22; stroke-width: 1.2; }
  35% { stroke: var(--accent-2); opacity: 0.95; stroke-width: 1.8; }
}
.js .mlz-rag .dm1 { animation: mlDoc 3s ease-in-out infinite; }
.js .mlz-rag .dm2 { animation: mlDoc 3s ease-in-out infinite 0.5s; }
@keyframes mlDoc {
  0%, 100% { fill: var(--paper); stroke: var(--ink); }
  35% { fill: var(--accent-2); stroke: var(--accent-2); }
}

.vol-medium {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 2;
  color: var(--ink-soft);
}
.vol-medium .k {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.35rem;
}
.vol-medium .chip {
  color: var(--ink);
}
.vol-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  margin-top: 0.3rem;
}

/* ---------- Domains grid (AI fields of expertise / roadmap) ---------- */
.dom-lead {
  max-width: 26ch;
}
.domains {
  margin-top: clamp(1.4rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.domain {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(1.2rem, 2.4vw, 1.7rem);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 1rem;
  align-content: start;
  transition: background 0.2s ease;
}
@media (hover: hover) {
  .domain:hover {
    background: color-mix(in srgb, var(--accent) 4%, transparent);
  }
}
.domain.is-soon {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 9px,
    color-mix(in srgb, var(--ink) 3%, transparent) 9px,
    color-mix(in srgb, var(--ink) 3%, transparent) 10px
  );
}
.domain-ico {
  width: 44px;
  height: 44px;
  color: var(--accent);
}
.domain-ico svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.domain-title {
  font-family: var(--font-display);
  font-size: 1.32rem;
  line-height: 1.1;
}
.domain-status {
  display: inline-block;
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  vertical-align: middle;
}
.domain-desc {
  margin-top: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 34ch;
}
.domain-tags {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip-link,
.chip-note,
.chip-soon {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.32rem 0.6rem;
  border-radius: 2px;
  white-space: nowrap;
}
.chip-link {
  border: 1px solid var(--accent);
  color: var(--accent);
}
.chip-link::after {
  content: " ↗";
}
.chip-link:hover {
  background: var(--accent);
  color: #fff;
}
.chip-note {
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.chip-soon {
  border: 1px dashed var(--ink-mute);
  color: var(--ink-mute);
}

/* animated domain icons — each a tiny living AI motif */
.domain-ico .stub {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.domain-ico .fill-a {
  fill: var(--accent);
  stroke: none;
}
.domain-ico .txt {
  stroke: var(--ink-mute);
  opacity: 0.6;
  stroke-width: 2;
}
.domain-ico .hot {
  fill: var(--accent-2);
  stroke: none;
}
.ico-llm .tok { fill: var(--ink-mute); }
.ico-pred .curve { stroke: var(--accent); }
.ico-pred .tip { fill: var(--accent-2); }
.ico-agents .hub,
.ico-agents .sat { fill: var(--accent); stroke: none; }
.ico-agents .spoke { stroke: var(--ink-mute); opacity: 0.5; stroke-width: 1.4; fill: none; }
.ico-data .layer { stroke: var(--accent); fill: none; stroke-width: 1.6; }
.ico-data .packet { fill: var(--accent-2); }
.ico-algo .aedge { stroke: var(--ink-mute); opacity: 0.55; stroke-width: 1.6; }
.ico-algo .an { fill: var(--paper); stroke: var(--accent); stroke-width: 1.6; }
/* OCR: scan bar sweeps the document */
.js .ico-ocr .scanbar { animation: dScan 2.8s cubic-bezier(0.5, 0, 0.5, 1) infinite; }
@keyframes dScan { 0% { transform: translateY(0); } 100% { transform: translateY(21px); } }
/* LLM: tokens light up in sequence */
.js .ico-llm .tok { animation: dTok 2.4s ease-in-out infinite; }
.js .ico-llm .k1 { animation-delay: 0.25s; }
.js .ico-llm .k2 { animation-delay: 0.5s; }
@keyframes dTok { 0%, 60%, 100% { fill: var(--ink-mute); } 20% { fill: var(--accent-2); } }
/* Prediction: the forecast curve draws, the tip pulses */
.js .ico-pred .curve { stroke-dasharray: 46; animation: dCurve 2.8s ease-in-out infinite; }
@keyframes dCurve { 0% { stroke-dashoffset: 46; } 55%, 100% { stroke-dashoffset: 0; } }
.js .ico-pred .tip { animation: dTip 2.8s ease-in-out infinite; }
@keyframes dTip { 0%, 55% { r: 0; } 70% { r: 3.4; } 100% { r: 2.4; } }
/* Agents: a pulse hops center → satellites in turn */
.js .ico-agents .sat { animation: dSat 2.4s ease-in-out infinite; }
.js .ico-agents .a1 { animation-delay: 0.35s; }
.js .ico-agents .a2 { animation-delay: 0.7s; }
@keyframes dSat { 0%, 55%, 100% { fill: var(--accent); } 22% { fill: var(--accent-2); } }
/* Data: a packet flows down the stack */
.js .ico-data .packet { animation: dFlow 2.6s cubic-bezier(0.5, 0, 0.5, 1) infinite; }
@keyframes dFlow { 0% { transform: translateY(-3px); opacity: 0; } 15%, 85% { opacity: 1; } 100% { transform: translateY(22px); opacity: 0; } }
/* Algo: tree nodes fire root → leaves */
.js .ico-algo .an { animation: dNode 2.6s ease-in-out infinite; }
.js .ico-algo .b1 { animation-delay: 0.3s; }
.js .ico-algo .b2 { animation-delay: 0.55s; }
@keyframes dNode { 0%, 60%, 100% { fill: var(--paper); } 25% { fill: var(--accent-2); } }
@media (max-width: 620px) {
  .domain {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0.8rem;
  }
}

/* ---------- 03/04 Datasheet tables (parcours / études) ---------- */
.datasheet {
  display: grid;
  gap: 0;
}
.row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.4rem);
  padding: 1.3rem 0;
  border-top: 1px solid var(--line);
}
.row:first-child {
  border-top: none;
}
.row .when {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding-top: 0.35rem;
}
.row .when .loc {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
}
.row .what h3 {
  font-size: 1.32rem;
}
.row .what .org {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}
.row .what .flagship {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.9rem;
  color: var(--ink);
}
.row .what ul {
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}
.row .what ul li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.row .what ul li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- 05 Matériaux & méthodes (skills) ---------- */
.spec {
  display: grid;
  gap: 0;
}
.spec-row {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.4rem);
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.spec-row:first-child {
  border-top: none;
}
.spec-row .k {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.spec-row .v {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.9;
  color: var(--ink-soft);
}
.spec-row .v b {
  color: var(--ink);
  font-weight: 500;
}
.side-list {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
}
.side-list h4 {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.7rem;
  font-weight: 500;
}
.side-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}
.side-list li {
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.side-list .lang {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.side-list .lang .lv {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-mute);
  white-space: nowrap;
}

/* ---------- 06 Colophon / contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 5vw, 3.6rem);
  align-items: start;
}
.contact-lead h2 {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
}
.contact-lead p {
  margin-top: 1rem;
  color: var(--ink-soft);
  max-width: 42ch;
}
.contact-actions {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.contact-card {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1.4rem;
  background: var(--paper-2);
}
.contact-card dl {
  margin: 0;
  display: grid;
  gap: 0;
}
.contact-card .cr {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.contact-card .cr:first-child {
  border-top: none;
  padding-top: 0;
}
.contact-card dt {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.contact-card dd {
  margin: 0;
  text-align: right;
  font-size: 0.92rem;
}

/* ---------- Contact form ---------- */
.contact-form {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.1rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.field-wide {
  grid-column: 1 / -1;
}
.contact-form label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.6rem 0.7rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.contact-form textarea {
  resize: vertical;
  min-height: 6rem;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(27, 59, 107, 0.12);
}
.contact-form input:user-invalid,
.contact-form textarea:user-invalid {
  border-color: var(--accent-2);
}
.form-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}
.form-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.form-note.err {
  color: var(--accent-2);
}
@media (max-width: 520px) {
  .contact-form {
    grid-template-columns: 1fr;
  }
}

/* ---------- Colophon foot ---------- */
.colophon {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  padding-block: 2rem 2.6rem;
}
.colophon-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
}
.colophon-brand {
  max-width: 30rem;
}
.colophon-brand .mono {
  color: var(--ink-mute);
}
.colophon-brand p {
  margin-top: 0.7rem;
  color: var(--ink-mute);
  font-size: 0.9rem;
}
.colophon-nav {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.colophon-col h4 {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.8rem;
  font-weight: 500;
}
.colophon-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.colophon-col a {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.colophon-col a:hover {
  color: var(--accent);
}
.colophon-bottom {
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}

/* ---------- Legal page ---------- */
.legal {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4.5rem);
}
.legal-head {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1.4rem;
}
.legal-head h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-top: 0.85rem;
}
.legal-head p {
  margin-top: 0.85rem;
  color: var(--ink-soft);
  max-width: 42rem;
}
.legal-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
  gap: 1rem clamp(1.5rem, 4vw, 3rem);
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.legal-block h2 {
  font-size: 1.3rem;
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}
.legal-block h2 .n {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
}
.legal-block p {
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.legal-block a {
  word-break: break-word;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.back-link:hover {
  color: var(--accent);
}
@media (max-width: 620px) {
  .legal-block {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* ============================================================
   MOTION — restrained, in service of the "signal / fine-press"
   idea. All of it collapses to static under prefers-reduced-motion.
   ============================================================ */

/* Reveal: rise + fade, editorial easing, optional stagger via --d */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0s);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* Hero entrance: each line rises in, gently staggered */
.js .hero-line {
  opacity: 0;
  transform: translateY(18px);
  animation: heroRise 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.js .hero-line:nth-child(1) { animation-delay: 0.05s; }
.js .hero-line:nth-child(2) { animation-delay: 0.16s; }
.js .hero-line:nth-child(3) { animation-delay: 0.3s; }
.js .hero-line:nth-child(4) { animation-delay: 0.42s; }
.js .hero-line:nth-child(5) { animation-delay: 0.52s; }
.js .hero-line:nth-child(6) { animation-delay: 0.62s; }
@keyframes heroRise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* AI band — an image classifier. Over an 8s cycle the input alternates
   cat → dog; a forward pass (4s) fires the layers left→right, and the
   matching class bar fills as the network commits to its prediction. */

/* forward pass: one lit segment sweeps input → logits, twice per cycle */
.js .nn-active {
  stroke-dasharray: 46 690;
  animation: nnFlow 4s cubic-bezier(0.45, 0, 0.35, 1) infinite;
}
@keyframes nnFlow {
  from { stroke-dashoffset: 736; }
  to { stroke-dashoffset: -46; }
}
.js .nn-node {
  animation: nnFire 4s ease-in-out infinite;
}
.js .nl0 { animation-delay: 0.5s; }
.js .nl1 { animation-delay: 1.4s; }
.js .nl2 { animation-delay: 2.4s; }
.js .nl3 { animation-delay: 3.3s; }
@keyframes nnFire {
  0%, 40%, 100% { fill: var(--paper); stroke: var(--ink); }
  8% { fill: var(--accent); stroke: var(--accent); }
}

/* input image swaps the pictured animal each pass */
.js .cls-cat { animation: clsCat 8s ease-in-out infinite; }
.js .cls-dog { animation: clsDog 8s ease-in-out infinite; }
@keyframes clsCat {
  0%, 42% { opacity: 1; }
  50%, 92% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes clsDog {
  0%, 42% { opacity: 0; }
  50%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

/* the prediction bars settle after each forward pass */
.js .bar-cat {
  animation: barCat 8s cubic-bezier(0.5, 0, 0.15, 1) infinite;
}
.js .bar-dog {
  animation: barDog 8s cubic-bezier(0.5, 0, 0.15, 1) infinite;
}
@keyframes barCat {
  0%, 4% { transform: scaleX(0.08); }
  20%, 46% { transform: scaleX(0.94); }
  54%, 96% { transform: scaleX(0.09); }
  100% { transform: scaleX(0.08); }
}
@keyframes barDog {
  0%, 46% { transform: scaleX(0.09); }
  54%, 58% { transform: scaleX(0.11); }
  70%, 96% { transform: scaleX(0.92); }
  100% { transform: scaleX(0.09); }
}

/* winner label lights up and its check appears */
.js .lbl-cat { animation: winLblCat 8s step-end infinite; }
.js .lbl-dog { animation: winLblDog 8s step-end infinite; }
.js .win-cat { animation: winMarkCat 8s step-end infinite; }
.js .win-dog { animation: winMarkDog 8s step-end infinite; }
@keyframes winLblCat {
  0%, 42% { fill: var(--accent); }
  50%, 100% { fill: var(--ink-mute); }
}
@keyframes winLblDog {
  0%, 42% { fill: var(--ink-mute); }
  50%, 100% { fill: var(--accent); }
}
@keyframes winMarkCat {
  0%, 42% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes winMarkDog {
  0%, 42% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

/* Blinking registration cursor in the proof frame — instrument "live" */
.js .proof .reg circle {
  animation: regPulse 3.6s ease-in-out infinite;
  transform-origin: center;
}
@keyframes regPulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.reading-rail {
  display: none;
}

/* Count-up numerals use tabular figures; each stat's label is wider than
   its number, so the value can grow during the count without shifting. */
.stat .v,
.vol-stats .v {
  font-variant-numeric: tabular-nums;
}

/* Volume hover: the spine grows and the title takes the volume's colour */
.volume .spine {
  transition: transform 0.25s ease;
}
.volume .vol-title {
  transition: color 0.25s ease;
}
@media (hover: hover) {
  .volume:hover .spine {
    transform: scaleX(2.1);
  }
  .volume:hover .vol-title {
    color: var(--vol-ink, var(--accent));
  }
}

/* Buttons & arrows: quiet lift on hover */
.btn,
.arrow {
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}
@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
  }
  .arrow:hover {
    transform: translateX(2px);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .hero-grid {
    gap: 2.2rem;
  }
  .frontispiece-fig {
    max-width: 320px;
    margin-inline: 0;
  }
  .volume {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .vol-aside {
    grid-column: 2;
  }
}
@media (max-width: 620px) {
  body {
    font-size: 16px;
  }
  .masthead-nav {
    display: none;
  }
  .section-head .meta {
    display: none;
  }
  .volume {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
  }
  .vol-aside {
    grid-column: 1 / -1;
    margin-left: 0;
    order: -1;
  }
  .row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .spec-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .contact-card dd {
    text-align: left;
  }
  .contact-card .cr {
    flex-direction: column;
    gap: 0.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  .js .reveal,
  .js .hero-line {
    opacity: 1;
    transform: none;
  }
  .js .nn-active {
    stroke-dashoffset: 0;
    opacity: 0.45;
  }
  .js .nn-node {
    fill: var(--paper);
    stroke: var(--ink);
  }
  .js .cls-cat,
  .js .cls-dog,
  .js .bar-cat,
  .js .bar-dog,
  .js .lbl-cat,
  .js .lbl-dog,
  .js .win-cat,
  .js .win-dog {
    animation: none;
  }
  .js .mlz-tree .t-path {
    stroke-dashoffset: 0;
  }
  .js .mlz-grid .scan,
  .js .mlz-json .scan {
    opacity: 0;
  }
  .js .mlz-json .jrow {
    opacity: 1;
  }
  .js .ico-pred .curve {
    stroke-dashoffset: 0;
  }
  .js .ico-pred .tip {
    r: 2.4;
  }
  .js .ico-data .packet {
    opacity: 1;
    transform: none;
  }
  .js .ico-ocr .scanbar {
    opacity: 0;
  }
}

/* ---------- Print ---------- */
@media print {
  .proof,
  .masthead,
  .reading-rail,
  .spine-rail,
  .ai-band,
  .lang-switch {
    display: none !important;
  }
  .js .reveal,
  .js .hero-line {
    opacity: 1 !important;
    transform: none !important;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
}
