/* ─────────────────────────────────────────────────────────────────────────
   Romain Mélisen — CV

   The rule that governs this sheet: the accent hue is spent on data and state
   only — level marks, scroll position, focus, the active section. It is never
   spent on a heading, a border, or a mood. Everything structural is a hairline
   in a cool grey that does none of the speaking.

   Two mediums: dark (default) and light. Both are checked for AA contrast —
   see the ratios noted beside the tokens.
   ───────────────────────────────────────────────────────────────────────── */

/* ─── Reset ──────────────────────────────────────────────────────────── */

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

html,
body,
h1, h2, h3, p, ol, ul, li, dl, dt, dd, figure, figcaption {
  margin: 0;
  padding: 0;
}

ol, ul {
  list-style: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
  /* The UA sheet sets text-transform: none on form controls, which beats
     inheritance — without this, a button inside an uppercased row renders
     lowercase while its sibling links don't. */
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ─── Tokens ─────────────────────────────────────────────────────────── */

:root {
  /* PAPER — the same apparatus, printed. */
  --field: #eef1f6;
  --field-2: #e6eaf2;
  --bone: #0b1220;
  --ash: #3c4657;
  --dim: #5a6779;            /* 5.0:1 on field */
  --signal: #0e6e82;         /* 5.2:1 on field */
  --signal-hi: #0a5566;
  --rule: rgba(11, 18, 32, 0.16);
  --rule-soft: rgba(11, 18, 32, 0.075);
  --halo: rgba(14, 110, 130, 0.07);

  --rail-h: 58px;
  --gutter: clamp(22px, 5.5vw, 88px);
  --sheet: 1180px;

  --display: "Jost", ui-sans-serif, system-ui, sans-serif;
  --utility: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

html.dark {
  /* NIGHT — darkness as instrument. */
  --field: #0a0e1a;
  --field-2: #0d1424;
  --bone: #dde5f0;
  --ash: #a3b2c8;
  --dim: #7c8da6;            /* 5.7:1 on field */
  --signal: #06b6d4;         /* 7.9:1 on field */
  --signal-hi: #22d3ee;
  --rule: rgba(143, 163, 191, 0.17);
  --rule-soft: rgba(143, 163, 191, 0.075);
  --halo: rgba(6, 182, 212, 0.09);
  color-scheme: dark;
}

html {
  background: var(--field);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--field);
  color: var(--bone);
  font-family: var(--display);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Focus ──────────────────────────────────────────────────────────── */

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

::selection {
  background: var(--signal);
  color: var(--field);
}

/* ─── Frame ──────────────────────────────────────────────────────────── */

.plate {
  position: relative;
  min-height: 100vh;
}

.plate .atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 78% 4%, var(--halo), transparent 62%),
    radial-gradient(ellipse 55% 40% at 6% 96%, var(--halo), transparent 62%);
}

/* Registration brackets at the corners of the field. */
.plate .brackets span {
  position: fixed;
  z-index: 2;
  width: 26px;
  height: 26px;
  pointer-events: none;
  border: 0 solid var(--rule);
}
.plate .brackets span:nth-child(1) {
  top: 14px; left: 14px; border-top-width: 1px; border-left-width: 1px;
}
.plate .brackets span:nth-child(2) {
  top: 14px; right: 14px; border-top-width: 1px; border-right-width: 1px;
}
.plate .brackets span:nth-child(3) {
  bottom: 14px; left: 14px; border-bottom-width: 1px; border-left-width: 1px;
}
.plate .brackets span:nth-child(4) {
  bottom: 14px; right: 14px; border-bottom-width: 1px; border-right-width: 1px;
}

.plate .sheet {
  position: relative;
  z-index: 1;
  max-width: var(--sheet);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ─── Rail ───────────────────────────────────────────────────────────── */

/* Position in the document, read as a hairline. */
.plate .progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 1px;
  background: var(--signal);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.plate .rail {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  height: var(--rail-h);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--rule-soft);
  background: color-mix(in oklab, var(--field) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.plate .rail-id {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}
.plate .rail-id .who {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.plate .rail-id .obs {
  font-family: var(--utility);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--dim);
  white-space: nowrap;
}

.plate .rail-nav {
  display: flex;
  gap: 2px;
  min-width: 0;
}
.plate .rail-nav button {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 11px;
  font-family: var(--utility);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.plate .rail-nav button .numeral {
  font-size: 9px;
  opacity: 0.55;
}
.plate .rail-nav button:hover {
  color: var(--bone);
}
.plate .rail-nav button.on {
  color: var(--bone);
}
.plate .rail-nav button.on .numeral {
  color: var(--signal);
  opacity: 1;
}

.plate .rail-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.plate .toggle {
  display: inline-flex;
  gap: 2px;
}
/* Padding here is hit area, not decoration — these read as bare text but need
   to be reachable with a thumb. */
.plate .toggle button,
.plate .medium {
  padding: 7px 7px 5px;
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--dim);
  transition: color 0.2s var(--ease);
}
.plate .toggle button:hover,
.plate .medium:hover {
  color: var(--bone);
}
.plate .toggle button.on {
  color: var(--bone);
  border-bottom: 1px solid var(--signal);
}

/* ─── Panels ─────────────────────────────────────────────────────────── */

.plate .head,
.plate .panel {
  padding-block: clamp(76px, 11.5vh, 150px);
  scroll-margin-top: calc(var(--rail-h) + 16px);
}
.plate .panel {
  border-top: 1px solid var(--rule-soft);
}
.plate .head {
  padding-top: calc(var(--rail-h) + clamp(52px, 9vh, 118px));
}

.plate .panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(34px, 5vw, 62px);
}
.plate .panel-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(24px, 3.2vw, 40px);
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.plate .panel-title .numeral {
  font-family: var(--utility);
  font-size: 0.42em;
  letter-spacing: 0.1em;
  color: var(--signal);
}
.plate .panel-title .dot {
  font-size: 0.42em;
  color: var(--dim);
}

.plate .sub-label {
  font-family: var(--utility);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}

/* ─── Head ───────────────────────────────────────────────────────────── */

.plate .head-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.plate .head-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(40px, 7vw, 96px);
  align-items: start;
  padding-top: clamp(38px, 6vw, 76px);
}

.plate .subject {
  display: flex;
  flex-direction: column;
  font-size: clamp(38px, 6.6vw, 96px);
  font-weight: 200;
  line-height: 1.02;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.plate .subject .family {
  color: var(--ash);
}

.plate .role {
  margin-top: 26px;
  font-family: var(--utility);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--signal);
}

.plate .bio {
  max-width: 56ch;
  margin-top: 30px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ash);
}

.plate .head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 40px;
}
.plate .act {
  padding: 13px 26px;
  border: 1px solid var(--rule);
  font-family: var(--utility);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.plate .act:hover {
  color: var(--bone);
  border-color: var(--dim);
}
/* The primary action earns its weight from a solid edge, not a solid fill. */
.plate .act.primary {
  color: var(--bone);
  border-color: var(--bone);
}
.plate .act.primary:hover {
  background: var(--bone);
  border-color: var(--bone);
  color: var(--field);
}

.plate .head-aside {
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.plate .fig img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--rule);
  filter: grayscale(1) contrast(1.06);
  transition: filter 0.5s var(--ease);
}
.plate .fig:hover img {
  filter: grayscale(0) contrast(1.02);
}
.plate .specs {
  display: flex;
  flex-direction: column;
}
.plate .spec-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.14em;
  line-height: 1.5;
}
.plate .spec-row:last-child {
  border-bottom: 1px solid var(--rule-soft);
}
.plate .spec-row dt {
  color: var(--dim);
}
.plate .spec-row dd {
  color: var(--ash);
}

/* ─── Entries (trajectory, education) ────────────────────────────────── */

.plate .entries {
  display: flex;
  flex-direction: column;
}
.plate .entry {
  display: grid;
  grid-template-columns: minmax(0, 168px) 1fr;
  gap: 20px;
  padding: clamp(26px, 3vw, 40px) 0;
  border-top: 1px solid var(--rule-soft);
}
.plate .entry:first-child {
  border-top: 0;
  padding-top: 0;
}
.plate .entry-when {
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
  padding-top: 5px;
}
.plate .entry-role {
  font-size: clamp(19px, 2.1vw, 25px);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: 0.01em;
}
.plate .entry-where {
  margin-top: 5px;
  font-size: 14px;
  color: var(--ash);
}
.plate .entry-where .city {
  margin-left: 12px;
  font-family: var(--utility);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.plate .notes {
  margin-top: 16px;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--ash);
}
.plate .notes li {
  position: relative;
  padding-left: 20px;
}
.plate .notes li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 9px;
  height: 1px;
  background: var(--dim);
}
.plate .notes.plain {
  padding-left: 0;
}

.plate .stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 18px;
  font-family: var(--utility);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ─── Inventory ──────────────────────────────────────────────────────── */

.plate .columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 3vw, 44px);
}
.plate .col-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--utility);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.plate .columns li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13.5px;
  color: var(--ash);
}
.plate .columns li:last-child {
  border-bottom: 0;
}
.plate .columns .nm {
  min-width: 0;
}
/* Three marks, filled to the level held. */
.plate .lvl {
  display: inline-flex;
  gap: 5px;
  flex-shrink: 0;
}
.plate .lvl span {
  width: 5px;
  height: 5px;
  border: 1px solid var(--rule);
  border-radius: 50%;
}
.plate .lvl span.on {
  background: var(--signal);
  border-color: var(--signal);
}

/* ─── Records ────────────────────────────────────────────────────────── */

.plate .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: clamp(30px, 4vw, 48px);
}
.plate .filter {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 0 5px;
  border-bottom: 1px solid transparent;
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.plate .filter .count {
  font-size: 9px;
  opacity: 0.6;
}
.plate .filter:hover {
  color: var(--bone);
}
.plate .filter.on {
  color: var(--bone);
  border-bottom-color: var(--signal);
}

.plate .records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.plate .record {
  padding: clamp(24px, 2.6vw, 38px);
  background: var(--field);
  transition: background 0.3s var(--ease);
}
.plate .record:hover {
  background: var(--field-2);
}
.plate .record-ref {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--utility);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}
.plate .record-ref .ref {
  color: var(--signal);
}
.plate .record-name {
  margin-top: 18px;
  font-size: clamp(18px, 1.9vw, 23px);
  font-weight: 300;
  line-height: 1.25;
}
.plate .record-blurb {
  margin-top: 9px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ash);
}
.plate .record .notes {
  margin-top: 14px;
  font-size: 13.5px;
}

/* ─── Off-field ──────────────────────────────────────────────────────── */

.plate .offfield {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(38px, 6vw, 88px);
}
.plate .tongues {
  display: flex;
  flex-direction: column;
}
.plate .tongues li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.plate .tongue-name {
  font-size: 17px;
  font-weight: 300;
}
.plate .tongue-level {
  font-family: var(--utility);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  align-self: center;
  text-align: right;
}
/* Five steps, counted. */
.plate .tongue-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 4px;
}
.plate .tongue-bar span {
  height: 3px;
  background: var(--rule);
}
.plate .tongue-bar span.on {
  background: var(--signal);
}

.plate .interests {
  display: flex;
  flex-direction: column;
}
.plate .interests li {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 15px;
  color: var(--ash);
}

/* ─── Contact ────────────────────────────────────────────────────────── */

.plate .contact .ask {
  font-size: clamp(30px, 5.2vw, 68px);
  font-weight: 200;
  line-height: 1.08;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.plate .mail {
  display: inline-block;
  margin-top: 30px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
  font-size: clamp(17px, 2vw, 23px);
  color: var(--ash);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.plate .mail:hover {
  color: var(--signal);
  border-bottom-color: var(--signal);
}
.plate .reach {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 30px;
  margin-top: 46px;
  font-family: var(--utility);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
/* Every child carries the same padding, so the plain location text sits on the
   same line as the interactive ones rather than riding high in the row. */
.plate .reach > * {
  padding: 5px 0;
}
.plate .reach a,
.plate .reach button {
  transition: color 0.2s var(--ease);
}
.plate .reach a:hover,
.plate .reach button:hover {
  color: var(--signal);
}

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

.plate .colophon {
  padding: 44px 0 60px;
  border-top: 1px solid var(--rule-soft);
}
.plate .colophon .mark {
  text-align: center;
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--dim);
}

/* ─── Toast ──────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  z-index: 80;
  padding: 11px 20px;
  border: 1px solid var(--rule);
  border-left: 1px solid var(--signal);
  background: var(--field-2);
  color: var(--bone);
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

@media (max-width: 1080px) {
  .plate .rail {
    grid-template-columns: 1fr auto;
    height: auto;
    padding-block: 10px;
    row-gap: 8px;
  }
  .plate .rail-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .plate .rail-nav::-webkit-scrollbar {
    display: none;
  }
  /* Names stay, designations go — the row scrolls rather than shedding the
     only part a visitor can read. */
  .plate .rail-nav button .numeral {
    display: none;
  }
  .plate .rail-nav button {
    padding: 7px 9px;
  }
  .plate .columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  :root {
    --rail-h: 92px;
  }
  .plate .head-body {
    grid-template-columns: 1fr;
  }
  .plate .head-aside {
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
  }
  .plate .fig {
    flex: 0 0 150px;
  }
  .plate .specs {
    flex: 1 1 auto;
  }
  .plate .entry {
    grid-template-columns: 1fr;
  }
  .plate .entry-when {
    padding-top: 0;
  }
  .plate .records {
    grid-template-columns: 1fr;
  }
  .plate .offfield {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .plate .columns {
    grid-template-columns: 1fr;
  }
  .plate .head-aside {
    flex-direction: column;
  }
  .plate .fig {
    flex-basis: auto;
    max-width: 180px;
  }
  .plate .brackets span {
    width: 16px;
    height: 16px;
  }
}

/* ─── Motion ─────────────────────────────────────────────────────────── */

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