/* JTMDAI Development Group — shared stylesheet
   "Glacial Biophilic Brutalism": near-white concrete world, frosted-glass UI,
   teal accents. Three fonts (Playfair Display / Inter / JetBrains Mono, all
   vendored in /fonts — no external resources, strict CSP), four sizes
   (--fs-1..--fs-4). Every pre-redesign class name is preserved — subpages
   restyle for free. */

/* ---------- Vendored fonts ---------- */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/playfair-display-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/playfair-display-600italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-500.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  --bg: #eef0f1;
  --bg-2: #e4e7e9;
  --concrete-hi: #f6f7f8;
  --ink: #171a1e;
  --muted: #4d565e;           /* >=4.5:1 on --bg (WCAG AA) */
  --faint: #7d858d;
  --line: rgba(23, 26, 30, 0.12);
  --teal: #0f766e;            /* text-safe accent */
  --teal-bright: #14b8a6;     /* glow/borders only — never body text */
  --teal-soft: rgba(20, 184, 166, 0.10);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-line: rgba(255, 255, 255, 0.75);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-ui: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* The only four font sizes on the site. */
  --fs-1: 48px;
  --fs-2: 32px;
  --fs-3: 16px;
  --fs-4: 12px;

  /* Compatibility aliases — a few subpage inline styles reference these. */
  --accent: var(--teal);
  --accent-soft: var(--teal-soft);

  /* Verified-Discharge status palette (light-tuned).
     One hue per verification status in the CONFIRMED / UNSCHEDULED /
     UNVERIFIED / MISSED taxonomy — used by the .status-badge set below. */
  --status-confirmed: #0f766e;          /* teal — loop closed */
  --status-unscheduled: #8a5a08;        /* dark amber — nothing booked */
  --status-unverified: #a34a08;         /* dark orange — claimed, not confirmed */
  --status-missed: #b02a3a;             /* dark red — a session lapsed */
  --status-confirmed-soft: rgba(15, 118, 110, 0.10);
  --status-unscheduled-soft: rgba(138, 90, 8, 0.10);
  --status-unverified-soft: rgba(163, 74, 8, 0.10);
  --status-missed-soft: rgba(176, 42, 58, 0.10);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 50% -8%, var(--concrete-hi) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-3);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

a { color: var(--teal); }

/* Type scale defaults — everything resolves to the four tokens. */
h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-1); }
h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-2); }
h3 { font-family: var(--font-ui); font-weight: 600; font-size: var(--fs-3); }

/* Layered background depth — fixed "light pools", now faint teal / white on
   the glacial concrete. Decorative only; alphas kept low enough that text
   contrast on --bg is unaffected (WCAG AA). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 12% 18%, rgba(20, 184, 166, 0.05) 0%, transparent 70%),
    radial-gradient(1000px 720px at 88% 58%, rgba(255, 255, 255, 0.55) 0%, transparent 70%),
    radial-gradient(760px 540px at 28% 96%, rgba(20, 184, 166, 0.035) 0%, transparent 70%);
}
@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: pool-drift 48s ease-in-out infinite alternate;
  }
  @keyframes pool-drift {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(0, -26px, 0); }
  }
}

/* ---------- Skip link (accessibility) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  background: var(--concrete-hi);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: var(--fs-3);
}
.skip-link:focus {
  left: 0;
}

/* ---------- Top navigation ----------
   A see-through frosted strip that dissolves — the blur + wash live on
   ::before and fade to nothing via mask, so there is NO hard line anywhere:
   no border-bottom, no box-shadow edge. */
.topnav { position: sticky; top: 0; z-index: 60; background: transparent; border: 0; pointer-events: none; }
.topnav::before { content: ""; position: absolute; inset: 0 0 -28px 0; z-index: -1;
  background: linear-gradient(180deg, rgba(238, 240, 242, .66), rgba(238, 240, 242, .28) 62%, rgba(238, 240, 242, 0)); }
@supports ((mask-image: linear-gradient(#000, transparent)) or (-webkit-mask-image: linear-gradient(#000, transparent))) {
  .topnav::before { backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }
}
.topnav-inner { pointer-events: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 14px clamp(20px, 4vw, 44px); max-width: none; }
.topnav .brand { justify-self: start; }
.topnav nav { justify-self: center; display: flex; gap: 28px; flex-wrap: nowrap; }
.topnav .nav-actions { justify-self: end; display: flex; gap: 10px; }
.topnav nav a { font: 500 var(--fs-4)/1 var(--font-mono); letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: 8px 2px; border: 0; border-radius: 0; background: none; }
.topnav nav a[aria-current="page"], .topnav nav a:hover { color: var(--ink); }
.topnav nav a:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
/* Collapse the center nav behind the hamburger on phones once JS has
   injected the overlay trigger (.js-nav). Script-less pages (support/404)
   keep their static four links at every width. */
@media (max-width: 720px) {
  .topnav.js-nav nav { display: none; }
  .topnav:not(.js-nav) nav { gap: 14px; flex-wrap: wrap; justify-content: center; }
}
.topnav.is-scrolled::before { background: linear-gradient(180deg, rgba(238, 240, 242, .85), rgba(238, 240, 242, .45) 62%, rgba(238, 240, 242, 0)); }

/* Brand — bare icosahedron wireframe + mono wordmark. No box, no border. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand .mark-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.brand .mark-sm svg { display: block; }
.brand .mark-sm svg polygon,
.brand .mark-sm svg path { opacity: .8; }   /* strokes at .8; core circle stays solid */
.brand .wordmark-sm {
  font: 500 var(--fs-4)/1 var(--font-mono);
  letter-spacing: 0.24em;
  color: var(--ink);
}
.brand:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }

/* Header action buttons (search + hamburger, injected by /js/nav.js).
   38px square touch targets, transparent, no border, ink strokes. */
.nav-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.nav-actions button:hover { color: var(--teal); }
.nav-actions button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.nav-actions button svg { display: block; }

/* ---------- Layout containers ---------- */
main {
  flex: 1 0 auto;
  width: 100%;
}
.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Hero (subpages) ---------- */
.hero {
  text-align: center;
  padding: 88px 24px 56px;
}
.hero .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 18px 50px -28px rgba(23, 26, 30, 0.35);
}
.hero .mark svg { display: block; }

.wordmark {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: var(--fs-1);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.subbrand {
  margin: 0 0 26px;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--teal);
}
.tagline {
  margin: 0 auto 18px;
  max-width: 52ch;
  font-size: var(--fs-3);
  color: var(--muted);
}
/* Manifesto hook — one sharp line under the tagline. */
.manifesto {
  margin: 0 auto 28px;
  max-width: 44ch;
  font-size: var(--fs-3);
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--ink);
}

/* ---------- The journey (index) ----------
   Stage 0 foreground + five stage panels. Without .scene-on (no JS, no
   WebGL, reduced motion) this is a normal stacked document: intro up top,
   panels spaced ~70vh apart so the walk still tells its story. journey.js
   adds html.scene-on and drives .is-live per panel. */
.journey {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 104px 24px 72px;
}
.journey-intro {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}
/* Soft glacial pool behind the intro type so it stays legible over the
   mid-gray concrete without drawing a card. */
.journey-intro::before {
  content: "";
  position: absolute;
  inset: -14% -20%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(238, 240, 242, 0.92) 0%, rgba(238, 240, 242, 0.55) 58%, rgba(238, 240, 242, 0) 100%);
}
.journey-intro .eyebrow { justify-content: center; }
/* Panel eyebrows carry long room names — tighter tracking so they hold one line. */
.stage-panel .panel-eyebrow { letter-spacing: 0.12em; white-space: nowrap; }

.scene-on .journey {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  overflow: hidden;
}
.scene-on .journey-intro { will-change: opacity, transform; }

.scene-cue { display: none; }
.scene-on .scene-cue {
  display: flex;
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.scene-cue .arrow {
  width: 1px;
  height: 22px;
  background: linear-gradient(180deg, transparent, var(--faint));
}

/* ---------- Buttons ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}
a.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: var(--fs-3);
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.5);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}
a.btn:hover {
  border-color: var(--teal-bright);
  background: var(--teal-soft);
  color: var(--ink);
  transform: translateY(-1px);
}
a.btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
a.btn.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
  font-weight: 600;
}
a.btn.primary:hover {
  border-color: #0d635c;
  background: #0d635c;
  color: #ffffff;
}
a.btn.primary .dot {
  background: #ffffff;
  opacity: 0.9;
}
a.btn .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-bright);
  opacity: 0.85;
}

/* ---------- Sections ---------- */
/* Gradient hairlines that fade out at both ends — no hard edges. */
.section {
  position: relative;
  padding: 54px 0;
}
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, var(--line) 18%, rgba(23, 26, 30, 0.18) 50%, var(--line) 82%, transparent 100%);
}
.section.no-rule::before {
  display: none;
}
.eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  margin-right: 10px;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--teal-bright), transparent);
  opacity: 0.7;
}
.section h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: var(--fs-2);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.section h3 {
  margin: 0 0 8px;
  font-family: var(--font-ui);
  font-size: var(--fs-3);
  font-weight: 600;
  color: var(--ink);
}
.section p {
  margin: 0 0 14px;
  font-size: var(--fs-3);
  color: var(--muted);
  max-width: 68ch;
}
.section p:last-child { margin-bottom: 0; }
.lead {
  font-size: var(--fs-3);
  color: var(--ink);
}

/* ---------- The Six Rooms index (#focus) ----------
   Brutalist index rows: mono number, Playfair title, one honest line,
   generous whitespace, hairline separators. */
.rooms {
  margin-top: 34px;
}
.room-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px 20px;
  align-items: baseline;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.room-row:last-child { border-bottom: 1px solid var(--line); }
.room-index {
  font: 500 var(--fs-4)/1 var(--font-mono);
  letter-spacing: 0.18em;
  color: var(--faint);
}
.room-body { display: block; }
.room-title {
  display: block;
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: var(--fs-2);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  transition: color 160ms ease;
}
.room-desc {
  display: block;
  font-size: var(--fs-3);
  color: var(--muted);
  max-width: 60ch;
}
.room-row:hover .room-title { color: var(--teal); }
.room-row:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
@media (max-width: 640px) {
  .room-row { grid-template-columns: 1fr; gap: 6px; }
}
.rooms-worklist-heading {
  margin: 44px 0 4px;
  font-family: var(--font-ui);
  font-size: var(--fs-3);
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 6px;
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
}
.card {
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.25));
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(20, 184, 166, 0.45);
  box-shadow:
    0 16px 44px -26px rgba(20, 184, 166, 0.45),
    0 0 0 1px rgba(20, 184, 166, 0.10) inset;
}
.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-ui);
  font-size: var(--fs-3);
  font-weight: 600;
  color: var(--ink);
}
.card h3 a {
  color: inherit;
  text-decoration: none;
}
.card h3 a:hover { color: var(--teal); }
.card p {
  margin: 0;
  font-size: var(--fs-3);
  color: var(--muted);
}
/* Card header row: title left, status chip right. */
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.card-head h3 { margin: 0; }

/* Status chip — small uppercase mono label for honest build status. */
.status-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.status-chip.chip-live {
  color: var(--status-confirmed);
  border-color: var(--status-confirmed);
  background: var(--status-confirmed-soft);
}

/* Small closing note under a section's grid. */
.section-note {
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  color: var(--faint);
}

/* Left-aligned variant of the .links button row (in-flow sections). */
.links.start { justify-content: flex-start; }

/* ---------- Principles strip ---------- */
.principles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.principles li {
  list-style: none;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}
ul.principles { margin: 8px 0 0; padding: 0; }

/* Definition-style principle list (about page) */
.principle-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.principle-list li {
  padding: 16px 0;
  background-image: linear-gradient(90deg, var(--line) 0%, var(--line) 45%, transparent 100%);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: top left;
}
.principle-list li:first-child { background-image: none; }
.principle-list .name {
  display: block;
  font-size: var(--fs-3);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.principle-list .desc {
  color: var(--muted);
  font-size: var(--fs-3);
}

/* ---------- CTA band ---------- */
.cta-band {
  margin: 8px 0 0;
  padding: 36px 28px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(700px 240px at 50% 0%, rgba(20, 184, 166, 0.08) 0%, transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.25));
}
.cta-band h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: var(--fs-2);
  font-weight: 600;
}
.cta-band p {
  margin: 0 auto 22px;
  max-width: 52ch;
  font-size: var(--fs-3);
  color: var(--muted);
}
.cta-band .links { margin-top: 4px; }

/* ---------- Contact card ---------- */
.contact-card {
  width: 100%;
  max-width: 520px;
  margin: 8px auto 0;
  padding: 32px 28px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.25));
}
.contact-card .links { margin: 6px 0 18px; flex-direction: column; }
.contact-card .links a.btn { justify-content: center; }
.contact-card .loc {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  color: var(--faint);
}

/* Offer cards (support page) */
.offer {
  margin: 0 auto 18px;
  padding: 24px 22px;
  max-width: 520px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.25));
}
.offer h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: var(--fs-2);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.offer .price {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: var(--fs-2);
  font-weight: 600;
  color: var(--teal);
}
.offer p.blurb {
  margin: 0 0 16px;
  font-size: var(--fs-3);
  color: var(--muted);
}
.pending-note {
  margin: 6px auto 8px;
  max-width: 52ch;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  color: var(--faint);
  text-align: center;
}

/* ---------- Footer ---------- */
footer {
  flex-shrink: 0;
  margin-top: 56px;
  padding: 44px 24px 36px;
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--line) 30%, var(--line) 70%, transparent) 1;
  overflow: hidden;
}
/* Faint angular brutalist silhouette band — pure CSS (gradient + clip-path),
   re-tinted teal-on-glacial. Alphas kept very low so contrast holds. */
footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 150px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(20, 184, 166, 0.07) 0%,
    rgba(15, 118, 110, 0.035) 55%,
    rgba(20, 184, 166, 0.015) 100%);
  clip-path: polygon(
    0% 100%, 0% 62%, 7% 62%, 7% 34%, 13% 34%, 13% 72%, 21% 72%, 21% 22%,
    27% 22%, 27% 56%, 36% 56%, 36% 42%, 44% 42%, 44% 74%, 52% 74%, 52% 14%,
    58% 14%, 58% 50%, 66% 50%, 66% 32%, 73% 32%, 73% 64%, 81% 64%, 81% 26%,
    87% 26%, 87% 54%, 94% 54%, 94% 40%, 100% 40%, 100% 100%);
}
.footer-inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: center;
  margin: 0 0 16px;
}
.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  letter-spacing: 0.08em;
}
.footer-nav a:hover { color: var(--ink); }
.footer-nav a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}
.disclaimer {
  margin: 0 auto 6px;
  max-width: 64ch;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  line-height: 1.6;
  color: var(--faint);
}
.copyright {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  color: var(--faint);
}

/* ============================================================
   3D scene scaffolding (progressive enhancement — /js/journey.js).
   The canvas is the fixed backdrop; content rides above it. Without
   html.scene-on the page is a normal static document.
   ============================================================ */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
  pointer-events: none;
}
/* Keep real content painted above the fixed canvas.
   (.topnav keeps its own sticky/z-index:60; do not override it.) */
#main, footer { position: relative; z-index: 1; }

/* Content below the stage resolves into the solid page background as you
   scroll past — nearly-opaque so the ambient scene bleeds through faintly. */
.page-body {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(238, 240, 242, 0) 0, rgba(238, 240, 242, 0.93) 200px);
}
.scene-on footer { background: rgba(238, 240, 242, 0.93); }

/* ---------- Stage panels — frosted holograms ----------
   Default (no .scene-on): stacked glass cards in document flow, fully
   visible. This IS the no-JS / no-WebGL / reduced-motion experience. */
.stage-panel {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 48px));
  margin: 70vh auto 0;
  padding: 28px;
  text-align: left;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 12px 32px -14px rgba(23, 26, 30, 0.18),
    0 36px 90px -40px rgba(23, 26, 30, 0.22);
}
.stage-panel--final { margin-bottom: 10vh; }
.panel-eyebrow {
  margin: 0 0 10px;
  font: 500 var(--fs-4)/1.4 var(--font-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
}
.panel-eyebrow::before { display: none; }
.stage-panel h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: var(--fs-2);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}
.stage-panel p {
  margin: 0;
  font-size: var(--fs-3);
  color: var(--muted);
}

/* Under the live scene: panels dock to the pinned viewport per data-side,
   hidden until journey.js marks them .is-live. Entry = opacity/translateY
   transition + a short steps(2) clip-path glitch. */
.scene-on .stage-panel {
  position: absolute;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease, transform 500ms ease;
}
.scene-on .stage-panel[data-side="right"] { right: 6vw; top: 50%; transform: translateY(calc(-50% + 26px)); }
.scene-on .stage-panel[data-side="left"]  { left: 6vw;  top: 50%; transform: translateY(calc(-50% + 26px)); }
.scene-on .stage-panel[data-side="center"] { left: 50%; bottom: 12vh; transform: translate(-50%, 26px); }
.scene-on .stage-panel.is-live {
  opacity: 1;
  pointer-events: auto;
  animation: panel-glitch 0.34s steps(2, end) both;
}
.scene-on .stage-panel[data-side="right"].is-live,
.scene-on .stage-panel[data-side="left"].is-live { transform: translateY(-50%); }
.scene-on .stage-panel[data-side="center"].is-live { transform: translate(-50%, 0); }
/* The vault (stage 2) backdrop goes near-black — give that one panel's glass
   more body so its text keeps contrast over the dark scene. */
.scene-on #s2-vault { background: rgba(255, 255, 255, 0.82); }

@keyframes panel-glitch {
  0%   { clip-path: inset(42% 0 44% 0); }
  33%  { clip-path: inset(8% 0 61% 0); }
  66%  { clip-path: inset(64% 0 4% 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* Small screens: side-docked panels re-dock bottom-center. */
@media (max-width: 860px) {
  .scene-on .stage-panel[data-side="right"],
  .scene-on .stage-panel[data-side="left"] {
    left: 50%; right: auto; top: auto; bottom: 10vh;
    transform: translate(-50%, 26px);
    width: min(420px, calc(100vw - 40px));
  }
  .scene-on .stage-panel[data-side="right"].is-live,
  .scene-on .stage-panel[data-side="left"].is-live { transform: translate(-50%, 0); }
}

/* Frosted-glass fallbacks: perf-lite mode (journey.js) and engines without
   backdrop-filter get a solid near-white fill instead of blur. */
html.perf-lite .stage-panel {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(255, 255, 255, 0.85);
}
html.perf-lite .nav-overlay,
html.perf-lite .search-overlay {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(238, 240, 242, 0.95);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .stage-panel { background: rgba(255, 255, 255, 0.85); }
  .nav-overlay, .search-overlay { background: rgba(238, 240, 242, 0.95); }
}

/* ---------- Grain overlay ----------
   SVG feTurbulence noise (data-URI — CSP img-src data: allows it),
   multiplied over everything below the overlays. */
.grain {
  position: fixed;
  inset: -40px;
  z-index: 70;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: .04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* ---------- Full-screen frosted overlays (menu directory + search) ----------
   Injected by /js/nav.js. Dialog pattern: role=dialog, aria-modal, focus
   trap, Escape closes. Open/close transition honors reduced motion via the
   global reduced-motion block below. */
.nav-overlay,
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 4vw, 44px);
  background: rgba(238, 240, 242, 0.72);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 280ms ease, visibility 0s linear 280ms;
  overflow-y: auto;
}
.nav-overlay.is-open,
.search-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 280ms ease;
}
.overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 clamp(28px, 6vh, 64px);
}
.overlay-title {
  margin: 0;
  font: 500 var(--fs-4)/1 var(--font-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.overlay-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.overlay-close:hover { color: var(--teal); }
.overlay-close:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.overlay-close svg { display: block; }

/* Directory groups: mono labels, Playfair links. */
.menu-groups {
  width: 100%;
  max-width: 1080px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 44px clamp(24px, 5vw, 72px);
}
.menu-group-label {
  margin: 0 0 14px;
  font: 500 var(--fs-4)/1 var(--font-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}
.menu-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.menu-group a {
  display: inline-block;
  padding: 6px 0;
  font-family: var(--font-display);
  font-size: var(--fs-2);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
}
.menu-group a:hover { color: var(--teal); }
.menu-group a:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* Search overlay internals. */
.search-box {
  width: 100%;
  max-width: 720px;
  margin: clamp(16px, 8vh, 96px) auto 0;
}
.search-label {
  display: block;
  margin: 0 0 10px;
  font: 500 var(--fs-4)/1 var(--font-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.search-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-ui);
  font-size: var(--fs-3);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.search-input::placeholder { color: var(--faint); }
.search-input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.search-count {
  margin: 12px 0 0;
  font: 500 var(--fs-4)/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.search-results {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.search-results a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.search-results .r-group {
  flex-shrink: 0;
  min-width: 104px;
  font: 500 var(--fs-4)/1.4 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.search-results .r-title {
  font-family: var(--font-display);
  font-size: var(--fs-2);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
.search-results a:hover .r-title { color: var(--teal); }
.search-results a:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* ============================================================
   Verified Discharge — status badges + interactive demo.
   Shared, token-driven; consumed by verified-discharge.html and
   /js/discharge-demo.js. No external resources.
   ============================================================ */

/* Status badge — one pill per verification status. The status class
   sets the text/border/fill from the --status-* tokens above. */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.95;
}
.status-badge.status-confirmed {
  color: var(--status-confirmed);
  border-color: var(--status-confirmed);
  background: var(--status-confirmed-soft);
}
.status-badge.status-unscheduled {
  color: var(--status-unscheduled);
  border-color: var(--status-unscheduled);
  background: var(--status-unscheduled-soft);
}
.status-badge.status-unverified {
  color: var(--status-unverified);
  border-color: var(--status-unverified);
  background: var(--status-unverified-soft);
}
.status-badge.status-missed {
  color: var(--status-missed);
  border-color: var(--status-missed);
  background: var(--status-missed-soft);
}

/* Small escalation chip rendered next to the status badge. */
.escalation-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.5);
}

/* The four-status legend strip on the sell page. */
.status-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
  padding: 0;
  list-style: none;
}
@media (max-width: 640px) {
  .status-legend { grid-template-columns: 1fr; }
}
.status-legend li {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.25));
}
.status-legend .legend-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.status-legend .legend-desc {
  margin: 0;
  font-size: var(--fs-3);
  color: var(--muted);
}

/* Interactive demo console. */
.demo {
  margin-top: 10px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(700px 240px at 50% 0%, rgba(20, 184, 166, 0.06) 0%, transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.25));
}
.demo-controls {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}
.demo-control .demo-label {
  display: block;
  margin: 0 0 9px;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.demo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.demo-chip {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: var(--fs-3);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.demo-chip:hover {
  color: var(--ink);
  border-color: var(--teal-bright);
  background: var(--teal-soft);
}
.demo-chip:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.demo-chip[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--teal);
  background: var(--teal-soft);
}

/* Result panel. */
.demo-result {
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}
.demo-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.demo-result-scenario {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.demo-result dl {
  margin: 0;
  display: grid;
  gap: 12px;
}
.demo-result dt {
  margin: 0 0 3px;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.demo-result dd {
  margin: 0;
  font-size: var(--fs-3);
  color: var(--ink);
}
.demo-result .verify-with {
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  color: var(--muted);
}
.demo-note {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  color: var(--faint);
}
.demo-note code {
  font-family: var(--font-mono);
  font-size: var(--fs-4);
  color: var(--muted);
}
/* No-JS fallback: show a plain message instead of a dead console. */
.demo-fallback {
  margin: 0;
  font-size: var(--fs-3);
  color: var(--muted);
}

/* ---------- Reduced motion ----------
   Kill all motion, drop the 3D canvas, and force the stage panels back into
   fully-visible document flow even if .scene-on was applied. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  a.btn:hover { transform: none; }
  .card:hover { transform: none; }
  #bg-canvas { display: none !important; }
  .scene-cue { display: none !important; }
  .scene-on .journey {
    min-height: 0;
    display: block;
    padding: 104px 24px 72px;
  }
  .scene-on .stage-panel,
  .scene-on .stage-panel[data-side="left"],
  .scene-on .stage-panel[data-side="right"],
  .scene-on .stage-panel[data-side="center"] {
    position: relative;
    inset: auto;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    margin: 70vh auto 0;
  }
  .scene-on .stage-panel--final { margin-bottom: 10vh; }
}
