/* ══════════════════════════════════════════════════════
   Tao Te Ching Institute — style.css
   assets/css/style.css
   ══════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ───────────────────────────────────── */
:root {
  /* Core palette */
  --void:        #070710;   /* Deepest background */
  --ink:         #0f0f17;   /* Near-black surfaces — re-spaced to match the light ladder's separation from --void (was #0a0a0f, too compressed against black) */
  --deep:        #16151f;   /* Elevated surfaces (text boxes/cards) — now visibly lifts off --void, mirroring light-theme deep (was #0f0e18) */
  --lifted:      #1f1d2c;   /* Cards, panels — top tier of the ladder (was #161525) */

  /* Text */
  --silk:        #e8e2d4;   /* Primary text */
  --mist:        #d6d1c4;   /* Secondary text — one contrast step up from #c8c4b8 (02b legibility) */
  --smoke:       #9b9688;   /* Tertiary / disabled — one step up from #8a8678 */

  /* Accents */
  --gold-rgb:    241,229,160;  /* the gold as raw channels — every gold glow/border/tint derives from THIS one source so they can't drift two-tone */
  --gold:        #f1e5a0;   /* Primary accent — light-yellow gold so it stands out on void black (was #c9a84c → #e0c878) */
  --gold-dim:    #d9c87f;   /* Subdued gold — light-yellow family, dimmer than --gold (was #8a6f30 → #c0a860) */
  --gold-glow:   rgba(var(--gold-rgb),0.12);

  /* Glass-plate chrome — shared translucent-surface primitives so the scrolled navbar,
     the cookie banner, and the verse float-nav don't drift independently. Each component
     still sets its OWN alpha/blur where it intentionally differs (e.g. the float-nav is
     more translucent and uses a lighter 6px blur). */
  --glass-void-rgb:  7, 7, 16;        /* dark plate base — nav.scrolled + verse float-nav */
  --glass-paper-rgb: 244, 239, 226;   /* light plate base — cookie banner + float-nav (light theme) */
  --glass-blur:      8px;             /* default plate blur (float-nav intentionally uses 6px) */

  --jade:        #4a7c6f;   /* Secondary accent */
  --jade-light:  #6aab9a;   /* Lighter jade */
  --jade-glow:   rgba(74,124,111,0.1);

  --crimson:     #8b2635;   /* Rare highlight */

  /* Typography scale — TYPE FLOOR (02b): no rendered text below 0.84rem (16px)
     except legal/footer fine print. Letterspaced-caps styles stay, just legible. */
  --text-xs:     0.84rem;
  --text-sm:     0.9rem;
  --text-base:   1rem;
  --text-md:     1.1rem;
  --text-lg:     1.3rem;
  --text-xl:     1.6rem;
  --text-2xl:    2rem;
  --text-3xl:    2.8rem;
  --text-4xl:    3.8rem;

  /* Spacing scale */
  --space-1:     0.5rem;
  --space-2:     1rem;
  --space-3:     1.5rem;
  --space-4:     2rem;
  --space-6:     3rem;
  --space-8:     4rem;
  --space-12:    6rem;
  --space-16:    8rem;

  /* Layout */
  --max-width:   1100px;
  --reading-width: 720px;

  /* Transitions */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --duration:    0.3s;
  --duration-slow: 0.6s;

  /* Borders */
  --border-subtle:  1px solid rgba(232,226,212,0.08);
  --border-gold:    1px solid rgba(var(--gold-rgb),0.2);
  --border-glow:    1px solid rgba(var(--gold-rgb),0.5);

  /* Semantic aliases (theme-agnostic; future components target these) */
  --bg:          var(--void);
  --surface:     var(--deep);
  --text:        var(--silk);
  --text-muted:  var(--mist);
  --text-faint:  var(--smoke);
}

/* ── LIGHT THEME ─────────────────────────────────────────
   A *designed* warm "rice-paper" palette — not an inversion.
   Activated by data-theme="light" on <html> (set before paint by
   the inline script in header.php; honors prefers-color-scheme). */
[data-theme="light"] {
  --void:        #f4efe2;   /* rice-paper background */
  --ink:         #efe9da;   /* near-bg surfaces */
  --deep:        #eae3d1;   /* elevated surfaces */
  --lifted:      #e3dac6;   /* cards, panels */

  --silk:        #2a2620;   /* primary text — warm ink, never pure black */
  --mist:        #443e34;   /* secondary text — one contrast step down from #514b40 (02b legibility) */
  --smoke:       #6b6457;   /* tertiary — one step down from #7c7568 */

  --gold-rgb:    147,116,31;  /* light-theme gold channels — darker, for contrast on rice paper; same single-source mechanism as dark */
  --gold:        #93741f;   /* retuned for contrast on light */
  --gold-dim:    #6f571a;
  --gold-glow:   rgba(var(--gold-rgb),0.12);

  --jade:        #2f5a4d;
  --jade-light:  #356b5b;
  --jade-glow:   rgba(47,90,77,0.10);

  --crimson:     #7a2230;

  --border-subtle:  1px solid rgba(42,38,32,0.12);
  --border-gold:    1px solid rgba(var(--gold-rgb),0.28);
  --border-glow:    1px solid rgba(var(--gold-rgb),0.5);
}

/* Light-theme fixes for the few hardcoded dark backgrounds in components */
[data-theme="light"] #navbar {
  background: linear-gradient(to bottom, rgba(244,239,226,0.97) 0%, transparent 100%);
}
[data-theme="light"] #navbar.scrolled { background: rgba(244,239,226,0.97); }
[data-theme="light"] .nav-overlay { background: rgba(42,38,32,0.4); }
[data-theme="light"] body::before { mix-blend-mode: multiply; opacity: 0.15; }

/* ── RESET & BASE ────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 100%;   /* respect the user's browser font size; body sets 19px via rem */
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--void);
  color: var(--silk);
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 1.1875rem;   /* 19px base — older-adult-inclusive legibility */
  font-weight: 500;       /* lift off the thin end; thin weights are display-only */
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9000;
  opacity: 0.3;
  mix-blend-mode: overlay;
}

img, video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ── TYPOGRAPHY ──────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  line-height: 1.2;
  color: var(--silk);
}

/* Chinese character display */
.chinese, .zh {
  font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
  letter-spacing: 0.1em;
}

/* Cinzel for labels, UI elements */
.label, .eyebrow, #navbar, .btn {
  font-family: 'Cinzel', 'Palatino Linotype', serif;
}

p {
  color: var(--mist);
  line-height: 1.7;
  font-size: 1.1875rem;   /* 19px body copy */
  font-weight: 500;
}

p + p { margin-top: 1.25rem; }

blockquote {
  border-left: 2px solid var(--gold);
  padding: 1.5rem 2rem;
  background: var(--gold-glow);
  margin: 2rem 0;
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--silk);
}

blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.3em;
  color: var(--gold-dim);
  font-style: normal;
}

/* ── LAYOUT UTILITIES ────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container--narrow {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: 5.5rem var(--space-4);   /* density pass (02b): was var(--space-16) = 8rem, ~30% tighter */
  position: relative;
}

.section--deep  { background: var(--deep); }
.section--ink   { background: var(--ink); }
.section--void  { background: var(--void); }

.section-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-3);
  opacity: 0.9;
}

.section-title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-style: italic;
  color: var(--silk);
  margin-bottom: var(--space-3);
}

.section-lead {
  font-size: var(--text-lg);
  color: var(--mist);
  max-width: 640px;
  line-height: 1.85;
}

/* Horizontal rule / divider */
.divider {
  width: 80px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: var(--space-4) 0;
}

.divider--center { margin-left: auto; margin-right: auto; }

/* ── NAVIGATION ──────────────────────────────────────── */
/* Scoped to #navbar, NEVER the bare `nav` element (fixed 2026-07-27). A bare `nav {}`
   rule turned every OTHER semantic <nav> on the site — the breadcrumb trail, the 81-verse
   number grids — into a second fixed, full-width, z-index:500 bar pinned over this one:
   its links landed on top of the logo and its invisible box ate every click on the real
   header (only the breadcrumb links still worked). Keep header rules on #navbar. */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem var(--space-8);
  background: linear-gradient(to bottom, rgba(7,7,16,0.97) 0%, transparent 100%);
  transition: padding var(--duration) var(--ease),
              background var(--duration) var(--ease),
              border-color var(--duration) var(--ease);
  border-bottom: 1px solid transparent;
}

#navbar.scrolled {
  padding: 1rem var(--space-8);
  background: rgba(var(--glass-void-rgb),0.97);
  border-bottom: var(--border-gold);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* Logo */
.nav-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-decoration: none;
  gap: 2px;
}

.nav-logo-chinese {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.3em;
}

.nav-logo-english {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;   /* type floor */
  letter-spacing: 0.16em;
  color: var(--mist);
  text-transform: uppercase;
  opacity: 0.8;
}

/* Right side of the nav: links + always-visible controls */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

/* Always-visible header controls (theme toggle; hamburger joins it when nav collapses) */
.nav-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-links a {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;   /* type floor — was 0.65rem */
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
  position: relative;
  padding-bottom: 2px;
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration) var(--ease);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--gold);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* CTA link in nav */
.nav-links a.nav-cta {
  color: var(--gold);
  border: 1px solid rgba(var(--gold-rgb),0.85);   /* strong gold outline; --gold-rgb auto-adapts per theme */
  padding: 0.5rem 1.25rem;
  transition: all var(--duration) var(--ease);
}

.nav-links a.nav-cta::after { display: none; }

.nav-links a.nav-cta:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
}

/* ── TEACHINGS DROPDOWN ──────────────────────────────────
   CSS-only: :hover for the mouse, :focus-within so a keyboard tab into "Teachings"
   opens the same menu. No JS, nothing to keep in sync. The plate is the same glass
   primitive as the scrolled navbar so the chrome stays one material.
   NOTE the wrapper carries the top PADDING rather than a margin — a gap between the
   link and the plate would close the menu as the pointer crossed it. */
.nav-has-menu { position: relative; }

.nav-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  padding-top: 1.1rem;          /* the hover bridge — must stay padding, not margin */
  transform: translateX(-50%) translateY(-6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease),
              transform var(--duration) var(--ease),
              visibility 0s linear var(--duration);
}

.nav-has-menu:hover .nav-menu,
.nav-has-menu:focus-within .nav-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}

.nav-menu-plate {
  display: flex;
  gap: var(--space-4);
  width: max-content;
  max-width: min(620px, calc(100vw - 3rem));
  padding: 1.6rem 1.8rem;
  background: rgba(var(--glass-void-rgb),0.98);
  border: var(--border-gold);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
}

[data-theme="light"] .nav-menu-plate {
  background: rgba(var(--glass-paper-rgb),0.98);
  box-shadow: 0 18px 40px rgba(42,38,32,0.18);
}

.nav-menu-group--pillars {
  padding-left: var(--space-4);
  border-left: var(--border-subtle);
}

.nav-menu-head {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;   /* type floor */
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1rem;
  white-space: nowrap;
}

.nav-menu-list { list-style: none; }

.nav-menu-list--two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-3);
}

/* The menu's own links: the nav's Cinzel caps are for the seven top-level words —
   a thirteen-item list reads better in the body serif, so both the type and the
   sliding gold underline are reset here. */
.nav-links .nav-menu a {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--mist);
  padding: 0.32rem 0;
  white-space: nowrap;
}

.nav-links .nav-menu a::after { display: none; }
.nav-links .nav-menu a:hover { color: var(--gold); }

.nav-menu-glyph {
  font-family: 'Noto Serif SC', serif;
  font-size: 0.9rem;
  color: var(--gold);
  opacity: 0.5;
  width: 1.1em;
  flex-shrink: 0;
}

.nav-links .nav-menu a:hover .nav-menu-glyph { opacity: 0.9; }

.nav-links .nav-menu a.nav-menu-all {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: var(--border-subtle);
  color: var(--gold-dim);
  font-style: italic;
}

/* Theme toggle (sun / moon) */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: 1px solid rgba(var(--gold-rgb),0.6);   /* gold ring; --gold-rgb auto-adapts per theme */
  border-radius: 50%;
  color: var(--gold);
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
  flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--gold); }
.theme-toggle svg { width: 16px; height: 16px; display: block; fill: currentColor; }

/* Show the icon for the action available now: sun in dark (→ go light), moon in light (→ go dark) */
.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--silk);
  transition: all var(--duration) var(--ease);
}

.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* Mobile drawer */
.nav-mobile {
  position: fixed;
  top: 0; right: 0;
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--deep);
  border-left: var(--border-gold);
  z-index: 490;
  padding: 6rem var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease);
  overflow: auto;
}

.nav-mobile.open {
  transform: translateX(0);
}

.nav-mobile ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.nav-mobile a {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;   /* type floor */
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mist);
  transition: color var(--duration);
}

.nav-mobile a:hover { color: var(--gold); }

/* Teachings sub-list in the drawer — a hover menu has nowhere to open on touch, so
   the topics sit under Teachings in two quiet columns rather than behind a tap. */
.nav-mobile ul.nav-mobile-sub {   /* out-specifies the drawer's own `.nav-mobile ul` column flex */
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-2);
  row-gap: 0.55rem;
  margin: 0.9rem 0 0.2rem;
  padding-left: 0.9rem;
  border-left: var(--border-subtle);
}

.nav-mobile .nav-mobile-sub a {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--smoke);
}

.nav-mobile .nav-mobile-sub a:hover { color: var(--gold); }

.nav-mobile-chinese {
  font-family: 'Noto Serif SC', serif;
  font-size: 2.5rem;
  color: var(--gold-dim);
  opacity: 0.2;
  letter-spacing: 0.3em;
  margin-top: auto;
  padding-top: var(--space-8);
}

/* Overlay for mobile menu */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,7,16,0.7);
  z-index: 480;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow);
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 2.5rem;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: none;
}

/* Primary — gold fill */
.btn--primary {
  background: var(--gold);
  color: var(--ink);
}

.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--silk);
  transform: translateX(-100%);
  transition: transform var(--duration) var(--ease);
  z-index: 0;
}

.btn--primary:hover::before { transform: translateX(0); }
.btn--primary:hover { color: var(--ink); }

.btn--primary span,
.btn--primary:not(:has(span)) {
  position: relative;
  z-index: 1;
}

/* Ghost — outlined */
.btn--ghost {
  background: transparent;
  color: var(--silk);
  border: 1px solid rgba(232,226,212,0.3);
}

.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Jade ghost */
.btn--jade {
  background: transparent;
  color: var(--jade-light);
  border: 1px solid rgba(106,171,154,0.3);
}

.btn--jade:hover {
  border-color: var(--jade-light);
  background: var(--jade-glow);
}

/* Small variant */
.btn--sm {
  padding: 0.6rem 1.5rem;
  font-size: 0.84rem;   /* type floor — was 0.6rem */
}

/* ── HERO (homepage) ─────────────────────────────────── */
.hero {
  min-height: 84vh;   /* density pass (02b): was 100vh — kill the oversized empty hero zone */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 6.5rem var(--space-4) var(--space-6);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(74,124,111,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(139,38,53,0.06) 0%, transparent 50%),
    radial-gradient(ellipse 100% 100% at 50% 100%, rgba(var(--gold-rgb),0.04) 0%, transparent 50%),
    var(--void);
  pointer-events: none;
}

/* ── HERO BREATH ─────────────────────────────────────────
   The hero used to sit perfectly still. These three animations are
   deliberately slower than anyone watches (80s / 34s / 40s) so the page
   reads as breathing, not animating — you notice it only if you stay.
   Only .hero-bg is scaled; .hero has overflow:hidden, so the drift can
   never create a scrollbar. The brush marks breathe on opacity ALONE —
   they carry a static rotate() and animating transform here would
   silently drop it. Reduced-motion turns all three off. */
@keyframes heroDrift {
  from { transform: scale(1)    translateY(0); }
  to   { transform: scale(1.05) translateY(-1.2%); }
}
@keyframes heroBreath {
  from { opacity: 0.035; }
  to   { opacity: 0.065; }
}

.hero-bg {
  animation: heroDrift 80s var(--ease-out, ease-in-out) infinite alternate;
  will-change: transform;
}
.hero-brush   { animation: heroBreath 34s ease-in-out infinite alternate; }
.hero-brush-2 { animation: heroBreath 40s ease-in-out infinite alternate 6s; }

@media (prefers-reduced-motion: reduce) {
  .hero-bg,
  .hero-brush,
  .hero-brush-2 { animation: none; }
}

.hero-brush {
  position: absolute;
  top: 15%; right: 8%;
  width: 320px; height: 480px;
  opacity: 0.05;
  background: radial-gradient(ellipse 40% 100% at 50% 50%, var(--silk) 0%, transparent 70%);
  transform: rotate(-12deg);
  filter: blur(2px);
  pointer-events: none;
}

.hero-brush-2 {
  position: absolute;
  bottom: 20%; left: 5%;
  width: 200px; height: 340px;
  opacity: 0.04;
  background: radial-gradient(ellipse 30% 100% at 50% 50%, var(--gold) 0%, transparent 70%);
  transform: rotate(8deg);
  filter: blur(3px);
  pointer-events: none;
}

.hero-vertical-text {
  position: absolute;
  right: 5%; top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: 'Noto Serif SC', serif;
  font-size: 0.84rem;   /* type floor */
  letter-spacing: 0.4em;
  color: var(--gold-dim);
  opacity: 0.35;
  line-height: 2;
  pointer-events: none;
  user-select: none;
}

.hero-vertical-text-left {
  position: absolute;
  left: 4%; top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: 'Noto Serif SC', serif;
  font-size: 0.84rem;   /* type floor */
  letter-spacing: 0.4em;
  color: var(--jade);
  opacity: 0.2;
  line-height: 2;
  pointer-events: none;
  user-select: none;
}

.hero-content {
  text-align: center;
  max-width: 860px;
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-4);
  opacity: 0.85;
}

.hero-chinese {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--gold);
  letter-spacing: 0.2em;
  line-height: 1;
  margin-bottom: 0.4rem;
  opacity: 0.88;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  font-weight: 300;
  font-style: italic;
  color: var(--silk);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;   /* type floor */
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--jade-light);
  margin-bottom: var(--space-6);
  opacity: 0.85;
}

.hero-mission {
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--mist);
  max-width: 580px;
  margin: 0 auto var(--space-6);
  line-height: 1.85;
}

.hero-cta-group {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero-scroll-label {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;   /* type floor — was 0.5rem */
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--mist);
  opacity: 0.45;
}

.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--gold-dim), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.25; transform: scaleY(0.95); }
  50%       { opacity: 0.7;  transform: scaleY(1.05); }
}

/* ── YIN YANG SVG ────────────────────────────────────── */
.yin-yang {
  width: 160px;
  height: 160px;
  animation: slowSpin 32s linear infinite;
  opacity: 0.85;
}

@keyframes slowSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── VERSE GRID (81 numbers) ─────────────────────────── */
/* Solid, centered plate the number grid sits on (home + teachings). Capped width
   + margin:0 auto so it stays centered under the grid; the grid fills it exactly. */
.verse-grid-panel {
  /* Frameless to match the verse-page jump grid (cleaner look, 2026-07-13):
     the lifted background + border were dropped. The aspect-ratio/flex sizing
     below STAYS — it is load-bearing for centering the grid in the column
     (see the note further down); only the visible box was removed. */
  padding: 1.5rem;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  /* The 9×9 grid uses aspect-ratio cells (below), whose height does NOT propagate up
     to this block — so without an explicit height the panel collapses to its padding
     (~50px) and the grid overflows downward, which read as "hugging the bottom" and
     defeated align-self:center on the column. The panel is itself square (a square grid
     + even padding), so aspect-ratio:1 restores a real, definite height; flex-centering
     keeps the grid tidy inside it. (Regression fix 2026-07-09 — see index/teachings.) */
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* The column that holds the yin-yang/title (top) + number grid (centered).
   min-height gives the column spare height beyond its content so the grid can
   actually float centered BELOW the top-pinned title with clear space around it —
   otherwise it just stacks tight against the title. */
.verse-number-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;   /* matches the verse-page jump grid */
  width: 100%;
}

/* Cells are responsive squares (aspect-ratio + min-width:0), NOT a fixed 34px, so
   they always shrink to fit their panel and can never overflow onto the section. */
.verse-number-grid a {
  width: 100%;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;   /* let the square aspect-ratio hold instead of the text forcing extra height */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;   /* matches the verse-page jump cell (was 0.84rem) */
  color: var(--gold-dim);
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  transition: all var(--duration);
  text-decoration: none;
}

/* Fills solid gold with a dark number on hover/focus — identical to
   .verse-jump-cell--link on the verse page. */
.verse-number-grid a:hover,
.verse-number-grid a:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--void);
}

/* ── VERSE CARDS ─────────────────────────────────────── */
.verse-card {
  display: block;
  background: var(--deep);
  padding: var(--space-6) 2.5rem;
  position: relative;
  overflow: hidden;
  transition: background var(--duration-slow) var(--ease);
  text-decoration: none;
  border: var(--border-subtle);
}

.verse-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  transform: scaleX(0);
  transition: transform var(--duration-slow) var(--ease);
}

.verse-card:hover { background: rgba(var(--gold-rgb),0.04); }
.verse-card:hover::before { transform: scaleX(1); }

.verse-card-number {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.3em;
  color: var(--gold-dim);
  margin-bottom: 0.4rem;
  display: block;
}

.verse-card-chinese {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.4rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
  opacity: 0.65;
}

.verse-card-title {
  font-size: var(--text-xl);
  font-style: italic;
  font-weight: 300;
  color: var(--silk);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.verse-card-excerpt {
  font-size: var(--text-base);
  color: var(--mist);
  line-height: 1.8;
  opacity: 0.8;
}

.verse-card-cta {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;   /* type floor */
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--jade-light);
  margin-top: var(--space-3);
  display: block;
  transition: color var(--duration);
}

.verse-card:hover .verse-card-cta { color: var(--gold); }

/* Grid of verse cards */
.verses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(var(--gold-rgb),0.08);
}

/* ── SINGLE VERSE PAGE ───────────────────────────────── */
.verse-hero {
  padding: 6.5rem var(--space-4) var(--space-6);   /* density pass (02b): was 10rem / 6rem — verse text reachable in <1 screen at 1080p */
  text-align: center;
  position: relative;
  background:
    radial-gradient(ellipse 60% 60% at 50% 0%, rgba(var(--gold-rgb),0.05) 0%, transparent 70%),
    var(--void);
  border-bottom: var(--border-gold);
}

.verse-number-display {
  font-family: 'Cinzel', serif;
  font-size: var(--text-sm);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: var(--space-2);
}

.verse-chinese-large {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(2.6rem, 8vw, 5.5rem);   /* density pass (02b): was clamp(3rem,10vw,7rem) */
  color: var(--gold);
  letter-spacing: 0.2em;
  line-height: 1;
  margin-bottom: var(--space-2);
  opacity: 0.7;
}

.verse-title-large {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl));
  font-style: italic;
  color: var(--silk);
}

.verse-nav-arrows {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: var(--space-4) auto 0;   /* density pass (02b) */
}

.verse-nav-arrows a {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.25em;
  color: var(--mist);
  opacity: 0.6;
  transition: all var(--duration);
}

.verse-nav-arrows a:hover { opacity: 1; color: var(--gold); }

/* ── Floating prev/next verse nav (verse.php) ──────────
   A fixed, decorative duplicate of the prev/next links that fades in once
   the reader has scrolled past the in-flow nav bar (main.js toggles
   .is-visible). Pinned to the screen edges on desktop; drops to the bottom
   corners on narrow screens so it never crosses the reading column.
   aria-hidden in markup — the accessible prev/next live in the in-flow bars. */
.verse-float-nav {
  position: fixed;
  inset: 0;
  z-index: 400;            /* under the fixed navbar (500) and cookie banner (600), over content */
  pointer-events: none;    /* only the links themselves catch clicks */
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration) var(--ease),
              visibility var(--duration) var(--ease);
}

.verse-float-nav.is-visible { opacity: 1; visibility: visible; }

.verse-float-nav__link {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  pointer-events: auto;
  padding: 0.4rem 0.65rem;          /* trimmed so the side plates clear the commentary column */
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mist);
  opacity: 0.92;
  /* Darker plate so the faint glyph reads against the verse text — same
     chrome language as nav.scrolled / the cookie banner (deep translucent
     surface + gold hairline + blur). Light theme gets its rice-paper twin. */
  background: rgba(var(--glass-void-rgb), 0.82);
  border: 1px solid rgba(232, 226, 212, 0.6);   /* light (silk) outline so it reads as a button on dark */
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(232, 226, 212, 0.22);   /* soft silk halo (never pure #fff on dark) so it lifts off the void black */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity var(--duration) var(--ease),
              color var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              background var(--duration) var(--ease);
}

.verse-float-nav__link:hover,
.verse-float-nav__link:focus-visible {
  opacity: 1;
  color: var(--gold);
  background: rgba(var(--glass-void-rgb), 0.92);
  border-color: rgba(232, 226, 212, 0.95);
}

[data-theme="light"] .verse-float-nav__link {
  background: rgba(var(--glass-paper-rgb), 0.9);
  border-color: rgba(var(--gold-rgb), 0.5);        /* warm gold ring is the light-theme button look (derived from --gold-rgb) */
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .verse-float-nav__link:hover,
[data-theme="light"] .verse-float-nav__link:focus-visible {
  background: rgba(var(--glass-paper-rgb), 0.97);
  border-color: rgba(var(--gold-rgb), 0.75);
}

.verse-float-nav__prev  { left: 0.6rem; }
.verse-float-nav__next  { right: 0.6rem; }

.verse-float-nav__chevron { font-size: 1.2rem; line-height: 1; }

/* Mobile (matches the site's hamburger breakpoint): drop the "Verse N" label
   and show a compact chevron-only button so it fits a narrow gutter. Stays
   pinned to the side edges, vertically centered, like the desktop labels. */
@media (max-width: 1080px) {
  .verse-float-nav__label { display: none; }
  .verse-float-nav__link {
    gap: 0;
    padding: 0.5rem 0.55rem;
  }
  .verse-float-nav__chevron { font-size: 1.4rem; }
}

.verse-body {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-4);   /* density pass (02b): was 6rem */
}

.verse-text-block {
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--silk);
  line-height: 2;
  text-align: center;
  margin-bottom: var(--space-8);            /* density pass (02b): was 6rem */
  border-top: var(--border-gold);
  border-bottom: var(--border-gold);
  padding: var(--space-6) var(--space-4);   /* density pass (02b): was 4rem */
}

.verse-text-block p + p {
  margin-top: var(--space-2);
}

/* Per-verse translation credit — accessibility pivot (2026-06-16).
   Sits at the foot of the verse text; quiet, non-italic, distinct from the verse lines. */
.verse-text-source {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  font-style: normal;
  letter-spacing: 0.16em;
  color: var(--gold-dim);
  line-height: 1.6;
  margin-top: var(--space-5);
  opacity: 0.9;
}
.verse-text-source a {
  color: var(--gold-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--duration);
}
.verse-text-source a:hover { color: var(--gold); }

.verse-commentary {
  margin-bottom: var(--space-6);   /* density pass (02b) */
}

.verse-commentary h3 {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-3);
  opacity: 0.8;
}

.verse-commentary p {
  font-size: 1.1875rem;
  line-height: 1.9;
}

.verse-contemplation {
  background: var(--deep);
  border: var(--border-gold);
  padding: var(--space-4) var(--space-6);
  text-align: center;
  margin: var(--space-6) 0;   /* density pass (02b) */
}

.verse-contemplation-label {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-2);
  opacity: 0.7;
}

.verse-contemplation p {
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--silk);
}

/* ── VERSE TWO-COLUMN LAYOUT (02b pass 2) ────────────────
   ≥1200px: Legge text left, Western Commentary right.
   Below 1200px everything stacks exactly as before. */
.verse-columns {
  display: grid;
  grid-template-columns: 1fr;
}

.verse-columns .verse-text-block {
  margin-bottom: var(--space-8);   /* stacked mode keeps the original rhythm */
}

/* Everything after the columns returns to a comfortable reading measure */
.verse-extras {
  max-width: var(--reading-width);
  margin: 0 auto;
}

@media (min-width: 1200px) {
  .verse-body--wide {
    max-width: 1200px;
  }
  .verse-columns {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: start;
  }
  .verse-columns .verse-text-block {
    margin-bottom: 0;
  }
}

/* ── MORE VERSES — jump grid (2026-06-24) ────────────────
   A compact 9×9 index of all 81 verses, beneath the verse text in the left
   column. Written verses link straight to that verse; the current verse is
   highlighted and inert; unwritten verses are dimmed and inert. No JS.
   The left column is wrapped in .verse-text-col so the grid sits BELOW the
   gold-bordered verse frame rather than inside it. */
.verse-text-col .verse-text-block {
  margin-bottom: 0;   /* spacing below the verse frame is owned by .verse-jump */
}

/* Stacked (mobile): keep the original rhythm before the commentary that follows.
   At ≥1200px the columns sit side-by-side, so no bottom margin is needed. */
.verse-text-col {
  margin-bottom: var(--space-8);
}
@media (min-width: 1200px) {
  .verse-text-col { margin-bottom: 0; }
}

.verse-jump {
  margin-top: var(--space-4);
}

.verse-jump-label {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  opacity: 0.8;
  margin-bottom: var(--space-3);
}

.verse-jump-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
}

.verse-jump-cell {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--duration), border-color var(--duration), color var(--duration);
}

/* Written verses — quiet gold link; fills gold on hover/focus */
.verse-jump-cell--link {
  color: var(--gold-dim);
  border-color: rgba(var(--gold-rgb), 0.18);
}
.verse-jump-cell--link:hover,
.verse-jump-cell--link:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--void);
}

/* Current verse — filled, not a link */
.verse-jump-cell--current {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--void);
}

/* ── VERSE GUIDE PLACEHOLDER (02b pass 2) ────────────────
   Phase-3 flag is OFF: this is a strictly non-functional, no-JS
   <details> panel — no input field, no calls. Expanding reveals a
   short description + the email-capture CTA. */
.verse-guide {
  border: var(--border-gold);
  background: var(--deep);
  margin: var(--space-6) 0 0;
}

.verse-guide summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  transition: background var(--duration) var(--ease);
}

.verse-guide summary::-webkit-details-marker { display: none; }
.verse-guide summary:hover { background: var(--gold-glow); }

.verse-guide-hint {
  font-size: 0.84rem;
  letter-spacing: 0.16em;
  color: var(--mist);
  opacity: 0.75;
  text-transform: none;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
}

.verse-guide-icon {
  flex-shrink: 0;
  color: var(--gold-dim);
  font-family: 'Cormorant Garamond', serif;
  font-size: var(--text-lg);
  line-height: 1;
  transition: transform var(--duration) var(--ease);
}

.verse-guide[open] .verse-guide-icon { transform: rotate(45deg); }

.verse-guide-body {
  padding: 0 var(--space-4) var(--space-4);
  border-top: var(--border-subtle);
}

.verse-guide-body p {
  font-size: var(--text-base);
  line-height: 1.8;
  margin-top: var(--space-3);
}

.verse-guide-body .btn { margin-top: var(--space-3); }

/* ── VERSE COMPANION (live chat inside .verse-guide) ──────
   All surfaces use theme-flipping tokens (--deep/--ink/--silk/--gold*), so the
   chat renders dark by default and light under [data-theme="light"] with no
   separate palette — it follows the reader's sun/moon choice. */
.companion-intro {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--mist);
  font-style: italic;
  margin-top: var(--space-3);
}
.companion-log {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 60vh;
  overflow-y: auto;
  margin-top: var(--space-3);
}
.companion-log:empty { margin-top: 0; }
.companion-msg {
  max-width: 85%;
  font-size: var(--text-base);
  line-height: 1.75;
  white-space: pre-line;
}
.companion-msg--user {
  align-self: flex-end;
  background: var(--gold-glow);
  color: var(--silk);
  padding: 0.6rem 1rem;
  border-radius: 12px;
}
.companion-msg--bot {
  align-self: flex-start;
  color: var(--silk);
  padding-left: var(--space-3);
  border-left: var(--border-glow);
}
.companion-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--space-3);
}
.companion-chip {
  font-family: inherit;
  font-size: var(--text-xs);
  color: var(--mist);
  background: transparent;
  border: var(--border-subtle);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.companion-chip:hover { border-color: var(--gold); color: var(--gold); }
.companion-error {
  font-size: var(--text-xs);
  color: var(--crimson);
  margin-top: var(--space-3);
}
.companion-composer {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  margin-top: var(--space-3);
}
.companion-input {
  flex: 1;
  resize: none;
  font-family: inherit;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--silk);
  background: var(--ink);
  border: var(--border-subtle);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  outline: none;
  max-height: 8rem;
}
.companion-input:focus { border-color: var(--gold); }
.companion-send {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--void);
  background: var(--gold);
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--duration) var(--ease), opacity var(--duration) var(--ease);
}
.companion-send:disabled {
  background: var(--smoke);
  cursor: default;
  opacity: 0.6;
}
.companion-disclaimer {
  font-size: var(--text-xs);
  color: var(--smoke);
  margin-top: var(--space-3);
}
.companion-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); display: inline-block; margin-right: 5px;
  animation: companionPulse 1.2s ease-in-out infinite;
}
.companion-dots span:nth-child(2) { animation-delay: 0.2s; }
.companion-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes companionPulse { 0%, 100% { opacity: 0.25 } 50% { opacity: 0.9 } }
@media (prefers-reduced-motion: reduce) { .companion-dots span { animation: none; opacity: 0.6; } }

/* ── VIDEO ───────────────────────────────────────────── */
.video-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* YouTube embed fills the same framed wrapper as the self-hosted player */
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Vertical (9:16) Shorts: portrait frame, centered and width-capped so it
   doesn't tower over the page. */
.video-wrapper--portrait { aspect-ratio: 9 / 16; }
.video-frame--short {
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7,7,16,0.45);
  transition: background var(--duration);
  cursor: pointer;
}

.video-overlay:hover { background: rgba(7,7,16,0.2); }
.video-overlay.hidden { display: none; }

.play-btn {
  width: 72px;
  height: 72px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
  background: rgba(var(--gold-rgb),0.08);
}

.play-btn svg {
  fill: var(--gold);
  width: 22px;
  margin-left: 4px;
}

.video-overlay:hover .play-btn {
  background: rgba(var(--gold-rgb),0.2);
  transform: scale(1.06);
}

/* Corner accents */
.video-frame {
  position: relative;
}

.video-frame::before,
.video-frame::after {
  content: '';
  position: absolute;
  width: 36px;
  height: 36px;
  pointer-events: none;
  z-index: 2;
}

.video-frame::before {
  top: -8px; left: -8px;
  border-top: 1px solid var(--gold-dim);
  border-left: 1px solid var(--gold-dim);
  opacity: 0.5;
}

.video-frame::after {
  bottom: -8px; right: -8px;
  border-bottom: 1px solid var(--gold-dim);
  border-right: 1px solid var(--gold-dim);
  opacity: 0.5;
}

/* ── PILLARS ─────────────────────────────────────────── */
.pillars-grid {
  display: grid;
  /* minmax(0, 1fr) not 1fr: a bare 1fr floors at the column's min-content
     width, so one long unbreakable string in a pillar could push the row
     past the viewport. Invisible today — this is the guard, not a fix. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

.pillar {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  transition: background var(--duration);
}

.pillar:hover {
  background: var(--gold-glow);
}

.pillar-glyph {
  font-family: 'Noto Serif SC', serif;
  font-size: 3.5rem;
  color: var(--gold);
  opacity: 0.55;
  margin-bottom: var(--space-3);
  display: block;
  transition: opacity var(--duration);
}

.pillar:hover .pillar-glyph { opacity: 0.9; }

.pillar-title {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;   /* type floor */
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--silk);
  margin-bottom: var(--space-2);
}

.pillar-text {
  font-size: var(--text-base);
  color: var(--mist);
  line-height: 1.85;
  opacity: 0.8;
}

/* ── QUOTE / MISSION BAND ────────────────────────────── */
.mission-band {
  background: linear-gradient(
    135deg,
    rgba(74,124,111,0.1) 0%,
    rgba(var(--gold-rgb),0.05) 50%,
    rgba(139,38,53,0.07) 100%
  );
  border-top: var(--border-gold);
  border-bottom: var(--border-gold);
  text-align: center;
}

.mission-quote {
  font-size: clamp(var(--text-lg), 3vw, var(--text-2xl));
  font-style: italic;
  color: var(--silk);
  line-height: 1.65;
  margin-bottom: var(--space-4);
}

/* ── NEWSLETTER / JOIN ───────────────────────────────── */
.join-form {
  display: flex;
  max-width: 480px;
  margin: var(--space-6) auto 0;
}

.join-form input[type="email"] {
  flex: 1;
  /* Recessed, clearly-bounded field at rest — the old 0.05 fill / 0.15 border were
     hardcoded LIGHT-silk rgba, so on the light rice-paper theme they vanished into the
     background ("almost invisible"). Darker fill + stronger border make the box visible
     before hover/focus; the light theme gets its own dark border below. (2026-07-09) */
  background: rgba(7,7,16,0.28);
  border: 1px solid rgba(232,226,212,0.34);
  border-right: none;
  color: var(--silk);
  font-family: 'Cormorant Garamond', serif;
  font-size: var(--text-md);
  padding: 0.85rem 1.25rem;
  outline: none;
  transition: border-color var(--duration), background var(--duration);
}

.join-form input[type="email"]::placeholder {
  color: rgba(200,196,184,0.35);
}

.join-form input[type="email"]:focus {
  border-color: rgba(var(--gold-rgb),0.45);
}

/* Light theme: the field needs a dark fill/border to read on rice paper (the dark-theme
   light-silk values would be invisible here). Uses the light-theme ink channels. */
[data-theme="light"] .join-form input[type="email"] {
  background: rgba(42,38,32,0.05);
  border-color: rgba(42,38,32,0.38);
}

[data-theme="light"] .join-form input[type="email"]::placeholder {
  color: rgba(42,38,32,0.5);
}

.join-form button {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;   /* type floor */
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--ink);
  border: none;
  padding: 0.85rem 1.75rem;
  cursor: pointer;
  transition: background var(--duration), color var(--duration);
  white-space: nowrap;
}

.join-form button:hover {
  background: var(--silk);
}

.join-note {
  font-size: var(--text-sm);
  color: var(--mist);
  opacity: 0.45;
  margin-top: var(--space-2);
  font-style: italic;
  text-align: center;
}

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  background: var(--ink);
  padding: var(--space-12) var(--space-4) var(--space-8);
  border-top: var(--border-gold);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: var(--border-subtle);
}

.footer-brand-chinese {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  opacity: 0.75;
  margin-bottom: 0.25rem;
}

.footer-brand-name {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--mist);
  opacity: 0.8;
  margin-bottom: var(--space-3);
}

.footer-brand-tagline {
  font-size: var(--text-md);   /* bumped from --text-sm — the Lao Tzu quote read too small */
  color: var(--mist);
  opacity: 0.78;
  line-height: 1.7;
  font-style: italic;
  margin-bottom: var(--space-2);
}

.footer-brand-url {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--gold-dim);
  opacity: 0.8;
}

.footer-col h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;   /* footer fine-print zone — bumped for usability, exempt from the 0.84 floor */
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-3);
  opacity: 0.9;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-col a {
  font-size: var(--text-sm);
  color: var(--silk);   /* primary text token — was --mist@0.55, too low contrast in both themes */
  opacity: 0.92;
  font-style: italic;
  transition: all var(--duration);
}

.footer-col a:hover {
  opacity: 1;
  color: var(--gold);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: var(--space-6) auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer-bottom p {
  font-family: 'Cinzel', serif;
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  color: var(--mist);
  opacity: 0.6;
  text-transform: uppercase;
}

.footer-tao {
  font-family: 'Noto Serif SC', serif !important;
  letter-spacing: 0.2em !important;
  font-size: 0.75rem !important;
}

/* ── SCROLL REVEAL ───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s var(--ease-out),
              transform 0.75s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Hero entrance animations */
@keyframes fadeRise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-content > * { animation: fadeRise 1.5s var(--ease-out) both; }
.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.25s; }
.hero-content > *:nth-child(3) { animation-delay: 0.35s; }
.hero-content > *:nth-child(4) { animation-delay: 0.45s; }
.hero-content > *:nth-child(5) { animation-delay: 0.55s; }
.hero-content > *:nth-child(6) { animation-delay: 0.65s; }
.hero-content > *:nth-child(7) { animation-delay: 0.75s; }
.hero-scroll { animation: fadeRise 1.5s 1.1s var(--ease-out) both; }

/* ── BREADCRUMB TRAIL ─────────────────────────────────
   Visible, centered locator rendered at the top of verse & article headers from
   the SAME source as the BreadcrumbList JSON-LD (includes/breadcrumbs.php). Tokens
   only, so it adapts to dark (default) + light themes automatically. The › between
   crumbs is a CSS ::before so screen readers skip it. */
.breadcrumb {
  margin-bottom: var(--space-4);
}
.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem 0.55rem;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  color: var(--smoke);
}
.breadcrumb li + li::before {
  content: '\203A';           /* › */
  margin-right: 0.55rem;
  color: var(--gold-dim);
  opacity: 0.65;
}
.breadcrumb a {
  color: var(--gold-dim);
  text-decoration: none;
  transition: color 0.3s;
}
.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--gold);
}
.breadcrumb li[aria-current="page"] {
  color: var(--mist);
}

/* ── PAGE HEADER (inner pages) ───────────────────────── */
.page-header {
  padding: 6.5rem var(--space-4) var(--space-8);   /* density pass (02b): was 9rem / 6rem */
  text-align: center;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(var(--gold-rgb),0.05) 0%, transparent 60%),
    var(--void);
  border-bottom: var(--border-gold);
}

.page-header-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xs);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-3);
  opacity: 0.85;
}

.page-header-title {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-style: italic;
  color: var(--silk);
  margin-bottom: var(--space-3);
}

.page-header-subtitle {
  font-size: var(--text-lg);
  color: var(--mist);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ── TWO-COLUMN LAYOUT ───────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.two-col--wide {
  grid-template-columns: 3fr 2fr;
}

/* ── TOPIC GRID (teachings.php "start where you are") ──
   Four across, degrading to 2 then 1. Deliberately reuses the hairline-gap
   idiom of the Four Qualities grid further down the same page — 1px of tinted
   gold showing between solid --deep cells — so the two grids read as one
   system rather than two card styles. A class rather than inline styles
   because a 4-column grid needs real breakpoints. */
.topic-grid {
  display: grid;
  /* auto-FIT, not a fixed 4 or auto-fill: empty tracks collapse, so the last row
     always fills even when the topic count is not a multiple of the columns.
     With a fixed repeat(4,1fr) a 9th topic left three empty cells showing the
     container's gold tint as a bare block. 260px lands 4 across at container
     width; the 900px breakpoint below takes over before the cards get narrow. */
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: rgba(var(--gold-rgb), 0.08);
}

/* The "Our Vision" three-card grid on about.php. Same hairline idiom as .topic-grid
   above — 1px of tinted gold between solid --deep cells — and the same 3-up structure
   as .pillars-grid, whose comment explains the minmax(0, 1fr) guard: a bare 1fr floors
   at the column's min-content width, so a track that cannot shrink pushes the row past
   the viewport.
   THIS WAS NOT HYPOTHETICAL HERE. These three cards were written as INLINE styles
   (`repeat(3,1fr)`), which no media query can reach and which therefore had neither the
   minmax guard nor a breakpoint. At 504px the three tracks could not shrink below their
   padded content and the page scrolled 102px sideways — measured: the third card's right
   edge was 606px against a 504px viewport, exactly the document scrollWidth.
   Deliberately 3 -> 1 at the 900px step, NOT auto-fit: with exactly three cards an
   intermediate 2-column row leaves one empty cell, and an empty cell in a hairline grid
   shows the container's gold tint as a bare block (the artifact .topic-grid's own comment
   records). Three items want three columns or one. */
.vision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(var(--gold-rgb), 0.08);
}

.topic-card {
  display: block;
  background: var(--deep);
  padding: 2.25rem 1.75rem;
  text-decoration: none;
  transition: background 0.3s, border-color 0.3s;
  border-top: 2px solid transparent;
}

.topic-card:hover,
.topic-card:focus-visible {
  background: var(--lifted);
  border-top-color: rgba(var(--gold-rgb), 0.5);
}

.topic-card-glyph {
  font-family: 'Noto Serif SC', serif;
  font-size: 2.1rem;
  color: var(--gold);
  opacity: 0.6;
  display: block;
  line-height: 1;
  margin-bottom: 1rem;
}

.topic-card-label {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--silk);
  margin: 0 0 0.6rem;
}

.topic-card-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.02rem;
  font-style: italic;
  color: var(--mist);
  line-height: 1.7;
  margin: 0;
}

.topic-card-count {
  font-family: 'Cinzel', serif;
  font-size: 0.52rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--jade-light);
  opacity: 0.75;
  display: block;
  margin-top: 1.1rem;
}

/* ── RESPONSIVE ──────────────────────────────────────── */

/* Nav collapse: the legible 0.84rem links need more room, so the
   drawer takes over earlier than the 900px layout breakpoint. The
   standalone .nav-controls theme toggle stays visible at EVERY width. */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* Tablet: 900px and below */
@media (max-width: 900px) {
  /* Nav */
  #navbar {
    padding: 1.25rem var(--space-4);
  }
  #navbar.scrolled {
    padding: 0.85rem var(--space-4);
  }

  /* Layouts */
  .two-col,
  .two-col--wide {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .verses-grid {
    grid-template-columns: 1fr 1fr;
  }

  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Straight to one column, like .pillars-grid below: three cards have no tidy
     two-column state (the empty cell would show as a gold-tinted block). */
  .vision-grid {
    grid-template-columns: 1fr;
  }

  .pillars-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  /* Hide decorative vertical text */
  .hero-vertical-text,
  .hero-vertical-text-left {
    display: none;
  }
}

/* Mobile: 600px and below */
@media (max-width: 600px) {
  .section {
    padding: 3.5rem var(--space-3);   /* density pass (02b): was 6rem */
  }

  .verses-grid {
    grid-template-columns: 1fr;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .join-form {
    flex-direction: column;
  }

  .join-form input[type="email"] {
    border-right: 1px solid rgba(232,226,212,0.15);
    border-bottom: none;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: center;
  }
}

/* ── ANALYTICS CONSENT BANNER ────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: 1rem var(--space-4);
  background: rgba(15,14,24,0.97);   /* cookie banner sits a hair lighter than the void plate by design */
  border-top: var(--border-gold);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

[data-theme="light"] .cookie-banner { background: rgba(var(--glass-paper-rgb),0.97); }

.cookie-banner[hidden] { display: none; }

.cookie-banner-text {
  font-size: var(--text-sm);
  color: var(--mist);
  margin: 0;
  max-width: 720px;
}

.cookie-banner-text a { color: var(--gold); text-decoration: underline; }

.cookie-banner-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }

@media (max-width: 600px) {
  .cookie-banner {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
    padding: 1rem var(--space-3);
  }
}

/* ── UTILITY CLASSES ─────────────────────────────────── */
.text-center  { text-align: center; }
.text-gold    { color: var(--gold); }
.text-jade    { color: var(--jade-light); }
.text-mist    { color: var(--mist); }
.text-italic  { font-style: italic; }
.text-cinzel  { font-family: 'Cinzel', serif; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ══════════════════════════════════════════════════════
   CHARACTERS DROPDOWN — session C (doc-12 dialog)
   Tokens only; both themes inherit. Panel text ≥16px.
   ══════════════════════════════════════════════════════ */
.chinese-cluster { position: relative; display: block; }
.chinese-cluster__btn {
  background: none; border: none; padding: 0; cursor: pointer; font: inherit;
}
.chinese-cluster__btn .verse-chinese-large {
  display: inline-block;
  border-bottom: 1px solid transparent;
  transition: opacity .3s ease, border-color .3s ease, text-shadow .3s ease;
}
.chinese-cluster__btn:hover .verse-chinese-large,
.chinese-cluster__btn:focus-visible .verse-chinese-large,
.chinese-cluster__btn[aria-expanded="true"] .verse-chinese-large {
  opacity: 1;
  border-bottom-color: var(--gold);
  text-shadow: 0 0 24px rgba(var(--gold-rgb), 0.35);
}
.char-panel {
  margin: 0 auto var(--space-2);
  max-width: 440px;
  text-align: left;
  background: var(--deep);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
}
.char-panel__framing {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;             /* 16px floor */
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9rem;
}
.char-panel__list { list-style: none; margin: 0 0 1rem; padding: 0; }
.char-panel__list li {
  display: flex; align-items: baseline; gap: 0.85rem;
  padding: 0.45rem 0;
}
.char-panel__list li + li { border-top: 1px solid var(--gold-dim); }
.char-panel__char {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.6rem; line-height: 1;
  color: var(--gold);
}
.char-panel__simp { color: var(--smoke); font-size: 1rem; margin-left: -0.4rem; }
.char-panel__simp::before { content: "("; }
.char-panel__simp::after  { content: ")"; }
.char-panel__pinyin { font-style: italic; color: var(--jade-light); min-width: 4.6rem; font-size: 1rem; }
.char-panel__meaning { color: var(--mist); font-size: 1rem; line-height: 1.5; flex: 1; }
.char-panel__note { color: var(--mist); font-size: 1rem; line-height: 1.65; margin-bottom: 0.75rem; }
.char-panel__source { color: var(--smoke); font-size: 0.84rem; font-style: italic; margin: 0; }
@media (max-width: 480px) {
  .char-panel { max-width: 100%; padding: 1rem 1.1rem; }
}

/* ── INSTAGRAM FEED (instagram.php) — wrapper for the EmbedSocial widget ── */
/* The widget renders its own responsive grid; this just centres + spaces it. */
.ig-embed {
  max-width: 960px;
  margin: 0 auto;
}
.ig-embed .es-widget-branding {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  opacity: 0.6;
  font-size: 0.84rem;   /* type floor — never below the site's minimum legible size */
}

/* ── ANCIENT ART, DISPERSED ──────────────────────────────────────────────────
   Genuine museum paintings (Met Open Access, CC0), placed sparingly on pages
   that have a reason for one. Data: includes/art-data.php. Markup: art-band.php.
   Spec: docs/superpowers/specs/2026-07-27-ancient-art-dispersed-design.md

   The whole treatment rests on one idea: the painting must never read as a
   RECTANGLE dropped on the page. It is feathered to fully transparent on all
   four edges with a radial mask, so at any opacity there is no border, no seam
   and no visible frame — only ink that fades into the page's own emptiness.
   Aged silk is a warm tan ground and its ink is brown-black, which is already
   --void plus the site's ink tones; nothing here tints the image, because the
   painting is not matched to the palette, it IS the palette.

   THEME ORDER IS DELIBERATE. Dark is the site's default token set, so the base
   rule below carries the DARK values and [data-theme="light"] overrides them.
   Written the other way round, a page whose inline theme script never ran (JS
   off) would get light-theme values painted onto a black background. */
.art-figure {
  margin: var(--space-12) 0;
}

/* A verse about emptiness should not be handed the widest frame on the page. */
.art-figure--inset {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.art-frame {
  position: relative;
  width: 100%;
  height: var(--art-h, 340px);   /* per-placement, set inline from art-data.php */
  overflow: hidden;
}

.art-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;             /* object-position comes inline, per placement */
  display: block;

  /* Feather every edge to nothing: two linear gradients INTERSECTED.
     Not a radial gradient, for two measured reasons. (1) Percentage radii resolve
     against the box's full width/height, not half — so `ellipse 78% 96%` puts the
     transparent stop well outside the box and the edges never actually reach zero,
     leaving the visible rectangle this treatment exists to avoid. (2) Shrinking the
     radii until the edges do reach zero turns a 3:1 band into an obvious oval
     lozenge, which is just a different shape dropped on the page. Feathering each
     edge independently keeps the band's rectangular character AND dissolves all
     four edges. If mask-composite is ever unsupported the layers union instead of
     intersecting, which degrades to a softer rectangle — not to a broken page. */
  --art-fx: 13%;   /* horizontal feather — overridden per form below */
  --art-fy: 17%;   /* vertical feather */
  -webkit-mask-image:
    linear-gradient(to right,  rgba(0,0,0,0) 0%, #000 var(--art-fx), #000 calc(100% - var(--art-fx)), rgba(0,0,0,0) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0) 0%, #000 var(--art-fy), #000 calc(100% - var(--art-fy)), rgba(0,0,0,0) 100%);
          mask-image:
    linear-gradient(to right,  rgba(0,0,0,0) 0%, #000 var(--art-fx), #000 calc(100% - var(--art-fx)), rgba(0,0,0,0) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0) 0%, #000 var(--art-fy), #000 calc(100% - var(--art-fy)), rgba(0,0,0,0) 100%);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;

  /* Default tone = SILK (see below). */
  opacity: 0.60;
  filter: brightness(0.86);
}

/* ── TONE, declared per piece in art-data.php ────────────────────────────────
   The spec expected the variable to be band WIDTH (full vs inset). Rendering both
   at both widths showed it isn't: the dominant variable is the SOURCE's own
   tonality. Aged silk is a warm mid-dark ground and sits down quietly on the void;
   ink on pale paper is near-white and, at the same opacity, glares as a bright slab
   on a black page while looking perfectly calm on the cream light theme. Width
   barely mattered by comparison. So tone is a per-piece declaration, and these are
   the only two grounds the Met's Chinese painting collection actually offers. */
.art-frame--paper img {
  opacity: 0.34;
  filter: brightness(0.62) contrast(1.06);
}

[data-theme="light"] .art-frame img       { opacity: 0.80; filter: none; }
[data-theme="light"] .art-frame--paper img { opacity: 0.72; filter: none; }

/* ── COLUMN FORM — a portrait piece living INSIDE one of the verse's two columns,
   beside the text rather than spanning the page (Brooke, 2026-07-30: "they don't
   all have to be long and skinny rectangles").

   This is what unlocks the portrait half of the collection. §3 of the spec rejected
   hanging scrolls outright, and rightly, for the band form: a portrait plate shoves
   the verse text a full screen down the page. In a column it pushes nothing down —
   it sits alongside the commentary and fills a column that was mostly empty. Same
   feathering, same tone system; only the box changes.

   No fixed height here: the image keeps its natural aspect at the column's width,
   because a hanging scroll's proportion is part of the work. ── */
.art-figure--column {
  margin: var(--space-8) 0;
}
/* Width is the only honest lever on a column piece's HEIGHT: the work keeps its
   natural proportion, so narrowing it shortens it. Cropping a hanging scroll to fit a
   column would just be cropping the work. Set per placement via 'col_width'.
   The cap is on the FRAME, not the figure, so the museum credit still gets the whole
   column to set in — capping the figure squeezed a five-line credit under a 343px
   scroll. (--art-col-w is declared on the figure and inherits down to here.) */
.art-figure--column .art-frame {
  height: auto;
  max-width: var(--art-col-w, 100%);
  margin-left: auto;
  margin-right: auto;
}
.art-figure--column .art-frame img {
  height: auto;
  /* A tall box needs a smaller feather PERCENTAGE to give the same softness in px. */
  --art-fx: 9%;
  --art-fy: 6%;
}

/* Museum credit, in the existing Cinzel small-caps idiom. Printed even though
   CC0 does not require it — it is the honest thing, and it is what makes the
   image earn its place rather than decorate. */
.art-credit {
  font-family: 'Cinzel', serif;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--smoke);
  text-align: center;
  margin: 1.2rem 0 0;
  line-height: 1.8;
  opacity: 0.75;
  padding: 0 1.5rem;
}
.art-credit em {
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.04em;
}
/* Break the credit only at its separators, never inside a phrase — otherwise the
   narrow (inset) band splits "The Met, Open Access" across two lines. */
.art-credit > span {
  white-space: nowrap;
}
.art-credit__sep {
  opacity: 0.6;
}
.art-credit a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.28);
  transition: color 0.3s, border-color 0.3s;
}
.art-credit a:hover,
.art-credit a:focus-visible {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* A 340px band on a 390px-wide phone is a completely different proportion from
   the same band on a 1400px desktop — nearly square instead of a slot of ink.
   Scale it with the viewport, never above the placement's desktop height. */
/* ── CORNER FORM — small, subtle, tucked into a corner that is already empty ─────
   Brooke, 2026-07-30: "they can be small in corners and very subtle but i want more."

   SMALL, not FAINT — and the distinction matters. §3 of the spec rejected a ~20% ghost
   wash precisely because "you cannot honestly print 'The Met, Open Access' under a work
   you have reduced to wallpaper." So these keep the same per-theme tone values as every
   other form and stay fully legible; what changes is only their SCALE, and that they sit
   in margin space nothing else wants. Each is still credited.

   Absolutely positioned, so adding one can never move the layout beside it — which is
   also the requirement for the piece under the homepage verse grid. pointer-events:none
   and z-index:0 mean it can never intercept a click or cover a control; verify with
   .claude/tools/verify-live.sh anyway, because that is exactly the class of bug an
   invisible positioned element causes. */
.art-anchor { position: relative; }

.art-figure--corner {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  width: var(--art-corner-w, 200px);
  margin: 0;
}
.art-figure--corner .art-frame { height: auto; }
.art-figure--corner .art-frame img {
  height: auto;
  --art-fx: 12%;
  --art-fy: 12%;
}
.art-figure--corner .art-credit {
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  line-height: 1.7;
  margin-top: 0.55rem;
  padding: 0;
  opacity: 0.55;
  pointer-events: auto;   /* the museum link stays clickable though the image cannot be */
}
/* At corner scale the nowrap-per-segment rule inverts: a single long segment
   ("Li Bai Gazing at the Waterfall on Mount Lu") is wider than a 170px figure and
   pushed 52px of horizontal overflow onto the whole page. Segments wrap here. */
.art-figure--corner .art-credit > span {
  white-space: normal;
  overflow-wrap: break-word;
}

.art-at--bl    { left: var(--space-4); bottom: var(--space-4); }
.art-at--br    { right: var(--space-4); bottom: var(--space-4); }
/* Centred with calc, NOT translateX(-50%). A transform on (or above) the figure makes
   the mask-composite'd image fail to paint entirely — the image loads and lays out and
   simply never appears. That is the same failure that made a body transform blank the
   bands during testing; here it would have shipped. Never put a transform on an
   .art-figure or any ancestor of one. */
.art-at--below {
  left: calc(50% - (var(--art-corner-w, 200px) / 2));
  top: calc(100% + 1.75rem);
}

/* Below ~1000px the empty margins these live in do not exist, so a positioned corner
   piece would land on top of text. Return it to normal flow rather than hiding it —
   these are credited works with real alt text, not decoration to drop on small screens. */
@media (max-width: 1000px) {
  .art-figure--corner {
    position: static;
    width: min(200px, 52vw);
    margin: var(--space-6, 3rem) auto;
    transform: none;
  }
}

@media (max-width: 760px) {
  /* Band form only — a column piece must keep its natural aspect at every width,
     or the clamp would re-impose a band height on a hanging scroll. */
  .art-figure:not(.art-figure--column):not(.art-figure--corner) .art-frame {
    height: clamp(150px, 44vw, var(--art-h, 340px));
  }
  .art-figure { margin: var(--space-8, 4rem) 0; }
  .art-credit { font-size: 0.72rem; letter-spacing: 0.1em; }
}

@media (prefers-reduced-motion: reduce) {
  .art-credit a { transition: none; }
}
