@layer reset, base, layout, components, page, utilities;

/* ==========================================================================
   RESET
   ========================================================================== */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

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

  picture {
    display: block;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
    color: inherit;
  }

  button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  ul[role="list"],
  ol[role="list"] {
    list-style: none;
    padding: 0;
  }

  h1,
  h2,
  h3,
  h4 {
    text-wrap: balance;
  }

  p {
    text-wrap: pretty;
  }

  :where(a) {
    color: inherit;
    text-decoration: none;
  }

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

/* ==========================================================================
   BASE
   ========================================================================== */
@layer base {
  @font-face {
    font-family: "Inter Tight";
    src: url("../fonts/inter-tight-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
      U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
      U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }

  @font-face {
    font-family: "Newsreader";
    src: url("../fonts/newsreader-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
      U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
      U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }

  @font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jetbrains-mono.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
      U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
      U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
  }

  body {
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    font-variation-settings: "wght" 400;
    overflow-x: hidden;
  }

  body.is-locked {
    overflow: hidden;
  }

  h1,
  h2,
  h3,
  h4 {
    font-weight: var(--weight-regular);
    line-height: var(--leading-h3);
    letter-spacing: var(--tracking-h3);
  }

  ::selection {
    background: var(--selection-bg);
    color: var(--brand-ruby);
  }

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

  .on-dark :focus-visible,
  .section--dark :focus-visible,
  .section--navy :focus-visible,
  .section--green :focus-visible,
  .site-footer :focus-visible,
  .drawer :focus-visible {
    outline-color: var(--focus-ring-dark);
  }
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
@layer layout {
  .container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
  }

  .grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .section {
    position: relative;
    padding-block: var(--section-y);
    isolation: isolate;
  }

  .section--dark {
    --accent: var(--accent-on-dark);
    background: var(--surface-dark);
    color: var(--ink-on-dark);
    --ink: var(--ink-on-dark);
    --ink-secondary: var(--ink-on-dark-secondary);
    --ink-muted: var(--ink-on-dark-muted);
    --line: var(--line-dark);
    --line-strong: var(--line-dark-strong);
    color-scheme: dark;
  }

  .section--navy {
    --accent: var(--accent-on-dark);
    background: var(--surface-navy);
    color: var(--ink-on-dark);
    --ink: var(--ink-on-dark);
    --ink-secondary: var(--ink-on-dark-secondary);
    --ink-muted: var(--ink-on-dark-muted);
    --line: var(--line-dark);
    --line-strong: var(--line-dark-strong);
    color-scheme: dark;
  }

  .section--green {
    --accent: var(--accent-on-green);
    background: var(--surface-green);
    color: var(--ink-on-dark);
    --ink: #efeade;
    --ink-secondary: #cbc6b9;
    --ink-muted: #a8a294;
    --line: var(--line-dark);
    --line-strong: var(--line-dark-strong);
    color-scheme: dark;
  }

  .section--dark::before,
  .section--navy::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(
      110% 70% at 88% -10%,
      rgb(122 0 22 / 0.28),
      transparent 62%
    );
    pointer-events: none;
  }

  /* Horizontal rail that carries the section index on wide screens */
  .rail {
    grid-column: 1 / 3;
    min-width: 0;
  }

  .rail__label {
    position: sticky;
    top: calc(var(--header-h) + 2.5rem);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: var(--tracking-micro);
    text-transform: uppercase;
    color: var(--ink-muted);
    line-height: 1;
  }

  .rail__num {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }

  .rail__rule {
    width: 18px;
    height: 1px;
    background: var(--accent);
  }

  @media (max-width: 900px) {
    .rail {
      grid-column: 1 / -1;
      margin-bottom: var(--s-5);
    }
    .rail__label {
      position: static;
    }
  }

  /* Strata divider — a direct reference to the mine benches */
  .strata {
    height: 62px;
    width: 100%;
    margin-top: var(--s-8);
    background-image: repeating-linear-gradient(
      to bottom,
      var(--line-strong) 0 1px,
      transparent 1px 10px
    );
    opacity: 0.55;
    -webkit-mask-image: linear-gradient(
      to right,
      #000 0%,
      rgb(0 0 0 / 0.55) 38%,
      transparent 78%
    );
    mask-image: linear-gradient(
      to right,
      #000 0%,
      rgb(0 0 0 / 0.55) 38%,
      transparent 78%
    );
  }

  .section--dark .strata,
  .section--navy .strata,
  .section--green .strata {
    background-image: repeating-linear-gradient(
      to bottom,
      rgb(239 234 222 / 0.22) 0 1px,
      transparent 1px 8px
    );
  }
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */
@layer components {
  /* ---------- Typography helpers ---------- */
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: var(--tracking-micro);
    text-transform: uppercase;
    color: var(--ink-muted);
    line-height: 1.4;
  }

  .eyebrow::before {
    content: "";
    width: 5px;
    height: 5px;
    background: var(--accent);
    flex: none;
  }

  .eyebrow--plain::before {
    display: none;
  }

  .accent {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.012em;
    font-size: 1.06em;
  }

  .section__title {
    font-size: var(--text-h2);
    line-height: var(--leading-h2);
    letter-spacing: var(--tracking-h2);
    font-weight: var(--weight-regular);
    max-width: 18ch;
  }

  .lede {
    font-size: var(--text-body-lg);
    line-height: var(--leading-snug);
    color: var(--ink);
    max-width: 34ch;
  }

  .prose {
    max-width: var(--measure);
  }

  .prose p {
    color: var(--ink-secondary);
    line-height: var(--leading-body);
  }

  .prose p + p {
    margin-top: 1.1em;
  }

  .prose strong {
    font-weight: var(--weight-medium);
    color: var(--ink);
  }

  .micro {
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--ink-muted);
    line-height: 1.5;
  }

  /* ---------- Buttons ---------- */
  .btn {
    --btn-bg: transparent;
    --btn-fg: var(--ink);
    --btn-bd: var(--line-strong);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 50px;
    padding-inline: 1.4rem;
    border: 1px solid var(--btn-bd);
    border-radius: var(--radius-xs);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    letter-spacing: 0.012em;
    line-height: 1;
    white-space: nowrap;
    transition: background var(--dur) var(--ease),
      border-color var(--dur) var(--ease), color var(--dur) var(--ease),
      transform var(--dur) var(--ease);
  }

  .btn__icon {
    width: 14px;
    height: 14px;
    flex: none;
    transition: transform var(--dur) var(--ease);
  }

  .btn:hover .btn__icon {
    transform: translateX(3px);
  }

  .btn:active {
    transform: translateY(1px);
  }

  .btn--primary {
    --btn-bg: var(--brand-green);
    --btn-fg: #f6f3ec;
    --btn-bd: var(--brand-green);
  }
  .btn--primary:hover {
    --btn-bg: #0d4d2c;
    --btn-bd: #0d4d2c;
  }

  .btn--ruby {
    --btn-bg: var(--brand-ruby);
    --btn-fg: #f6f3ec;
    --btn-bd: var(--brand-ruby);
  }
  .btn--ruby:hover {
    --btn-bg: #96001c;
    --btn-bd: #96001c;
  }

  .btn--light {
    --btn-bg: #f4f1ea;
    --btn-fg: #0a1120;
    --btn-bd: #f4f1ea;
  }
  .btn--light:hover {
    --btn-bg: #ffffff;
    --btn-bd: #ffffff;
  }

  .btn--ghost-light {
    --btn-bg: rgb(8 15 29 / 0.18);
    --btn-fg: #efeade;
    --btn-bd: rgb(239 234 222 / 0.38);
  }
  .btn--ghost-light:hover {
    --btn-bg: rgb(239 234 222 / 0.12);
    --btn-bd: rgb(239 234 222 / 0.62);
  }

  .btn:disabled,
  .btn[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
  }

  /* ---------- Inline text link with rule ---------- */
  .link-rule {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--line-strong);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    transition: border-color var(--dur) var(--ease),
      color var(--dur) var(--ease);
  }

  .link-rule:hover {
    color: var(--accent);
    border-color: currentColor;
  }

  /* ---------- Header ---------- */
  .skip-link {
    position: absolute;
    top: 0;
    left: var(--s-4);
    z-index: var(--z-skip);
    padding: 0.75rem 1rem;
    background: var(--surface-raised);
    color: var(--ink);
    font-size: var(--text-sm);
    transform: translateY(-120%);
    transition: transform var(--dur) var(--ease);
  }

  .skip-link:focus {
    transform: translateY(0.5rem);
  }

  .site-header {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: var(--z-header);
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border-bottom: 1px solid transparent;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    transition: background var(--dur) var(--ease),
      border-color var(--dur) var(--ease);
  }

  @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .site-header {
      background: rgb(8 15 29 / 0.94);
    }
  }

  .site-header.is-scrolled {
    background: var(--glass-bg-strong);
    border-bottom-color: var(--glass-border);
  }

  .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
    width: 100%;
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #f4f1ea;
    line-height: 1;
  }

  .brand__mark {
    width: 7px;
    height: 7px;
    background: var(--ruby-bright);
    flex: none;
  }

  .brand__name {
    font-size: 0.9375rem;
    font-weight: var(--weight-medium);
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }

  .brand__sub {
    display: none;
    white-space: nowrap;
    padding-left: 0.7rem;
    border-left: 1px solid rgb(239 234 222 / 0.25);
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-on-dark-muted);
  }

  @media (min-width: 560px) {
    .brand__sub {
      display: inline-block;
    }
  }

  .header-nav {
    display: none;
    align-items: center;
    gap: 0.15rem;
  }

  .header-nav a {
    position: relative;
    padding: 0.6rem 0.7rem;
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-on-dark-secondary);
    transition: color var(--dur) var(--ease);
  }

  .header-nav a::after {
    content: "";
    position: absolute;
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.3rem;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur) var(--ease);
  }

  .header-nav a:hover {
    color: #fff;
  }

  .header-nav a:hover::after {
    transform: scaleX(1);
  }

  .header-nav a[aria-current="true"],
  .header-nav a[aria-current="page"] {
    color: #fff;
  }

  .header-nav a[aria-current="true"]::after,
  .header-nav a[aria-current="page"]::after {
    transform: scaleX(1);
    background: var(--ruby-bright);
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: none;
  }

  .header-actions .btn {
    min-height: 38px;
    padding-inline: 0.95rem;
    font-size: var(--text-xs);
  }

  .header-actions .btn--ruby {
    display: none;
  }

  @media (min-width: 1024px) {
    .header-nav {
      display: flex;
    }
    .header-actions .btn--ruby {
      display: inline-flex;
    }
  }

  /* Compact mode: activated when the header cannot fit its contents
     (large text sizes, narrow desktop widths). The drawer carries navigation. */
  .site-header.is-compact .header-nav,
  .site-header.is-compact .brand__sub,
  .site-header.is-compact .header-actions .btn--ruby {
    display: none;
  }

  .site-header.is-compact .nav-toggle {
    display: inline-flex;
  }

  /* ---------- Mobile navigation ---------- */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 38px;
    padding-inline: 0.75rem;
    border: 1px solid rgb(239 234 222 / 0.3);
    border-radius: var(--radius-xs);
    color: #f4f1ea;
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  @media (min-width: 1024px) {
    .nav-toggle {
      display: none;
    }
  }

  .nav-toggle__bars {
    position: relative;
    width: 14px;
    height: 8px;
    flex: none;
  }

  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transition: transform var(--dur) var(--ease);
  }

  .nav-toggle__bars::before {
    top: 0;
  }
  .nav-toggle__bars::after {
    bottom: 0;
  }

  .drawer {
    position: fixed;
    inset: 0;
    z-index: var(--z-drawer);
    display: flex;
    flex-direction: column;
    background: var(--surface-dark);
    color: var(--ink-on-dark);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 480ms var(--ease-out),
      visibility 0s linear 480ms;
    overscroll-behavior: contain;
  }

  .drawer.is-open {
    transform: none;
    visibility: visible;
    transition: transform 480ms var(--ease-out), visibility 0s linear 0s;
  }

  .drawer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding-inline: var(--container-pad);
    border-bottom: 1px solid var(--line-dark);
    flex: none;
  }

  .drawer__close {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 38px;
    padding-inline: 0.75rem;
    border: 1px solid var(--line-dark-strong);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-on-dark);
  }

  .drawer__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--s-6) var(--container-pad) var(--s-7);
    overflow-y: auto;
  }

  .drawer__nav {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .drawer__nav li {
    border-bottom: 1px solid var(--line-dark);
  }

  .drawer__nav a {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding-block: 1.15rem;
    font-size: clamp(1.6rem, 1.2rem + 3.2vw, 2.4rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--ink-on-dark);
  }

  .drawer__nav a span:first-child {
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.1em;
    color: var(--accent);
    flex: none;
    min-width: 1.5rem;
  }

  .drawer__foot {
    display: grid;
    gap: var(--s-3);
    margin-top: var(--s-7);
  }

  .drawer__foot .contact-email {
    font-size: clamp(1.05rem, 0.9rem + 1vw, 1.4rem);
  }

  .drawer__address {
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--ink-on-dark-secondary);
    max-width: 30ch;
  }

  /* ---------- Figures ---------- */
  .figure {
    margin: 0;
    min-width: 0;
  }

  .figure__media {
    position: relative;
    overflow: hidden;
    background: var(--surface-sunk);
  }

  .figure__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .figure figcaption {
    display: flex;
    justify-content: space-between;
    gap: var(--s-4);
    margin-top: 0.85rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-muted);
    line-height: 1.6;
  }

  /* ---------- Spec list ---------- */
  .spec {
    margin: 0;
    border-top: 1px solid var(--line);
  }

  /* Flex, not grid: when the column is too narrow for both cells the
     description drops under its label instead of breaking words. */
  .spec > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem var(--s-4);
    padding-block: 0.8rem;
    border-bottom: 1px solid var(--line);
  }

  .spec dt {
    flex: 0 1 38%;
    min-width: 8rem;
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-muted);
    line-height: 1.7;
  }

  .spec dd {
    flex: 1 1 10rem;
    margin: 0;
    min-width: 0;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--ink);
    overflow-wrap: break-word;
  }

  @media (max-width: 560px) {
    .spec > div {
      display: block;
      padding-block: 0.9rem;
    }
    .spec dt {
      line-height: 1.5;
      margin-bottom: 0.25rem;
    }
    .contact-list > div {
      grid-template-columns: 1fr;
      gap: 0.2rem;
    }
  }

  /* ---------- Steps ---------- */
  .steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
  }

  .steps li {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: var(--s-4);
    padding-block: 1.5rem;
    border-top: 1px solid var(--line);
  }

  .steps li:last-child {
    border-bottom: 1px solid var(--line);
  }

  .steps__num {
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.08em;
    color: var(--accent);
    padding-top: 0.45rem;
    font-variant-numeric: tabular-nums;
  }

  .steps h3 {
    font-size: var(--text-h3);
    letter-spacing: -0.015em;
    margin-bottom: 0.4rem;
  }

  .steps p {
    font-size: var(--text-sm);
    line-height: 1.65;
    color: var(--ink-secondary);
    max-width: 46ch;
  }

  /* ---------- Stat / fact strip ---------- */
  .facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }

  @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .facts {
      background: rgb(8 15 29 / 0.9);
    }
  }

  .facts > div {
    padding: 1.05rem 1.25rem 1.15rem;
    border-left: 1px solid var(--glass-border);
  }

  .facts > div:first-child {
    border-left: 0;
  }

  .facts dt {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-on-dark-muted);
    margin-bottom: 0.4rem;
    line-height: 1.4;
  }

  .facts dd {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.35;
    color: var(--ink-on-dark);
    letter-spacing: -0.005em;
  }

  /* ---------- Note ---------- */
  .note {
    margin-top: var(--s-6);
    padding-top: var(--s-4);
    border-top: 1px solid var(--line);
    max-width: 46ch;
  }

  .note .micro {
    margin-bottom: 0.6rem;
  }

  .note p:last-child {
    font-size: var(--text-sm);
    line-height: 1.62;
    color: var(--ink-secondary);
  }

  /* ---------- Affiliation rows ---------- */
  .affiliations {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
  }

  .affiliations > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding-block: 1.15rem;
    border-bottom: 1px solid var(--line);
  }

  .affiliations h3 {
    font-size: 1rem;
    font-weight: var(--weight-medium);
    letter-spacing: -0.005em;
  }

  .affiliations p {
    font-size: var(--text-sm);
    color: var(--ink-secondary);
    line-height: 1.55;
  }

  /* ---------- Organisation chart ---------- */
  /* A nested list, not a diagram. It linearises for screen readers, reflows at
     any width, and prints without a separate layout. */
  .org {
    list-style: none;
    max-width: 44rem;
    margin: var(--s-6) 0 0;
    padding: 0;
    border-top: 1px solid var(--line);
  }

  .org__children {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0 0 0 var(--s-5);
    border-left: 1px solid var(--line);
  }

  .org__node {
    padding-block: 1.1rem;
    border-bottom: 1px solid var(--line);
  }

  .org__children .org__node {
    border-bottom: 0;
    padding-block: 0.85rem;
  }

  .org__children .org__node:first-child {
    padding-top: 0.55rem;
  }

  .org__children .org__node:last-child {
    padding-bottom: 0;
  }

  .org__meta {
    display: flex;
    margin-bottom: 0.4rem;
  }

  .org__sample {
    padding: 0.12rem 0.4rem;
    border: 1px solid var(--line-strong);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-muted);
    line-height: 1.4;
  }

  .org__title {
    font-size: var(--text-h4);
    font-weight: var(--weight-medium);
    letter-spacing: -0.008em;
    line-height: 1.35;
  }

  .org__post {
    margin-top: 0.2rem;
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-muted);
    line-height: 1.6;
  }

  .org__detail {
    margin-top: 0.35rem;
    max-width: 56ch;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--ink-secondary);
  }

  /* ---------- Contact ---------- */
  .contact-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
  }

  .contact-list > div {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: var(--s-4);
    padding-block: 0.95rem;
    border-bottom: 1px solid var(--line);
    align-items: baseline;
  }

  .contact-list dt {
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-muted);
  }

  .contact-list dd {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.6;
  }

  .contact-email {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: clamp(1.25rem, 0.95rem + 1.35vw, 1.9rem);
    letter-spacing: -0.022em;
    line-height: 1.2;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line-strong);
    transition: color var(--dur) var(--ease),
      border-color var(--dur) var(--ease);
    overflow-wrap: anywhere;
  }

  .contact-email:hover {
    color: var(--accent);
    border-color: currentColor;
  }

  .contact-email svg {
    width: 0.72em;
    height: 0.72em;
    flex: none;
    transition: transform var(--dur) var(--ease);
  }

  .contact-email:hover svg {
    transform: translate(2px, -2px);
  }

  /* ---------- Footer ---------- */
  .site-footer {
    background: #050b16;
    color: var(--ink-on-dark);
    border-top: 1px solid var(--line-dark);
    padding-block: var(--s-7) var(--s-6);
    --ink: var(--ink-on-dark);
    --ink-secondary: var(--ink-on-dark-secondary);
    --ink-muted: var(--ink-on-dark-muted);
    --line: var(--line-dark);
    color-scheme: dark;
  }

  .footer-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--gutter);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-col {
    grid-column: 1 / -1;
    margin-top: var(--s-5);
  }

  .footer-col h2 {
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 0.9rem;
  }

  .footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.55rem;
  }

  .footer-col a,
  .footer-col p {
    font-size: var(--text-sm);
    color: var(--ink-secondary);
    line-height: 1.55;
    transition: color var(--dur) var(--ease);
  }

  .footer-col a:hover {
    color: var(--ink-on-dark);
  }

  .footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s-3) var(--s-5);
    margin-top: var(--s-7);
    padding-top: var(--s-4);
    border-top: 1px solid var(--line-dark);
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
    line-height: 1.7;
  }

  @media (min-width: 720px) {
    .footer-brand {
      grid-column: 1 / 5;
    }
    .footer-col:nth-of-type(2) {
      grid-column: 5 / 7;
    }
    .footer-col:nth-of-type(3) {
      grid-column: 7 / 10;
    }
    .footer-col:nth-of-type(4) {
      grid-column: 10 / 13;
    }
    .footer-col {
      margin-top: 0;
    }
  }

  /* ---------- Reveal ---------- */
  .js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
  }

  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .js .reveal {
      opacity: 1;
      transform: none;
      transition: none;
    }
  }
}

  /* ---------- Data table ---------- */
  /* Specimen plate: keeps its own ratio inside a figure column that
     would otherwise force 3:2 */
  .figure--plate .figure__media {
    aspect-ratio: var(--plate-ratio, 1);
  }

  .table-wrap {
    margin-top: var(--s-7);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
    font-size: var(--text-sm);
    line-height: 1.55;
  }

  .table caption {
    text-align: left;
    padding-bottom: 0.9rem;
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-muted);
  }

  .table th,
  .table td {
    text-align: left;
    vertical-align: top;
    padding: 0.85rem var(--gutter) 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }

  .table thead th {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: var(--text-micro);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-muted);
    padding-bottom: 0.6rem;
    border-bottom-color: var(--line-strong);
  }

  .table tbody th {
    font-weight: 500;
    color: var(--ink);
  }

  .table td {
    color: var(--ink-secondary);
  }

  .table tbody tr:last-child th,
  .table tbody tr:last-child td {
    border-bottom: 0;
  }

  /* Below 700 px the table becomes a stack of labelled rows: a horizontally
     scrolling data table is unreadable at phone width. */
  @media (max-width: 700px) {
    .table-wrap {
      overflow-x: visible;
    }

    .table {
      min-width: 0;
    }

    .table thead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
    }

    .table tbody tr {
      padding-block: 1.1rem;
      border-bottom: 1px solid var(--line);
    }

    .table tbody tr:last-child {
      border-bottom: 0;
    }

    .table tbody th {
      display: block;
      font-size: var(--text-body);
      margin-bottom: 0.4rem;
    }

    .table td {
      display: block;
      padding: 0;
      border: 0;
    }

    .table td + td {
      margin-top: 0.55rem;
    }

    .table td::before {
      content: attr(data-label);
      display: block;
      margin-bottom: 0.1rem;
      font-family: var(--font-mono);
      font-size: var(--text-micro);
      letter-spacing: 0.09em;
      text-transform: uppercase;
      color: var(--ink-muted);
    }
  }

/* ==========================================================================
   PAGE COMPOSITION
   ========================================================================== */
@layer page {
  /* ---------- Hero ---------- */
  .hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 680px;
    min-height: max(680px, 100svh);
    background: var(--surface-dark);
    color: var(--ink-on-dark);
    --ink: var(--ink-on-dark);
    --ink-secondary: var(--ink-on-dark-secondary);
    --ink-muted: var(--ink-on-dark-muted);
    isolation: isolate;
    overflow: hidden;
  }

  .hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
  }

  .hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 900ms var(--ease);
  }

  .hero__slide.is-active {
    opacity: 1;
  }

  .hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        rgb(8 15 29 / 0.62) 0%,
        rgb(8 15 29 / 0.08) 26%,
        rgb(8 15 29 / 0.34) 58%,
        rgb(8 15 29 / 0.88) 100%
      ),
      linear-gradient(
        to right,
        rgb(8 15 29 / 0.58) 0%,
        rgb(8 15 29 / 0.34) 34%,
        transparent 70%
      );
    pointer-events: none;
  }

  @media (max-width: 640px) {
    .hero::after {
      background: linear-gradient(
          to bottom,
          rgb(8 15 29 / 0.52) 0%,
          rgb(8 15 29 / 0.06) 18%,
          rgb(8 15 29 / 0.44) 38%,
          rgb(8 15 29 / 0.84) 62%,
          rgb(8 15 29 / 0.94) 80%,
          rgb(8 15 29 / 0.97) 100%
        ),
        linear-gradient(to right, rgb(8 15 29 / 0.28) 0%, transparent 80%);
    }
  }

  .hero__inner {
    position: relative;
    z-index: 2;
    padding-top: calc(var(--header-h) + var(--s-9));
    padding-bottom: var(--s-6);
  }

  .hero__bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-5);
  }

  .hero__content {
    max-width: 100%;
    min-width: 0;
  }

  /* ---------- Hero controls ---------- */
  .hero__controls {
    position: absolute;
    right: var(--container-pad);
    bottom: var(--s-6);
    display: flex;
    align-items: stretch;
    border: 1px solid rgb(239 234 222 / 0.22);
    border-radius: var(--radius-xs);
    background: rgb(8 15 29 / 0.56);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }

  .hero__controls[hidden] {
    display: none;
  }

  .hero__ctrl {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: #efeade;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  }

  .hero__ctrl:hover {
    background: rgb(239 234 222 / 0.12);
  }

  .hero__ctrl:active {
    background: rgb(239 234 222 / 0.18);
  }

  .hero__ctrl svg {
    width: 15px;
    height: 15px;
  }

  .hero__ctrl--toggle {
    border-left: 1px solid rgb(239 234 222 / 0.18);
  }

  .hero__icon--play {
    display: none;
  }

  .hero__controls[data-playing="false"] .hero__icon--pause {
    display: none;
  }

  .hero__controls[data-playing="false"] .hero__icon--play {
    display: block;
  }

  .hero__count {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-inline: 0.85rem;
    border-inline: 1px solid rgb(239 234 222 / 0.18);
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.1em;
    color: rgb(239 234 222 / 0.8);
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }

  .hero__count span:first-child {
    color: #efeade;
  }

  .hero .eyebrow {
    color: rgb(239 234 222 / 0.82);
  }

  .eyebrow__short {
    display: none;
  }

  @media (max-width: 640px) {
    .eyebrow__full {
      display: none;
    }
    .eyebrow__short {
      display: inline;
    }
  }

  .hero h1 {
    margin-top: var(--s-5);
    max-width: 13ch;
    font-size: var(--text-display);
    line-height: var(--leading-display);
    letter-spacing: var(--tracking-display);
    font-weight: var(--weight-regular);
    color: #f7f4ed;
  }

  .hero h1 .accent {
    display: inline-block;
  }

  .hero__lede {
    margin-top: var(--s-5);
    max-width: 44ch;
    font-size: var(--text-body-lg);
    line-height: 1.5;
    color: rgb(239 234 222 / 0.86);
  }

  .hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: var(--s-6);
  }

  .facts {
    position: relative;
    z-index: 2;
  }

  @media (max-width: 720px) {
    .hero__inner {
      padding-top: calc(var(--header-h) + var(--s-6));
      padding-bottom: calc(var(--s-6) + 46px + var(--s-4));
    }

    .hero__bar {
      flex-direction: column;
      align-items: flex-start;
      gap: var(--s-5);
    }

    .hero__controls {
      right: auto;
      left: var(--container-pad);
    }

    .facts {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .facts > div:nth-child(3) {
      border-left: 0;
      border-top: 1px solid var(--glass-border);
    }
    .facts > div:nth-child(4) {
      border-top: 1px solid var(--glass-border);
    }
    .hero__actions .btn {
      flex: 1 1 auto;
    }
  }

  /* ---------- Origin ---------- */
  .origin__body {
    grid-column: 1 / -1;
  }

  .origin__title {
    margin-bottom: var(--s-5);
  }

  .origin__text {
    display: grid;
    gap: var(--s-5);
  }

  .origin__figure {
    grid-column: 1 / -1;
    margin-top: var(--s-6);
  }

  .origin__figure .figure__media {
    aspect-ratio: 4 / 5;
  }

  @media (min-width: 900px) {
    .origin__body {
      grid-column: 3 / 9;
    }
    .origin__figure {
      grid-column: 9 / 13;
      grid-row: 1;
      margin-top: 0;
      align-self: start;
    }
    .origin__figure .figure__media {
      aspect-ratio: 4 / 5;
    }
  }

  /* ---------- Stone ---------- */
  .stone__body {
    grid-column: 1 / -1;
  }

  .stone__figure {
    grid-column: 1 / -1;
    margin-top: var(--s-6);
  }

  .stone__figure .figure__media {
    aspect-ratio: 3 / 2;
  }

  .stone__spec {
    margin-top: var(--s-6);
  }

  @media (min-width: 900px) {
    .stone__body {
      grid-column: 3 / 8;
    }
    .stone__figure {
      grid-column: 8 / 13;
      grid-row: 1;
      margin-top: 0;
      align-self: start;
      position: sticky;
      top: calc(var(--header-h) + 2.5rem);
    }
    .stone__figure .figure__media {
      aspect-ratio: 3 / 2;
    }
  }

  /* ---------- Operations ---------- */
  .operations__band {
    position: relative;
    width: 100%;
  }

  .operations__band .figure__media {
    width: 100%;
    height: clamp(280px, 38vw, 560px);
  }

  .operations__body {
    grid-column: 1 / -1;
    margin-top: var(--s-6);
  }

  .operations__aside {
    grid-column: 1 / -1;
    margin-top: var(--s-6);
  }

  .operations__figure .figure__media {
    aspect-ratio: 3 / 2;
  }

  @media (min-width: 900px) {
    .operations__body {
      grid-column: 3 / 8;
      margin-top: 0;
    }
    .operations__aside {
      grid-column: 8 / 13;
      grid-row: 1;
      margin-top: 0;
      align-self: start;
      position: sticky;
      top: calc(var(--header-h) + 2.5rem);
    }
  }

  /* ---------- Company ---------- */
  .company__body {
    grid-column: 1 / -1;
  }

  .company__figures {
    display: grid;
    gap: var(--s-5);
    grid-column: 1 / -1;
    margin-top: var(--s-6);
  }

  .company__figures .figure__media {
    aspect-ratio: 4 / 3;
  }

  .company__figures figure:last-child .figure__media {
    aspect-ratio: 3 / 2;
  }

  /* Tablet: pair the two frames rather than stacking two full-width images */
  @media (min-width: 720px) and (max-width: 899px) {
    .company__figures {
      grid-template-columns: 1fr 1fr;
      align-items: start;
      gap: var(--gutter);
    }

    .company__figures .figure__media,
    .company__figures figure:last-child .figure__media {
      aspect-ratio: 3 / 2;
    }
  }

  @media (min-width: 900px) {
    .company__body {
      grid-column: 3 / 9;
    }
    .company__figures {
      grid-column: 9 / 13;
      grid-row: 1;
      margin-top: 0;
      align-self: start;
    }
  }

  /* ---------- Enquiry ---------- */
  .enquiry__inner {
    align-items: start;
  }

  .enquiry__body {
    grid-column: 1 / -1;
  }

  .enquiry__aside {
    grid-column: 1 / -1;
    margin-top: var(--s-6);
  }

  .enquiry__aside .figure__media {
    aspect-ratio: 16 / 9;
  }

  .enquiry__contact {
    margin-top: var(--s-6);
  }

  @media (min-width: 900px) {
    .enquiry__body {
      grid-column: 3 / 8;
    }
    .enquiry__aside {
      grid-column: 8 / 13;
      grid-row: 1;
      margin-top: 0;
      align-self: start;
    }
  }

  /* ==========================================================================
     INNER PAGES — about.html, life.html
     ========================================================================== */

  .page-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 520px;
    min-height: clamp(520px, 76svh, 820px);
    padding-top: var(--header-h);
    overflow: hidden;
    isolation: isolate;
    --ink: var(--ink-on-dark);
    --ink-muted: rgb(239 234 222 / 0.78);
    --accent: var(--accent-on-green);
    color-scheme: dark;
  }

  .page-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
  }

  .page-hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        rgb(8 15 29 / 0.5) 0%,
        rgb(8 15 29 / 0.12) 30%,
        rgb(8 15 29 / 0.6) 72%,
        rgb(8 15 29 / 0.9) 100%
      ),
      linear-gradient(to right, rgb(8 15 29 / 0.6) 0%, rgb(8 15 29 / 0.2) 42%, transparent 78%);
    pointer-events: none;
  }

  .page-hero__inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding-block: var(--s-8) var(--s-7);
  }

  .page-hero__title {
    margin-top: var(--s-5);
    font-size: clamp(2.4rem, 1.4rem + 4.4vw, 5.2rem);
    line-height: 1.02;
    letter-spacing: -0.032em;
    font-weight: var(--weight-regular);
    max-width: 17ch;
    color: #fff;
    text-wrap: balance;
  }

  .page-hero__lede {
    margin-top: var(--s-5);
    max-width: 46ch;
    font-size: var(--text-body-lg);
    line-height: var(--leading-snug);
    color: rgb(239 234 222 / 0.88);
  }

  /* Row of in-page anchors directly under a page hero */
  .page-jump {
    background: var(--surface-navy);
    border-bottom: 1px solid var(--line-dark);
    color-scheme: dark;
    --accent: var(--accent-on-dark);
  }

  .page-jump__inner {
    display: flex;
    gap: 1.6rem;
    padding-block: 0.9rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-padding-inline: var(--container-pad);
  }

  .page-jump__inner::-webkit-scrollbar {
    display: none;
  }

  .page-jump a {
    display: inline-flex;
    white-space: nowrap;
    flex: none;
    align-items: baseline;
    gap: 0.55rem;
    padding-block: 0.35rem;
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgb(239 234 222 / 0.66);
    transition: color var(--dur) var(--ease);
  }

  .page-jump a span {
    color: var(--accent-on-dark);
    font-variant-numeric: tabular-nums;
  }

  .page-jump a:hover {
    color: #fff;
  }

  /* Chapter spacing: a hairline between sections rather than a full band */
  .chapter {
    padding-block: clamp(3rem, 2rem + 4vw, 5rem);
  }

  .chapter__body {
    grid-column: 1 / -1;
  }

  .chapter__aside {
    grid-column: 1 / -1;
    display: grid;
    gap: var(--s-6);
    margin-top: var(--s-7);
  }

  .chapter__band {
    margin-top: var(--s-7);
  }

  .chapter__band .figure__media {
    aspect-ratio: 16 / 9;
  }

  .chapter__aside .figure__media {
    aspect-ratio: 3 / 2;
  }

  .note--wide {
    max-width: var(--measure);
  }

  @media (min-width: 700px) {
    .chapter__aside {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--s-5) var(--gutter);
    }

    .chapter__aside > *:last-child:nth-child(odd) {
      grid-column: 1 / -1;
    }
  }

  @media (min-width: 900px) {
    .chapter__body {
      grid-column: 3 / 9;
    }

    /* Registers and tables take the full content width, with the rail kept */
    .chapter--wide .chapter__body {
      grid-column: 3 / 13;
    }

    .chapter__aside {
      grid-column: 9 / 13;
      grid-row: 1;
      grid-template-columns: 1fr;
      margin-top: 0;
      align-self: start;
      position: sticky;
      top: calc(var(--header-h) + 2.5rem);
    }

    .chapter__aside > *:last-child:nth-child(odd) {
      grid-column: auto;
    }

    /* Chapters with no photograph: type on the left, facts on the right */
    .chapter--facts .chapter__body {
      grid-column: 3 / 13;
      display: grid;
      grid-template-columns: minmax(0, 6fr) minmax(0, 4fr);
      gap: var(--s-5) clamp(2rem, 4vw, 4.5rem);
      align-items: start;
    }

    .chapter--facts .chapter__body > .section__title,
    .chapter--facts .chapter__body > .prose {
      grid-column: 1;
    }

    .chapter--facts .chapter__body > .spec,
    .chapter--facts .chapter__body > .note {
      grid-column: 2;
      margin-top: 0;
      align-self: start;
    }

    .chapter--facts .chapter__body > .steps {
      grid-column: 1 / -1;
    }

    /* Steps read as number · name · description across the full width */
    .chapter--facts .steps li > div {
      display: grid;
      grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr);
      gap: clamp(1.5rem, 3vw, 3.5rem);
      align-items: baseline;
    }

    .chapter--facts .steps h3 {
      margin-bottom: 0;
    }

    .chapter--facts .steps p {
      max-width: 64ch;
    }
  }

  /* Two- and three-up figure rows */
  .figrow {
    display: grid;
    gap: var(--s-6) var(--gutter);
    grid-column: 1 / -1;
    margin-top: var(--s-7);
  }

  @media (min-width: 640px) {
    .figrow--2,
    .figrow--3 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 860px) {
    .figrow--3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  .figrow .figure__media {
    aspect-ratio: 3 / 2;
  }

  /* Sticky asides stop being sticky where the column is taller than the viewport */
  @media (min-width: 900px) and (max-height: 780px) {
    .chapter__aside {
      position: static;
    }
  }

  /* ---------- Page navigation ---------- */
  .pagenav {
    background: var(--surface-navy);
    color: var(--ink-on-dark);
    --ink: var(--ink-on-dark);
    --ink-muted: var(--ink-on-dark-muted);
    --line: var(--line-dark);
    color-scheme: dark;
    padding-block: var(--s-8);
  }

  .pagenav__inner {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
  }

  .pagenav__link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
    align-self: flex-start;
    font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem);
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: #fff;
    border-bottom: 1px solid rgb(239 234 222 / 0.24);
    padding-bottom: 0.15em;
    transition: border-color var(--dur) var(--ease);
  }

  .pagenav__arrow {
    display: inline-block;
    font-size: 0.8em;
    transition: transform var(--dur) var(--ease);
  }

  .pagenav__link:hover {
    border-color: #fff;
  }

  .pagenav__link:hover .pagenav__arrow {
    transform: translateX(4px);
  }

  .pagenav__note {
    max-width: 44ch;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--ink-on-dark-secondary);
  }

  /* ---------- Utility surface ---------- */
  .section--light {
    background: var(--surface);
  }

  .hairline {
    height: 1px;
    width: 100%;
    background: var(--line);
  }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
@layer utilities {
  .visually-hidden,
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .stack > * + * {
    margin-top: var(--stack-gap, var(--s-4));
  }

  .text-muted {
    color: var(--ink-muted);
  }

  .no-wrap {
    white-space: nowrap;
  }

  /* Print: nothing may be left at the reveal start state */
  @media print {
    .js .reveal {
      opacity: 1;
      transform: none;
      transition: none;
    }

    .site-header,
    .drawer,
    .hero__controls,
    .page-jump,
    .pagenav {
      display: none;
    }

    /* A register prints as a document: drop the photograph and the dark
       field, keep the title, the lede and the rules. */
    .page-hero {
      min-height: 0;
      padding-top: 0;
      background: none;
      --ink: #0e1319;
      --ink-muted: #61686f;
      --accent: #7a0016;
    }

    .page-hero__media,
    .page-hero::after {
      display: none;
    }

    .page-hero__inner {
      padding-block: 0 1.25rem;
    }

    .page-hero__title {
      color: #0e1319;
      font-size: 2rem;
    }

    .page-hero__lede {
      color: #3b424b;
      font-size: 0.95rem;
      max-width: 60ch;
    }

    .section,
    .chapter {
      padding-block: 1.25rem;
    }
  }
}
