/* ─────────────────────────────────────────────────────────────
   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: leads with iA Writer Duo (if ever vendored) then a
     high-quality per-OS system-mono fallback so the look stays consistent
     even without the webfont. */
  --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;
}

/* Tagline specific styling */
.tagline p {
  line-height: 2.0;
  margin-bottom: 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;
  }
}

/* Responsive content handling */
@media (max-width: 1279px) {
  /* Stacked layout improvements for smaller screens */
  #personal-overview .content-text {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Improve spacing on collapsible sections for mobile */
  #pushing-limits, #optimization, #connections {
    padding-left: 0.75rem;
  }
}

/* ── 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;
}

/* Subtle divider before the Logout action so it reads as an action,
   not another nav link. Applies only to the desktop row (md+). */
@media (min-width: 768px) {
  nav .nav-action {
    margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid rgb(var(--color-text-rgb) / 0.18);
  }
}

/* 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;
}

/* Toggle container - adjust top position to match new header height */
.toggle-container-wrapper {
  position: sticky;
  top: 3rem; /* Adjusted to match new navbar min-height */
  z-index: 9;
  background-color: var(--color-bg);
  padding-bottom: 0.5rem;
  padding-top: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
  border-bottom: 1px solid rgb(var(--color-text-rgb) / 0.05);
}

@media (min-width: 768px) {
  .toggle-container-wrapper {
    top: 3.25rem; /* Adjusted for medium screens */
  }
}

/* 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;
  }
}

/* Skill category styling */
.skill-category {
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  background-color: rgb(var(--color-accent-rgb) / 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgb(var(--color-accent-rgb) / 0.1);
}

.skill-category:hover {
  background-color: rgb(var(--color-accent-rgb) / 0.08);
  border-color: rgb(var(--color-accent-rgb) / 0.2);
}

.category-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--color-accent);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 0.75rem;
}

.category-btn:hover {
  color: rgb(var(--color-accent-rgb) / 0.9);
  background-color: rgb(var(--color-accent-rgb) / 0.1);
}

.category-title {
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.category-icon {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.875rem;
}

.category-content {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  padding: 0 1.25rem;
}

.category-content.active {
  max-height: 2000px;
  padding: 0 1.25rem 1.25rem 1.25rem;
  opacity: 1;
}

/* Skill group styling */
.skill-group {
  margin-bottom: 1.5rem;
}

.skill-group:last-child {
  margin-bottom: 0;
}

.skill-group-title {
  font-size: 0.9rem;
  color: rgb(var(--color-accent-rgb) / 0.8);
  margin-bottom: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Skill bars styling */
.skill-item {
  margin-bottom: 1.25rem;
  transform: translateZ(0);
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  background-color: rgb(var(--color-accent-rgb) / 0.03);
}

.skill-item:hover {
  background-color: rgb(var(--color-accent-rgb) / 0.08);
  transform: translateY(-1px);
}

.skill-name {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-accent);
  font-size: 0.95rem;
}

.skill-levels {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skill-level-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.level-label {
  font-size: 0.75rem;
  color: rgb(var(--color-accent-rgb) / 0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.skill-bar {
  height: 0.5rem;
  background-color: rgb(var(--color-accent-rgb) / 0.1);
  border-radius: 0.25rem;
  position: relative;
  overflow: hidden;
}

.skill-level {
  height: 100%;
  background-color: var(--color-accent);
  border-radius: 0.25rem;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateZ(0);
}

.level-markers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.marker {
  position: absolute;
  height: 100%;
  width: 1px;
  background-color: rgb(var(--color-text-rgb) / 0.2);
}

.marker-label {
  position: absolute;
  font-size: 0.6rem;
  color: rgb(var(--color-accent-rgb) / 0.7);
  white-space: nowrap;
  font-weight: 500;
}

.marker-label-top {
  bottom: 100%;
  margin-bottom: 0.25rem;
  transform: translateX(-50%);
}

.marker-label-bottom {
  top: 100%;
  margin-top: 0.25rem;
  transform: translateX(-50%);
}

/* Proficiency stages */
.proficiency-stage {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
  background-color: rgb(var(--color-accent-rgb) / 0.1);
  color: var(--color-accent);
  text-transform: capitalize;
}

.proficiency-stage.beginner {
  background-color: rgb(var(--color-accent-rgb) / 0.1);
}

.proficiency-stage.intermediate {
  background-color: rgb(var(--color-accent-rgb) / 0.2);
}

.proficiency-stage.advanced {
  background-color: rgb(var(--color-accent-rgb) / 0.3);
}

.proficiency-stage.expert {
  background-color: rgb(var(--color-accent-rgb) / 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .skill-category {
    margin-bottom: 1rem;
  }

  .category-btn {
    padding: 0.875rem 1rem;
  }

  .category-title {
    font-size: 1rem;
  }

  .skill-item {
    padding: 0.625rem;
    margin-bottom: 1rem;
  }

  .skill-name {
    font-size: 0.9rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   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: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 1rem;
}

.scope-lede {
  font-family: 'DM Sans', sans-serif;
  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: 'DM Sans', sans-serif;
  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: 'DM Sans', sans-serif;
  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: 'DM Sans', sans-serif;
  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: 'DM Sans', sans-serif;
  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: 'DM Sans', sans-serif;
  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: 'DM Sans', sans-serif;
  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;
}

/* ── 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: 'iAWriterDuoS', monospace;
  font-size: 0.75rem;
  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: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  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: 'iAWriterDuoS', monospace;
}
.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: 0.85rem;
  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: 0.9rem;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ledger-note {
  font-family: 'iAWriterDuoS', monospace;
  font-size: 0.72rem;
  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: 'iAWriterDuoS', monospace;
}
.work-row:last-child { border-bottom: var(--rule-hairline) solid var(--color-border); }
.work-title { color: var(--color-text); font-size: 0.9rem; }
.work-role { display: block; margin-top: 0.25rem; color: var(--color-text-muted); font-size: 0.78rem; }
.work-outcome {
  flex: 0 0 auto;
  color: var(--color-accent);
  font-size: 0.85rem;
  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: 'iAWriterDuoS', monospace;
  font-size: 0.75rem;
  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: 'iAWriterDuoS', monospace;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
  max-width: 26ch;
  margin: 0 0 1.25rem;
}
.standfirst {
  font-family: 'iAWriterDuoS', monospace;
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  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); }
