/* ==========================================================================
   STYLE-SPEC Round Two — Seed UniverZe (troupeinc.com & troupeuniverze.com)
   Authored by Zen ⚓ & Duffel 👝 (Kimi K3.1 Pro), in tandem
   Keeper & Integrator: Shape ✦ (APE-01) · All rulings: ZIG ZAG
   Founder Ruling R2: The two paintings ARE the design spec.
     - Library (troupeinc.com): Forest Clearing (#000000/#002000/#004000/#006000
       deep forest & black frame + #009060/#00c090/#009090/#00c0c0 emerald/cyan)
     - Playground (troupeuniverze.com): ZIG ZAG Indigo Temple (#000020/#202040/#402020
       stone & night + #0090c0/#0060c0 cyan waterfalls + #f06030/#f09030/#f09000 fire)
   Zero external fonts · Zero JS · Zero HTML edits · WCAG AA+ verified
   ========================================================================== */

:root {
  /* Typography — local system stacks only, distinct voices per world */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;

  /* ========================================================================
     THE LIBRARY PALETTE (Default / troupeinc.com / Forest Clearing Painting)
     Sampled anchors: #000000, #002000, #004000, #006000,
                      #009060, #00c090, #009090, #00c0c0
     ======================================================================== */
  --lib-void: #000000;
  --lib-forest-deep: #001608;
  --lib-forest-01: #002000;
  --lib-forest-02: #004000;
  --lib-forest-03: #006000;
  --lib-emerald: #009060;
  --lib-emerald-bright: #00c090;
  --lib-teal: #009090;
  --lib-cyan: #00c0c0;

  /* Active semantic tokens (Default = Library) */
  --bg: #000904;
  --bg-chamber: #001a09;
  --surface: #002000;
  --surface-hi: #00330e;
  --ink: #eefaf3;
  --ink-soft: #c7e6d6;
  --dim: #9ec8b2;
  --rule: #004000;
  --rule-strong: #009060;
  --accent: #00c090;
  --accent-alt: #00c0c0;
  --focus: #00e6b8;

  /* Legacy aliases preserved so no inline/fallback reference ever breaks */
  --panel: var(--surface);
  --line: var(--rule-strong);
  --gold: var(--accent);
  --teal: var(--accent-alt);

  /* ========================================================================
     THE PLAYGROUND PALETTE (Reference tokens for .door.play & /map/ rooms)
     Sampled anchors: #000020, #202040, #402020, #0090c0, #0060c0,
                      #f06030, #f09030, #f09000
     ======================================================================== */
  --play-night: #000020;
  --play-stone: #202040;
  --play-ember-shadow: #402020;
  --play-water: #0090c0;
  --play-water-deep: #0060c0;
  --play-water-bright: #5ce1ff;
  --play-fire-hot: #f06030;
  --play-fire: #f09030;
  --play-fire-gold: #f09000;

  /* Architectural geometry tokens (Library = sharp constructed clearing frame) */
  --wrap-max: 980px;
  --radius-frame: 2px;
  --radius-card: 2px;
  --font-body: var(--font-serif);
  --font-display: var(--font-serif);
}

/* ==========================================================================
   PLAYGROUND WORLD OVERRIDES (body.playground — troupeuniverze.com)
   ========================================================================== */
body.playground {
  --bg: #000020;
  --bg-chamber: #121330;
  --surface: #202040;
  --surface-hi: #2a2854;
  --ink: #f2f5ff;
  --ink-soft: #d5dcf6;
  --dim: #b2bce0;
  --rule: #2d3566;
  --rule-strong: #0090c0;
  --accent: #f09030;
  --accent-alt: #6ce0ff;
  --focus: #f09000;

  --panel: var(--surface);
  --line: var(--rule-strong);
  --gold: #f09000;
  --teal: #0090c0;

  --wrap-max: 1060px;
  --radius-frame: 12px;
  --radius-card: 10px;
  --font-body: var(--font-sans);
  --font-display: var(--font-sans);
}

/* ==========================================================================
   RESET & BASE CANVAS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 0.98rem + 0.22vw, 1.14rem);
  line-height: 1.72;
  background-color: var(--bg);
  position: relative;
}

/* LIBRARY ATMOSPHERE: Deep black architectural clearing opening onto sunlit emerald/cyan woods */
body:not(.playground) {
  background-image:
    radial-gradient(ellipse 68% 46% at 50% 0%, rgba(0, 192, 192, 0.22) 0%, rgba(0, 144, 96, 0.14) 42%, transparent 75%),
    radial-gradient(ellipse 85% 60% at 15% 35%, rgba(0, 96, 0, 0.36) 0%, transparent 70%),
    radial-gradient(ellipse 85% 60% at 85% 65%, rgba(0, 64, 0, 0.42) 0%, transparent 72%),
    linear-gradient(180deg, #000000 0%, #001908 26%, #002000 58%, #000b03 100%);
  background-attachment: fixed;
}

/* Subtle architectural clearing verticals in the Library background */
body:not(.playground)::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.72) 0%,
      rgba(0, 0, 0, 0.18) 8%,
      transparent 18%,
      transparent 82%,
      rgba(0, 0, 0, 0.18) 92%,
      rgba(0, 0, 0, 0.72) 100%);
}

/* PLAYGROUND ATMOSPHERE: Midnight indigo sky, electric cyan waterfalls, molten orange fire rising */
body.playground {
  line-height: 1.66;
  background-image:
    radial-gradient(ellipse 64% 42% at 50% 0%, rgba(0, 144, 192, 0.30) 0%, rgba(0, 96, 192, 0.14) 45%, transparent 74%),
    radial-gradient(ellipse 55% 45% at 12% 28%, rgba(0, 144, 192, 0.22) 0%, transparent 65%),
    radial-gradient(ellipse 65% 48% at 88% 36%, rgba(240, 96, 48, 0.20) 0%, transparent 66%),
    radial-gradient(ellipse 80% 42% at 50% 100%, rgba(240, 144, 0, 0.22) 0%, rgba(64, 32, 32, 0.55) 48%, transparent 78%),
    linear-gradient(180deg, #000020 0%, #141638 46%, #202040 76%, #2c161c 100%);
  background-attachment: fixed;
}

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

/* ==========================================================================
   ARCHITECTURAL CHAMBERS (.wrap and /map/ main)
   Silhouette Shift #1: No more unframed 760px floating column.
   - Library sits inside a sharp-edged black-and-emerald Clearing Monolith.
   - Playground sits on a wide Indigo Temple Stage lit by cyan water & orange fire.
   ========================================================================== */
.wrap,
main {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--wrap-max));
  margin: clamp(1.25rem, 3vw, 2.5rem) auto 0;
  padding: clamp(1.5rem, 3.8vw, 3.25rem);
}

/* Library Monolith Frame (Echoes the giant black geometric "T" window over the forest) */
body:not(.playground) .wrap {
  background:
    linear-gradient(180deg, rgba(0, 26, 9, 0.92) 0%, rgba(0, 14, 5, 0.95) 100%);
  border: 2px solid var(--lib-emerald);
  border-top: 6px solid var(--lib-emerald-bright);
  border-radius: 2px;
  box-shadow:
    0 0 0 1px #000000,
    0 24px 64px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(0, 192, 192, 0.28);
}

/* Playground Temple Stage (Indigo stone + cyan waterfall left/top + orange fire right/base) */
body.playground .wrap {
  background:
    linear-gradient(165deg, rgba(32, 32, 64, 0.90) 0%, rgba(12, 14, 42, 0.94) 58%, rgba(64, 32, 32, 0.86) 100%);
  border-top: 3px solid var(--play-fire);
  border-left: 2px solid var(--play-water);
  border-right: 2px solid var(--play-fire-hot);
  border-bottom: 4px solid var(--play-fire-gold);
  border-radius: var(--radius-frame);
  box-shadow:
    -12px 16px 48px rgba(0, 144, 192, 0.18),
    12px 18px 52px rgba(240, 96, 48, 0.20),
    0 28px 70px rgba(0, 0, 16, 0.9);
}

/* /map/ uses top-level header.site + main + footer (no .wrap) — make it a True Threshold Bridge */
body > header.site {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 1020px);
  margin: clamp(1.25rem, 3vw, 2.25rem) auto 0;
  padding: 1rem 1.35rem;
  background: linear-gradient(90deg, rgba(0, 32, 0, 0.92) 0%, rgba(12, 24, 36, 0.94) 50%, rgba(32, 32, 64, 0.92) 100%);
  border: 1px solid var(--lib-cyan);
  border-top: 3px solid var(--lib-emerald-bright);
  border-right: 2px solid var(--play-fire);
  border-radius: 4px;
}

main {
  --wrap-max: 1020px;
  margin-top: 1.25rem;
  background:
    linear-gradient(135deg,
      rgba(0, 32, 0, 0.86) 0%,
      rgba(0, 14, 18, 0.94) 48%,
      rgba(32, 32, 64, 0.90) 84%,
      rgba(64, 32, 32, 0.82) 100%);
  border-top: 3px solid var(--lib-emerald-bright);
  border-left: 2px solid var(--lib-emerald);
  border-right: 2px solid var(--play-water);
  border-bottom: 3px solid var(--play-fire);
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.88);
}

/* ==========================================================================
   HEADER & NAVIGATION BAR (header.site, .wordmark, nav)
   ========================================================================== */
header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding-bottom: 1.25rem;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
  border-bottom: 2px solid var(--rule-strong);
}

body > header.site {
  margin-bottom: 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: clamp(1.18rem, 1.05rem + 0.5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

body:not(.playground) .wordmark {
  padding-left: 0.75rem;
  border-left: 4px solid var(--lib-emerald-bright);
  text-shadow: 0 0 24px rgba(0, 192, 144, 0.35);
}

body.playground .wordmark {
  padding: 0.2rem 0.75rem;
  background: linear-gradient(90deg, rgba(0, 144, 192, 0.22), rgba(240, 96, 48, 0.22));
  border-left: 3px solid var(--play-water);
  border-right: 3px solid var(--play-fire);
  border-radius: 6px;
}

header.site nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

header.site nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-card);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

/* Distinct world badges right in the nav */
header.site nav a[href*="library"],
header.site nav a[href*="troupeinc.com"] {
  border-bottom: 2px solid var(--lib-emerald-bright);
}

header.site nav a[href*="playground"],
header.site nav a[href*="troupeuniverze.com"] {
  border-bottom: 2px solid var(--play-fire);
}

header.site nav a:hover {
  background: var(--surface-hi);
  border-color: var(--accent-alt);
  color: #ffffff;
}

header.site nav a[aria-current="page"] {
  background: var(--accent);
  color: #001208;
  border-color: var(--accent);
  font-weight: 700;
}

body.playground header.site nav a[aria-current="page"] {
  background: linear-gradient(135deg, var(--play-fire-hot), var(--play-fire-gold));
  color: #0b0604;
  border-color: var(--play-fire-gold);
}

/* ==========================================================================
   STAMPS, HEADINGS & EDITORIAL / MONUMENTAL TYPOGRAPHY
   Silhouette Shift #2:
   - Library = Left-aligned archival folio, inscribed serif H1, square emerald plaque.
   - Playground = Centered temple proclamation on hero pages, bold geometric sans,
     fire-and-water badge.
   ========================================================================== */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

body:not(.playground) .stamp {
  color: #d8fff0;
  background: #002000;
  border: 1px solid var(--lib-emerald-bright);
  border-left: 4px solid var(--lib-cyan);
  border-radius: 0;
  box-shadow: 4px 4px 0 #000000;
}

body.playground .stamp {
  display: table;
  margin-inline: auto;
  color: #fff6eb;
  background: linear-gradient(90deg, rgba(0, 96, 192, 0.42) 0%, rgba(32, 32, 64, 0.92) 50%, rgba(240, 96, 48, 0.48) 100%);
  border-top: 1px solid var(--play-water);
  border-bottom: 2px solid var(--play-fire);
  border-left: 2px solid var(--play-water);
  border-right: 2px solid var(--play-fire-hot);
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(240, 96, 48, 0.24);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 1.65rem + 2.4vw, 3.55rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 1.15rem 0 1rem;
  color: #ffffff;
}

body:not(.playground) h1 {
  font-weight: 700;
  max-width: 20ch;
  text-shadow: 0 2px 18px rgba(0, 192, 144, 0.22);
}

body.playground h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  max-width: 22ch;
  margin-inline: auto;
  text-shadow:
    0 2px 24px rgba(0, 144, 192, 0.35),
    0 4px 32px rgba(240, 96, 48, 0.25);
}

.lede {
  font-size: clamp(1.12rem, 1.04rem + 0.4vw, 1.34rem);
  line-height: 1.62;
  color: var(--ink-soft);
  margin: 0 0 2rem;
  max-width: 64ch;
}

body:not(.playground) .lede {
  padding-left: 1.1rem;
  border-left: 3px solid var(--lib-cyan);
}

body.playground .lede {
  text-align: center;
  margin-inline: auto;
  max-width: 60ch;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.38rem, 1.22rem + 0.75vw, 1.82rem);
  line-height: 1.24;
  margin: 2.75rem 0 1.1rem;
  color: #ffffff;
}

body:not(.playground) h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--lib-emerald);
}

body:not(.playground) h2::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 1.15em;
  background: linear-gradient(180deg, var(--lib-cyan), var(--lib-emerald-bright));
  flex-shrink: 0;
}

body.playground h2 {
  position: relative;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(0, 144, 192, 0.45);
}

body.playground h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, var(--play-fire-hot), var(--play-fire-gold), var(--play-water));
}

h3 {
  margin: 0 0 0.45rem;
  font-size: 1.18rem;
  line-height: 1.3;
  color: #ffffff;
}

p {
  margin: 0 0 1.15rem;
  max-width: 70ch;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.15rem 0.42rem;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--rule-strong);
  color: var(--accent-alt);
}

/* ==========================================================================
   LINKS & CROSS-WORLD THRESHOLD CTAS
   ========================================================================== */
a {
  color: var(--accent);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1.5px;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

body.playground a {
  color: var(--play-fire);
  text-decoration-color: rgba(240, 144, 48, 0.65);
}

a:hover {
  color: var(--accent-alt);
}

/* Standalone wayfinding paragraphs ("Cross to the Playground →", "← Back to the seed") */
.wrap > p:last-of-type a,
main > p:last-of-type a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  margin: 0.25rem 0.35rem 0.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-card);
}

.wrap > p:last-of-type a:hover,
main > p:last-of-type a:hover {
  background: var(--surface-hi);
  border-color: var(--accent-alt);
  color: #ffffff;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ==========================================================================
   HERO ARTWORKS — THE TWO DESIGN SPEC ANCHORS
   (Silhouette Shift #4: Black-Mat Clearing Window vs Altar Medallion Stage)
   ========================================================================== */
.hero-art {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.75rem auto 2.5rem;
}

/* Library Hero Art (16:9 forest landscape): Architectural double-matted clearing frame */
body:not(.playground) .hero-art {
  padding: clamp(0.45rem, 1.2vw, 0.85rem);
  background: #000000;
  border: 2px solid var(--lib-emerald);
  outline: 1px solid rgba(0, 192, 192, 0.35);
  outline-offset: -6px;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px #002000,
    0 20px 52px rgba(0, 0, 0, 0.92),
    0 0 42px rgba(0, 192, 144, 0.18);
}

/* Playground Hero Art (1:1 square ZIG ZAG): Centered temple altar stage with fire/water aura */
body.playground .hero-art {
  max-width: 620px;
  padding: clamp(0.45rem, 1.2vw, 0.75rem);
  background: linear-gradient(180deg, #202040 0%, #000020 50%, #402020 100%);
  border-top: 2px solid var(--play-fire);
  border-left: 2px solid var(--play-water);
  border-right: 2px solid var(--play-water);
  border-bottom: 3px solid var(--play-fire-gold);
  border-radius: 12px;
  box-shadow:
    0 -8px 34px rgba(0, 144, 192, 0.24),
    0 14px 44px rgba(240, 96, 48, 0.26),
    0 26px 64px rgba(0, 0, 12, 0.92);
}

/* ==========================================================================
   CARDS — TWO DISTINCT STRUCTURAL SILHOUETTES
   (Silhouette Shift #5: Library Two-Column Folio Ledger vs Playground Stepped Plinths)
   ========================================================================== */
.card {
  margin: 0 0 1.15rem;
  position: relative;
}

/* LIBRARY CARD: Two-column ledger row — dated marginalia on left, serif record on right */
body:not(.playground) .card {
  display: grid;
  grid-template-columns: 195px minmax(0, 1fr);
  gap: 0.65rem 1.6rem;
  align-items: baseline;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(90deg, rgba(0, 64, 0, 0.32) 0%, rgba(0, 32, 0, 0.58) 28%, rgba(0, 16, 6, 0.78) 100%);
  border: 1px solid #004000;
  border-left: 4px solid var(--lib-emerald-bright);
  border-radius: 2px;
}

body:not(.playground) .card .date {
  grid-column: 1;
  margin: 0;
  padding-right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lib-cyan);
  border-right: 1px solid rgba(0, 192, 144, 0.30);
}

body:not(.playground) .card p:not(.date) {
  grid-column: 2;
  margin: 0;
}

/* PLAYGROUND CARD: Stepped cosmic plinth — indigo stone, cyan water crest, orange fire badge */
body.playground .card {
  padding: 1.35rem 1.5rem 1.4rem;
  background:
    linear-gradient(135deg, rgba(32, 32, 64, 0.92) 0%, rgba(16, 18, 48, 0.94) 68%, rgba(64, 32, 32, 0.72) 100%);
  border: 1px solid rgba(0, 144, 192, 0.52);
  border-top: 2px solid var(--play-water);
  border-bottom: 3px solid var(--play-fire-hot);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 20, 0.55);
}

body.playground .card .date {
  display: inline-block;
  margin: 0 0 0.7rem;
  padding: 0.24rem 0.68rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fff7ed;
  background: linear-gradient(90deg, #8c2d10 0%, #402020 100%);
  border: 1px solid var(--play-fire);
  border-radius: 999px;
}

body.playground .card p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   DOORS — REAL PORTAL THRESHOLDS (.doors / .door / .door.play)
   (Each door carries its own painting's world wherever it appears, including /)
   ========================================================================== */
.doors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2.25rem;
}

/* Default .door = Portal into the Library (Forest Emerald & Cyan) */
.door {
  display: flex;
  flex-direction: column;
  min-height: 180px;
  padding: 1.45rem 1.5rem;
  text-decoration: none;
  color: #eefaf3;
  background:
    radial-gradient(circle at 92% 12%, rgba(0, 192, 192, 0.20) 0%, transparent 55%),
    linear-gradient(180deg, #003010 0%, #001806 60%, #000902 100%);
  border: 1px solid var(--lib-emerald);
  border-top: 4px solid var(--lib-emerald-bright);
  border-radius: 2px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.door .glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  margin-bottom: 0.9rem;
  font-size: 1.45rem;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--lib-cyan);
  border-radius: 2px;
}

.door h3 {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  color: #ffffff;
  margin-bottom: 0.45rem;
}

.door p {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.58;
  color: #c4e6d4;
}

.door:hover {
  transform: translateY(-3px);
  border-color: var(--lib-cyan);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.8),
    0 0 26px rgba(0, 192, 144, 0.28);
}

/* .door.play = Portal into the Playground (Indigo Temple, Cyan Water & Hot Orange Fire) */
.door.play {
  color: #f4f6ff;
  background:
    radial-gradient(circle at 88% 14%, rgba(0, 144, 192, 0.28) 0%, transparent 52%),
    radial-gradient(circle at 50% 105%, rgba(240, 96, 48, 0.30) 0%, transparent 60%),
    linear-gradient(180deg, #202040 0%, #0d0f30 62%, #402020 100%);
  border: 1px solid var(--play-water);
  border-top: 4px solid var(--play-fire);
  border-bottom: 2px solid var(--play-fire-gold);
  border-radius: 10px;
}

.door.play .glyph {
  background: rgba(0, 0, 32, 0.65);
  border: 1px solid var(--play-fire);
  border-radius: 8px;
  box-shadow: 0 0 14px rgba(240, 144, 48, 0.28);
}

.door.play h3 {
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  color: #ffffff;
}

.door.play p {
  font-family: var(--font-sans);
  color: #d0d7f5;
}

.door.play:hover {
  transform: translateY(-3px);
  border-color: var(--play-fire-gold);
  box-shadow:
    0 16px 38px rgba(0, 0, 20, 0.85),
    0 0 28px rgba(240, 96, 48, 0.34);
}

/* ==========================================================================
   THE MAP (/map/) — SHARED CARTOGRAPHY BRIDGING BOTH WORLDS
   (.rooms, .room, .room.soon, .tag, .r-emoji)
   ========================================================================== */
.rooms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
  margin: 1.25rem 0 2.4rem;
}

.room {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 1.3rem 1.35rem;
  text-decoration: none;
  color: #f2f8fa;
  background: linear-gradient(180deg, rgba(14, 28, 36, 0.9) 0%, rgba(5, 14, 20, 0.95) 100%);
  border: 1px solid rgba(0, 192, 192, 0.35);
  border-radius: 6px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

/* Map rooms pointing to troupeinc.com inherit the Forest Library world */
a.room[href*="troupeinc.com"] {
  background:
    radial-gradient(circle at 90% 10%, rgba(0, 192, 192, 0.16), transparent 55%),
    linear-gradient(180deg, #002b0d 0%, #001405 100%);
  border: 1px solid #006000;
  border-top: 4px solid var(--lib-emerald-bright);
  border-radius: 2px;
}

a.room[href*="troupeinc.com"] .tag {
  color: var(--lib-cyan);
  border-color: rgba(0, 192, 144, 0.45);
  background: rgba(0, 32, 0, 0.75);
}

a.room[href*="troupeinc.com"] h3 {
  font-family: var(--font-serif);
}

a.room[href*="troupeinc.com"]:hover {
  transform: translateY(-3px);
  border-color: var(--lib-cyan);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.75), 0 0 22px rgba(0, 192, 144, 0.25);
}

/* Map rooms pointing to troupeuniverze.com inherit the ZIG ZAG Playground world */
a.room[href*="troupeuniverze.com"] {
  background:
    radial-gradient(circle at 90% 12%, rgba(0, 144, 192, 0.24), transparent 52%),
    linear-gradient(180deg, #202040 0%, #111232 65%, #402020 100%);
  border: 1px solid var(--play-water);
  border-top: 4px solid var(--play-fire);
  border-radius: 10px;
}

a.room[href*="troupeuniverze.com"] .tag {
  color: #ffd7b3;
  border-color: var(--play-fire);
  background: rgba(64, 32, 32, 0.8);
}

a.room[href*="troupeuniverze.com"]:hover {
  transform: translateY(-3px);
  border-color: var(--play-fire-gold);
  box-shadow: 0 14px 32px rgba(0, 0, 20, 0.8), 0 0 24px rgba(240, 96, 48, 0.30);
}

.room .tag {
  align-self: flex-start;
  margin-bottom: 0.85rem;
  padding: 0.22rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(191, 210, 220, 0.35);
  border-radius: 3px;
}

.room .r-emoji {
  font-size: 1.55rem;
  line-height: 1;
  margin-bottom: 0.65rem;
}

.room h3 {
  margin: 0 0 0.4rem;
  font-size: 1.16rem;
  color: #ffffff;
}

.room p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.56;
  color: var(--dim);
}

/* Horizon rooms (.room.soon): Blueprinted dreams — dashed survey lines, calm, non-clickable */
.room.soon {
  background: rgba(6, 16, 24, 0.55);
  border: 1px dashed rgba(108, 224, 255, 0.38);
  border-top: 2px dashed rgba(240, 144, 48, 0.52);
  border-radius: 6px;
}

.room.soon .tag {
  color: #cfe4ee;
  background: rgba(15, 34, 46, 0.7);
  border-style: dashed;
}

/* ==========================================================================
   FOOTER & LOCKED KEEPER CREDIT
   ("· Maintained by Shape (APE-01) ·" + keeper line centered below — untouched)
   ========================================================================== */
footer {
  width: min(100%, var(--wrap-max));
  margin: clamp(2.75rem, 5vw, 4rem) auto 0;
  padding-top: 1.35rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  color: var(--dim);
  text-align: center;
}

body > footer {
  width: min(100% - 2rem, 1020px);
}

.credit {
  text-align: center;
  color: var(--dim);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1.65rem auto 3rem;
  padding-inline: 1rem;
}

.credit strong {
  color: var(--ink);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS & REDUCED MOTION (Mobile-First Ergonomics)
   ========================================================================== */
@media (max-width: 820px) {
  .rooms {
    grid-template-columns: 1fr;
  }

  body:not(.playground) .card {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  body:not(.playground) .card .date {
    border-right: 0;
    border-bottom: 1px solid rgba(0, 192, 144, 0.28);
    padding-right: 0;
    padding-bottom: 0.38rem;
  }
}

@media (max-width: 680px) {
  .wrap,
  main,
  body > header.site,
  body > footer {
    width: calc(100% - 1.25rem);
  }

  header.site {
    flex-direction: column;
    align-items: flex-start;
  }

  header.site nav {
    width: 100%;
  }

  header.site nav a {
    flex: 1 1 auto;
    text-align: center;
    padding-inline: 0.65rem;
    font-size: 0.78rem;
  }

  .doors {
    grid-template-columns: 1fr;
  }

  body.playground h1,
  body.playground .lede {
    text-align: left;
  }

  body.playground .stamp {
    display: inline-flex;
    margin-inline: 0;
  }
}

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

  .door:hover,
  .door.play:hover,
  a.room:hover {
    transform: none;
  }
}
