/* ─────────────────────────────────────────────────────────────
   Theme tokens. Dark is the default; [data-theme="light"] flips
   the palette. RGB triplets exist so Tailwind opacity utilities
   (e.g. border-text border-opacity-20) keep working — see
   tailwind.config.js which references --color-*-rgb.
   ───────────────────────────────────────────────────────────── */
:root,
[data-theme="dark"] {
  /* Mono identity: iA Writer Duo S (vendored — fonts.css) with a per-OS
     system-mono fallback that covers the swap window. */
  --font-mono: 'iA Writer Duo S', 'iAWriterDuoS', 'iAWriterDuo', ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --color-bg: #0f1715;
  --color-bg-elevated: #131c17;
  --color-text: #ECFFFB;
  --color-text-muted: rgb(236 255 251 / 0.7);
  --color-accent: #C2B290;
  --color-border: rgb(236 255 251 / 0.1);

  --color-bg-rgb: 15 23 21;
  --color-text-rgb: 236 255 251;
  --color-accent-rgb: 194 178 144;

  /* Scope-pill dot palette — restrained multicolour, tuned for #0f1715 */
  --color-pill-1: #E8C547;
  --color-pill-2: #7EB8DA;
  --color-pill-3: #B38FD1;
  --color-pill-4: #E08A9B;
  --color-pill-5: #7FC29B;
  --color-pill-6: #5FB3B3;
  --color-pill-7: #D9A66C;
}

[data-theme="light"] {
  --color-bg: #f5f1e8;
  --color-bg-elevated: #faf6ec;
  --color-text: #1a1612;
  --color-text-muted: #645b4e;
  --color-accent: #7a5f28;
  --color-border: #ddd5c0;

  --color-bg-rgb: 245 241 232;
  --color-text-rgb: 26 22 18;
  --color-accent-rgb: 122 95 40;

  /* Scope-pill dot palette — darkened counterparts for #f5f1e8 */
  --color-pill-1: #9A7B0F;
  --color-pill-2: #2F6690;
  --color-pill-3: #6A4C93;
  --color-pill-4: #A34D5E;
  --color-pill-5: #3E7C55;
  --color-pill-6: #2F7E7E;
  --color-pill-7: #9C6B2F;
}

/* Base styling */
html {
  scroll-behavior: smooth;
}

body {
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Line height for content elements */
.content-text,
p,
li,
ul,
ol {
  line-height: 2.0;
}

a {
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover {
  color: var(--color-accent);
}

/* Theme-toggle glyph: quiet quarter-turn on hover, half-turn while pressed */
[data-theme-toggle] [data-theme-icon] {
  display: inline-block;
  transition: transform 0.3s ease;
}
[data-theme-toggle]:hover [data-theme-icon] { transform: rotate(20deg); }
[data-theme-toggle]:active [data-theme-icon] { transform: rotate(180deg); }

/* Page entry: one subtle fade-up on the main column (no stagger chains) */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
main { animation: pageFadeIn 0.5s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a { transition: none; }
  [data-theme-toggle] [data-theme-icon] { transition: none; }
  [data-theme-toggle]:hover [data-theme-icon],
  [data-theme-toggle]:active [data-theme-icon] { transform: none; }
  main { animation: none; }
}

@media (max-width: 640px) {
  main {
    padding-top: 3rem;
  }
}

/* ── Sticky navigation ──
   Sticky lives on the <site-nav> custom element itself, NOT the inner
   <header>: custom elements default to display:inline, so a sticky child
   has no room to travel inside the collapsed parent box. This single rule
   makes the nav stick on every page (no per-page classes needed). */
site-nav {
  display: block;
  position: sticky;
  top: 0;
  z-index: 50;
}

site-nav header {
  min-height: 0;
  position: relative; /* positioning context for the mobile menu */
  background-color: var(--color-bg);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Scrolled state (toggled by site-nav.js): translucent tint + blur + hairline */
site-nav header.scrolled {
  background-color: rgb(var(--color-bg-rgb) / 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgb(var(--color-accent-rgb) / 0.2);
}

@media (prefers-reduced-motion: reduce) {
  site-nav header {
    transition: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Menu expanded state - only increase padding when menu is open */
header.menu-expanded nav {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* Default compact nav state */
nav {
  transition: padding 0.3s ease;
  min-height: 3rem; /* Reduced minimum height for the navbar */
  padding-top: 0.125rem !important; /* Reduced top padding */
  padding-bottom: 0.125rem !important; /* Reduced bottom padding */
  display: flex;
  align-items: center;
}

/* Every nav item shares one optical box (same height, same line-height,
   flex-centred) so <a>, <button> and glyph items sit on a common baseline
   and gap utilities produce visually even spacing. */
nav a, nav button {
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  line-height: 1.2;
}

/* Glyph-only items (theme toggle) get a fixed square box so the ☾/☀
   glyph centres identically to the text items regardless of font metrics. */
nav [data-theme-toggle] {
  width: 2.25rem;
  justify-content: center;
  font-size: 1rem;
}

/* Active-page indicator — a 4px accent dot below the item (echoes the
   scope-diagram pill dots); drives off aria-current to avoid per-file JS. */
nav a[aria-current="page"] {
  position: relative;
}
nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0.1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--color-accent);
}
/* In the stacked mobile menu the centred dot reads oddly on full-width rows:
   mark the active item by colour instead. */
#mobile-menu a[aria-current="page"] { color: var(--color-accent); }
#mobile-menu a[aria-current="page"]::after { display: none; }

/* Adjust menu button size for better touch target while keeping compact */
#mobile-menu-button {
  padding: 0.25rem !important; /* Reduced padding */
  height: 2.25rem;
  width: 2.25rem;
  cursor: pointer;
  z-index: 20;
  -webkit-tap-highlight-color: transparent;
}

#mobile-menu-button svg {
  transition: transform 0.2s ease;
}

#mobile-menu-button:active svg {
  transform: scale(0.9);
}

/* Mobile menu styling - consistent across all pages */
#mobile-menu {
  position: absolute;
  width: 100%;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100; /* Ensure it's above other content */
  background-color: var(--color-bg);
  border-top: 1px solid rgb(var(--color-text-rgb) / 0.1);
  border-bottom: 1px solid rgb(var(--color-text-rgb) / 0.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  padding: 0;
}

#mobile-menu.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  visibility: hidden;
}

/* Mobile menu items consistent styling */
#mobile-menu a,
#mobile-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgb(var(--color-text-rgb) / 0.05);
}

#mobile-menu a:last-child,
#mobile-menu button:last-child {
  border-bottom: none;
}

/* ── "More" disclosure in the desktop nav ──
   The toggle reads like a nav link; the panel is a small elevated card of
   not-yet-published sections rendered as non-interactive rows. */
.nav-more-toggle .caret {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.7em;
  transition: transform 0.2s ease;
}
.nav-more-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav-more-panel {
  top: calc(100% + 0.4rem);
  min-width: 11rem;
  padding: 0.4rem 0;
  background-color: var(--color-bg-elevated);
  border: var(--rule-hairline, 1px) solid var(--color-border);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
  z-index: 60;
}
.nav-more-panel .locked {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: default;
}
.nav-more-panel .lock { font-size: 0.75em; }
@media (prefers-reduced-motion: reduce) {
  .nav-more-toggle .caret { transition: none; }
}

/* Image constraints for large screens */
.imggrid img {
  max-height: 70vh;
  object-fit: cover;
}

/* Media queries for responsive adjustments */
@media (min-width: 1800px) {
  /* Additional constraints for ultrawide screens */
  .imggrid img:first-of-type {
    max-height: 60vh;
  }

  .imggrid img:not(:first-of-type) {
    max-height: 35vh;
  }
}

/* ─────────────────────────────────────────────────────────────
   Scope-of-work diagram (index.html)
   Scroll-triggered Venn → Dumbbell morph + mastery-pill reveal.
   Motion language inspired by ramotion.com; visuals on dark theme.
   ───────────────────────────────────────────────────────────── */

.scope-section {
  position: relative;
  z-index: 10;
  background: var(--color-bg);
  color: var(--color-text);
  padding: var(--space-3xl, 6rem) var(--space-lg, 2rem) 8rem;
  min-height: 90vh;
}

.scope-intro {
  max-width: 42rem;
  margin: 0 auto 3.5rem;
  text-align: center;
}

.scope-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 1rem;
}

.scope-lede {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgb(var(--color-text-rgb) / 0.78);
  max-width: 32rem;
  margin: 0 auto;
}

/* Industry strip: small caps under the lede; encodes the 8-sector breadth */
.scope-industries {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(var(--color-accent-rgb) / 0.75);
  max-width: 38rem;
  margin: 1.25rem auto 0;
  line-height: 1.6;
}
/* Light theme: the 0.75-alpha accent drops below WCAG AA (4.5:1) on cream,
   so use the solid darkened accent for this always-visible text. */
[data-theme="light"] .scope-industries { color: var(--color-accent); }

.scope-diagram-wrapper {
  max-width: 980px;
  margin: 0 auto;
}

.scope-diagram {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* NOTE: all scope elements default to their FINAL visible state — the markup
   ships the finished composition. scope-diagram.js rewinds to the resting Venn
   and animates only when motion is allowed (progressive enhancement). */
.scope-ring {
  fill: none;
  stroke: rgb(var(--color-accent-rgb) / 0.22);
  stroke-width: 0.5;
}

/* Dumbbell parts */
.scope-bulb {
  fill: var(--color-text);
}

/* Gooey tapering connector between the bulbs (visible only mid-morph) */
.scope-connector {
  fill: var(--color-text);
  opacity: 0;
}

/* Resting-state labels inside the light Venn bulbs (visible only pre-morph) */
.scope-inside {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  fill: var(--color-bg);
  letter-spacing: 0.04em;
  dominant-baseline: middle;
  opacity: 0;
}

/* Anchor labels */
.scope-anchor {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  fill: var(--color-text);
  letter-spacing: 0.06em;
  dominant-baseline: middle;
}
.scope-anchor-right { text-anchor: start; }
.scope-anchor:not(.scope-anchor-right) { text-anchor: end; }

/* Mastery Area heading */
.scope-mastery-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  /* Solid accent (not 0.9-alpha) so the at-rest / no-JS / reduced-motion state
     clears WCAG AA on the light theme; GSAP tweens over this during scroll. */
  fill: var(--color-accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Ghost capability pills: faint outline + muted label */
.scope-ghost-box {
  fill: none;
  stroke: rgb(var(--color-text-rgb) / 0.16);
  stroke-width: 0.75;
}

.scope-outer-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: rgb(var(--color-text-rgb) / 0.42);
  letter-spacing: 0.04em;
  dominant-baseline: middle;
}

/* Mastery pills */
.scope-pill rect {
  fill: rgb(var(--color-bg-rgb) / 0.96);
  stroke: rgb(var(--color-accent-rgb) / 0.45);
  stroke-width: 0.75;
}

.scope-pill text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  fill: var(--color-text);
  letter-spacing: 0.02em;
  dominant-baseline: middle;
}

/* Tablet */
@media (max-width: 1024px) {
  .scope-section {
    padding: 5rem 1.5rem 6rem;
  }
}

/* Mobile: drop a few outer labels to reduce clutter and downscale type */
@media (max-width: 640px) {
  .scope-section {
    padding: 4rem 1rem 5rem;
    min-height: 0;
  }
  .scope-eyebrow { font-size: 0.7rem; }
  .scope-lede { font-size: 0.95rem; }
  .scope-industries { font-size: 0.62rem; letter-spacing: 0.12em; }
  .scope-outer-label { font-size: 9px; }
  .scope-pill text { font-size: 9px; }
  .scope-anchor { font-size: 12px; }
  /* Hide every other ghost pill to declutter the small canvas. */
  .scope-ghost:nth-of-type(2),
  .scope-ghost:nth-of-type(4),
  .scope-ghost:nth-of-type(6),
  .scope-ghost:nth-of-type(8) {
    display: none;
  }
}

/* Pill dots: a restrained multicolour palette (theme-aware tokens, see the
   theme blocks at the top) echoing the ramotion reference — colour lives ONLY
   in the 4px dots; the capsules stay monochrome. Falls back to accent. */
.scope-pill circle { fill: var(--color-accent); }
.scope-pill[data-pill-id="1"] circle { fill: var(--color-pill-1); }
.scope-pill[data-pill-id="2"] circle { fill: var(--color-pill-2); }
.scope-pill[data-pill-id="3"] circle { fill: var(--color-pill-3); }
.scope-pill[data-pill-id="4"] circle { fill: var(--color-pill-4); }
.scope-pill[data-pill-id="5"] circle { fill: var(--color-pill-5); }
.scope-pill[data-pill-id="6"] circle { fill: var(--color-pill-6); }
.scope-pill[data-pill-id="7"] circle { fill: var(--color-pill-7); }

/* ═══════════════════════════════════════════════════════════════════════════
   LEDGER-RIDGE redesign — shared editorial components
   Editorial data-ledger + a single self-drawing contour thread.
   ADDITIVE ONLY: nothing here alters the global prose line-height:2.0 rule
   above (styles.css:44-51); --leading-ledger is scoped to ledger rows only.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --rule-hairline: 1px;
  --measure: 62ch;
  --leading-ledger: 1.5;
  --contour-stroke: var(--color-accent);
  --contour-stroke-faint: rgb(var(--color-accent-rgb) / 0.28);

  /* Unified container + rhythm scale (one system across all pages) */
  --container-md: 46rem;  /* ledger / reading measure */
  --container-lg: 52rem;  /* cv content */
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Fluid type scale — rem-based clamps named by editorial role (not abstract
     steps) so a size change is one token edit. Min values match the old
     fixed sizes; growth is deliberately shallow to keep the ledger dense. */
  --text-label: clamp(0.72rem, 0.69rem + 0.15vw, 0.8rem);   /* eyebrows · dateline · notes · colophon */
  --text-body-sm: clamp(0.8rem, 0.77rem + 0.15vw, 0.87rem); /* ledger labels · work roles */
  --text-body: clamp(0.87rem, 0.84rem + 0.18vw, 0.95rem);   /* ledger figures · work titles */
  --text-standfirst: clamp(0.9rem, 0.84rem + 0.3vw, 1.05rem);
  --text-title: clamp(1.75rem, 1.32rem + 2.1vw, 2.6rem);    /* inner-page H1 */
  --text-display: clamp(2rem, 1.38rem + 3.1vw, 3.25rem);    /* index hero H1 */
}

/* ── Editorial text wrapping (Baseline 2024/25; zero-cost fallbacks) ──
   balance: headings + standfirsts weigh their lines evenly.
   pretty: paragraphs avoid orphans / bad rag (Safari optimizes whole ¶). */
h1, h2, h3, .page-title, .standfirst { text-wrap: balance; }
p, li { text-wrap: pretty; }
.standfirst, blockquote { hanging-punctuation: first last; } /* Safari-only PE */

/* ── Editorial drop cap (Firefox shows a normal first letter) ── */
.drop-cap::first-letter {
  -webkit-initial-letter: 3;
  initial-letter: 3;
  color: var(--color-accent);
  font-weight: 700;
  margin-right: 0.55rem;
}

/* ── Page shells: centred content column per page grammar ──
   Fixes the "everything hugs left, void right" imbalance on reading pages.
   Horizontal padding still comes from the Tailwind px-8/16/24 utilities. */
.page-shell { margin-inline: auto; }
.shell-md { max-width: var(--container-md); }  /* contact */
.shell-lg { max-width: 60rem; }                /* cv (proficiency = widest block) */
.shell-xl { max-width: 76rem; }                /* about (two-column grid) */

/* ── Dateline: label the page like a broadsheet masthead line ── */
.dateline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding-bottom: 0.75rem;
  margin-bottom: 2.5rem;
  border-bottom: var(--rule-hairline) solid var(--color-accent);
}
.dateline .dateline-role {
  color: var(--color-accent);
  text-align: right;
}
@media (max-width: 640px) {
  .dateline { flex-direction: column; gap: 0.2rem; }
  .dateline .dateline-role { text-align: left; }
}

/* ── Section eyebrow (reused across pages) ── */
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 1.25rem;
}

/* ── The ledger: neutral label · dotted leader · right-aligned figure ── */
.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--container-md);
  font-family: var(--font-mono);
}
.ledger-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0;
  line-height: var(--leading-ledger);
  border-top: var(--rule-hairline) solid var(--color-border);
}
.ledger-row:last-child {
  border-bottom: var(--rule-hairline) solid var(--color-border);
}
.ledger-label {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  font-size: var(--text-body-sm);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.ledger-leader {
  flex: 1 1 auto;
  min-width: 1.5rem;
  align-self: stretch;
  border-bottom: var(--rule-hairline) dotted rgb(var(--color-text-rgb) / 0.25);
  transform: translateY(-0.28em);
}
.ledger-figure {
  flex: 0 0 auto;
  color: var(--color-text);
  font-size: var(--text-body);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ledger-note {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: rgb(var(--color-text-rgb) / 0.5);
  max-width: var(--container-md);
  margin: 0.95rem 0 0;
}
@media (max-width: 640px) {
  .ledger-note { font-size: 0.8rem; }
}
@media (max-width: 640px) {
  /* Stack label over figure; drop the leader (dotted leaders read as noise when wrapped). */
  .ledger-row { flex-wrap: wrap; gap: 0.1rem 0.5rem; }
  .ledger-leader { display: none; }
  .ledger-label { white-space: normal; flex: 1 1 100%; }
  .ledger-figure { flex: 1 1 100%; text-align: left; color: var(--color-accent); }
}

/* ── Selected work: hairline rows, no cards ── */
.selected-work { max-width: var(--container-md); margin: 0; padding: 0; list-style: none; }
.work-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1rem 0;
  border-top: var(--rule-hairline) solid var(--color-border);
  font-family: var(--font-mono);
}
.work-row:last-child { border-bottom: var(--rule-hairline) solid var(--color-border); }
.work-title { color: var(--color-text); font-size: var(--text-body); }
.work-role { display: block; margin-top: 0.25rem; color: var(--color-text-muted); font-size: var(--text-body-sm); }
.work-outcome {
  flex: 0 0 auto;
  color: var(--color-accent);
  font-size: var(--text-body-sm);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .work-row { flex-direction: column; gap: 0.4rem; }
  .work-outcome { white-space: normal; }
}

/* ── Hairline section rule (draws in on scroll when motion is allowed) ── */
.rule-section {
  height: var(--rule-hairline);
  margin: 3.5rem 0;
  border: 0;
  background: var(--color-accent);
  transform-origin: left center;
}

/* ── Colophon footer ── */
.colophon {
  max-width: var(--container-md);
  margin: var(--space-2xl) 0 0;
  padding: var(--space-md) 0 3.5rem;
  border-top: var(--rule-hairline) solid var(--color-accent);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--color-text-muted);
}
.colophon a { color: var(--color-text); text-underline-offset: 4px; }
.colophon a:hover { text-decoration: underline; text-decoration-color: var(--color-accent); }
.colophon-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* ── Prose column (about page "Notes") ── */
.measure { max-width: var(--measure); }

/* ── Signature: a single self-drawing contour thread in the left gutter ──
   Ships FULLY DRAWN (no dasharray) so no-JS / reduced-motion / crawlers get a
   complete static line; contour.js only ADDS the draw-on-scroll. Hidden below
   md where the gutter is too tight to hold it without crowding text. */
.contour-thread {
  position: fixed;
  top: 0;
  left: 0;
  width: 3.5rem;
  height: 100vh;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}
.contour-thread path {
  fill: none;
  stroke: var(--contour-stroke-faint);
  stroke-width: 1.25;
  stroke-linecap: round;
}
@media (max-width: 767px) {
  .contour-thread { display: none; }
}

/* ── Motion reveals: opt-in, only active once contour.js confirms motion is OK.
   Elements are visible by default; the .js-motion flag (set by JS, never under
   reduced-motion) enables the pre-reveal hidden state, so no-JS shows everything. */
.js-motion .js-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-motion .js-reveal.is-visible {
  opacity: 1;
  transform: none;
}
.js-motion .rule-section.js-reveal-rule {
  transform: scaleX(0);
  transition: transform 0.5s ease;
}
.js-motion .rule-section.js-reveal-rule.is-visible {
  transform: scaleX(1);
}

/* ── Shared inner-page heading + standfirst (about / cv / contact) ── */
.page-title {
  font-family: var(--font-mono);
  font-size: var(--text-title);
  letter-spacing: -0.01em;
  line-height: 1.15;
  max-width: 26ch;
  margin: 0 0 1.25rem;
}
.standfirst {
  font-family: var(--font-mono);
  font-size: var(--text-standfirst);
  line-height: 1.75;
  color: var(--color-text-muted);
  max-width: 62ch;
  margin: 0 0 2rem;
}
/* Links sitting inside a ledger figure inherit the figure colour, underline on hover. */
.ledger-figure a { color: var(--color-text); text-underline-offset: 4px; }
.ledger-figure a:hover { text-decoration: underline; text-decoration-color: var(--color-accent); }

/* Recruiter reading path: HTML first, local styles, optional interaction. */
[hidden] { display: none !important; }
body { background: var(--color-bg); color: var(--color-text); font-family: var(--font-mono); }
.site-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 1rem 2rem; }
.site-brand { margin-right: auto; }
.desktop-nav { display: none; align-items: center; gap: 2rem; }
.mobile-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; width: 100%; }
#mobile-menu-button { min-height: 44px; padding-inline: .5rem; }
.enhanced .mobile-nav { flex-direction: column; gap: .5rem; }
.mobile-nav a { padding-block: .3rem; }
@media (min-width: 768px) {
  .site-navigation { padding-inline: 4rem; }
  .desktop-nav { display: flex; }
  #mobile-menu-button, .mobile-nav { display: none !important; }
}
@media (min-width: 1024px) { .site-navigation { padding-inline: 6rem; } }
.hero-links, .cv-actions { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; }
.hero-links a, .cv-actions a { padding-block: .5rem; border-bottom: 1px solid var(--color-accent); }
.ledger-row > * { min-width: 0; }
.ledger-figure { white-space: normal; overflow-wrap: anywhere; text-align: right; }
.scope-section { padding-block: 2rem; }
.selected-section { margin-top: 1rem; }
.scope-mobile { display: none; }
.role-header { list-style: none; }
.role-header::-webkit-details-marker { display: none; }
details:not([open]) .role-arrow { transform: rotate(-90deg); }
summary:focus-visible, [role="tabpanel"]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }
.print-contact { display: none; }
@media (max-width: 767px) {
  .scope-diagram-wrapper { display: none; }
  .scope-mobile { display: block; padding: 0 2rem; list-style: disc; list-style-position: inside; }
  .scope-mobile li { margin-bottom: .75rem; font-size: .9rem; }
  .ledger-row { flex-wrap: wrap; }
  .ledger-figure { flex: 1 1 12rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js-reveal, .js-reveal-rule { opacity: 1 !important; transform: none !important; }
}
@media print {
  @page { size: A4; margin: 15mm; }
  :root, [data-theme] { --color-bg: #fff; --color-text: #111; --color-text-muted: #333; --color-accent: #333; --color-border: #bbb; }
  body { background: #fff !important; color: #111 !important; font-size: 10pt; }
  site-nav, .skip-link, .contour-thread, .cv-actions, .colophon, .scope-section, .read-as { display: none !important; }
  main.page-shell { padding: 0 !important; min-height: 0 !important; max-width: none; }
  .dateline { margin-bottom: .5rem; }
  .page-title { font-size: 24pt; margin-bottom: .5rem; }
  .standfirst { margin-bottom: 1rem; font-size: 10pt; }
  .print-contact { display: block; }
  details > .role-details { display: block !important; }
  details { content-visibility: visible !important; }
  .role-arrow { display: none; }
  .role-header { break-after: avoid; }
  .cv-entry, .cv-role { break-inside: avoid; }
  .cv-section { margin-top: .75rem; }
  .proficiency { gap: 1rem; }
  #business-content, #personal-content { display: block !important; }
  a { color: inherit; text-decoration: none; }
}
.scope-section { min-height: 0; padding-bottom: 2rem; }
.scope-intro { margin-bottom: 1.5rem; }
@media (max-width: 640px) { .ledger-figure { text-align: left; } }
@media print {
  .proficiency { grid-template-columns: repeat(3, 1fr); }
  .role-details { padding-bottom: .6rem; }
  .role-details li, .cv-entry-note, .prof-list li { font-size: 9pt; line-height: 1.4; }
  .role-header { padding-block: .5rem; }
  .cv-entry { padding-block: .5rem; }
  .cv-section h2 { break-after: avoid; }
}
@media print {
  #cv-body .page-title { font-size: 0; margin: .3rem 0; }
  #cv-body .page-title::before { content: 'Jérôme Elia Hug'; font-size: 24pt; }
  #cv-body .section-eyebrow { margin: .5rem 0; font-size: 9pt; line-height: 1.3; }
  #cv-body .rule-section { margin: .75rem 0 .5rem; }
  #cv-body .dateline { display: none; }
  #cv-body .standfirst { margin: .5rem 0; font-size: 9pt; line-height: 1.4; }
  #cv-body .role-header { padding: .45rem 0 .25rem; line-height: 1.3; }
  #cv-body .role-details { padding-bottom: .45rem; }
  #cv-body .role-details li, #cv-body .cv-entry-note, #cv-body .prof-list li { font-size: 9pt; line-height: 1.4; padding-block: .1rem; }
  #cv-body .cv-entry { padding-block: .45rem; }
  #cv-body .cv-entry-title, #cv-body .cv-role-title { font-size: 10pt; }
  #cv-body .prof-head { margin-bottom: .35rem; }
  #cv-body .proficiency { break-inside: avoid; }
  #cv-body .fit-list li { font-size: 9pt; line-height: 1.4; padding-block: .2rem; }
}
@media print { #cv-body .page-title::before { display: inline-block; white-space: nowrap; } }
.ledger-figure { flex-shrink: 1; }
@media print {
  details::details-content { display: block !important; content-visibility: visible !important; }
}
.ledger-note { color: var(--color-text-muted); }

.record-main > .selected-section > .rule-section { margin-block: 1.5rem; }
.toggle-slider { cursor: default; }

/* The SVG needs desktop space; tablet readers receive the same readable text. */
@media (min-width: 768px) and (max-width: 1023px) {
  .scope-diagram-wrapper { display: none; }
  .scope-mobile { display: block; padding: 0 2rem; list-style: disc; list-style-position: inside; }
  .scope-mobile li { margin-bottom: .75rem; font-size: .9rem; }
}

/* Deliberate navigation, reading choice and CV disclosure hierarchy. */
site-nav header { background: var(--color-bg); }
.site-navigation { min-height: 4.5rem; padding: .5rem 1.5rem !important; gap: 1rem; }
.site-brand { white-space: nowrap; }
nav a, nav button { min-height: 44px; height: auto; }
nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--color-accent); text-underline-offset: .4em; }
nav a[aria-current="page"]::after { display: none; }
.site-brand[aria-current="page"] { text-decoration: none; }
#mobile-menu-button { width: auto; min-width: 4rem; padding: .5rem !important; }
#mobile-menu { position: static; border: 0; box-shadow: none; background: var(--color-bg); width: 100%; gap: .5rem 1rem; }
#mobile-menu a, #mobile-menu button { width: auto; padding: .35rem 0; border: 0; }
.enhanced .site-navigation { flex-wrap: nowrap; }
.enhanced #mobile-menu { position: absolute; top: 100%; left: 0; right: 0; width: 100%; padding: .75rem 1.5rem; border-bottom: 1px solid var(--color-border); max-height: calc(100dvh - 4.5rem); overflow-y: auto; gap: .25rem; }
.enhanced #mobile-menu a, .enhanced #mobile-menu button { display: flex; align-items: center; width: 100%; padding: .5rem 0; }
.enhanced #mobile-menu [data-theme-toggle] { justify-content: flex-start; gap: .5rem; font-size: inherit; }
@media (min-width: 768px) { .site-navigation { padding-inline: 4rem !important; } }
@media (min-width: 1024px) { .site-navigation { padding-inline: 6rem !important; } }
.cv-section { border-top: 1px solid var(--color-border); margin-top: 1rem; }
.cv-section-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; padding-block: .75rem; cursor: pointer; list-style: none; }
.cv-section-summary::-webkit-details-marker { display: none; }
.cv-section-summary .section-eyebrow { margin: 0; }
.cv-section-marker { font-size: 1.25rem; color: var(--color-accent); }
.cv-section-marker::before { content: '+'; }
.cv-section[open] > .cv-section-summary .cv-section-marker::before { content: '−'; }
.cv-section-body { padding-bottom: 1rem; }
.cv-role .role-header { cursor: default; }
.cv-role .role-header:hover { opacity: 1; }
@media print {
  .cv-section-body { display: block !important; }
  .cv-section-summary { min-height: 0; padding-block: .3rem; break-after: avoid; }
  .cv-section-marker { display: none; }
}
