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

@property --fade-start {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

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

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

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }

  body {
    margin: 0;
  }

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

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

  figure {
    margin: 0;
  }
}

@layer tokens {
  @font-face {
    font-family: "Geist";
    src: url("/assets/fonts/geist-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: "Geist Mono";
    src: url("/assets/fonts/geist-mono-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: "Instrument Serif";
    src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
  }

  :root {
    color-scheme: light dark;

    /* Raw palette pairs: Warm Alabaster (Light) + Neutral Obsidian (Dark) */
    --bg-light: #fafaf9;
    --bg-dark: #0c0c0b;
    --surface-light: #ffffff;
    --surface-dark: #141413;
    --surface-subtle-light: #f3f2ee;
    --surface-subtle-dark: #1b1b19;
    --surface-hover-light: #eae8e2;
    --surface-hover-dark: #242421;

    --ink-light: #141413;
    --ink-dark: #f5f5f3;
    --ink-secondary-light: #4a4843;
    --ink-secondary-dark: #c5c2ba;
    --ink-muted-light: #69665f;
    --ink-muted-dark: #949087;

    --border-light: rgba(20, 20, 19, 0.11);
    --border-dark: rgba(245, 245, 243, 0.11);
    --border-strong-light: rgba(20, 20, 19, 0.22);
    --border-strong-dark: rgba(245, 245, 243, 0.22);

    --btn-bg-light: #141413;
    --btn-bg-dark: #f5f5f3;
    --btn-ink-light: #fafaf9;
    --btn-ink-dark: #0c0c0b;
    --btn-bg-hover-light: #2b2b28;
    --btn-bg-hover-dark: #e0dfd8;

    --accent-light: #1d4ed8;
    --accent-dark: #60a5fa;
    --safe-light: #047857;
    --safe-dark: #34d399;
    --amber-light: #b45309;
    --amber-dark: #fbbf24;
    --leak-light: #b91c1c;
    --leak-dark: #f87171;

    --shadow-specimen-light: 0 1px 2px rgba(20, 20, 19, 0.04), 0 14px 36px -16px rgba(20, 20, 19, 0.12);
    --shadow-specimen-dark: 0 1px 0 rgba(245, 245, 243, 0.05) inset, 0 18px 40px -16px rgba(0, 0, 0, 0.65);
    --shadow-dialog-light: 0 24px 64px -16px rgba(20, 20, 19, 0.22), 0 2px 8px rgba(20, 20, 19, 0.08);
    --shadow-dialog-dark: 0 24px 64px -12px rgba(0, 0, 0, 0.78), 0 0 0 1px rgba(245, 245, 243, 0.08);

    /* Semantic defaults (Light fallback for pre-light-dark engines) */
    --bg: var(--bg-light);
    --surface: var(--surface-light);
    --surface-subtle: var(--surface-subtle-light);
    --surface-hover: var(--surface-hover-light);
    --ink: var(--ink-light);
    --ink-secondary: var(--ink-secondary-light);
    --ink-muted: var(--ink-muted-light);
    --border: var(--border-light);
    --border-strong: var(--border-strong-light);
    --btn-bg: var(--btn-bg-light);
    --btn-ink: var(--btn-ink-light);
    --btn-bg-hover: var(--btn-bg-hover-light);
    --accent: var(--accent-light);
    --safe: var(--safe-light);
    --amber: var(--amber-light);
    --leak: var(--leak-light);
    --shadow-specimen: var(--shadow-specimen-light);
    --shadow-dialog: var(--shadow-dialog-light);

    --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
    --font-mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --container-max: 1200px;
    --container-narrow: 820px;

    &:has(> head > meta[name="color-scheme"][content="dark"]) {
      color-scheme: dark;
    }
    &:has(> head > meta[name="color-scheme"][content="light"]) {
      color-scheme: light;
    }
  }

  @supports (color: light-dark(#fff, #000)) {
    :root {
      --bg: light-dark(var(--bg-light), var(--bg-dark));
      --surface: light-dark(var(--surface-light), var(--surface-dark));
      --surface-subtle: light-dark(var(--surface-subtle-light), var(--surface-subtle-dark));
      --surface-hover: light-dark(var(--surface-hover-light), var(--surface-hover-dark));
      --ink: light-dark(var(--ink-light), var(--ink-dark));
      --ink-secondary: light-dark(var(--ink-secondary-light), var(--ink-secondary-dark));
      --ink-muted: light-dark(var(--ink-muted-light), var(--ink-muted-dark));
      --border: light-dark(var(--border-light), var(--border-dark));
      --border-strong: light-dark(var(--border-strong-light), var(--border-strong-dark));
      --btn-bg: light-dark(var(--btn-bg-light), var(--btn-bg-dark));
      --btn-ink: light-dark(var(--btn-ink-light), var(--btn-ink-dark));
      --btn-bg-hover: light-dark(var(--btn-bg-hover-light), var(--btn-bg-hover-dark));
      --accent: light-dark(var(--accent-light), var(--accent-dark));
      --safe: light-dark(var(--safe-light), var(--safe-dark));
      --amber: light-dark(var(--amber-light), var(--amber-dark));
      --leak: light-dark(var(--leak-light), var(--leak-dark));
    }
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: var(--bg-dark);
      --surface: var(--surface-dark);
      --surface-subtle: var(--surface-subtle-dark);
      --surface-hover: var(--surface-hover-dark);
      --ink: var(--ink-dark);
      --ink-secondary: var(--ink-secondary-dark);
      --ink-muted: var(--ink-muted-dark);
      --border: var(--border-dark);
      --border-strong: var(--border-strong-dark);
      --btn-bg: var(--btn-bg-dark);
      --btn-ink: var(--btn-ink-dark);
      --btn-bg-hover: var(--btn-bg-hover-dark);
      --accent: var(--accent-dark);
      --safe: var(--safe-dark);
      --amber: var(--amber-dark);
      --leak: var(--leak-dark);
      --shadow-specimen: var(--shadow-specimen-dark);
      --shadow-dialog: var(--shadow-dialog-dark);
    }
  }

  :root[data-theme="light"] {
    color-scheme: light;
    --bg: var(--bg-light);
    --surface: var(--surface-light);
    --surface-subtle: var(--surface-subtle-light);
    --surface-hover: var(--surface-hover-light);
    --ink: var(--ink-light);
    --ink-secondary: var(--ink-secondary-light);
    --ink-muted: var(--ink-muted-light);
    --border: var(--border-light);
    --border-strong: var(--border-strong-light);
    --btn-bg: var(--btn-bg-light);
    --btn-ink: var(--btn-ink-light);
    --btn-bg-hover: var(--btn-bg-hover-light);
    --accent: var(--accent-light);
    --safe: var(--safe-light);
    --amber: var(--amber-light);
    --leak: var(--leak-light);
    --shadow-specimen: var(--shadow-specimen-light);
    --shadow-dialog: var(--shadow-dialog-light);
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-subtle: var(--surface-subtle-dark);
    --surface-hover: var(--surface-hover-dark);
    --ink: var(--ink-dark);
    --ink-secondary: var(--ink-secondary-dark);
    --ink-muted: var(--ink-muted-dark);
    --border: var(--border-dark);
    --border-strong: var(--border-strong-dark);
    --btn-bg: var(--btn-bg-dark);
    --btn-ink: var(--btn-ink-dark);
    --btn-bg-hover: var(--btn-bg-hover-dark);
    --accent: var(--accent-dark);
    --safe: var(--safe-dark);
    --amber: var(--amber-dark);
    --leak: var(--leak-dark);
    --shadow-specimen: var(--shadow-specimen-dark);
    --shadow-dialog: var(--shadow-dialog-dark);
  }
}

@layer base {
  html {
    accent-color: var(--accent);
  }

  body {
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    font-size-adjust: from-font;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
  }

  ::selection {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--ink);
  }

  a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
  }

  a:hover {
    text-decoration-thickness: 2px;
  }

  code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.08em 0.34em;
  }

  h1, h2, h3, h4 {
    margin: 0;
    color: var(--ink);
    letter-spacing: -0.025em;
    line-height: 1.18;
  }

  p {
    margin: 0;
  }

  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
}

@layer layout {
  .container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 24px;
  }

  .container-narrow {
    max-width: var(--container-narrow);
  }

  /* Architectural Drafting Frame (Zed x Vercel subtle 1px rails + intersection crosshairs) */
  .arch-frame {
    position: relative;
  }

  .arch-section {
    position: relative;
  }

  @media (min-width: 1248px) {
    .arch-frame {
      max-width: var(--container-max);
      margin-inline: auto;
      border-inline: 1px solid var(--border);
    }

    .arch-section:not(:first-child)::before,
    .arch-section:not(:first-child)::after {
      content: "+";
      position: absolute;
      top: -10px;
      width: 19px;
      height: 19px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 300;
      line-height: 1;
      color: var(--ink-muted);
      background: var(--bg);
      pointer-events: none;
      user-select: none;
      z-index: 3;
    }

    .arch-section:not(:first-child)::before {
      left: -10px;
    }

    .arch-section:not(:first-child)::after {
      right: -10px;
    }
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
  }

  .site-footer {
    border-top: 1px solid var(--border);
    padding-block: 32px 44px;
    margin-top: 64px;
    background: var(--surface);
  }

  .footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    font-size: 13px;
    color: var(--ink-secondary);
  }
}

@layer components {
  .skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    padding: 8px 12px;
    background: var(--btn-bg);
    color: var(--btn-ink);
    border-radius: var(--radius-sm);
    z-index: 100;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
  }

  .skip-link:focus {
    left: 12px;
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 650;
    font-size: 15px;
    letter-spacing: -0.02em;
    flex-shrink: 0;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .site-nav {
    display: flex;
    align-items: center;
  }

  .nav-list {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .nav-list a {
    color: var(--ink-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.14s ease;
  }

  .nav-list a:hover {
    color: var(--ink);
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }

  .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-secondary);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  .theme-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--ink);
  }

  .theme-toggle svg {
    width: 17px;
    height: 17px;
  }

  :root:not([data-theme="dark"]) .icon-sun { display: none; }
  :root[data-theme="dark"] .icon-moon { display: none; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-moon { display: none; }
    :root:not([data-theme="light"]) .icon-sun { display: block; }
  }

  .nav-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, scale 0.12s ease;
  }

  .nav-search-trigger:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--ink);
  }

  .nav-search-trigger svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
  }

  .nav-search-kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 550;
    line-height: 1.1;
    padding: 2px 5px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: var(--surface-subtle);
    color: var(--ink-muted);
  }

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 580;
    letter-spacing: -0.005em;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, scale 0.12s ease;
  }

  .btn-sm {
    padding: 7px 12px;
    font-size: 13px;
  }

  .btn-xs {
    padding: 5px 10px;
    font-size: 12.5px;
  }

  .btn-primary {
    background: var(--btn-bg);
    color: var(--btn-ink);
  }

  .btn-primary:hover {
    background: var(--btn-bg-hover);
  }

  .btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border-strong);
  }

  .btn-secondary:hover {
    background: var(--btn-bg);
    border-color: var(--btn-bg);
    color: var(--btn-ink);
  }

  .btn-ghost {
    background: transparent;
    color: var(--ink-secondary);
    border-color: var(--border);
  }

  .btn-ghost:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--ink);
  }

  .btn-quiet {
    background: transparent;
    color: var(--ink-secondary);
    border-color: transparent;
    font-weight: 520;
  }

  .btn-quiet:hover {
    background: var(--surface-hover);
    color: var(--ink);
  }

  .btn-ledger-cta {
    background: var(--surface-subtle);
    color: var(--ink);
    border-color: var(--border-strong);
    font-weight: 600;
  }

  .btn-ledger-cta:hover {
    background: var(--btn-bg);
    border-color: var(--btn-bg);
    color: var(--btn-ink);
  }

  @media (prefers-reduced-motion: no-preference) {
    .btn:active,
    .filter-tab:active,
    .theme-toggle:active,
    .nav-search-trigger:active {
      scale: 0.98;
    }
  }

  /* Frontier Editorial Masthead + Interactive Studio Stage */
  .hero {
    padding-block: clamp(32px, 4vw, 52px) clamp(36px, 4.5vw, 56px);
    background-image: radial-gradient(64% 48% at 50% 0%, rgba(20, 20, 19, 0.025), transparent 72%);
  }

  :root[data-theme="dark"] .hero {
    background-image: radial-gradient(64% 48% at 50% 0%, rgba(255, 255, 255, 0.048), transparent 72%);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hero {
      background-image: radial-gradient(64% 48% at 50% 0%, rgba(255, 255, 255, 0.048), transparent 72%);
    }
  }

  .hero-masthead {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: end;
    margin-bottom: clamp(24px, 3vw, 34px);
  }

  @media (min-width: 920px) {
    .hero-masthead {
      grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.88fr);
      gap: 36px;
    }
  }

  .hero-masthead h1 {
    font-family: var(--font-sans);
    font-size: clamp(2.25rem, 1.6rem + 2.25vw, 3.5rem);
    font-weight: 470;
    line-height: 1.04;
    letter-spacing: -0.038em;
    color: var(--ink);
  }

  .serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.15em;
    letter-spacing: -0.012em;
    color: var(--ink-secondary);
  }

  .hero-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 4px;
  }

  .hero-lead {
    font-size: 0.96875rem;
    line-height: 1.56;
    letter-spacing: -0.008em;
    color: var(--ink-secondary);
    max-width: 42ch;
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
  }

  .hero-text-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-secondary);
    text-decoration: none;
    transition: color 0.14s ease;
  }

  .hero-text-link:hover {
    color: var(--ink);
    text-decoration: underline;
  }

  /* Unified Interactive Studio Stage */
  .hero-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-specimen);
  }

  :root[data-theme="dark"] .hero-stage {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 56px -20px rgba(0, 0, 0, 0.72);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hero-stage {
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 56px -20px rgba(0, 0, 0, 0.72);
    }
  }

  @media (min-width: 960px) {
    .hero-stage {
      grid-template-columns: 324px minmax(0, 1fr);
    }
  }

  .stage-rail {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    background: var(--surface);
  }

  @media (min-width: 960px) {
    .stage-rail {
      border-top: 0;
      border-right: 1px solid var(--border);
    }
  }

  .stage-rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
  }

  .stage-rail-counter {
    font-variant-numeric: tabular-nums;
    color: var(--ink-secondary);
  }

  .stage-tablist {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
  }

  .stage-tablist::-webkit-scrollbar {
    display: none;
  }

  @media (min-width: 960px) {
    .stage-tablist {
      flex-direction: column;
      overflow-x: visible;
      border-bottom: 0;
    }
  }

  .stage-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 11px 14px;
    border: 0;
    border-right: 1px solid var(--border);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.14s ease, color 0.14s ease;
  }

  .stage-tab:last-child {
    border-right: 0;
  }

  .stage-tab[aria-selected="true"]::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    border-block-end: 2px solid var(--ink);
  }

  .stage-tab-desc,
  .stage-tab-price,
  .stage-tab-arrow {
    display: none;
  }

  @media (min-width: 960px) {
    .stage-tab {
      display: grid;
      grid-template-columns: 24px minmax(0, 1fr) auto 14px;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 12px 16px;
      border-right: 0;
      border-bottom: 1px solid var(--border);
    }

    .stage-tab[aria-selected="true"]::before {
      inset-inline: 0 auto;
      inset-block: 0;
      border-block-end: 0;
      border-inline-start: 2px solid var(--ink);
    }

    .stage-tab-desc,
    .stage-tab-price,
    .stage-tab-arrow {
      display: inline;
    }
  }

  .stage-tab:hover {
    background: var(--surface-subtle);
  }

  .stage-tab[aria-selected="true"] {
    background: var(--surface-subtle);
  }

  .stage-tab-num {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    color: var(--ink-muted);
    transition: color 0.14s ease;
  }

  .stage-tab[aria-selected="true"] .stage-tab-num {
    color: var(--ink);
    font-weight: 600;
  }

  .stage-tab-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .stage-tab-name {
    font-size: 13.5px;
    font-weight: 560;
    letter-spacing: -0.015em;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stage-tab-desc {
    font-size: 12px;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stage-tab-price {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    color: var(--ink-secondary);
    white-space: nowrap;
  }

  .stage-tab-arrow {
    font-size: 12.5px;
    color: var(--ink-muted);
    opacity: 0.28;
    transition: opacity 0.14s ease, transform 0.14s ease, color 0.14s ease;
  }

  .stage-tab:hover .stage-tab-arrow,
  .stage-tab[aria-selected="true"] .stage-tab-arrow {
    opacity: 1;
    color: var(--ink);
    transform: translateX(2px);
  }

  .stage-dock {
    margin-top: auto;
    padding: 15px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface);
  }

  @media (max-width: 959px) {
    .stage-rail-head {
      display: none;
    }

    .stage-viewport-col {
      order: -1;
    }

    .stage-dock {
      border-top: 0;
    }
  }

  .stage-dock-caption {
    font-size: 12.75px;
    line-height: 1.5;
    color: var(--ink-secondary);
  }

  .stage-dock-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .stage-dock-link {
    font-size: 12.5px;
    font-weight: 520;
    color: var(--ink-secondary);
    text-decoration: none;
    transition: color 0.14s ease;
  }

  .stage-dock-link:hover {
    color: var(--ink);
    text-decoration: underline;
  }

  .stage-viewport-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface-subtle);
  }

  .stage-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 38px;
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  .stage-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .stage-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface-subtle);
  }

  .stage-path {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stage-inspect-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid transparent;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-secondary);
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  }

  .stage-inspect-btn:hover {
    background: var(--surface-subtle);
    border-color: var(--border);
    color: var(--ink);
  }

  .stage-frame-wrap {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
  }

  .stage-media-link {
    display: block;
    width: 100%;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
  }

  .stage-media-link img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    opacity: 1;
  }

  @media (prefers-reduced-motion: no-preference) {
    .stage-media-link img {
      transition: opacity 180ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 220ms ease;
    }

    .stage-media-link img.is-swapping {
      opacity: 0.72;
    }

    .stage-media-link:hover img {
      transform: scale(1.008);
    }
  }

  /* Dark-mode matte bezel & glare dampening on light-canvas product screenshots */
  :root[data-theme="dark"] .stage-viewport-col,
  :root[data-theme="dark"] .stage-media-link,
  :root[data-theme="dark"] .showcase-media,
  :root[data-theme="dark"] .dialog-media,
  :root[data-theme="dark"] .screenshot-frame {
    background: #161614;
  }

  :root[data-theme="dark"] img[data-canvas="light"] {
    filter: brightness(0.91) contrast(1.02);
  }

  :root[data-theme="dark"] .stage-media-link:hover img[data-canvas="light"],
  :root[data-theme="dark"] .showcase-card:hover img[data-canvas="light"],
  :root[data-theme="dark"] .dialog-media:hover img[data-canvas="light"],
  :root[data-theme="dark"] .screenshot-frame:hover img[data-canvas="light"] {
    filter: brightness(0.97) contrast(1.01);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .stage-viewport-col,
    :root:not([data-theme="light"]) .stage-media-link,
    :root:not([data-theme="light"]) .showcase-media,
    :root:not([data-theme="light"]) .dialog-media,
    :root:not([data-theme="light"]) .screenshot-frame {
      background: #161614;
    }

    :root:not([data-theme="light"]) img[data-canvas="light"] {
      filter: brightness(0.91) contrast(1.02);
    }

    :root:not([data-theme="light"]) .stage-media-link:hover img[data-canvas="light"],
    :root:not([data-theme="light"]) .showcase-card:hover img[data-canvas="light"],
    :root:not([data-theme="light"]) .dialog-media:hover img[data-canvas="light"],
    :root:not([data-theme="light"]) .screenshot-frame:hover img[data-canvas="light"] {
      filter: brightness(0.97) contrast(1.01);
    }
  }

  .specimen-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    padding: 10px 4px 2px;
  }

  .specimen-meta {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
  }

  .specimen-name {
    font-weight: 630;
    font-size: 13.5px;
    color: var(--ink);
    text-decoration: none;
  }

  .specimen-name:hover {
    text-decoration: underline;
  }

  .specimen-sep {
    color: var(--ink-muted);
    font-size: 12px;
  }

  .specimen-badge {
    font-size: 12.5px;
    color: var(--ink-muted);
  }

  .specimen-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
  }

  .specimen-price {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 540;
    color: var(--ink-secondary);
    font-variant-numeric: tabular-nums;
    padding-right: 6px;
    margin-right: 2px;
    border-right: 1px solid var(--border);
  }

  .specimen-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-subtle);
    font-size: 12px;
    font-weight: 540;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  }

  .specimen-action:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    text-decoration: none;
  }

  /* Section Header Rhythm */
  .section-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
  }

  .section-heading-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }

  .section-index {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
  }

  .section-header h2 {
    font-size: clamp(1.4375rem, 1.2rem + 0.65vw, 1.75rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.03em;
  }

  .section-intro {
    font-size: 14.5px;
    color: var(--ink-secondary);
    max-width: 56ch;
  }

  /* Selected Work: Hairline-Joined 2x2 Architectural Matrix */
  .showcase-section {
    border-top: 1px solid var(--border);
    padding-block: clamp(44px, 5vw, 68px);
  }

  .showcase-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  :root[data-theme="dark"] .showcase-grid {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .showcase-grid {
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }
  }

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

  .showcase-card {
    container-type: inline-size;
    background: var(--surface);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.18s ease;
  }

  .showcase-card:hover {
    background: color-mix(in srgb, var(--surface) 88%, var(--surface-subtle));
  }

  .showcase-media {
    display: block;
    background: var(--surface-subtle);
    padding: 10px 10px 0;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
  }

  .showcase-media img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 6px 6px 0 0;
    border: 1px solid var(--border);
    border-bottom: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    .showcase-media img {
      transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 220ms ease;
    }

    .showcase-card:hover .showcase-media img {
      transform: scale(1.015);
    }
  }

  .showcase-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
  }

  .showcase-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
  }

  .showcase-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .showcase-title {
    font-size: 1.0625rem;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.02em;
  }

  .showcase-title a {
    color: var(--ink);
    text-decoration: none;
  }

  .showcase-title a:hover {
    text-decoration: underline;
  }

  .showcase-badge {
    font-size: 12px;
    color: var(--ink-muted);
  }

  .showcase-price {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 540;
    color: var(--ink-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
  }

  .showcase-caption {
    font-size: 14px;
    line-height: 1.52;
    color: var(--ink-secondary);
  }

  .showcase-actions {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .showcase-detail-link {
    margin-left: auto;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-secondary);
    text-decoration: none;
  }

  .showcase-detail-link:hover {
    color: var(--ink);
    text-decoration: underline;
  }

  /* Interactive Catalog Directory */
  .catalog-section {
    border-top: 1px solid var(--border);
    padding-block: clamp(44px, 5vw, 68px);
  }

  .catalog-toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
  }

  .toolbar-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
  }

  .toolbar-heading {
    display: flex;
    align-items: baseline;
    gap: 12px;
  }

  .toolbar-heading h2 {
    font-size: clamp(1.4375rem, 1.2rem + 0.65vw, 1.75rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.03em;
  }

  .catalog-meta {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
  }

  .search-wrap {
    position: relative;
    width: 100%;
    max-width: 350px;
  }

  .search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--ink-muted);
    pointer-events: none;
  }

  .search-input {
    width: 100%;
    padding: 8px 36px 8px 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink);
    font-size: 13.5px;
    transition: border-color 0.14s ease;
  }

  .search-input::placeholder {
    color: var(--ink-muted);
  }

  .search-input:focus {
    border-color: var(--accent);
  }

  .search-kbd {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 550;
    line-height: 1.2;
    padding: 2px 6px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: var(--surface-subtle);
    color: var(--ink-muted);
    pointer-events: none;
  }

  .search-wrap:focus-within .search-kbd,
  .search-wrap.has-value .search-kbd {
    opacity: 0;
  }

  /* Single-Row Category Filter Rail with Scroll-Driven Edge Fades */
  @keyframes filter-fade-edges {
    0% {
      --fade-start: 0px;
      --fade-end: 28px;
    }
    10%, 90% {
      --fade-start: 28px;
      --fade-end: 28px;
    }
    100% {
      --fade-start: 28px;
      --fade-end: 0px;
    }
  }

  .filter-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    scroll-snap-type: inline proximity;
    scrollbar-width: none;
    padding-block: 2px;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  @supports (animation-timeline: scroll(self inline)) {
    .filter-bar {
      mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 var(--fade-start),
        #000 calc(100% - var(--fade-end)),
        transparent 100%
      );
      animation: filter-fade-edges linear both;
      animation-timeline: scroll(self inline);
    }
  }

  .filter-tab {
    flex: none;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-secondary);
    font-size: 12px;
    font-weight: 520;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, scale 0.12s ease;
  }

  .filter-tab:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--ink);
  }

  .filter-tab[aria-pressed="true"] {
    background: var(--btn-bg);
    color: var(--btn-ink);
    border-color: var(--btn-bg);
  }

  @media (forced-colors: active) {
    .filter-tab[aria-pressed="true"] {
      outline: 2px solid Highlight;
      outline-offset: -2px;
    }
  }

  .tab-count {
    font-family: var(--font-mono);
    font-size: 11px;
    opacity: 0.72;
    font-variant-numeric: tabular-nums;
  }

  /* Architectural Ledger Directory */
  .directory-list {
    container-type: inline-size;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  .directory-inner {
    margin-bottom: -1px;
  }

  .tool-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 84px;
    transition: background-color 120ms ease-out;
  }

  .tool-row:hover {
    background: var(--surface-subtle);
  }

  .tool-row.is-highlighted {
    box-shadow: inset 3px 0 0 var(--accent);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  }

  .tool-row[hidden] {
    display: none;
  }

  .tool-identity {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
  }

  .tool-identity-main {
    min-width: 0;
  }

  .tool-title {
    font-size: 0.96875rem;
    font-weight: 630;
    line-height: 1.3;
    letter-spacing: -0.015em;
  }

  .tool-name-link {
    color: var(--ink);
    text-decoration: none;
  }

  .tool-name-link:hover {
    text-decoration: underline;
  }

  .tool-venue {
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 2px;
  }

  .tool-summary {
    min-width: 0;
  }

  .tool-tagline {
    font-size: 13.5px;
    line-height: 1.48;
    color: var(--ink-secondary);
  }

  .tool-price-cell {
    display: none;
  }

  .tool-price {
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 540;
    color: var(--ink);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  .tool-price-inline {
    flex-shrink: 0;
  }

  .tool-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .tool-detail-icon {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  }

  .tool-detail-icon:hover {
    background: var(--surface-hover);
    border-color: var(--border);
    color: var(--ink);
    text-decoration: none;
  }

  .tool-inline-links {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
  }

  .tool-inline-links a {
    color: var(--ink-muted);
    text-decoration: none;
  }

  .tool-inline-links a:hover {
    color: var(--ink);
    text-decoration: underline;
  }

  @container (min-width: 820px) {
    .tool-row {
      display: grid;
      grid-template-columns: 205px minmax(0, 1fr) 168px 268px;
      gap: 12px 18px;
      align-items: center;
      padding: 13px 20px;
    }

    .tool-identity {
      display: block;
    }

    .tool-price-inline {
      display: none;
    }

    .tool-price-cell {
      display: block;
      text-align: right;
    }

    .tool-actions {
      display: grid;
      grid-template-columns: 62px minmax(0, 1fr) 28px;
      align-items: center;
      gap: 8px;
      width: 100%;
    }

    .tool-actions .btn-ledger-cta {
      width: 100%;
      justify-content: center;
    }

    .tool-detail-icon {
      display: inline-flex;
      width: 28px;
      height: 28px;
    }

    .tool-inline-links {
      display: none;
    }
  }

  .empty-state {
    margin-top: 14px;
    padding: 36px 20px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--ink-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .empty-state[hidden] {
    display: none;
  }

  /* Native Quick-Preview Dialog (Modern Web Guidance) */
  dialog.tool-dialog {
    width: min(680px, calc(100% - 28px));
    max-height: min(88dvh, 780px);
    margin: auto;
    padding: 0;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-dialog);
    overflow: hidden;
    opacity: 0;
    transition-property: opacity, transform, display, overlay;
    transition-duration: 0.22s;
    transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
    transition-behavior: allow-discrete;
  }

  @media (prefers-reduced-motion: no-preference) {
    dialog.tool-dialog {
      transform: translateY(8px) scale(0.985);
    }
  }

  dialog.tool-dialog:modal {
    overscroll-behavior: contain;
  }

  dialog.tool-dialog[open] {
    display: flex;
    flex-direction: column;
  }

  dialog.tool-dialog[open]:where(:not([data-closing])) {
    opacity: 1;

    @starting-style {
      opacity: 0;
    }

    @media (prefers-reduced-motion: no-preference) {
      transform: translateY(0) scale(1);

      @starting-style {
        transform: translateY(8px) scale(0.985);
      }
    }
  }

  dialog.tool-dialog::backdrop {
    overflow: hidden;
    overscroll-behavior: contain;
    background-color: rgba(12, 12, 11, 0);
    backdrop-filter: blur(0px);
    transition-property: background-color, backdrop-filter, display, overlay;
    transition-duration: 0.22s;
    transition-timing-function: ease-out;
    transition-behavior: allow-discrete;
  }

  dialog.tool-dialog[open]:where(:not([data-closing]))::backdrop {
    background-color: rgba(12, 12, 11, 0.56);
    backdrop-filter: blur(3px);

    @starting-style {
      background-color: rgba(12, 12, 11, 0);
      backdrop-filter: blur(0px);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    dialog.tool-dialog,
    dialog.tool-dialog::backdrop {
      transition-duration: 0.1s;
    }
  }

  .dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .dialog-kicker {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--ink-muted);
    margin-bottom: 4px;
  }

  .dialog-header h2 {
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.025em;
  }

  .dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  }

  .dialog-close:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--ink);
  }

  .dialog-body {
    padding: 20px 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .dialog-media {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
  }

  .dialog-media img {
    width: 100%;
    max-height: 290px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border);
  }

  .dialog-tagline {
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-secondary);
  }

  .dialog-subheading {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 560;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
    margin-bottom: -8px;
  }

  .dialog-highlights {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--ink-secondary);
  }

  .dialog-highlights li {
    position: relative;
    padding-left: 16px;
  }

  .dialog-highlights li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 1px;
    background: var(--ink-muted);
  }

  .dialog-specs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
    margin: 4px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }

  .dialog-specs dt {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
  }

  .dialog-specs dd {
    margin: 3px 0 0;
    font-size: 13px;
    font-weight: 520;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }

  .dialog-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--surface-subtle);
    flex-shrink: 0;
  }

  .dialog-privacy-link {
    margin-left: auto;
    font-size: 12.5px;
    color: var(--ink-muted);
    text-decoration: none;
  }

  .dialog-privacy-link:hover {
    color: var(--ink);
    text-decoration: underline;
  }

  /* Architectural Hairline Workflow Suites Matrix */
  .suites-section {
    border-top: 1px solid var(--border);
    padding-block: clamp(44px, 5vw, 68px);
  }

  .suites-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

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

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

  .suite-card {
    background: var(--surface);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .suite-index {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 550;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
  }

  .suite-card h3 {
    font-size: 15.5px;
    font-weight: 640;
    letter-spacing: -0.02em;
  }

  .suite-card p {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ink-secondary);
  }

  .suite-links {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11.5px;
  }

  .suite-links a {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 5px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    color: var(--ink);
    text-decoration: none;
    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  }

  .suite-links a:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--accent);
    text-decoration: none;
  }

  /* Editorial Spec-Sheet Detail & Privacy Pages */
  .prose-page {
    padding-block: clamp(32px, 4.5vw, 52px) 24px;
  }

  .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-muted);
    margin-bottom: 16px;
  }

  .breadcrumb a {
    color: var(--ink-muted);
    text-decoration: none;
  }

  .breadcrumb a:hover {
    color: var(--ink);
    text-decoration: underline;
  }

  .prose-header {
    padding-bottom: 24px;
    margin-bottom: 28px;
  }

  .prose-header h1 {
    font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
    font-weight: 660;
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
  }

  .prose-lead {
    font-size: 16px;
    line-height: 1.56;
    color: var(--ink-secondary);
    max-width: 60ch;
    margin-bottom: 20px;
  }

  .detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
  }

  .meta-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    margin: 0;
    padding-block: 16px;
    border-block: 1px solid var(--border);
  }

  @media (min-width: 640px) {
    .meta-list {
      grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(max-content, 1.35fr);
    }
  }

  .meta-list a {
    white-space: nowrap;
  }

  .meta-list dt {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
  }

  .meta-list dd {
    margin: 3px 0 0;
    font-size: 13.5px;
    font-weight: 520;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }

  .callout-box {
    position: relative;
    overflow: hidden;
    padding: 15px 18px 15px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink-secondary);
  }

  .callout-box::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--safe);
  }

  .prose-article h2 {
    font-size: 19px;
    font-weight: 640;
    margin: 32px 0 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
  }

  .prose-article p,
  .prose-article li {
    color: var(--ink-secondary);
    font-size: 14.5px;
    line-height: 1.6;
  }

  .prose-article p + p {
    margin-top: 12px;
  }

  .prose-article ul {
    margin: 10px 0 16px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .prose-article ul.cross-sell-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 16px;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
  }

  .cross-sell-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    transition: background-color 0.14s ease;
  }

  .cross-sell-list li:hover {
    background: var(--surface-subtle);
  }

  .cross-sell-list li:last-child {
    border-bottom: 0;
  }

  .cross-sell-list a {
    color: var(--ink);
    font-weight: 580;
    text-decoration: none;
  }

  .cross-sell-list a:hover {
    color: var(--accent);
    text-decoration: underline;
  }

  .cross-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }

  .cross-price {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  .cross-arrow {
    font-size: 13px;
    color: var(--ink-muted);
  }

  .table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 14px 0 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  .permissions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
  }

  .permissions-table th,
  .permissions-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
  }

  .permissions-table thead th {
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
    background: var(--surface-subtle);
  }

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

  .screenshot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-block: 16px 24px;
  }

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

    .screenshot-grid .screenshot-frame:first-child:nth-last-child(odd) {
      grid-column: 1 / -1;
    }
  }

  .screenshot-frame {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 10px 0;
    overflow: hidden;
  }

  .screenshot-frame img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
  }

  .screenshot-caption {
    padding: 10px 4px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--ink-secondary);
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px 18px;
  }

  .footer-links a {
    color: var(--ink-secondary);
    text-decoration: none;
  }

  .footer-links a:hover {
    color: var(--ink);
    text-decoration: underline;
  }
}

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

  .tabular {
    font-variant-numeric: tabular-nums;
  }

  @media (max-width: 720px) {
    .container {
      padding-inline: 16px;
    }

    .site-nav {
      display: none;
    }

    .header-inner {
      gap: 10px;
    }

    .nav-search-trigger {
      width: 34px;
      padding: 0;
    }

    .nav-search-label,
    .nav-search-kbd {
      display: none;
    }

    .specimen-action {
      min-height: 32px;
      padding: 0 11px;
    }

    .search-wrap {
      max-width: 100%;
    }

    .dialog-specs {
      grid-template-columns: minmax(0, 1fr);
    }

    .dialog-privacy-link {
      margin-left: 0;
      width: 100%;
    }
  }
}
