/* =====================================================================
   TRUST — marketing site stylesheet
   Mirrors the instrument's design system (lib/tokens.css):
   flat surfaces, 0–2px radius, no box-shadow, four-font system,
   navy-tinted neutrals, TRUST-magenta framework signature.
   The "Review Bench" aesthetic: sharp borders, monospace metadata,
   evidence pinned to observations.
   ===================================================================== */

/* Web fonts are loaded via <link> tags in index.html for parallel, non-blocking fetch. */

/* ----- @font-face CLS fallback metrics (font-display: swap already via Google Fonts <link>) ----- */
/* Inter fallback metrics — prevent layout shift while Google Font loads */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
  size-adjust: 107%;
}
/* Nunito Sans fallback metrics — wider display face */
@font-face {
  font-family: "Nunito Sans Fallback";
  src: local("Arial");
  ascent-override: 92%;
  descent-override: 22%;
  line-gap-override: 0%;
  size-adjust: 105%;
}

/* ----- Design tokens (mirrors lib/tokens.css) ----- */
:root {
  /* Primary / institutional */
  --ut-primary: #002c5f;
  --ut-navy: var(--ut-primary);
  --ut-blue: #007d9c; /* links, focus */
  --ut-red: #c60c30;
  --ut-green: #4a8355;

  /* Light surfaces — navy-tinted, never flat gray */
  --ut-grey: color-mix(in srgb, var(--ut-navy) 6%, var(--ut-white));
  --ut-offwhite: color-mix(in srgb, var(--ut-navy) 3%, var(--ut-white));
  --ut-border: #bfc6cf;
  --ut-text: #172033;
  --ut-muted: #4f5e73; /* WCAG AA on white (~6.4:1) */
  --ut-slate: #4c5e74;
  --ut-panel-bg: var(--ut-offwhite);
  --ut-white: #fafbfc;
  --ut-canvas: var(--ut-grey);
  --ut-on-accent: #ffffff;

  /* TRUST principle tokens */
  --tr: #2563eb;
  --re: #16a34a;
  --uc: #9333ea;
  --se: #ea580c;
  --tc: #0d9488;
  --section-default: #64748b;

  /* Framework signature */
  --trust-magenta: #8e036c;
  --trust-magenta-strong: #6a0254;
  --trust-magenta-tint: #fbeef5;
  /* Active-section accent — driven by scroll-spy: purple → blue → green → orange → purple */
  --active-accent: var(--trust-magenta);
  --trust-magenta-border: #c991ab;

  /* Organizational secondary */
  --lisa-red: #ab2b44;
  --eis-teal: #005c53;

  /* Score semantics */
  --score-0: #c60c30;
  --score-1: #c2410c;
  --score-2: #0e7490;
  --score-3: #4a8355;
  --score-0-tint: color-mix(in srgb, var(--score-0) 14%, var(--ut-white));
  --score-1-tint: color-mix(in srgb, var(--score-1) 14%, var(--ut-white));
  --score-2-tint: color-mix(in srgb, var(--score-2) 14%, var(--ut-white));
  --score-3-tint: color-mix(in srgb, var(--score-3) 14%, var(--ut-white));

  /* Darkened text variants — AA-compliant on white/tints. Base colors stay for decorative borders/fills. */
  --tr-strong: color-mix(in srgb, var(--tr) 85%, #000);
  --re-strong: color-mix(in srgb, var(--re) 75%, #000);
  --uc-strong: color-mix(in srgb, var(--uc) 85%, #000);
  --se-strong: color-mix(in srgb, var(--se) 77%, #000);
  --tc-strong: color-mix(in srgb, var(--tc) 80%, #000);
  --score-1-strong: color-mix(in srgb, var(--score-1) 90%, #000);
  --score-2-strong: color-mix(in srgb, var(--score-2) 90%, #000);
  --score-3-strong: color-mix(in srgb, var(--score-3) 88%, #000);
  --ut-green-strong: var(--score-3-strong);

  /* Radius — regimented functionalism: 0–2px (pills the only exception) */
  --radius-lg: 0px;
  --radius-md: 2px;
  --radius-sm: 1px;
  --radius-full: 999px;

  /* Border widths */
  --border-default: 2px;
  --border-accent: 8px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 64px;
  --space-16: 96px;

  /* Letter spacing */
  --ls-heading: 0.03em;
  --ls-label: 0.02em;
  --ls-uppercase: 0.04em;
  --ls-kicker: 0.08em;

  /* Font families — four roles */
  --ff-body:
    "Inter", "Inter Fallback", "Segoe UI", "Helvetica Neue", ui-sans-serif, system-ui, Arial,
    sans-serif;
  --ff-heading:
    "Arial Narrow", "Roboto Condensed", "Open Sans Condensed", Arial, "Helvetica Neue", sans-serif;
  --ff-mono:
    "JetBrains Mono", "Cascadia Code", "Fira Code", DejaVu Sans Mono, Menlo, Consolas, ui-monospace,
    monospace;
  --ff-display: "Nunito Sans", "Nunito Sans Fallback", "Inter", "Segoe UI", system-ui, sans-serif;

  /* Motion */
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);

  /* Layout */
  --prose-measure: 65ch;
  --container: 1080px;

  /* Sticky nav height for scroll-offset */
  --nav-height: 56px;
}

/* ----- Reset ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  /* offset anchor targets so the sticky header + sticky sub-nav don't cover them */
  scroll-padding-top: calc(var(--nav-height) + 3.25rem + var(--space-3));
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  /* Immediately show all reveal targets so content is never hidden */
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-progress::after {
    transform: scaleX(0) !important;
  }
}

/* ----- Base ----- */
body {
  font-family: var(--ff-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ut-text);
  background: var(--ut-canvas);
  /* Offset for the fixed site header (nav height + bottom border). */
  padding-top: calc(var(--nav-height) + var(--border-default));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* OpenType: kerning, ligatures, tabular-nums for aligned data */
  font-feature-settings:
    "kern" 1,
    "liga" 1,
    "calt" 1,
    "tnum" 1;
  font-kerning: normal;
  font-variant-ligatures: contextual;
  font-variant-numeric: tabular-nums;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
/* Broken image fallback: show alt text with muted color */
img::before {
  content: attr(alt);
  display: block;
  color: var(--ut-muted);
  font-style: italic;
}
a {
  color: var(--trust-magenta);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--trust-magenta) 35%, transparent);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--trust-magenta-strong);
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--ut-blue);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  background: var(--ut-white);
  color: var(--ut-primary);
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--ut-primary);
  z-index: 200;
  font-family: var(--ff-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  text-decoration: none;
}
.skip-link:focus {
  top: var(--space-3);
}

/* ----- Layout ----- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* =====================================================================
   Header + sticky anchor navigation
   ===================================================================== */
.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 100;
  background: var(--ut-primary);
  border-bottom: var(--border-default) solid color-mix(in srgb, var(--ut-navy) 70%, black);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: var(--nav-height);
}
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--ut-white);
  flex-shrink: 0;
}
.header-logo img {
  height: 28px;
}
.header-logo span {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

/* Anchor nav — horizontally scrollable on small screens */
.tab-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar {
  display: none;
}
.tab-nav a {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  font-family: var(--ff-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  border: 1px solid transparent;
  transition:
    color var(--duration-fast) var(--ease-out-quart),
    background var(--duration-fast) var(--ease-out-quart);
}
.tab-nav a:hover {
  color: var(--ut-white);
  background: color-mix(in srgb, var(--ut-white) 10%, transparent);
}
.tab-nav a.active {
  color: var(--ut-white);
  background: var(--active-accent);
  border-color: color-mix(in srgb, var(--active-accent) 82%, #000);
  transition:
    background var(--duration-normal) var(--ease-out-quart),
    border-color var(--duration-normal) var(--ease-out-quart);
}
.tab-nav a.cta {
  background: var(--trust-magenta);
  color: var(--ut-white);
  border-color: var(--trust-magenta-strong);
}
.tab-nav a.cta:hover {
  background: var(--trust-magenta-strong);
}

/* External brand links — white chips on the navy header (github / UT / LIBER / Chrome Store) */
.header-externals {
  display: none;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-2);
}
.ext-link {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  padding: var(--space-1) var(--space-2);
  background: var(--ut-white);
  color: var(--ut-text);
  border: 1px solid color-mix(in srgb, var(--ut-navy) 14%, transparent);
  border-radius: 2px;
  text-decoration: none;
  transition:
    border-color var(--duration-fast) var(--ease-out-quart),
    color var(--duration-fast) var(--ease-out-quart);
}
.ext-link:hover {
  border-color: var(--trust-magenta);
  color: var(--trust-magenta);
}
.ext-link:focus-visible {
  outline: 2px solid var(--trust-magenta);
  outline-offset: 2px;
}
.ext-link[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ut-primary);
  color: var(--ut-white);
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  z-index: 200;
  transition:
    opacity var(--duration-fast) var(--ease-out-quart),
    transform var(--duration-fast) var(--ease-out-quart);
}
.ext-link[data-tip]:hover::after,
.ext-link[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ext-icon {
  display: block;
}
.ext-logo {
  display: block;
  height: 20px;
  width: auto;
  filter: grayscale(1) brightness(0.6);
}
@media (min-width: 760px) {
  .header-externals {
    display: flex;
  }
}

/* Mobile brand strip — the external links as a slim navy band after the hero.
   Desktop shows the same links in the header, so this is mobile-only (<760px). */
.brand-strip {
  display: none;
  background: var(--ut-navy);
}
.brand-strip .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}
.brand-strip .ext-link:focus-visible {
  outline: 2px solid var(--ut-white);
  outline-offset: 2px;
}
@media (max-width: 759px) {
  .brand-strip {
    display: block;
  }
}

/* =====================================================================
   Mobile nav toggle — the horizontal scroll strip collapses into a
   dropdown panel below 760px (matches the external-links breakpoint).
   ===================================================================== */
.nav-toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ut-white) 30%, transparent);
  color: var(--ut-white);
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  min-height: 44px;
  border-radius: var(--radius-sm);
  transition:
    background var(--duration-fast) var(--ease-out-quart),
    border-color var(--duration-fast) var(--ease-out-quart);
}
.nav-toggle:hover {
  background: color-mix(in srgb, var(--ut-white) 10%, transparent);
}
.nav-toggle[aria-expanded="true"] {
  background: var(--trust-magenta);
  border-color: var(--trust-magenta-strong);
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--ut-white);
  outline-offset: 2px;
}
@media (max-width: 759px) {
  .js .tab-nav {
    display: none;
  }
  .js .tab-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ut-primary);
    border-top: 1px solid color-mix(in srgb, var(--ut-white) 16%, transparent);
    border-bottom: var(--border-default) solid color-mix(in srgb, var(--ut-navy) 70%, black);
    padding: var(--space-2) var(--space-6) var(--space-3);
    margin: 0;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
    scroll-snap-type: none;
  }
  .js .tab-nav.open a {
    width: 100%;
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
    justify-content: flex-start;
    border-bottom: 1px solid color-mix(in srgb, var(--ut-white) 12%, transparent);
  }
  .js .tab-nav.open a.cta {
    margin-top: var(--space-2);
    border-bottom: 0;
  }
  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
}

/* =====================================================================
   Roadmap — next steps checklist (flat cards, group-accented)
   ===================================================================== */
.roadmap-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}
.roadmap-item {
  background: var(--ut-white);
  border: 1px solid var(--ut-border);
  border-top: var(--border-accent) solid var(--group-accent, var(--se));
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.roadmap-num {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: var(--ls-kicker);
  color: var(--group-accent, var(--se));
  margin-bottom: var(--space-2);
}
.roadmap-icon {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--group-accent, var(--se));
  margin: var(--space-2) 0;
}
.roadmap-item h3 {
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--ut-primary);
  margin-bottom: var(--space-2);
}
.roadmap-item p {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ut-muted);
  margin-bottom: 0;
}

/* =====================================================================
   Modal — abstract & references (native <dialog>, flat: no shadow)
   ===================================================================== */
.modal {
  background: var(--ut-white);
  color: var(--ut-text);
  border: var(--border-default) solid var(--ut-border);
  border-top: var(--border-accent) solid var(--trust-magenta);
  border-radius: var(--radius-md);
  padding: 0;
  max-width: min(760px, 94vw);
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  position: fixed;
  inset: 0;
  margin: auto;
}
.modal::backdrop {
  background: color-mix(in srgb, var(--ut-primary) 64%, transparent);
}
.modal-inner {
  position: relative;
  padding: var(--space-8) var(--space-8) var(--space-6);
  max-height: 88vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--ut-primary);
  color: var(--ut-white);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out-quart);
}
.modal-close:hover {
  background: var(--trust-magenta);
}
.modal-close:focus-visible {
  outline: 2px solid var(--ut-blue);
  outline-offset: 2px;
}
.modal-title {
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.6vw, 1.65rem);
  text-transform: uppercase;
  letter-spacing: var(--ls-heading);
  color: var(--ut-primary);
  line-height: 1.2;
  margin-top: var(--space-3);
  text-wrap: balance;
}
.modal-byline {
  color: var(--ut-muted);
  margin-top: var(--space-2);
  font-size: 1rem;
}
.modal-inner > .kicker,
.modal-inner > .modal-title,
.modal-inner > .modal-byline {
  padding-right: 52px;
}
/* Entrance delight — opacity + slight translate, flat (no shadow) */
.modal[open] {
  animation: modal-in var(--duration-normal) var(--ease-out-quart);
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .modal[open] {
    animation: none;
  }
}

/* =====================================================================
   References — citation markers in prose link to the reference list.
   ===================================================================== */
.refs {
  margin-top: var(--space-8);
  border-top: 1px solid var(--ut-border);
  padding-top: var(--space-6);
}
.refs .ref-list {
  max-width: 68ch;
}
/* Citation markers ([1], [2] …) — themed to the surrounding group accent. */
.prose a[href^="#ref-"] {
  color: var(--group-accent, var(--trust-magenta));
  text-decoration: none;
  transition:
    color var(--duration-fast) var(--ease-out-quart),
    text-decoration-color var(--duration-fast) var(--ease-out-quart);
}
.prose a[href^="#ref-"]:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.prose a[href^="#ref-"]:focus-visible {
  outline: 2px solid var(--ut-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* =====================================================================
   Section groups — color-coded top-level chapters with sticky sub-nav.
   Each .group carries a TRUST principle accent that drives its band and
   sub-nav (flat: tint + accent border only, no shadow).
   ===================================================================== */
.group {
  --group-accent: var(--section-default);
}
.group[data-accent="tr"] {
  --group-accent: var(--tr);
}
.group[data-accent="re"] {
  --group-accent: var(--re);
}
.group[data-accent="se"] {
  --group-accent: var(--se);
}

.group-band {
  border-top: var(--border-accent) solid var(--group-accent);
  background: color-mix(in srgb, var(--group-accent) 5%, var(--ut-white));
}
.group-band .container {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}
.group-name {
  display: inline;
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  text-transform: uppercase;
  letter-spacing: var(--ls-heading);
  color: var(--group-accent);
  vertical-align: middle;
}
.group-intro {
  max-width: 68ch;
  margin-top: var(--space-3);
  line-height: 1.55;
  color: var(--ut-text);
}

/* Sticky secondary nav — pins under the header for the duration of its group. */
.sub-nav {
  position: sticky;
  top: var(--nav-height);
  z-index: 5;
  background: var(--ut-white);
  border-bottom: 1px solid var(--ut-border);
}
.sub-nav .container {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: var(--space-2);
  padding-bottom: 0;
}
.sub-nav .container::-webkit-scrollbar {
  display: none;
}
.sub-nav a {
  text-decoration: none;
  flex: 0 0 auto;
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--ut-muted);
  padding: var(--space-2) var(--space-3) calc(var(--space-2) + 3px);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition:
    color var(--duration-fast) var(--ease-out-quart),
    border-color var(--duration-fast) var(--ease-out-quart);
}
.sub-nav a:hover {
  color: var(--group-accent);
}
.sub-nav a.active {
  color: var(--group-accent);
  border-bottom-color: var(--group-accent);
}
.sub-nav a:focus-visible {
  outline: 2px solid var(--ut-blue);
  outline-offset: -2px;
}
/* The sub-nav sits inside each group, so --group-accent cascades down. */

/* Small button + references header (download .bib) */
.btn-sm {
  font-size: 0.8125rem;
  padding: var(--space-1) var(--space-3);
}
.refs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* =====================================================================
   Hero
   ===================================================================== */
.hero {
  padding: var(--space-16) 0 var(--space-12);
  text-align: center;
  border-bottom: 1px solid var(--ut-border);
  background: var(--ut-offwhite);
}
.hero-logo {
  height: 72px;
  width: auto;
  margin: 0 auto var(--space-6);
}
.hero h1 {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ut-primary);
  max-width: 17ch;
  margin: 0 auto var(--space-5);
  text-wrap: balance;
}
.hero .lede {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ut-muted);
  max-width: 68ch;
  text-align: justify;
  hyphens: auto;
  margin: 0 auto var(--space-6);
}
.hero-cta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* Hero quick-start — prominent install / try / report actions with descriptions */
.quickstart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
  margin: var(--space-6) auto 0;
  max-width: 960px;
  text-align: left;
}
.quickstart-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.quickstart-item .btn {
  align-self: flex-start;
}
.quickstart-desc {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ut-muted);
}

/* =====================================================================
   Buttons / badges — sharp edges, flat
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  text-decoration: none;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: var(--border-default) solid transparent;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out-quart),
    border-color var(--duration-fast) var(--ease-out-quart),
    color var(--duration-fast) var(--ease-out-quart);
}
.btn-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}
.btn-primary {
  background: var(--trust-magenta);
  color: var(--ut-on-accent);
  border-color: var(--trust-magenta-strong);
}
.btn-primary:hover {
  background: var(--trust-magenta-strong);
  color: var(--ut-on-accent);
}
.btn-ghost {
  background: transparent;
  color: var(--trust-magenta);
  border-color: var(--trust-magenta);
}
.btn-ghost:hover {
  background: var(--trust-magenta-tint);
  color: var(--trust-magenta-strong);
}

/* Inline version / license pill */
.pill {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ut-muted);
  background: var(--ut-white);
  border: 1px solid var(--ut-border);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
a.pill:hover {
  color: var(--trust-magenta);
  border-color: var(--trust-magenta-border);
}

/* =====================================================================
   Section scaffold
   ===================================================================== */
.section {
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--ut-border);
}
.section-head {
  margin-bottom: var(--space-6);
}
.section-title {
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  text-transform: uppercase;
  letter-spacing: var(--ls-heading);
  color: var(--ut-primary);
  line-height: 1.15;
  text-wrap: balance;
  /* Magenta accent — top-border trick */
  border-top: var(--border-accent) solid var(--group-accent, var(--trust-magenta));
  padding-top: var(--space-2);
  display: inline-block;
}
.section-lede {
  margin-top: var(--space-3);
  color: var(--ut-muted);
  max-width: var(--prose-measure);
  font-size: 1.0625rem;
}
.prose {
  max-width: var(--prose-measure);
}
.prose p {
  text-wrap: pretty;
}
.prose--wide {
  max-width: 68ch;
}
/* Justified measure for the conference abstract — even columns, hyphenated to avoid rivers */
.prose--wide p {
  text-align: justify;
  hyphens: auto;
}
.prose p + p {
  margin-top: var(--space-3);
}
.prose ul {
  margin: var(--space-3) 0;
  padding-left: var(--space-5);
}
.prose li {
  margin-bottom: var(--space-2);
}

/* =====================================================================
   Principle cards — flat, accent top border, no shadow
   ===================================================================== */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}
.principle-card {
  background: var(--ut-white);
  border: 1px solid var(--ut-border);
  border-top: var(--border-accent) solid var(--card-color, var(--section-default));
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.principle-card .letter {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 2.85rem;
  line-height: 1;
  color: var(--card-color, var(--section-default));
}
.principle-card .name {
  font-family: var(--ff-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  margin-top: var(--space-3);
  color: var(--ut-text);
}
.principle-card .desc {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ut-muted);
  margin-top: var(--space-2);
}
.principle-card[data-principle="tr"] {
  --card-color: var(--tr);
}
.principle-card[data-principle="re"] {
  --card-color: var(--re);
}
.principle-card[data-principle="uc"] {
  --card-color: var(--uc);
}
.principle-card[data-principle="se"] {
  --card-color: var(--se);
}
.principle-card[data-principle="tc"] {
  --card-color: var(--tc);
}

/* =====================================================================
   Authors
   ===================================================================== */
.authors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-4);
}
.author-chip {
  font-family: var(--ff-mono);
  font-size: 0.8125rem;
  color: var(--ut-text);
  background: var(--ut-white);
  border: 1px solid var(--ut-border);
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
}
.attribution {
  text-align: center;
  color: var(--ut-muted);
  font-size: 0.95rem;
  margin-top: var(--space-3);
  max-width: 60ch;
  margin-inline: auto;
}

/* =====================================================================
   Card / panel — flat
   ===================================================================== */
.card {
  background: var(--ut-white);
  border: 1px solid var(--ut-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.card.flush {
  padding: 0;
  overflow: hidden;
}
.card h3 {
  font-family: var(--ff-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: 1.05rem;
  color: var(--ut-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-wrap: balance;
}
.card h3 .icon {
  color: var(--trust-magenta);
  flex-shrink: 0;
}

/* =====================================================================
   Install cards
   ===================================================================== */
.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}
.install-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-6);
  align-items: center;
}
.install-meta li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--ut-muted);
}
.install-card ol {
  margin: var(--space-3) 0 0;
  padding-left: var(--space-5);
}
.install-card li {
  margin-bottom: var(--space-2);
  line-height: 1.5;
}
code {
  font-family: var(--ff-mono);
  font-size: 0.85em;
  background: var(--ut-canvas);
  border: 1px solid var(--ut-border);
  padding: 1px var(--space-1);
  border-radius: var(--radius-sm);
}

/* =====================================================================
   Tools table — flat, dense, scannable
   ===================================================================== */
.table-wrap {
  overflow-x: auto;
}
.tools-table,
.compare-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--ut-border);
  font-size: 0.9375rem;
}
.tools-table th,
.compare-table th {
  text-align: left;
  font-family: var(--ff-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: 0.8125rem;
  color: var(--ut-on-accent);
  background: var(--ut-primary);
  padding: var(--space-3) var(--space-3);
  white-space: nowrap;
}
.tools-table th.num,
.tools-table td.num {
  text-align: center;
}
.tools-table td {
  padding: var(--space-3);
  border-top: 1px solid var(--ut-border);
  vertical-align: middle;
}
.tools-table tbody tr:hover td {
  background: var(--ut-offwhite);
}
.tools-table .tool-link {
  font-weight: 600;
  color: var(--trust-magenta);
  text-decoration: none;
}
.tools-table .tool-link:hover {
  text-decoration: underline;
}
.tools-table .muted {
  color: var(--ut-muted);
}

/* Score pills — the semantic ramp */
.score-pill {
  display: inline-block;
  min-width: 2.25em;
  text-align: center;
  font-family: var(--ff-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--ut-border);
  background: var(--ut-white);
  color: var(--ut-slate);
}
.score-pill[data-score="3"] {
  color: var(--score-3-strong);
  background: var(--score-3-tint);
  border-color: color-mix(in srgb, var(--score-3) 32%, var(--ut-border));
}
.score-pill[data-score="2"] {
  color: var(--score-2-strong);
  background: var(--score-2-tint);
  border-color: color-mix(in srgb, var(--score-2) 32%, var(--ut-border));
}
.score-pill[data-score="1"] {
  color: var(--score-1-strong);
  background: var(--score-1-tint);
  border-color: color-mix(in srgb, var(--score-1) 32%, var(--ut-border));
}
.score-pill[data-score="0"] {
  color: var(--score-0);
  background: var(--score-0-tint);
  border-color: color-mix(in srgb, var(--score-0) 32%, var(--ut-border));
}

/* Verdict + status badges */
.verdict {
  font-family: var(--ff-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: 0.75rem;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--ut-border);
  white-space: nowrap;
}
.verdict-recommended {
  color: var(--ut-green-strong);
  background: color-mix(in srgb, var(--ut-green) 12%, var(--ut-white));
  border-color: color-mix(in srgb, var(--ut-green) 32%, var(--ut-border));
}
.verdict-provisional {
  color: var(--score-1-strong);
  background: var(--score-1-tint);
  border-color: color-mix(in srgb, var(--score-1) 32%, var(--ut-border));
}
.verdict-not-recommended {
  color: var(--ut-red);
  background: color-mix(in srgb, var(--ut-red) 12%, var(--ut-white));
  border-color: color-mix(in srgb, var(--ut-red) 32%, var(--ut-border));
}
.status-badge {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--ut-border);
  color: var(--ut-muted);
}
.status-badge.done {
  color: var(--ut-green-strong);
  background: color-mix(in srgb, var(--ut-green) 12%, var(--ut-white));
  border-color: color-mix(in srgb, var(--ut-green) 32%, var(--ut-border));
}
.status-badge.in-progress {
  color: var(--score-1-strong);
  background: var(--score-1-tint);
}
.status-badge.nominated {
  color: var(--trust-magenta);
  background: var(--trust-magenta-tint);
  border-color: var(--trust-magenta-border);
}

/* =====================================================================
   Compare tool (upload)
   ===================================================================== */
.upload-zone {
  border: var(--border-default) dashed var(--ut-border);
  border-radius: var(--radius-md);
  background: var(--ut-offwhite);
  padding: var(--space-8);
  text-align: center;
  color: var(--ut-muted);
  transition:
    border-color var(--duration-fast) var(--ease-out-quart),
    background var(--duration-fast) var(--ease-out-quart);
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--trust-magenta);
  background: var(--trust-magenta-tint);
  color: var(--trust-magenta-strong);
}
.upload-zone label {
  color: var(--trust-magenta);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}
.compare-error {
  color: var(--trust-magenta-strong);
  background: var(--trust-magenta-tint);
  border: var(--border-default) solid var(--trust-magenta);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) 0;
  font-size: 0.9rem;
}
.compare-controls {
  display: flex;
  justify-content: flex-end;
  margin: var(--space-4) 0;
}
.compare-btn {
  font-family: var(--ff-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: 0.8125rem;
  background: var(--ut-white);
  color: var(--ut-text);
  border: 1px solid var(--ut-border);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-out-quart),
    color var(--duration-fast) var(--ease-out-quart);
}
.compare-btn:hover {
  border-color: var(--trust-magenta);
  color: var(--trust-magenta);
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.compare-card {
  background: var(--ut-white);
  border: 1px solid var(--ut-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.compare-card .compare-url {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--ut-muted);
  word-break: break-all;
}
.compare-card .compare-remove {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--ut-slate);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 var(--space-1);
}
.compare-card .compare-remove:hover {
  color: var(--ut-red);
}
.compare-table th,
.compare-table td {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--ut-border);
  font-size: 0.875rem;
  text-align: center;
}
.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
}
.compare-table thead th {
  background: var(--ut-panel-bg);
  color: var(--ut-primary);
  border-top: none;
}
.compare-table .highlight-best {
  background: color-mix(in srgb, var(--ut-green) 10%, var(--ut-white));
  font-weight: 700;
}

/* =====================================================================
   References
   ===================================================================== */
.ref-list {
  list-style: none;
  counter-reset: ref;
  max-width: 560px;
}
.ref-list li {
  counter-increment: ref;
  padding: var(--space-2) 0 var(--space-2) var(--space-6);
  border-bottom: 1px solid var(--ut-border);
  position: relative;
  line-height: 1.5;
  font-size: 0.95rem;
}
.ref-list li::before {
  content: counter(ref);
  position: absolute;
  left: 0;
  top: var(--space-2);
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--trust-magenta);
}

/* =====================================================================
   Links grid — flat, no hover-lift
   ===================================================================== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.link-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--ut-text);
  background: var(--ut-white);
  border: 1px solid var(--ut-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition:
    border-color var(--duration-fast) var(--ease-out-quart),
    background var(--duration-fast) var(--ease-out-quart);
}
.link-card:hover {
  border-color: var(--trust-magenta-border);
  background: var(--trust-magenta-tint);
  color: var(--ut-text);
}
.link-card .link-icon {
  color: var(--trust-magenta);
  flex-shrink: 0;
}
.link-card .link-label {
  font-family: var(--ff-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: 0.9375rem;
}
.link-card .link-url {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--ut-muted);
  margin-top: 2px;
}
.contact {
  text-align: center;
}
/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
  background: var(--ut-primary);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--space-8) 0;
  border-top: var(--border-accent) solid var(--trust-magenta);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.site-footer .footer-logos {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.site-footer img {
  height: 22px;
  max-width: 100%;
}
.site-footer a {
  color: var(--ut-white);
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 720px) {
  body {
    font-size: 1rem;
  }
  .container {
    padding: 0 var(--space-4);
  }
  .hero {
    padding: var(--space-12) 0 var(--space-8);
  }
  .hero-logo {
    height: 56px;
  }
  .section {
    padding: var(--space-8) 0;
  }
  /* Principle cards stack to a true single column on phones */
  .principles-grid {
    grid-template-columns: 1fr 1fr;
  }
  .install-grid,
  .links-grid {
    grid-template-columns: 1fr;
  }
  .header-logo span {
    display: none; /* wordmark glyph is enough on the narrow bar */
  }
  /* Touch targets: ensure ≥44px tap height on mobile */
  .tab-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .btn {
    min-height: 44px;
  }
  .compare-btn {
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
  }
  .upload-zone label {
    display: inline-block;
    min-height: 44px;
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }
  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
  .roadmap-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 400px) {
  .principles-grid {
    grid-template-columns: 1fr;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta .btn {
    justify-content: center;
  }
}

/* Pointer-coarse: drop hover-only affordances that confuse touch */
@media (hover: none) {
  .principle-card,
  .link-card {
    transition: none;
  }
}

/* ----- Utilities ----- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* Alias — used by script.js aria-live status element */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.muted {
  color: var(--ut-muted);
}
.center {
  text-align: center;
}
.text-sm {
  font-size: 0.9rem;
}
.text-xs {
  font-size: 0.85rem;
}
.mt-2 {
  margin-top: var(--space-2);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-8 {
  margin-top: var(--space-8);
}
.section-title--sub {
  font-size: clamp(1.15rem, 1.5vw, 1.3rem);
  text-wrap: balance;
  color: var(--group-accent, var(--trust-magenta));
  font-family: var(--ff-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-heading);
}
.section-title--sub::after {
  display: none;
}
.compare-card .compare-points {
  color: var(--ut-muted);
  font-family: var(--ff-mono);
  font-size: 0.8rem;
}
/* Principle-color label inside the compare table (data-code driven, no inline style) */
.compare-table td[data-code="tr"] {
  color: var(--tr-strong);
  font-weight: 700;
}
.compare-table td[data-code="re"] {
  color: var(--re-strong);
  font-weight: 700;
}
.compare-table td[data-code="uc"] {
  color: var(--uc-strong);
  font-weight: 700;
}
.compare-table td[data-code="se"] {
  color: var(--se-strong);
  font-weight: 700;
}
.compare-table td[data-code="tc"] {
  color: var(--tc-strong);
  font-weight: 700;
}
.compare-table .cell-prose {
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.4;
}
/* =====================================================================
   Callouts, kickers, screenshots — abstract / try / poster / example
   ===================================================================== */
.kicker {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--trust-magenta);
  margin-bottom: var(--space-2);
}

/* Notice / callout — flat, top accent bar (mirrors the principle-card accent),
   no shadow. Uses a top accent rather than border-left to avoid the side-stripe
   tell banned by the impeccable system; DESIGN.md sanctions a top accent bar. */
.notice {
  border: 1px solid var(--trust-magenta-border);
  border-top: var(--border-accent) solid var(--trust-magenta);
  background: var(--trust-magenta-tint);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-md);
}
.notice--muted {
  border: 1px solid var(--ut-border);
  border-top: var(--border-accent) solid var(--ut-slate);
  background: var(--ut-offwhite);
  padding: var(--space-4) var(--space-5);
}
.notice p + p {
  margin-top: var(--space-3);
}
.notice .section-title {
  margin-bottom: var(--space-2);
}

/* Abstract principle list — color-keyed square markers */
.principle-list {
  list-style: none;
  padding: 0;
}
.principle-list li {
  position: relative;
  padding-left: var(--space-5);
  margin-bottom: var(--space-2);
}
.principle-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-sm);
  background: var(--trust-magenta);
}

/* At-a-glance facts card */
.at-a-glance ul {
  margin: 0;
  list-style: none;
}

/* Try-section screenshot grid */
.screenshot-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin: var(--space-4) 0;
}
.screenshot-row img {
  width: 100%;
  height: auto;
  border: 1px solid var(--ut-border);
  border-radius: var(--radius-sm);
  display: block;
}

/* Example report action row */
.example-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
/* =====================================================================
   Motion — scroll progress, hero entrance, scroll reveals
   ===================================================================== */

/* Scroll-progress bar — fixed top, magenta */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: var(--border-accent);
  z-index: 10001;
  overflow: hidden;
  background: transparent;
}
.scroll-progress::after {
  content: "";
  display: block;
  height: 100%;
  background: var(--active-accent);
  transition: background var(--duration-normal) var(--ease-out-quart);
  /* JS sets --scroll-progress as a 0..1 value; transform avoids layout thrash */
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left center;
  /* will-change applied dynamically via JS .is-scrolling class only while scrolling */
}
body.is-scrolling .scroll-progress::after {
  will-change: transform;
}

/* Hero entrance stagger */
@keyframes hero-fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hero-logo {
  animation: hero-fade-up 0.6s var(--ease-out-quart) both;
  animation-delay: 0.1s;
}
.hero h1 {
  animation: hero-fade-up 0.7s var(--ease-out-quart) both;
  animation-delay: 0.25s;
}
.hero .lede {
  animation: hero-fade-up 0.6s var(--ease-out-quart) both;
  animation-delay: 0.4s;
}
.hero-cta {
  animation: hero-fade-up 0.5s var(--ease-out-quart) both;
  animation-delay: 0.55s;
}

/* Scroll-reveal system */
@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s var(--ease-out-quart),
    transform 0.6s var(--ease-out-quart);
}
html.js [data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay tokens for children of a reveal container */
[data-reveal-stagger] > [data-reveal]:nth-child(1) {
  transition-delay: 0s;
}
[data-reveal-stagger] > [data-reveal]:nth-child(2) {
  transition-delay: 0.08s;
}
[data-reveal-stagger] > [data-reveal]:nth-child(3) {
  transition-delay: 0.16s;
}
[data-reveal-stagger] > [data-reveal]:nth-child(4) {
  transition-delay: 0.24s;
}
[data-reveal-stagger] > [data-reveal]:nth-child(5) {
  transition-delay: 0.32s;
}
[data-reveal-stagger] > [data-reveal]:nth-child(6) {
  transition-delay: 0.4s;
}

/* Micro-interactions: button press feedback */
.btn:active {
  transform: scale(0.97);
  transition-duration: 0.06s;
}

/* Micro-interactions: principle card hover border-pulse */
.principle-card {
  transition:
    border-color var(--duration-fast) var(--ease-out-quart),
    background var(--duration-fast) var(--ease-out-quart);
}
/* Principle cards join the hero entrance — staggered cascade */
.principle-card {
  animation: hero-fade-up 0.5s var(--ease-out-quart) both;
}
.principles-grid .principle-card:nth-child(1) {
  animation-delay: 0.65s;
}
.principles-grid .principle-card:nth-child(2) {
  animation-delay: 0.74s;
}
.principles-grid .principle-card:nth-child(3) {
  animation-delay: 0.83s;
}
.principles-grid .principle-card:nth-child(4) {
  animation-delay: 0.92s;
}
.principles-grid .principle-card:nth-child(5) {
  animation-delay: 1.01s;
}

/* Micro-interactions: link-card icon nudge */
.link-card:hover .link-icon {
  transform: translateX(3px);
  transition: transform var(--duration-fast) var(--ease-out-quart);
}
.link-card .link-icon {
  transition: transform var(--duration-fast) var(--ease-out-quart);
}

/* Overdrive: section-title accent slide-in */
@keyframes accent-slide {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}
.section-title {
  position: relative;
  overflow: hidden;
}
.section-title::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--border-accent);
  background: var(--group-accent, var(--trust-magenta));
  animation: accent-slide 0.4s var(--ease-out-quart) both;
  animation-delay: 0.15s;
  opacity: 0;
  transition: opacity 0.3s;
}
.section-head.revealed .section-title::after {
  opacity: 1;
}

/* Lead author chip — a link that keeps the chip shape */
a.author-chip {
  text-decoration: none;
  color: var(--trust-magenta);
  border-color: var(--trust-magenta-border);
}
a.author-chip:hover {
  background: var(--trust-magenta-tint);
  color: var(--trust-magenta-strong);
}

@media (max-width: 720px) {
  .screenshot-row {
    grid-template-columns: 1fr;
  }
  .example-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .example-actions .btn {
    width: 100%;
  }
}

/* =====================================================================
   Print — clean ink-on-paper (navy-tinted neutrals per DESIGN.md), hide interactive chrome
   ===================================================================== */
@media print {
  .site-header,
  .tab-nav,
  .site-footer,
  .upload-zone,
  .compare-controls,
  .hero-cta,
  .example-actions,
  .scroll-progress,
  .btn,
  .btn-primary,
  .btn-ghost,
  .compare-btn {
    display: none !important;
  }
  /* Hide the mobile menu button; reveal the abstract <dialog> as static flow
     so the conference abstract and reference DOIs survive in print/PDF. */
  .nav-toggle {
    display: none;
  }
  .modal {
    display: block;
    position: static;
    inset: auto;
    margin: 0;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .modal::backdrop {
    display: none;
  }
  .modal-close {
    display: none;
  }
  .modal-inner {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: var(--ut-text);
    background: var(--ut-white);
  }
  .prose,
  .prose--wide {
    max-width: 100%;
  }
  a {
    color: var(--ut-text);
    text-decoration: underline;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: var(--ut-muted);
  }
  a[href^="#"]::after {
    content: none;
  }
  img {
    max-width: 100%;
    page-break-inside: avoid;
  }
  .section {
    padding: 12pt 0;
    border-bottom: 1pt solid var(--ut-border);
  }
  .card,
  .principle-card,
  .notice {
    break-inside: avoid;
  }
  .table-wrap {
    overflow-x: visible;
  }
  .tools-table,
  .compare-table {
    font-size: 9pt;
  }
}
