@font-face { font-family: "Cormorant"; src: url("cormorant.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("cormorant-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  /* One family of pages, three rooms. Each opens on its own chart: a weather map (profile),
     the northern sky about Polaris (service), a compass card (CMIA). All continue on the same
     pale sheet and close on the same engraved calling card. */
  --paper: oklch(97.5% 0.005 250);
  --ink: oklch(23% 0.045 258);
  --slate: oklch(45% 0.035 255);
  --rule: oklch(88% 0.012 250);
  --scarlet: oklch(52% 0.19 27);   /* Intelligence Branch colours */
  --green: oklch(36% 0.08 155);

  --serif: "Cormorant", "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 56px);
  --dock: 0px;
  color-scheme: light;
}

/* Profile: daylight. Air force blue on the sheet. */
html[data-page="profile"] {
  --hero-bg: linear-gradient(oklch(96% 0.012 245), var(--paper));
  --hero-fg: var(--ink); --hero-sub: var(--slate);
  --hero-acc: oklch(42% 0.12 255); --hero-on-acc: #fff;
  --close-bg: radial-gradient(120% 90% at 78% 12%, oklch(30% 0.06 255), oklch(22% 0.045 256) 46%, oklch(16% 0.04 258));
  --close-fg: oklch(94% 0.01 250); --close-sub: oklch(78% 0.03 250);
  --close-acc: oklch(84% 0.07 242); --close-on-acc: oklch(17% 0.04 258);
  --accent: oklch(42% 0.12 255);
  --bar-bg: var(--paper); --bar-fg: var(--ink); --bar-acc: oklch(42% 0.12 255); --bar-on-acc: #fff;
}
/* Service: mess-dress midnight and brass. */
html[data-page="service"] {
  --hero-bg: radial-gradient(120% 90% at 78% 12%, oklch(27% 0.06 258), oklch(20% 0.045 258) 46%, oklch(15% 0.04 258));
  --hero-fg: oklch(94% 0.01 250); --hero-sub: oklch(76% 0.03 250);
  --hero-acc: oklch(78% 0.09 85); --hero-on-acc: oklch(15% 0.04 258);
  --close-bg: var(--hero-bg); --close-fg: var(--hero-fg); --close-sub: var(--hero-sub);
  --close-acc: var(--hero-acc); --close-on-acc: var(--hero-on-acc);
  --accent: oklch(50% 0.085 75);
  --bar-bg: oklch(15% 0.04 258); --bar-fg: oklch(94% 0.01 250); --bar-acc: oklch(78% 0.09 85); --bar-on-acc: oklch(15% 0.04 258);
}
/* CMIA: the branch's dark green, with silver. */
html[data-page="cmia"] {
  --hero-bg: radial-gradient(120% 90% at 78% 12%, oklch(31% 0.06 160), oklch(23% 0.05 160) 46%, oklch(16% 0.04 162));
  --hero-fg: oklch(95% 0.012 130); --hero-sub: oklch(80% 0.03 150);
  --hero-acc: oklch(91% 0.02 115); --hero-on-acc: oklch(18% 0.04 162);
  --close-bg: var(--hero-bg); --close-fg: var(--hero-fg); --close-sub: var(--hero-sub);
  --close-acc: var(--hero-acc); --close-on-acc: var(--hero-on-acc);
  --accent: oklch(38% 0.085 158);
  --bar-bg: oklch(16% 0.04 162); --bar-fg: oklch(95% 0.012 130); --bar-acc: oklch(91% 0.02 115); --bar-on-acc: oklch(18% 0.04 162);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.62;
  -webkit-font-smoothing: antialiased; padding-bottom: var(--dock);
}
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; text-wrap: balance; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--acc, var(--accent)); outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

html[lang="en"] .fr, html[lang="fr"] .en { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sheet { max-width: 1180px; margin: 0 auto; padding-inline: var(--gutter); }
.caps { font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }

/* ---------- Top bar and page switch ---------- */
.bar {
  --acc: var(--bar-acc); --on-acc: var(--bar-on-acc);
  position: absolute; inset: 0 0 auto 0; z-index: 20; color: var(--hero-fg);
  .sheet { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-block: 16px; }
}
.mark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; letter-spacing: 0.02em; }
.mark svg { width: 20px; height: 20px; fill: var(--acc); }
.switch {
  order: 3; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px;
  border: 1px solid color-mix(in oklch, var(--acc) 45%, transparent); border-radius: 999px;
  a { display: grid; place-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; text-decoration: none; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; transition: background-color .2s, color .2s; }
  a:hover { background: color-mix(in oklch, var(--acc) 18%, transparent); }
  a[aria-current="page"] { background: var(--acc); color: var(--on-acc); }
}
.lang {
  background: none; border: 1px solid color-mix(in oklch, var(--acc) 55%, transparent); border-radius: 999px;
  padding: 7px 16px; cursor: pointer; font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em;
  transition: background-color .2s, color .2s;
  &:hover { background: var(--acc); color: var(--on-acc); }
}
/* Service on a phone: the globe sits behind the opening text. A shadow in the hero colour keeps the words clear of the chart. */
@media (max-width: 759px) {
  html[data-page="service"] {
    .switch, .lang:not(:hover) { background: oklch(17% 0.045 258 / 0.6); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
    .hero .rank, .hero .name { text-shadow: 0 0 2px oklch(15% 0.04 258 / 0.9), 0 1px 14px oklch(15% 0.04 258 / 0.95), 0 0 30px oklch(15% 0.04 258 / 0.7); }
  }
}
@media (min-width: 760px) {
  .bar { position: fixed; color: var(--bar-fg); background: color-mix(in oklch, var(--bar-bg) 86%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
  .bar .sheet { flex-wrap: nowrap; padding-block: 14px; }
  .switch { order: 0; width: auto; }
  @supports (animation-timeline: scroll()) {
    .bar { animation: bar-in linear both; animation-timeline: scroll(root); animation-range: 0 260px; }
    @keyframes bar-in { from { background-color: transparent; backdrop-filter: none; } }
  }
}

/* ---------- Opening ---------- */
.hero, .close { position: relative; overflow: clip; }
.hero { --fg: var(--hero-fg); --sub: var(--hero-sub); --acc: var(--hero-acc); --on-acc: var(--hero-on-acc); background: var(--hero-bg); color: var(--fg); }
.close { --fg: var(--close-fg); --sub: var(--close-sub); --acc: var(--close-acc); --on-acc: var(--close-on-acc); background: var(--close-bg); color: var(--fg); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero .sheet { position: relative; }

.opening { display: grid; grid-template-columns: 1fr; gap: 28px; padding-block: 162px 56px; }
.rank { color: var(--acc); }
.name { font-weight: 500; font-size: min(16.2vw, 10.25rem); line-height: 0.92; letter-spacing: -0.012em; white-space: nowrap; margin-top: 10px; view-transition-name: name; }
.posts { font-family: var(--serif); font-weight: 500; font-size: clamp(1.4rem, 2.5vw, 1.8rem); line-height: 1.28; }
.intro { margin-top: 18px; max-width: 46ch; color: var(--sub); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--acc, var(--ink)); background: transparent; color: var(--fg, var(--ink)); cursor: pointer;
  font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.02em; text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s;
  svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  &.solid { background: var(--acc); color: var(--on-acc); }
  &:hover { background: var(--fg, var(--ink)); border-color: var(--fg, var(--ink)); color: var(--on-acc, var(--paper)); }
}
html[data-page="profile"] .hero .btn:hover { color: var(--paper); }

.portrait { margin: 0; position: relative; width: min(100%, 400px); view-transition-name: portrait; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 12%; border-radius: 2px; }
.frame { position: relative; }
.frame::after { content: ""; position: absolute; inset: 10px -10px -10px 10px; border: 1px solid color-mix(in oklch, var(--acc) 70%, transparent); border-radius: 2px; pointer-events: none; }
.portrait figcaption { margin-top: 22px; font-size: 0.8125rem; color: var(--sub); line-height: 1.45; }

@media (max-width: 759px) {
  .portrait img { aspect-ratio: 1 / 1; }
  .portrait { width: calc(100% - 10px); }
}
@media (min-width: 760px) {
  .opening { grid-template-columns: 7fr 5fr; gap: 20px 64px; padding-block: 150px 96px; align-items: end; }
  .head { grid-column: 1 / -1; }
  .name { font-size: min(13.4vw, 10.25rem); }
  .portrait { justify-self: end; grid-column: 2; grid-row: 2; }
  .say { grid-column: 1; grid-row: 2; padding-bottom: 12px; }
}

/* The seam: scarlet, white and dark green, the Intelligence Branch colours. */
.seam { height: 7px; background: linear-gradient(var(--scarlet) 0 3px, #fff 3px 4px, var(--green) 4px 7px); }
html[data-page="profile"] .seam { height: 1px; background: var(--rule); }

/* ---------- The sheet ---------- */
.part { padding-block: clamp(56px, 8vw, 104px); border-bottom: 1px solid var(--rule); }
.part > .sheet { display: grid; grid-template-columns: 1fr; gap: 28px; }
.part h2 { font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.05; letter-spacing: -0.005em; }
.part h2::before { content: ""; display: block; width: 44px; height: 2px; background: var(--accent); margin-bottom: 18px; }
@media (min-width: 900px) {
  .part > .sheet { grid-template-columns: 3fr 9fr; gap: 64px; }
  .part h2 { position: sticky; top: 104px; align-self: start; }
}

.bio p { max-width: 62ch; }
.bio p + p { margin-top: 1.1em; }
.bio p:first-child { font-family: var(--serif); font-size: clamp(1.45rem, 2.4vw, 1.8rem); line-height: 1.32; font-weight: 500; max-width: 34ch; margin-bottom: 0.4em; }
.bio .btn { margin-top: 26px; }

/* Appointments */
.path { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; }
.path::before, .path::after { content: ""; position: absolute; left: 4px; top: 12px; bottom: 12px; width: 1px; background: var(--rule); }
.path::after { background: var(--accent); transform-origin: top; }
.path li { position: relative; display: grid; grid-template-columns: 1fr; gap: 2px; padding-block: 16px; }
.path li::before { content: ""; position: absolute; left: -28px; top: 27px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1px solid var(--accent); z-index: 1; }
.path li.now::before { background: var(--accent); box-shadow: 0 0 0 5px color-mix(in oklch, var(--accent) 18%, transparent); }
.path .year { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1.2; font-variant-numeric: lining-nums tabular-nums; color: var(--accent); }
.path h3 { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.path p { color: var(--slate); max-width: 60ch; }
@media (min-width: 640px) {
  .path li { grid-template-columns: 4.5rem 1fr; gap: 0 20px; }
  .path .year { grid-row: 1 / span 2; }
}

/* Records and glossed terms */
.record { margin: 0; display: grid; grid-template-columns: 1fr; gap: 34px 56px; }
.record > div { border-top: 1px solid var(--ink); padding-top: 14px; }
.record dt { color: var(--accent); margin-bottom: 12px; }
.record dd { margin: 0; }
.record dd + dd { margin-top: 14px; }
.record dd b { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.record dd > span { color: var(--slate); font-size: 0.9375rem; }
@media (min-width: 720px) { .record { grid-template-columns: 1fr 1fr; } }
.aside { color: var(--slate); max-width: 58ch; margin: 0 0 30px; }
.sources { margin: 30px 0 0; max-width: 78ch; font-size: 0.8125rem; line-height: 1.55; color: var(--slate); }
.sources a { color: inherit; text-underline-offset: 2px; }
.record.gloss dd b { font-size: 1.6rem; }
.record.gloss dd > span { display: block; margin-top: 8px; font-size: 1rem; line-height: 1.58; max-width: 46ch; }

/* Doors: the way to the other pages */
.doors { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .doors { grid-template-columns: 1fr 1fr; } }
.door {
  display: grid; gap: 8px; padding: 26px 26px 24px; text-decoration: none; border: 1px solid var(--ink); border-radius: 2px;
  transition: background-color .25s, color .25s;
  .caps { color: var(--accent); transition: color .25s; }
  b { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; line-height: 1.12; }
  span.line { color: var(--slate); font-size: 0.9375rem; transition: color .25s; }
  span.go { margin-top: 8px; font-size: 0.875rem; font-weight: 600; letter-spacing: 0.03em; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.25em; }
  &:hover { background: var(--ink); color: var(--paper); }
  &:hover .caps, &:hover span.line { color: color-mix(in oklch, var(--paper) 75%, transparent); }
}

/* Film */
.film { display: grid; grid-template-columns: 1fr; gap: 36px; align-items: start; }
.still { margin: 0; }
.still img { width: 100%; border-radius: 2px; }
.still figcaption { margin-top: 10px; font-size: 0.8125rem; color: var(--slate); }
.film blockquote { margin: 0; }
.film blockquote p { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.1; max-width: 14ch; text-wrap: balance; }
.film .about { margin-top: 20px; max-width: 40ch; }
.film .btn { margin-top: 24px; }
@media (min-width: 760px) { .film { grid-template-columns: 6fr 5fr; gap: 48px; } }

/* ---------- Closing: the card ---------- */
.close { padding-block: clamp(64px, 9vw, 120px); text-align: center; }
.card {
  position: relative; max-width: 560px; margin: 0 auto; padding: clamp(36px, 7vw, 60px) clamp(20px, 5vw, 48px);
  border: 1px solid color-mix(in oklch, var(--acc) 75%, transparent);
  background: color-mix(in oklch, black 22%, transparent);
  &::before { content: ""; position: absolute; inset: 7px; border: 1px solid color-mix(in oklch, var(--acc) 30%, transparent); pointer-events: none; }
  svg.star { width: 26px; height: 26px; fill: var(--acc); }
  h2 { margin-top: 18px; font-weight: 500; font-size: clamp(1.9rem, 6vw, 2.5rem); letter-spacing: 0.04em; line-height: 1.1; }
  .rank { margin-top: 10px; }
  .post { margin-top: 14px; color: var(--sub); font-size: 0.9375rem; line-height: 1.5; }
  .mail { display: inline-block; margin-top: 22px; font-family: var(--serif); font-size: clamp(1.35rem, 5vw, 1.75rem); font-weight: 500; text-decoration-color: var(--acc); overflow-wrap: anywhere; }
}
.close .actions { justify-content: center; margin-top: 30px; }
.close .note { margin-top: 26px; color: var(--sub); font-size: 0.9375rem; }

footer { background: var(--ink); color: oklch(78% 0.03 250); font-size: 0.8125rem; padding-block: 26px 34px; }
footer p { max-width: 78ch; }
footer p + p { margin-top: 6px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 14px; font-weight: 600; }
footer a { text-decoration-color: color-mix(in oklch, currentColor 50%, transparent); }

/* ---------- Dock: the card's actions, always in reach on a phone ---------- */
.dock { display: none; }
@media (max-width: 759px) {
  :root { --dock: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .dock {
    position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in oklch, var(--bar-bg) 88%, transparent); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border-top: 1px solid color-mix(in oklch, var(--bar-acc) 40%, transparent); color: var(--bar-fg);
  }
  .dock a, .dock button {
    display: grid; justify-items: center; gap: 3px; min-height: 52px; padding: 7px 4px; background: none; border: 0; cursor: pointer;
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-decoration: none; color: inherit; border-radius: 10px;
  }
  .dock svg { width: 21px; height: 21px; fill: none; stroke: var(--bar-acc); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .dock a:active, .dock button:active { background: color-mix(in oklch, var(--bar-acc) 18%, transparent); }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
  @supports (animation-timeline: view()) {
    .rise { animation: rise linear both; animation-timeline: view(); animation-range: entry 0px entry 150px; }
    @keyframes rise { from { opacity: .35; translate: 0 26px; } }
    .path::after { animation: draw linear both; animation-timeline: view(); animation-range: entry 35% exit 55%; }
    @keyframes draw { from { transform: scaleY(0); } }
    .part h2::before { animation: rule linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; transform-origin: left; }
    @keyframes rule { from { transform: scaleX(0); } }
  }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- End mark, bio kit, speaking, privacy ---------- */
.endmark { display: inline-block; vertical-align: -0.12em; color: var(--accent); }
.kit .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.kit .acts .btn { font-size: 0.875rem; padding-block: 8px; }
html[lang="en"] .kit .acts .btn.fr, html[lang="fr"] .kit .acts .btn.en { display: none !important; }
.talks { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.talks li { border-top: 1px solid var(--ink); padding-top: 14px; display: grid; gap: 6px; }
.talks h3 { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; line-height: 1.15; margin: 0; }
.talks .where { color: var(--slate); font-size: 0.9375rem; margin: 0; }
.talks .btn { justify-self: start; margin-top: 6px; }
body.plain .part { padding-block: 72px; }
body.plain .serif-title { font-family: var(--serif); font-weight: 600; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1; margin: 18px 0 8px; }
body.plain h2 { font-family: var(--serif); font-size: 1.5rem; margin: 32px 0 6px; }

/* Speech text */
.speech p { max-width: 62ch; }
.speech .names { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.3rem; line-height: 1.5; margin-left: 1.2rem; }
.speech .addendum { margin-top: 3rem; }
.speech .addendum h2 { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; margin: 0 0 .5rem; }
