/*
  terranceaddison.com: shared stylesheet
  Keeps the live site's identity: Poppins, warm paper, ink, and gold.
  Layers, in order of precedence (last wins):
  reset → tokens → base → layout → components → pages → motion → utilities
*/
@layer reset, tokens, base, layout, components, pages, motion, utilities;

/* Keep the symbol sprite outside layout without permitting inline styles. */
@layer utilities { .sprite { position: absolute; } }

/* ---------- Fonts: Poppins (self-hosted, Latin subset) ---------- */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/poppins-700.woff2") format("woff2"); }
/* Metric-matched fallbacks so the font swap causes no layout shift. */
@font-face { font-family: "Poppins Fallback"; src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Helvetica"); font-weight: 400 500; size-adjust: 112.5%; ascent-override: 93.3%; descent-override: 31.1%; line-gap-override: 8.9%; }
@font-face { font-family: "Poppins Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Helvetica Bold"); font-weight: 600 800; size-adjust: 107.2%; ascent-override: 98%; descent-override: 32.7%; line-gap-override: 9.3%; }

/* Registered so the signature line's draw value can interpolate smoothly. */
@property --draw {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 100%;
}

/* ---------- Reset ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  img, picture, svg { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
  [hidden] { display: none !important; }
}

@layer tokens {
  :root {
    color-scheme: light;
  --paper: oklch(99.1% 0.0041 91.4);
  --paper-deep: oklch(96.45% 0.0098 87.5);
  --panel: oklch(100% 0 90);
  --ink: oklch(21.78% 0 90);
  --ink-soft: oklch(43.15% 0.0085 88.7);
  --line: oklch(91.42% 0.0133 82.4);
  --field: oklch(62.11% 0.0127 84.6);
  --gold: oklch(65.21% 0.1322 81.6);
  --gold-dark: oklch(50.79% 0.104 85.8);
  --gold-light: oklch(76.65% 0.1387 91.1);
  --gold-wash: oklch(95.09% 0.0281 86.6);
  --dark: oklch(19.13% 0 90);
  --dark-2: oklch(23.11% 0.0041 84.6);
  --on-dark: oklch(94.63% 0.007 88.6);
  --on-dark-soft: oklch(77.7% 0.0091 84.6);
  --dark-line: oklch(34% 0.006 88);
  --footer: oklch(19.13% 0 90);
  --error: oklch(45.98% 0.1682 27);
  --error-bg: oklch(97.6% 0.013 27);
  --accent-text: var(--gold-dark);
  --tick: var(--gold);
  --focus: var(--gold);
  --link: var(--gold-dark);
  --nav-cta-bg: var(--ink);
  --nav-cta-ink: var(--panel);
  --shadow-color: oklch(21.78% 0 0 / 0.14);
  --shadow-soft: oklch(21.78% 0 0 / 0.06);
  --on-gold: oklch(21.78% 0 0);
  --button-hover-bg: var(--gold-dark);
  --button-hover-ink: oklch(100% 0 0);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
  --paper: oklch(19.53% 0.002 106.6);
  --paper-deep: oklch(22.25% 0.0041 84.6);
  --panel: oklch(25.19% 0.0057 91.6);
  --ink: oklch(94.63% 0.007 88.6);
  --ink-soft: oklch(78.67% 0.012 84.6);
  --line: oklch(34.1% 0.009 88.7);
  --field: oklch(63.48% 0.0158 84.6);
  --gold: oklch(65.21% 0.1322 81.6);
  --gold-dark: oklch(50.79% 0.104 85.8);
  --gold-light: oklch(76.65% 0.1387 91.1);
  --gold-wash: oklch(95.09% 0.0281 86.6);
  --dark: oklch(22.25% 0.0041 84.6);
  --dark-2: oklch(25.19% 0.0057 91.6);
  --on-dark: oklch(94.63% 0.007 88.6);
  --on-dark-soft: oklch(77.7% 0.0091 84.6);
  --dark-line: oklch(34% 0.006 88);
  --footer: oklch(15.86% 0.0021 106.6);
  --error: oklch(73.97% 0.1267 28.2);
  --error-bg: oklch(25% 0.04 28);
  --accent-text: var(--gold-light);
  --tick: var(--gold-light);
  --focus: oklch(88.28% 0.0989 87.6);
  --link: var(--gold-light);
  --nav-cta-bg: var(--gold);
  --nav-cta-ink: oklch(21.78% 0 0);
  --shadow-color: oklch(0% 0 0 / 0.5);
  --shadow-soft: oklch(0% 0 0 / 0.3);
  --on-gold: oklch(21.78% 0 0);
  --button-hover-bg: var(--gold-light);
  --button-hover-ink: oklch(21.78% 0 0);
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
  --paper: oklch(19.53% 0.002 106.6);
  --paper-deep: oklch(22.25% 0.0041 84.6);
  --panel: oklch(25.19% 0.0057 91.6);
  --ink: oklch(94.63% 0.007 88.6);
  --ink-soft: oklch(78.67% 0.012 84.6);
  --line: oklch(34.1% 0.009 88.7);
  --field: oklch(63.48% 0.0158 84.6);
  --gold: oklch(65.21% 0.1322 81.6);
  --gold-dark: oklch(50.79% 0.104 85.8);
  --gold-light: oklch(76.65% 0.1387 91.1);
  --gold-wash: oklch(95.09% 0.0281 86.6);
  --dark: oklch(22.25% 0.0041 84.6);
  --dark-2: oklch(25.19% 0.0057 91.6);
  --on-dark: oklch(94.63% 0.007 88.6);
  --on-dark-soft: oklch(77.7% 0.0091 84.6);
  --dark-line: oklch(34% 0.006 88);
  --footer: oklch(15.86% 0.0021 106.6);
  --error: oklch(73.97% 0.1267 28.2);
  --error-bg: oklch(25% 0.04 28);
  --accent-text: var(--gold-light);
  --tick: var(--gold-light);
  --focus: oklch(88.28% 0.0989 87.6);
  --link: var(--gold-light);
  --nav-cta-bg: var(--gold);
  --nav-cta-ink: oklch(21.78% 0 0);
  --shadow-color: oklch(0% 0 0 / 0.5);
  --shadow-soft: oklch(0% 0 0 / 0.3);
  --on-gold: oklch(21.78% 0 0);
  --button-hover-bg: var(--gold-light);
  --button-hover-ink: oklch(21.78% 0 0);
  }

  /* sRGB fallbacks for browsers without OKLCH support. */
  @supports not (color: oklch(0% 0 0)) {
    :root {
  --paper: #fdfcf9;
  --paper-deep: #f6f3ec;
  --panel: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #52504b;
  --line: #e7e2d9;
  --field: #8a867e;
  --gold: #b8860b;
  --gold-dark: #806000;
  --gold-light: #d4af37;
  --gold-wash: #f7eeda;
  --dark: #141414;
  --dark-2: #1e1d1b;
  --on-dark: #efede8;
  --on-dark-soft: #b9b6b0;
  --dark-line: #393834;
  --footer: #141414;
  --error: #a11c1c;
  --error-bg: #fff4f2;
    }
    @media (prefers-color-scheme: dark) {
      :root:not([data-theme="light"]) {
  --paper: #151514;
  --paper-deep: #1c1b19;
  --panel: #23221f;
  --ink: #efede8;
  --ink-soft: #bdb9b1;
  --line: #3a3833;
  --field: #8f8a80;
  --gold: #b8860b;
  --gold-dark: #806000;
  --gold-light: #d4af37;
  --gold-wash: #f7eeda;
  --dark: #1c1b19;
  --dark-2: #23221f;
  --on-dark: #efede8;
  --on-dark-soft: #b9b6b0;
  --dark-line: #393834;
  --footer: #0d0d0c;
  --error: #f08a7d;
  --error-bg: #321a17;
      }
    }
    :root[data-theme="dark"] {
  --paper: #151514;
  --paper-deep: #1c1b19;
  --panel: #23221f;
  --ink: #efede8;
  --ink-soft: #bdb9b1;
  --line: #3a3833;
  --field: #8f8a80;
  --gold: #b8860b;
  --gold-dark: #806000;
  --gold-light: #d4af37;
  --gold-wash: #f7eeda;
  --dark: #1c1b19;
  --dark-2: #23221f;
  --on-dark: #efede8;
  --on-dark-soft: #b9b6b0;
  --dark-line: #393834;
  --footer: #0d0d0c;
  --error: #f08a7d;
  --error-bg: #321a17;
    }
  }
}

/* Non-color tokens */
@layer tokens {
  :root {
    --font: "Poppins", "Poppins Fallback", "Century Gothic", system-ui, sans-serif;

    --step--1: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
    --step-0: clamp(1.0625rem, 1.04rem + 0.1vw, 1.125rem);
    --step-1: clamp(1.15rem, 1.07rem + 0.35vw, 1.375rem);
    --step-2: clamp(1.2rem, 1.12rem + 0.35vw, 1.45rem);
    --step-3: clamp(1.75rem, 1.45rem + 1.3vw, 2.7rem);
    --step-4: clamp(2.25rem, 1.7rem + 2.4vw, 3.75rem);
    --step-5: clamp(2.35rem, 1.6rem + 2.6vw, 3.75rem);

    --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
    --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem;
    --section-y: clamp(4rem, 2.5rem + 6vw, 7.5rem);
    --gutter: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);
    --container: 70rem;
    --measure: 40rem;
    --header-h: 4.75rem;
    --radius: 14px;
    --radius-sm: 8px;
    --frame: 14px;
  }
}

/* ---------- Base ---------- */
@layer base {
  html {
    scroll-padding-top: calc(var(--header-h) + 1.5rem);
    background: var(--paper);
  }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
  body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  main { flex: 1 0 auto; }
  h1, h2, h3 {
    color: var(--ink);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }
  h1 { font-size: var(--step-4); line-height: 1.08; letter-spacing: -0.03em; }
  h2 { font-size: var(--step-3); }
  h3 { font-size: var(--step-2); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
  p, li, dd { text-wrap: pretty; }
  p { max-width: var(--measure); color: var(--ink-soft); }
  a { color: var(--link); text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; }
  a:hover { color: var(--ink); }
  strong { font-weight: 600; color: var(--ink); }
  :focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
    border-radius: 2px;
  }
  ::selection { background: var(--gold-wash); color: oklch(21.78% 0 0); }
}

/* ---------- Layout ---------- */
@layer layout {
  .container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
  }
  .section { --surface: var(--paper); padding-block: var(--section-y); }
  .section--tint {
    --surface: var(--paper-deep);
    background: var(--paper-deep);
    border-block: 1px solid var(--line);
  }
  /* Dark bands: the live site's #141414 → #1e1d1b, with gold-light accents. */
  .section--dark,
  .site-footer {
    --ink: var(--on-dark);
    --ink-soft: var(--on-dark-soft);
    --line: var(--dark-line);
    --accent-text: var(--gold-light);
    --link: var(--gold-light);
    --tick: var(--gold-light);
    --focus: oklch(88.28% 0.0989 87.6);
    --surface: var(--dark-2);
    color: var(--on-dark);
    background: linear-gradient(170deg, var(--dark), var(--dark-2));
  }
  .section--dark a:hover, .site-footer a:hover { color: var(--gold-light); }

  .split {
    display: grid;
    gap: var(--s-5) var(--s-8);
    align-items: start;
  }
  @media (min-width: 56rem) {
    .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  }
  .stack > * + * { margin-block-start: var(--flow, 1.1em); }
}

/* ---------- Components ---------- */
@layer components {
  .skip-link {
    position: fixed;
    left: var(--s-4);
    top: var(--s-4);
    z-index: 100;
    padding: 0.7rem 1rem;
    font-weight: 600;
    color: var(--on-gold);
    background: var(--gold);
    border-radius: var(--radius-sm);
    transform: translateY(-200%);
    &:focus { transform: none; }
  }

  /* Eyebrow: the live site's tracked gold label, led by a small dimension tick. */
  .eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-block-end: var(--s-5);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-text);
    &::before {
      content: "";
      flex: none;
      width: 1.9rem;
      height: 0.55rem;
      color: var(--tick);
      background:
        linear-gradient(currentColor 0 0) 0 50% / 100% 2px no-repeat,
        linear-gradient(currentColor 0 0) 100% 0 / 2px 100% no-repeat;
    }
  }

  .lede {
    font-size: var(--step-1);
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 40rem;
  }

  /* Buttons: pills, as on the live site */
  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.125rem;
    padding: 0.8rem 1.65rem;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    color: var(--on-gold);
    background: var(--gold);
    border: 1.5px solid var(--gold);
    border-radius: 999px;
    transition: transform 180ms ease;
    &:hover {
      color: var(--button-hover-ink);
      background: var(--button-hover-bg);
      border-color: var(--button-hover-bg);
      transform: translateY(-1px);
    }
    &:disabled { opacity: 0.65; cursor: progress; transform: none; }
  }
  .button--outline {
    color: var(--ink);
    background: transparent;
    border-color: var(--ink);
    &:hover { color: var(--accent-text); background: transparent; border-color: var(--accent-text); }
  }
  .button--small { min-height: 2.75rem; padding: 0.6rem 1.2rem; font-size: 0.875rem; }

  .text-link {
    display: inline-block;
    min-height: 2.75rem;
    padding-block: 0.6rem;
    font-weight: 700;
    color: var(--accent-text);
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.3em;
    &:hover { color: var(--ink); }
    & .arrow {
      display: inline-block;
      transition: transform 200ms ease;
    }
    &:hover .arrow { transform: translateX(3px); }
  }
  .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-4) 1.4rem;
  }

  /* Header */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--paper);
    border-block-end: 1px solid var(--line);
    view-transition-name: site-header;
  }
  @supports (backdrop-filter: blur(1px)) {
    .site-header {
      background: color-mix(in oklch, var(--paper) 92%, transparent);
      backdrop-filter: blur(10px);
    }
  }
  .header-inner {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    min-height: var(--header-h);
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-inline-end: auto;
    color: var(--ink);
    text-decoration: none;
    &:hover { color: var(--ink); }
  }
  .brand-mark {
    width: 1.75rem;
    height: auto;
    aspect-ratio: 667 / 968;
    color: var(--gold);
    flex: none;
  }
  .brand-text {
    display: grid;
    gap: 0.2rem;
    line-height: 1.1;
    & strong {
      font-size: 0.92rem;
      font-weight: 700;
      letter-spacing: 0.055em;
      text-transform: uppercase;
      color: var(--ink);
    }
    & small {
      font-size: 0.68rem;
      font-weight: 500;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      white-space: nowrap;
      color: var(--ink-soft);
    }
  }
  @media (max-width: 26rem) {
    .site-header .brand-text strong { font-size: 0.84rem; letter-spacing: 0.04em; }
    .site-header .brand-text small { font-size: 0.6rem; letter-spacing: 0.05em; }
    .site-header .brand { gap: 0.55rem; }
  }

  .site-nav {
    & ul { list-style: none; margin: 0; padding: 0; }
    & a:not(.button) {
      position: relative;
      display: block;
      color: var(--ink-soft);
      font-weight: 600;
      text-decoration: none;
    }
    & a[aria-current="page"] { color: var(--accent-text); }
    & .button { color: var(--nav-cta-ink); background: var(--nav-cta-bg); border-color: var(--nav-cta-bg); }
    & .button:hover { color: var(--on-gold); background: var(--gold); border-color: var(--gold); }
  }

  .nav-toggle,
  .theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    &:hover { border-color: var(--field); }
  }
  .theme-toggle svg {
    width: 1.1rem;
    height: 1.1rem;
    transition: transform 400ms cubic-bezier(0.3, 0.7, 0.2, 1);
  }
  :root[data-theme-effective="dark"] .theme-toggle svg { transform: rotate(180deg); }
  .nav-toggle-bars {
    display: grid;
    gap: 5px;
    width: 1.1rem;
    & span {
      display: block;
      height: 2px;
      background: currentColor;
      border-radius: 1px;
      transition: transform 220ms ease;
    }
  }
  .site-header:has(.site-nav:popover-open) .nav-toggle-bars span,
  .site-header.menu-open .nav-toggle-bars span {
    &:first-child { transform: translateY(3.5px) rotate(45deg); }
    &:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  }

  @media (max-width: 63.99rem) {
    .site-nav[popover] {
      position: fixed;
      inset: var(--header-h) 0 auto 0;
      width: 100%;
      max-width: none;
      height: auto;
      max-height: calc(100dvh - var(--header-h));
      margin: 0;
      padding: var(--s-3) var(--gutter) var(--s-7);
      overflow: auto;
      color: var(--ink);
      background: var(--paper);
      border: 0;
      border-block-end: 1px solid var(--line);
      box-shadow: 0 24px 45px var(--shadow-soft);
    }
    .site-nav[popover]::backdrop {
      inset-block-start: var(--header-h);
      background: oklch(10% 0 0 / 0.3);
    }
    .site-nav ul { display: grid; }
    .site-nav li { border-block-end: 1px solid var(--line); }
    .site-nav a:not(.button) {
      padding-block: 0.95rem;
      font-size: 1.25rem;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--ink);
    }
    .site-nav a[aria-current="page"] { color: var(--accent-text); }
    .site-nav .button { width: 100%; margin-block-start: var(--s-6); min-height: 3.25rem; }
    .no-popover .site-nav { display: none; }
    .no-popover .site-nav.is-open {
      display: block;
      position: fixed;
      inset: var(--header-h) 0 auto 0;
      padding: var(--s-3) var(--gutter) var(--s-7);
      background: var(--paper);
      border-block-end: 1px solid var(--line);
    }
  }
  @media (min-width: 64rem) {
    :root { --header-h: 5.25rem; }
    .nav-toggle { display: none; }
    .site-nav,
    .site-nav[popover] {
      display: flex;
      align-items: center;
      gap: 1.6rem;
      position: static;
      inset: auto;
      width: auto;
      height: auto;
      margin: 0 var(--s-2) 0 0;
      padding: 0;
      overflow: visible;
      color: inherit;
      background: none;
      border: 0;
    }
    .site-nav ul { display: flex; gap: clamp(1rem, 1.8vw, 1.45rem); }
    .site-nav a:not(.button) {
      padding-block: 0.6rem;
      font-size: 0.88rem;
      &::after {
        content: "";
        position: absolute;
        inset: auto 0 0.15rem 0;
        height: 2px;
        background: var(--tick);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 220ms ease;
      }
      &:hover::after, &[aria-current="page"]::after { transform: scaleX(1); }
      &:hover { color: var(--ink); }
    }
  }
  @media (min-width: 64rem) and (max-width: 74.99rem) {
    .site-nav .button { display: none; }
  }

  /* Photos: rounded, with the live site's offset gold frame */
  .photo {
    position: relative;
    isolation: isolate;
    margin: 0;
    & img {
      position: relative;
      z-index: 1;
      width: 100%;
      aspect-ratio: 4 / 5;
      object-fit: cover;
      border-radius: var(--radius);
      background: var(--paper-deep);
      filter: saturate(0.9);
    }
  }
  .photo--wide img { aspect-ratio: 4 / 3; }
  .photo--framed {
    margin-inline-start: var(--frame);
    margin-block-end: var(--frame);
    &::before {
      content: "";
      position: absolute;
      inset: var(--frame) var(--frame) calc(-1 * var(--frame)) calc(-1 * var(--frame));
      z-index: 0;
      border: 1.5px solid var(--gold);
      border-radius: calc(var(--radius) + 2px);
    }
  }

  /* Panel grid: one white panel divided into cells (the live site's card vocabulary) */
  .panel-wrap { container-type: inline-size; }
  .panel-grid {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px var(--shadow-soft);
    & > li, & > div {
      padding: clamp(1.4rem, 1rem + 1.5vw, 2rem);
      background: var(--panel);
    }
    & h3, & dt {
      margin-block-end: var(--s-2);
      font-size: var(--step-2);
      font-weight: 600;
      line-height: 1.3;
      letter-spacing: -0.01em;
      color: var(--ink);
    }
    & h3::before, & dt::before {
      content: "";
      display: block;
      width: 1.5rem;
      height: 2px;
      margin-block-end: var(--s-4);
      background: var(--tick);
    }
    & p, & dd { font-size: 1rem; line-height: 1.6; color: var(--ink-soft); }
    & > li:hover, & > div:hover { box-shadow: inset 0 3px 0 var(--gold); }
  }
  @container (min-width: 34rem) {
    .panel-grid--3, .panel-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @container (min-width: 58rem) {
    .panel-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  .section-title { max-width: 22ch; margin-block-end: clamp(2rem, 1.5rem + 2vw, 3rem); }

  /* Invitation band */
  .band { container-type: inline-size; padding-block: clamp(4.5rem, 3rem + 5vw, 7rem); }
  .band-grid { display: grid; gap: var(--s-5) var(--s-8); align-items: end; }
  @container (min-width: 52rem) {
    .band-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  }
  .band h2 { max-width: 16ch; }
  .band p { margin-block-end: var(--s-6); font-size: 1.1rem; }

  /* Footer */
  .site-footer {
    container-type: inline-size;
    padding-block: var(--s-7) var(--s-6);
    font-size: 0.875rem;
    color: var(--on-dark-soft);
    background: var(--footer);
    & a { color: var(--on-dark-soft); text-decoration: none; }
    & a:hover { color: var(--gold-light); }
  }
  .closing-rule {
    height: 1.25rem;
    margin-block-end: var(--s-7);
    color: var(--gold);
    background:
      linear-gradient(currentColor 0 0) 0 50% / 100% 1px no-repeat,
      linear-gradient(currentColor 0 0) 0 0 / 2px 100% no-repeat,
      linear-gradient(currentColor 0 0) 100% 0 / 2px 100% no-repeat;
    opacity: 0.8;
  }
  .footer-grid {
    display: grid;
    gap: var(--s-6) var(--s-5);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-intro, .footer-connect { grid-column: 1 / -1; }
  @container (min-width: 56rem) {
    .footer-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 3fr); }
    .footer-intro, .footer-connect { grid-column: auto; }
  }
  .footer-brand { display: inline-flex; align-items: center; gap: 0.7rem; margin-inline-end: 0; }
  .footer-brand .brand-mark { width: 1.85rem; color: var(--gold-light); }
  .footer-brand strong { color: var(--on-dark); }
  .footer-brand small { color: var(--gold-light); }
  .footer-positioning {
    margin-block-start: var(--s-5);
    max-width: 24rem;
    line-height: 1.65;
    color: var(--on-dark-soft);
  }
  .footer-heading {
    margin-block-end: var(--s-3);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--on-dark);
  }
  .footer-col { display: grid; align-content: start; gap: 0.1rem; }
  .footer-col a, .footer-link { display: flex; align-items: center; min-height: 2.75rem; }
  .footer-col a { overflow-wrap: break-word; }
  .footer-link {
    justify-self: start;
    padding: 0;
    font: inherit;
    text-align: left;
    color: var(--on-dark-soft);
    background: none;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    &:hover { color: var(--gold-light); }
  }
  .footer-bottom {
    margin-block-start: var(--s-6);
    padding-block-start: var(--s-5);
    border-block-start: 1px solid var(--dark-line);
    font-size: 0.8rem;
    color: var(--on-dark-soft);
  }

  /* Analytics consent: native non-modal dialog, laid out like the live site's banner */
  .consent {
    position: fixed;
    inset: auto var(--s-4) var(--s-4);
    z-index: 60;
    width: auto;
    max-width: 60rem;
    margin-inline: auto;
    padding: 1.15rem 1.25rem;
    color: var(--ink);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 20px 80px var(--shadow-color);
    & strong { display: block; font-size: 1rem; }
    & p { margin-block: 0.25rem var(--s-4); font-size: 0.86rem; line-height: 1.55; }
  }
  @media (min-width: 48rem) {
    .consent[open] { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s-6); align-items: center; }
    .consent p { margin-block-end: 0; grid-column: 1; }
    .consent strong { grid-column: 1; }
    .consent .consent-actions { grid-column: 2; grid-row: 1 / span 2; }
  }
  .consent-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
  .button-secondary {
    color: var(--ink);
    background: transparent;
    border-color: var(--ink);
    &:hover { color: var(--accent-text); background: transparent; border-color: var(--accent-text); }
  }
  body:has(.consent[open]) .site-footer { padding-block-end: 13rem; }
  @media (min-width: 48rem) {
    body:has(.consent[open]) .site-footer { padding-block-end: 8rem; }
  }

  /* The signature: a dimension line measuring the span from priority to result */
  .dimension {
    --n: 4;
    container-type: inline-size;
    position: relative;
    overflow: clip;
    padding-inline-end: 0.75rem;
  }
  .dimension__track { position: relative; pointer-events: none; }
  .dimension__line { position: absolute; inset: 0; color: var(--tick); }
  .dimension__cursor {
    position: absolute;
    inset: 0;
    &::before {
      content: "";
      position: absolute;
      width: 0.8rem;
      height: 0.8rem;
      border-radius: 50%;
      background: var(--tick);
      box-shadow: 0 0 0 4px var(--surface, var(--paper));
    }
  }
  .dimension__steps { display: grid; gap: var(--s-6); margin: 0; list-style: none; }
  .dimension__step { position: relative; }
  .dimension__step h3 { margin-block-end: var(--s-3); }
  .dimension__step p { color: var(--ink-soft); font-size: 1rem; }

  /* Narrow: the line runs down the left edge; each step gets its own station tick. */
  .dimension__steps { padding-inline-start: 2.75rem; padding-block-end: 1rem; }
  .dimension__track {
    position: absolute;
    inset-block: 0.5rem 1rem;
    inset-inline-start: 0.25rem;
    width: 1.1rem;
  }
  .dimension__line {
    background:
      linear-gradient(currentColor 0 0) 50% 0 / 2px 100% no-repeat,
      linear-gradient(currentColor 0 0) 0 0 / 100% 2px no-repeat,
      linear-gradient(currentColor 0 0) 0 100% / 100% 2px no-repeat;
    clip-path: inset(0 0 calc(100% - var(--draw)) 0);
  }
  .dimension__cursor {
    transform: translateY(var(--draw));
    &::before { top: -0.4rem; left: calc(50% - 0.4rem); }
  }
  .dimension__step::before {
    content: "";
    position: absolute;
    top: 0.55rem;
    left: -2.4rem;
    width: 1rem;
    height: 2px;
    background: var(--tick);
  }

  /* Wide: the line runs across the top; station ticks are part of the line itself. */
  @container (min-width: 50rem) {
    .dimension__steps { padding: 0; }
    .dimension__track {
      position: relative;
      inset: auto;
      width: auto;
      height: 2.25rem;
      margin-block-end: var(--s-5);
    }
    .dimension__line {
      background:
        linear-gradient(currentColor 0 0) 0 50% / 100% 2px no-repeat,
        linear-gradient(currentColor 0 0) 0 0 / 2px 100% no-repeat,
        linear-gradient(currentColor 0 0) 25% 50% / 2px 1rem no-repeat,
        linear-gradient(currentColor 0 0) 50% 50% / 2px 1rem no-repeat,
        linear-gradient(currentColor 0 0) 75% 50% / 2px 1rem no-repeat,
        linear-gradient(currentColor 0 0) 100% 0 / 2px 100% no-repeat;
      clip-path: inset(-2px calc(100% - var(--draw)) -2px 0);
    }
    .dimension__cursor {
      transform: translateX(var(--draw));
      &::before { top: calc(50% - 0.4rem); left: -0.4rem; }
    }
    .dimension__steps { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0; }
    .dimension__step { padding-inline-end: var(--s-6); }
    .dimension__step::before { display: none; }
  }

  /* Decorative rule (Home): always horizontal, no steps or labels. */
  .dimension--rule .dimension__track {
    position: relative;
    inset: auto;
    width: auto;
    height: 2.25rem;
  }
  .dimension--rule .dimension__line {
    background:
      linear-gradient(currentColor 0 0) 0 50% / 100% 2px no-repeat,
      linear-gradient(currentColor 0 0) 0 0 / 2px 100% no-repeat,
      linear-gradient(currentColor 0 0) 25% 50% / 2px 1rem no-repeat,
      linear-gradient(currentColor 0 0) 50% 50% / 2px 1rem no-repeat,
      linear-gradient(currentColor 0 0) 75% 50% / 2px 1rem no-repeat,
      linear-gradient(currentColor 0 0) 100% 0 / 2px 100% no-repeat;
    clip-path: inset(-2px calc(100% - var(--draw)) -2px 0);
  }
  .dimension--rule .dimension__cursor {
    transform: translateX(var(--draw));
    &::before { top: calc(50% - 0.4rem); left: -0.4rem; }
  }

  /* Forms */
  .form-card {
    padding: clamp(1.25rem, 0.6rem + 3vw, 2.5rem);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px var(--shadow-soft);
  }
  .contact-form { container-type: inline-size; }
  .form-grid { display: grid; gap: 1.35rem; }
  @container (min-width: 34rem) {
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field--full { grid-column: 1 / -1; }
  }
  .field label,
  .human-check-label {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.3rem;
    margin-block-end: 0.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
  }
  .optional { margin-inline-start: auto; font-size: 0.78rem; font-weight: 500; color: var(--ink-soft); }
  .field-help { margin-block: -0.1rem 0.45rem; font-size: 0.84rem; color: var(--ink-soft); }
  .contact-form input:not([type="checkbox"]),
  .contact-form select,
  .contact-form textarea {
    display: block;
    width: 100%;
    min-height: 3rem;
    padding: 0.72rem 0.8rem;
    font-size: 1rem;
    line-height: 1.45;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--field);
    border-radius: var(--radius-sm);
    &:hover { border-color: var(--ink); }
    &:focus-visible { outline-offset: 2px; }
    &[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
  }
  .contact-form textarea { min-height: 11rem; resize: vertical; }
  .contact-form select {
    appearance: none;
    padding-inline-end: 2.5rem;
    background-image:
      linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
      linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
    background-position: calc(100% - 1.15rem) 52%, calc(100% - 0.8rem) 52%;
    background-size: 0.36rem 0.36rem;
    background-repeat: no-repeat;
  }
  .field:has([aria-invalid="true"]) label { color: var(--error); }
  .field-error {
    display: block;
    margin-block-start: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--error);
    &:empty { display: none; }
  }
  .consent-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
    margin-block-start: var(--s-6);
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ink-soft);
    cursor: pointer;
    & input { width: 1.2rem; height: 1.2rem; margin: 0.15rem 0 0; accent-color: var(--gold-dark); }
  }
  .human-check {
    margin-block-start: var(--s-6);
    padding: var(--s-5);
    background: var(--paper-deep);
    border-radius: var(--radius-sm);
    & .field-help { margin-block: var(--s-3) 0; }
  }
  #contact-turnstile { min-height: 65px; }
  #contact-turnstile[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 4px; border-radius: 4px; }
  .submit-button { margin-block-start: var(--s-6); min-width: 15rem; }
  @container (max-width: 34rem) {
    .submit-button { width: 100%; }
  }
  .form-error-summary {
    margin-block-end: var(--s-6);
    padding: var(--s-4) var(--s-5);
    font-size: 0.92rem;
    color: var(--ink);
    background: var(--error-bg);
    border: 2px solid var(--error);
    border-radius: 10px;
    & ul { margin: var(--s-2) 0 0; padding-inline-start: 1.2rem; }
    & a { color: var(--error); font-weight: 600; }
    &:focus-visible { outline-color: var(--error); }
  }
  .form-status {
    margin-block-start: var(--s-4);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--error);
    &:empty { display: none; }
  }
  .honeypot { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
  .no-script { margin-block-start: var(--s-4); font-size: 0.9rem; }
}

/* ---------- Pages ---------- */
@layer pages {
  /* Home hero */
  .hero-home {
    padding-block: clamp(3rem, 2rem + 5vw, 6.5rem);
    border-block-end: 1px solid var(--line);
  }
  .hero-home .hero-grid {
    display: grid;
    gap: var(--s-6);
    grid-template-areas: "head" "body" "figure";
  }
  .hero-home .hero-head { grid-area: head; }
  .hero-home .hero-body { grid-area: body; }
  .hero-home .photo { grid-area: figure; width: min(100% - var(--frame), 22rem); }
  .hero-home h1 { font-size: var(--step-5); line-height: 1.08; max-width: 17ch; }
  .hero-home .actions { margin-block-start: var(--s-6); }
  .trust-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-block-start: var(--s-6);
    font-size: 0.9rem;
    color: var(--ink-soft);
    &::before { content: ""; flex: none; width: 1.6rem; height: 1px; background: var(--gold); }
  }
  @media (max-width: 29.99rem) {
    .hero-home .actions .button { width: 100%; }
  }
  @media (min-width: 44rem) {
    .hero-home .hero-grid {
      grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr);
      grid-template-areas: "head figure" "body figure";
      grid-template-rows: auto 1fr;
      column-gap: clamp(2.5rem, 6vw, 6rem);
      row-gap: var(--s-5);
      align-items: start;
    }
    .hero-home .photo { width: auto; max-width: 23rem; align-self: center; justify-self: end; }
  }

  /* Interior page hero */
  .page-hero {
    padding-block: clamp(3.5rem, 2rem + 5vw, 7rem) clamp(3rem, 2rem + 4vw, 5.5rem);
    border-block-end: 1px solid var(--line);
  }
  .page-hero h1 { max-width: 18ch; }
  .page-hero .lede { margin-block-start: var(--s-6); }
  @media (min-width: 60rem) {
    .page-hero--asym .container {
      display: grid;
      grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
      column-gap: clamp(2rem, 5vw, 6rem);
      align-items: end;
    }
    .page-hero--asym .lede { margin-block-start: 0; padding-block-end: 0.5rem; }
  }
  .page-hero--split .hero-grid {
    display: grid;
    gap: var(--s-7);
    grid-template-areas: "head" "figure" "body";
  }
  .page-hero--split .hero-head { grid-area: head; }
  .page-hero--split .hero-body { grid-area: body; }
  .page-hero--split .photo { grid-area: figure; width: min(100% - var(--frame), 26rem); }
  .page-hero--split .photo--wide { width: min(100% - var(--frame), 32rem); }
  .page-hero--split h1 { max-width: 16ch; }
  .page-hero--split .lede { margin-block-start: 0; }
  .hero-body > p + p { margin-block-start: var(--s-4); }
  @media (min-width: 60rem) {
    .page-hero--split .hero-grid {
      grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr);
      grid-template-areas: "head figure" "body figure";
      grid-template-rows: auto 1fr;
      column-gap: clamp(2.5rem, 6vw, 6rem);
      row-gap: var(--s-5);
    }
    .page-hero--split .photo, .page-hero--split .photo--wide { width: auto; max-width: 26rem; align-self: center; justify-self: end; }
  }

  .split-heading h2 { max-width: 16ch; }
  .split-body > * + * { margin-block-start: var(--s-5); }
  .split-body .text-link { margin-block-start: var(--s-4); }
  .large-prose { font-size: var(--step-1); line-height: 1.6; }
  .section--dark .large-prose { color: var(--on-dark); }
  .section-dimension { margin-block-start: clamp(3rem, 2rem + 3vw, 5rem); }

  .path-section h2 { max-width: 18ch; margin-block-end: clamp(2.5rem, 1.5rem + 3vw, 4rem); }

  /* Contact */
  .contact-layout { display: grid; gap: var(--s-7) var(--s-8); }
  @media (min-width: 60rem) {
    .contact-layout { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: start; }
    .contact-aside { position: sticky; top: calc(var(--header-h) + 2rem); }
  }
  .contact-aside p { margin-block-start: var(--s-4); }
  .prefer-email { font-weight: 600; color: var(--ink); }

  /* Legal pages: clause layout */
  .legal-header {
    padding-block: clamp(3.5rem, 2rem + 5vw, 6.5rem) clamp(2rem, 1.5rem + 2vw, 3rem);
  }
  .legal-header .lede { margin-block-start: var(--s-5); }
  .updated { margin-block-start: var(--s-5); font-size: 0.85rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .clauses { container-type: inline-size; padding-block-end: var(--section-y); }
  .clause {
    display: grid;
    gap: var(--s-3) var(--s-8);
    padding-block: var(--s-6);
    border-block-start: 1px solid var(--line);
  }
  .clause h2 { font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.75rem); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
  .clause p { max-width: 42rem; }
  .clause ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-2); max-width: 42rem; }
  .clause li {
    position: relative;
    padding-inline-start: 1.5rem;
    color: var(--ink-soft);
    &::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 0.75rem; height: 2px; background: var(--tick); }
  }
  @container (min-width: 46rem) {
    .clause { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  }

  /* Status pages: thank-you, 404 */
  .status-page {
    display: grid;
    align-items: center;
    min-height: min(65vh, 44rem);
    padding-block: var(--section-y);
  }
  .status-page h1 { max-width: 16ch; }
  .status-page .lede { margin-block-start: var(--s-5); }
  .status-page .actions { margin-block-start: var(--s-7); }
  .status-code {
    margin-block-end: var(--s-2);
    font-size: clamp(5rem, 3rem + 9vw, 10rem);
    font-weight: 700;
    line-height: 0.85;
    letter-spacing: -0.06em;
    color: var(--line);
  }
}

/* ---------- Motion (non-essential; transform, opacity, clip-path only) ---------- */
@layer motion {
  @keyframes reveal-up {
    from { opacity: 0; transform: translateY(1.25rem); }
    to { opacity: 1; transform: none; }
  }
  @keyframes draw-line {
    from { --draw: 0%; }
    to { --draw: 100%; }
  }
  @keyframes tick-in {
    from { opacity: 0; transform: scaleX(0.2); }
    to { opacity: 1; transform: none; }
  }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-0.5rem); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(0.75rem); } }

  @media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
    ::view-transition-old(root) { animation: vt-out 160ms ease-in both; }
    ::view-transition-new(root) { animation: vt-in 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }

    @supports (animation-timeline: view()) {
      .reveal {
        animation: reveal-up linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 7rem;
      }
      .dimension { view-timeline: --dimension block; }
      .dimension__track {
        animation: draw-line linear both;
        animation-timeline: --dimension;
        animation-range: entry 55% cover 50%;
      }
      .dimension__step::before {
        transform-origin: left;
        animation: tick-in linear both;
        animation-timeline: view();
        animation-range: entry 30% entry 80%;
      }
    }

    .js-reveal .reveal {
      opacity: 0;
      transform: translateY(1.25rem);
      transition: opacity 600ms ease, transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
    }
    .js-reveal .reveal.is-in { opacity: 1; transform: none; }
    .js-dimension .dimension__track {
      --draw: 0%;
      transition: --draw 1600ms cubic-bezier(0.4, 0.1, 0.2, 1);
    }
    .js-dimension .dimension.is-drawn .dimension__track { --draw: 100%; }
  }

  .no-at-property .dimension__track { --draw: 100% !important; animation: none !important; transition: none !important; }
  .no-at-property .dimension__cursor { display: none; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
    .dimension__track { --draw: 100% !important; animation: none !important; }
  }
}

/* ---------- Utilities ---------- */
@layer utilities {
  .nowrap { white-space: nowrap; }
  .sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  @media print {
    .site-header, .consent, .nav-toggle, .theme-toggle, .band .button { display: none !important; }
    .section--dark, .site-footer { background: none; --ink: #000; --ink-soft: #222; color: #000; }
    body { font-size: 11pt; }
  }
}
