/* =========================================================
   Verdandi Weaver — shared styles
   A breathing library. Soft, warm, alive.
   ========================================================= */

:root {
  /* Warm earth palette */
  --bg-deep:   #16120e;
  --bg-warm:   #1d1812;
  --bg-soft:   #2a231b;
  --bg-lift:   #342c22;

  --ivory:     #f1e8d8;
  --cream:     #e6d9c0;
  --sand:      #c9b693;
  --stone:     #8c7f6e;
  --stone-dim: #6e6457;

  --forest:    #6e8569;
  --forest-dim:#4f6149;
  --mist:      #7e9591;
  --gold:      #c39a64;
  --rose:      #b87f6a;
  --ember:     #d2916a;

  /* Type */
  --serif: 'EB Garamond', 'Iowan Old Style', Georgia, serif;
  --sans:  'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  /* Rhythm */
  --r-xs: 8px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 999px;

  --shadow-soft: 0 30px 80px -40px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--ivory);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  font-size: 17px;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(195,154,100,0.07), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(110,133,105,0.06), transparent 60%),
    var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: rgba(195,154,100,0.25); color: var(--ivory); }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ivory);
  margin: 0 0 0.6em;
  text-wrap: pretty;
}
h1 { font-size: clamp(40px, 5.4vw, 78px); font-weight: 400; }
h2 { font-size: clamp(30px, 3.6vw, 52px); }
h3 { font-size: clamp(22px, 2vw, 30px); }

p { margin: 0 0 1.2em; color: rgba(241,232,216,0.78); text-wrap: pretty; }

em, .italic { font-family: var(--serif); font-style: italic; color: var(--cream); }

a { color: var(--cream); text-decoration: none; transition: color .5s ease; }
a:hover { color: var(--gold); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--stone);
  font-weight: 400;
}

.lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.55;
  color: var(--cream);
  font-weight: 400;
}

.muted { color: var(--stone); }
.dim   { color: rgba(241,232,216,0.55); }

/* =========================================================
   Layout
   ========================================================= */
.shell { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
.shell-narrow { max-width: 880px; margin: 0 auto; padding: 0 40px; }

section { padding: 140px 0; position: relative; }
section.tight { padding: 80px 0; }

hr.thread {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(195,154,100,0.25), transparent);
  margin: 80px auto;
  max-width: 600px;
}

/* =========================================================
   Top navigation — soft, relational
   ========================================================= */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  background: linear-gradient(to bottom, rgba(22,18,14,0.85), rgba(22,18,14,0.0));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 1s ease;
}

.topnav.hidden { opacity: 0; pointer-events: none; }

.brand {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.02em;
  color: var(--ivory);
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand .mark {
  width: 26px; height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,220,180,0.5), transparent 55%),
    radial-gradient(circle at 50% 50%, #d2916a 0%, #8a4a2e 50%, #2a1410 100%);
  box-shadow: 0 0 14px rgba(210,145,106,0.3);
  animation: breathe-mini 14s ease-in-out infinite;
}
.brand small {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--stone);
  display: block;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
}
.nav-links a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  color: rgba(241,232,216,0.62);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.nav-links a:hover { color: var(--ivory); }
.nav-links a.active { color: var(--ivory); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
}
.nav-links .glyph {
  font-size: 12px;
  opacity: 0.65;
  filter: saturate(0.7);
}

/* =========================================================
   Living glyphs — custom symbolic iconography
   ========================================================= */
svg.glyph, .glyph svg.gicon, svg.gicon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.22em;
  color: var(--cream);
  opacity: 0.85;
  transition: opacity .6s ease, color .6s ease;
}
.nav-links svg.glyph,
.nav-links svg.gicon {
  width: 15px;
  height: 15px;
  opacity: 0.62;
  vertical-align: -3px;
  color: var(--cream);
}
.nav-links a:hover svg.glyph,
.nav-links a:hover svg.gicon,
.nav-links a.active svg.glyph,
.nav-links a.active svg.gicon {
  opacity: 0.9;
  color: var(--ivory);
}
.tile svg.glyph,
.tile svg.gicon {
  display: block;
  width: 28px;
  height: 28px;
  margin-bottom: 18px;
  opacity: 0.7;
  color: var(--cream);
}
.tile:hover svg.glyph,
.tile:hover svg.gicon { color: var(--gold); opacity: 0.95; }

.eco-node .ring svg.gicon {
  width: 26px;
  height: 26px;
  opacity: 0.78;
  color: var(--cream);
}
.eco-node.small .ring svg.gicon {
  width: 18px;
  height: 18px;
  opacity: 0.65;
}
.includes .item svg.glyph,
.includes .item svg.gicon {
  display: block;
  width: 22px;
  height: 22px;
  margin-bottom: 14px;
  opacity: 0.7;
  color: var(--cream);
}

[data-theme="light"] svg.glyph,
[data-theme="light"] svg.gicon { color: var(--cream); opacity: 0.78; }
[data-theme="light"] .nav-links svg.glyph,
[data-theme="light"] .nav-links svg.gicon { color: rgba(44,50,44,0.62); opacity: 1; }
[data-theme="light"] .nav-links a:hover svg.glyph,
[data-theme="light"] .nav-links a.active svg.glyph,
[data-theme="light"] .nav-links a:hover svg.gicon,
[data-theme="light"] .nav-links a.active svg.gicon { color: var(--ivory); }

/* =========================================================
   Breathing sphere
   ========================================================= */
.sphere-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sphere {
  position: relative;
  width: 50vmin;
  height: 50vmin;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255,228,196,0.55) 0%, rgba(255,200,150,0.0) 30%),
    radial-gradient(circle at 50% 50%,
      #e8b787 0%,
      #c98a5e 18%,
      #8a4a2e 42%,
      #4a2418 70%,
      #1c0d08 100%);
  box-shadow:
    0 0 120px 30px rgba(210,145,106,0.10),
    0 0 280px 60px rgba(184,127,106,0.06),
    inset -40px -70px 140px rgba(0,0,0,0.55),
    inset 30px 30px 80px rgba(255,210,160,0.10);
  animation: breathe 14s ease-in-out infinite;
  will-change: transform, filter;
}

.sphere::before {
  content: '';
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(210,145,106,0.16), transparent 55%);
  filter: blur(40px);
  z-index: -1;
  animation: breathe-halo 14s ease-in-out infinite;
}

.sphere::after {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,235,210,0.10) 0%, transparent 35%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.sphere-small { width: 280px; height: 280px; }
.sphere-tiny  { width: 140px; height: 140px; }

@keyframes breathe {
  0%, 100% { transform: scale(0.96); filter: brightness(0.93); }
  50%      { transform: scale(1.04); filter: brightness(1.05); }
}
@keyframes breathe-halo {
  0%, 100% { opacity: 0.55; transform: scale(0.95); }
  50%      { opacity: 0.85; transform: scale(1.08); }
}
@keyframes breathe-mini {
  0%, 100% { transform: scale(0.94); }
  50%      { transform: scale(1.06); }
}

/* drifting particles around sphere */
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: rgba(241,232,216,0.5);
  filter: blur(0.5px);
  animation: drift 22s linear infinite;
}

@keyframes drift {
  from { transform: translate(0,0); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.6; }
  to   { transform: translate(var(--dx, 60px), var(--dy, -100px)); opacity: 0; }
}

/* =========================================================
   Buttons & links
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-radius: var(--r-xl);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.02em;
  font-weight: 400;
  border: 1px solid rgba(241,232,216,0.16);
  background: transparent;
  color: var(--ivory);
  cursor: pointer;
  transition: all .6s cubic-bezier(.2,.7,.2,1);
}
.btn:hover {
  border-color: rgba(195,154,100,0.5);
  background: rgba(195,154,100,0.06);
  color: var(--cream);
}
.btn-solid {
  background: rgba(241,232,216,0.92);
  color: #2a1c12;
  border-color: transparent;
}
.btn-solid:hover {
  background: var(--ivory);
  color: #2a1c12;
}
.btn .arr { transition: transform .6s ease; }
.btn:hover .arr { transform: translateX(4px); }

.link-soft {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--cream);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.link-soft .arr { opacity: 0.6; transition: transform .5s ease, opacity .5s ease; }
.link-soft:hover .arr { transform: translateX(4px); opacity: 1; }

/* =========================================================
   Cards & relational tiles
   ========================================================= */
.tile {
  display: block;
  padding: 32px;
  border: 1px solid rgba(241,232,216,0.08);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, rgba(241,232,216,0.025), rgba(241,232,216,0.005));
  transition: all .8s cubic-bezier(.2,.7,.2,1);
  position: relative;
  overflow: hidden;
}
.tile:hover {
  border-color: rgba(195,154,100,0.28);
  background: linear-gradient(160deg, rgba(195,154,100,0.05), rgba(241,232,216,0.01));
  transform: translateY(-2px);
}
.tile .glyph {
  font-size: 22px;
  display: block;
  margin-bottom: 18px;
  filter: saturate(0.65);
}
.tile h3 {
  font-size: 22px;
  margin-bottom: 8px;
}
.tile p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(241,232,216,0.6);
  margin: 0;
}

/* Relational nav (homepage) */
.relational-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 60px;
}
@media (max-width: 900px) {
  .relational-grid { grid-template-columns: 1fr; }
}

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--r-xl);
  border: 1px solid rgba(241,232,216,0.14);
  color: var(--stone);
  background: rgba(241,232,216,0.025);
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--stone);
}
.pill.released .dot { background: var(--forest); box-shadow: 0 0 8px rgba(110,133,105,0.6);}
.pill.released { color: var(--forest); border-color: rgba(110,133,105,0.3); }
.pill.emerging .dot { background: var(--gold); box-shadow: 0 0 8px rgba(195,154,100,0.5);}
.pill.emerging { color: var(--gold); border-color: rgba(195,154,100,0.3); }
.pill.in-progress .dot { background: var(--mist); }
.pill.in-progress { color: var(--mist); border-color: rgba(126,149,145,0.3); }
.pill.coming .dot { background: var(--rose); }
.pill.coming { color: var(--rose); border-color: rgba(184,127,106,0.3); }

/* =========================================================
   Footer
   ========================================================= */
.foot {
  border-top: 1px solid rgba(241,232,216,0.06);
  padding: 80px 40px 60px;
  margin-top: 80px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.3));
}
.foot-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 60px;
}
.foot h4 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--stone);
  font-weight: 400;
  margin-bottom: 18px;
}
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 10px; }
.foot a { color: rgba(241,232,216,0.62); font-size: 14px; }
.foot a:hover { color: var(--ivory); }
.foot-meta {
  max-width: 1280px;
  margin: 60px auto 0;
  padding-top: 30px;
  border-top: 1px solid rgba(241,232,216,0.05);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-dim);
}
@media (max-width: 800px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   Soft fade-in (used by site.js)
   ========================================================= */
.fade-up {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.6s cubic-bezier(.2,.7,.2,1), transform 1.6s cubic-bezier(.2,.7,.2,1);
}
.fade-up.in { opacity: 1; transform: translateY(0); }

/* =========================================================
   Page hero variant — gentle, anchor sphere
   ========================================================= */
.page-hero {
  padding-top: 180px;
  padding-bottom: 100px;
  text-align: center;
  position: relative;
}
.page-hero .sphere-tiny {
  margin: 0 auto 50px;
}
.page-hero h1 {
  max-width: 900px;
  margin: 0 auto 24px;
}
.page-hero .lede {
  max-width: 640px;
  margin: 0 auto;
}

/* =========================================================
   Specific page layouts
   ========================================================= */

/* Library — book grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px 40px;
}
@media (max-width: 1000px) { .book-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px)  { .book-grid { grid-template-columns: 1fr; } }

.book {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.book-cover {
  aspect-ratio: 3 / 4.2;
  border-radius: 6px;
  background: linear-gradient(160deg, var(--bg-soft), var(--bg-warm));
  border: 1px solid rgba(241,232,216,0.06);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 24px;
  transition: transform .8s cubic-bezier(.2,.7,.2,1), box-shadow .8s ease;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.book-cover:hover {
  transform: translateY(-4px);
  box-shadow: 0 40px 100px -40px rgba(0,0,0,0.7);
}
.book-cover.cover-stone { background: linear-gradient(160deg, #3a3328, #261f17); }
.book-cover.cover-forest { background: linear-gradient(160deg, #3a4839, #1f2a20); }
.book-cover.cover-mist { background: linear-gradient(160deg, #3a4744, #1f2826); }
.book-cover.cover-rose { background: linear-gradient(160deg, #4a3328, #2a1c15); }
.book-cover.cover-gold { background: linear-gradient(160deg, #4a3a22, #271e12); }
.book-cover.cover-deep { background: linear-gradient(160deg, #2a2218, #14100c); }

.book-cover .ornament {
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 20% auto;
  background:
    radial-gradient(circle at 40% 35%, rgba(255,235,210,0.18), transparent 50%),
    radial-gradient(circle, rgba(195,154,100,0.18), transparent 60%);
  border: 1px solid rgba(241,232,216,0.12);
}

.book-cover .title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.2;
  color: var(--cream);
  margin-top: auto;
}
.book-cover .author {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
  margin-top: 10px;
}
.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.book h3 { margin: 0; font-size: 22px; }
.book .themes {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}
.book p { font-size: 14px; line-height: 1.65; margin: 0; }

/* Ecosystem map */
.ecosystem-stage {
  position: relative;
  height: 720px;
  margin: 60px auto;
  max-width: 1200px;
  border-radius: var(--r-lg);
  background: radial-gradient(ellipse at 50% 50%, rgba(195,154,100,0.04), transparent 60%);
  border: 1px solid rgba(241,232,216,0.05);
  overflow: hidden;
}
.eco-node {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  cursor: pointer;
  transition: all .8s cubic-bezier(.2,.7,.2,1);
}
.eco-node .ring {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 1px solid rgba(241,232,216,0.18);
  background: radial-gradient(circle, rgba(195,154,100,0.14), rgba(195,154,100,0));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  transition: all .8s ease;
}
.eco-node.center .ring {
  width: 200px; height: 200px;
  background:
    radial-gradient(circle at 38% 32%, rgba(255,228,196,0.4) 0%, transparent 35%),
    radial-gradient(circle, #c98a5e 0%, #6a3422 50%, #2a1410 100%);
  border: none;
  box-shadow: 0 0 80px rgba(210,145,106,0.3);
  animation: breathe 14s ease-in-out infinite;
}
.eco-node.small .ring { width: 64px; height: 64px; opacity: 0.7; }
.eco-node:hover .ring {
  border-color: var(--gold);
  background: radial-gradient(circle, rgba(195,154,100,0.25), rgba(195,154,100,0));
}
.eco-node .label {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--cream);
}
.eco-node .sub {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--stone);
  margin-top: 4px;
}

/* Self-scan card */
.scan-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 20px;
}
@media (max-width: 800px) { .scan-grid { grid-template-columns: 1fr; } }

.scan-card {
  padding: 36px;
  border-radius: var(--r-md);
  border: 1px solid rgba(241,232,216,0.08);
  background: linear-gradient(160deg, rgba(241,232,216,0.025), transparent);
  transition: all .8s ease;
  cursor: pointer;
  position: relative;
}
.scan-card:hover {
  border-color: rgba(195,154,100,0.28);
  background: linear-gradient(160deg, rgba(195,154,100,0.06), transparent);
}
.scan-card .duration {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.scan-card .duration .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--mist);
}
.scan-card h3 { font-size: 26px; margin: 0 0 10px; }
.scan-card p { font-size: 14px; margin: 0; }

/* Scan flow modal */
.scan-modal {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
}
.scan-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.scan-modal .step {
  max-width: 680px;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}
.scan-modal .step.in { opacity: 1; transform: translateY(0); }
.scan-modal .q {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.25;
  color: var(--ivory);
  margin: 0 0 50px;
}
.scan-modal .answers {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.scan-modal .answer {
  width: 100%;
  max-width: 460px;
  padding: 18px 28px;
  border: 1px solid rgba(241,232,216,0.14);
  border-radius: var(--r-xl);
  background: transparent;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  cursor: pointer;
  transition: all .6s cubic-bezier(.2,.7,.2,1);
  letter-spacing: 0.01em;
}
.scan-modal .answer:hover {
  border-color: var(--gold);
  background: rgba(195,154,100,0.08);
  color: var(--ivory);
  transform: translateY(-1px);
}
.scan-modal .progress {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.scan-modal .progress span {
  width: 22px; height: 2px;
  background: rgba(241,232,216,0.15);
  transition: background .6s ease;
}
.scan-modal .progress span.active { background: var(--gold); }
.scan-modal .close-scan {
  position: absolute;
  top: 36px;
  right: 40px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.scan-modal .close-scan:hover { color: var(--ivory); }

/* Frameworks gallery */
.frame-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 800px) { .frame-grid { grid-template-columns: 1fr; } }
.frame {
  border: 1px solid rgba(241,232,216,0.07);
  border-radius: var(--r-md);
  padding: 40px;
  background: linear-gradient(160deg, rgba(241,232,216,0.02), transparent);
  transition: all .8s ease;
  position: relative;
  overflow: hidden;
}
.frame:hover { border-color: rgba(195,154,100,0.22); }
.frame .diagram {
  height: 200px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.frame h3 { font-size: 24px; margin: 0 0 8px; }
.frame p { font-size: 14px; margin: 0; line-height: 1.65; }

/* Reflections / articles list */
.reflection-list { display: flex; flex-direction: column; }
.reflection {
  display: grid;
  grid-template-columns: 120px 1fr 200px;
  gap: 40px;
  padding: 36px 0;
  border-bottom: 1px solid rgba(241,232,216,0.06);
  align-items: start;
  cursor: pointer;
  transition: opacity .5s ease;
}
.reflection:hover { opacity: 0.85; }
.reflection:hover h3 { color: var(--gold); }
.reflection h3 {
  font-size: 22px;
  margin: 0 0 8px;
  transition: color .5s ease;
}
.reflection p { font-size: 14px; line-height: 1.6; margin: 0; color: rgba(241,232,216,0.55); }
.reflection .date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
}
.reflection .kind {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
  text-align: right;
}
@media (max-width: 800px) {
  .reflection { grid-template-columns: 1fr; gap: 8px; }
  .reflection .kind { text-align: left; }
}

/* About */
.about-portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-md);
  background:
    repeating-linear-gradient(135deg, rgba(241,232,216,0.04), rgba(241,232,216,0.04) 8px, transparent 8px, transparent 16px),
    linear-gradient(160deg, var(--bg-soft), var(--bg-warm));
  border: 1px solid rgba(241,232,216,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone-dim);
}

/* =========================================================
   Quote / pull
   ========================================================= */
.pull {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.3;
  color: var(--cream);
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}
.pull::before, .pull::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: rgba(195,154,100,0.4);
  margin: 30px auto;
}
.pull-author {
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
  margin-top: 30px;
  display: block;
  text-align: center;
}

/* =========================================================
   Soft "now growing" notice
   ========================================================= */
.growing {
  text-align: center;
  padding: 100px 40px;
  border-top: 1px solid rgba(241,232,216,0.05);
  border-bottom: 1px solid rgba(241,232,216,0.05);
  background: linear-gradient(to bottom, transparent, rgba(195,154,100,0.025), transparent);
}
.growing p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2vw, 26px);
  color: var(--cream);
  max-width: 640px;
  margin: 0 auto;
}

/* =========================================================
   Responsive nav collapse (simple)
   ========================================================= */
@media (max-width: 900px) {
  .nav-links { gap: 16px; }
  .nav-links a span:not(.glyph) { display: none; }
  .topnav { padding: 18px 24px; }
  .shell, .shell-narrow { padding: 0 24px; }
  section { padding: 90px 0; }
  .reflection { padding: 24px 0; }
}

/* Mobile hamburger drawer (≤600px) */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(241,232,216,0.16);
  border-radius: 999px;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--cream);
  padding: 0;
  margin-left: auto;
}
.nav-toggle:hover { color: var(--gold); border-color: rgba(195,154,100,0.4); }
.nav-toggle svg { width: 18px; height: 18px; }
[data-theme="light"] .nav-toggle { border-color: rgba(80,60,40,0.18); color: #424a40; }

@media (max-width: 600px) {
  .topnav { flex-wrap: wrap; gap: 12px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 4px !important;
    padding: 16px 0 8px;
    border-top: 1px solid rgba(241,232,216,0.08);
    margin-top: 8px;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 4px;
    border-bottom: 1px solid rgba(241,232,216,0.05);
    display: flex !important;
    align-items: center;
    gap: 12px;
  }
  .nav-links a span:not(.glyph) { display: inline !important; }
  .nav-links a:last-child { border-bottom: none; }
  [data-theme="light"] .nav-links { border-top-color: rgba(80,60,40,0.12); }
  [data-theme="light"] .nav-links a { border-bottom-color: rgba(80,60,40,0.08); }
}

/* =========================================================
   Theme toggle button (injected by site.js)
   ========================================================= */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 50%;
  transform: translateX(720px);
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(241,232,216,0.16);
  background: rgba(241,232,216,0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .6s ease;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--cream);
}
.theme-toggle:hover {
  border-color: rgba(195,154,100,0.5);
  color: var(--gold);
}
@media (max-width: 1480px) {
  .theme-toggle { right: 24px; transform: none; top: 22px; }
}

/* =========================================================
   LIGHT MODE — forest after rain · moss · stone · sage
   cool, grounded, Nordic; soft but never beige
   ========================================================= */
[data-theme="light"] {
  --bg-deep:   #e7ebe3;   /* cool off-white, faint sage */
  --bg-warm:   #dde3d6;   /* moss-tinted mist */
  --bg-soft:   #c9d2c2;   /* damp stone */
  --bg-lift:   #aab5a3;   /* deeper moss */
  --ivory:     #2c322c;   /* soft charcoal, slight green */
  --cream:     #424a40;   /* warmer charcoal */
  --sand:      #6e7868;   /* stone-moss */
  --stone:     #6a7164;   /* moss grey */
  --stone-dim: #8b9385;   /* lifted moss-stone */
  --forest:    #3f5440;   /* deep forest accent */
  --forest-dim:#6e8167;   /* muted sage */
  --mist:      #7a8a80;   /* grey-green mist */
  --gold:      #506547;   /* deep olive — replaces gold in light mode */
  --rose:      #7a6f60;   /* quiet earth */
  --ember:     #8a7e6a;   /* warmer stone */
  --shadow-soft: 0 30px 80px -40px rgba(40,55,40,0.20);
}

[data-theme="light"] body {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(80,101,71,0.06), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(110,136,132,0.06), transparent 60%),
    var(--bg-deep);
  color: var(--ivory);
}

[data-theme="light"] p { color: rgba(44,50,44,0.80); }
[data-theme="light"] em, [data-theme="light"] .italic { color: var(--cream); }
[data-theme="light"] .lede { color: var(--cream); }
[data-theme="light"] .muted { color: var(--stone); }
[data-theme="light"] .dim { color: rgba(44,50,44,0.55); }

[data-theme="light"] ::selection {
  background: rgba(80,101,71,0.22);
  color: var(--ivory);
}

[data-theme="light"] .topnav {
  background: linear-gradient(to bottom, rgba(231,235,227,0.90), rgba(231,235,227,0.0));
}
[data-theme="light"] .nav-links a { color: rgba(44,50,44,0.62); }
[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active { color: var(--ivory); }

[data-theme="light"] .brand small { color: var(--stone); }

/* Tiles, cards, scan-cards — sand surfaces */
[data-theme="light"] .tile {
  border-color: rgba(60,72,52,0.10);
  background: linear-gradient(160deg, rgba(255,255,255,0.45), rgba(255,255,255,0.12));
}
[data-theme="light"] .tile:hover {
  border-color: rgba(80,101,71,0.4);
  background: linear-gradient(160deg, rgba(80,101,71,0.08), rgba(255,255,255,0.2));
}
[data-theme="light"] .tile p { color: rgba(44,50,44,0.62); }

[data-theme="light"] .scan-card {
  border-color: rgba(60,72,52,0.10);
  background: linear-gradient(160deg, rgba(255,255,255,0.4), transparent);
}
[data-theme="light"] .scan-card:hover {
  border-color: rgba(80,101,71,0.35);
  background: linear-gradient(160deg, rgba(80,101,71,0.08), transparent);
}

[data-theme="light"] .frame {
  border-color: rgba(60,72,52,0.10);
  background: linear-gradient(160deg, rgba(255,255,255,0.35), transparent);
}
[data-theme="light"] .frame:hover { border-color: rgba(80,101,71,0.3); }

[data-theme="light"] .frame .diag .stroke { stroke: rgba(44,50,44,0.55); }
[data-theme="light"] .frame .diag .stroke-dim { stroke: rgba(44,50,44,0.22); }
[data-theme="light"] .frame .diag .stroke-gold { stroke: var(--gold); }
[data-theme="light"] .frame .diag .fill-cream { fill: var(--cream); }
[data-theme="light"] .frame .diag .fill-gold { fill: var(--gold); }
[data-theme="light"] .frame .diag .fill-mist { fill: var(--mist); }
[data-theme="light"] .frame .diag .fill-forest { fill: var(--forest); }
[data-theme="light"] .frame .diag .fill-rose { fill: var(--rose); }
[data-theme="light"] .frame .diag text { fill: var(--stone); }

/* Book covers — keep warmth, soften */
[data-theme="light"] .book-cover {
  border-color: rgba(60,72,52,0.10);
  box-shadow: 0 24px 60px -28px rgba(60,72,52,0.28);
}
[data-theme="light"] .book-cover.cover-stone { background: linear-gradient(160deg, #8c948a, #6c746a); }
[data-theme="light"] .book-cover.cover-forest { background: linear-gradient(160deg, #6a7d65, #485a44); }
[data-theme="light"] .book-cover.cover-mist { background: linear-gradient(160deg, #8aa098, #6a8278); }
[data-theme="light"] .book-cover.cover-rose { background: linear-gradient(160deg, #8c7e72, #6e6256); }
[data-theme="light"] .book-cover.cover-gold { background: linear-gradient(160deg, #7e8a6a, #5e6a4c); }
[data-theme="light"] .book-cover.cover-deep { background: linear-gradient(160deg, #6e786a, #4e584c); }
[data-theme="light"] .book-cover .title { color: #eef0e8; }
[data-theme="light"] .book-cover .author { color: rgba(238,240,232,0.72); }
[data-theme="light"] .book-cover .ornament {
  background:
    radial-gradient(circle at 40% 35%, rgba(240,244,232,0.28), transparent 50%),
    radial-gradient(circle, rgba(240,244,232,0.14), transparent 60%);
  border-color: rgba(240,244,232,0.18);
}

/* Buttons */
[data-theme="light"] .btn {
  border-color: rgba(60,72,52,0.18);
  color: var(--ivory);
}
[data-theme="light"] .btn:hover {
  border-color: rgba(80,101,71,0.6);
  background: rgba(80,101,71,0.08);
  color: var(--cream);
}
[data-theme="light"] .btn-solid {
  background: #2c322c;
  color: #e7ebe3;
  border-color: transparent;
}
[data-theme="light"] .btn-solid:hover {
  background: #3a423a;
  color: #eef0e8;
}

[data-theme="light"] .link-soft { color: var(--cream); }
[data-theme="light"] .link-soft:hover { color: var(--gold); }
[data-theme="light"] a { color: var(--cream); }
[data-theme="light"] a:hover { color: var(--gold); }

/* Pills */
[data-theme="light"] .pill {
  border-color: rgba(60,72,52,0.16);
  color: var(--stone);
  background: rgba(255,255,255,0.3);
}
[data-theme="light"] .pill .dot { background: var(--stone); }

/* Threads / dividers */
[data-theme="light"] hr.thread {
  background: linear-gradient(to right, transparent, rgba(80,101,71,0.32), transparent);
}

/* Pull quote dividers */
[data-theme="light"] .pull::before,
[data-theme="light"] .pull::after { background: rgba(80,101,71,0.45); }
[data-theme="light"] .pull { color: var(--cream); }

/* Reflection list */
[data-theme="light"] .reflection {
  border-bottom-color: rgba(60,72,52,0.10);
}
[data-theme="light"] .reflection p { color: rgba(44,50,44,0.6); }

/* Footer */
[data-theme="light"] .foot {
  border-top-color: rgba(60,72,52,0.10);
  background: linear-gradient(to bottom, transparent, rgba(60,72,52,0.06));
}
[data-theme="light"] .foot a { color: rgba(44,50,44,0.65); }
[data-theme="light"] .foot a:hover { color: var(--ivory); }
[data-theme="light"] .foot p { color: rgba(44,50,44,0.55); }
[data-theme="light"] .foot-meta { color: var(--stone-dim); border-top-color: rgba(60,72,52,0.08); }

/* Growing notice */
[data-theme="light"] .growing {
  border-top-color: rgba(60,72,52,0.10);
  border-bottom-color: rgba(60,72,52,0.10);
  background: linear-gradient(to bottom, transparent, rgba(80,101,71,0.05), transparent);
}
[data-theme="light"] .growing p { color: var(--cream); }

/* About portrait placeholder */
[data-theme="light"] .about-portrait {
  background:
    repeating-linear-gradient(135deg, rgba(60,72,52,0.05), rgba(60,72,52,0.05) 8px, transparent 8px, transparent 16px),
    linear-gradient(160deg, rgba(255,255,255,0.4), rgba(255,255,255,0.15));
  border-color: rgba(60,72,52,0.10);
  color: var(--stone-dim);
}

/* Particles — soften on light */
[data-theme="light"] .particle { background: rgba(60,72,52,0.45); }

/* Theme toggle button */
[data-theme="light"] .theme-toggle {
  border-color: rgba(60,72,52,0.18);
  background: rgba(255,255,255,0.4);
  color: var(--cream);
}
[data-theme="light"] .theme-toggle:hover {
  border-color: rgba(80,101,71,0.55);
  color: var(--gold);
}

/* Eco map */
[data-theme="light"] .ecosystem-stage {
  background: radial-gradient(ellipse at 50% 50%, rgba(80,101,71,0.06), transparent 60%);
  border-color: rgba(60,72,52,0.08);
}
[data-theme="light"] .eco-svg .thread { stroke: rgba(80,101,71,0.35); }
[data-theme="light"] .eco-svg .thread-soft { stroke: rgba(60,72,52,0.14); }
[data-theme="light"] .eco-node .ring {
  border-color: rgba(60,72,52,0.22);
  background: radial-gradient(circle, rgba(80,101,71,0.18), transparent);
}
[data-theme="light"] .eco-node:hover .ring {
  border-color: var(--gold);
  background: radial-gradient(circle, rgba(80,101,71,0.32), transparent);
}
[data-theme="light"] .eco-node .label { color: var(--cream); }
[data-theme="light"] .eco-node .sub { color: var(--stone); }

/* Scan modal */
[data-theme="light"] .scan-modal { background: var(--bg-deep); }
[data-theme="light"] .scan-modal .answer {
  border-color: rgba(60,72,52,0.18);
  color: var(--cream);
}
[data-theme="light"] .scan-modal .answer:hover {
  border-color: var(--gold);
  background: rgba(80,101,71,0.10);
  color: var(--ivory);
}
[data-theme="light"] .scan-modal .progress span { background: rgba(60,72,52,0.18); }
[data-theme="light"] .scan-modal .progress span.active { background: var(--gold); }
[data-theme="light"] .scan-modal .close-scan { color: var(--stone); }
[data-theme="light"] .scan-modal .close-scan:hover { color: var(--ivory); }

/* About email input */
[data-theme="light"] section .growing input[type="email"],
[data-theme="light"] input[type="email"] {
  border-color: rgba(60,72,52,0.18) !important;
  background: rgba(255,255,255,0.5) !important;
  color: var(--ivory) !important;
}

/* Light-mode sphere — keep the warm planetary glow but lift it */
[data-theme="light"] .sphere {
  box-shadow:
    0 0 120px 30px rgba(210,145,106,0.18),
    0 0 280px 60px rgba(184,127,106,0.10),
    inset -40px -70px 140px rgba(0,0,0,0.45),
    inset 30px 30px 80px rgba(255,210,160,0.18);
}
[data-theme="light"] .sphere::before {
  background: radial-gradient(circle, rgba(210,145,106,0.22), transparent 55%);
}
[data-theme="light"] .brand .mark {
  box-shadow: 0 0 14px rgba(80,101,71,0.4);
}


/* =========================================================
   LIGHT-THEME SAFETY NET
   Catches recurring cream/ivory text colors (rgba(241,232,216,*))
   used across page-level <style> blocks and inline styles so
   they don't disappear on the light background.
   Uses html[data-theme="light"] for higher specificity over
   page-level [data-theme="light"] rules; uses !important
   where inline styles need to be defeated.
   ========================================================= */

/* — reflective prose & anchors (used on most framework pages) — */
html[data-theme="light"] .reflection-block,
html[data-theme="light"] .reflection-anchor {
  color: rgba(44,50,44,0.85);
}
html[data-theme="light"] .reflection-block.small {
  color: rgba(44,50,44,0.70);
}

/* — section heads & ledes — */
html[data-theme="light"] .section-head .lede-line,
html[data-theme="light"] .section-head .sub,
html[data-theme="light"] .lede-line {
  color: rgba(44,50,44,0.70);
}

/* — stage chrome (the framed visual panels) — */
html[data-theme="light"] .stage-feel,
html[data-theme="light"] .stage-caption,
html[data-theme="light"] .stage-foot,
html[data-theme="light"] .stage-meta {
  color: rgba(44,50,44,0.62);
}
html[data-theme="light"] .stage-caption .hint {
  color: rgba(44,50,44,0.55);
}
html[data-theme="light"] .stage-meta .title {
  color: rgba(44,50,44,0.82);
}

/* — arrival blocks (page intros) — */
html[data-theme="light"] .arrival .breath,
html[data-theme="light"] .arrival .h-sub,
html[data-theme="light"] .arrival .breath em,
html[data-theme="light"] .arrival h1 {
  color: rgba(44,50,44,0.85);
}
html[data-theme="light"] .arrival .breath-line,
html[data-theme="light"] .arrival .axis .into,
html[data-theme="light"] .arrival .axis .out,
html[data-theme="light"] .arrival .tri,
html[data-theme="light"] .arrival .tag {
  color: rgba(44,50,44,0.62);
}

/* — atmosphere keyword grids — */
html[data-theme="light"] .atmosphere span,
html[data-theme="light"] .escape-words span,
html[data-theme="light"] .system-list .cell .which,
html[data-theme="light"] .system-list .cell .small {
  color: rgba(44,50,44,0.66);
}
html[data-theme="light"] .atmosphere span,
html[data-theme="light"] .escape-words span,
html[data-theme="light"] .system-list .cell {
  border-top-color: rgba(60,72,52,0.12);
}

/* — three awakenings chapter (doorway, caution, requires, triad) — */
html[data-theme="light"] .doorway h3,
html[data-theme="light"] .door-prose p,
html[data-theme="light"] .triad .col p,
html[data-theme="light"] .requires .qualities,
html[data-theme="light"] .chapter-open h2 {
  color: rgba(44,50,44,0.88);
}
html[data-theme="light"] .door-feel,
html[data-theme="light"] .door-roman,
html[data-theme="light"] .requires .label,
html[data-theme="light"] .caution .label,
html[data-theme="light"] .chapter-open .three-mark,
html[data-theme="light"] .triad .col .roman {
  color: rgba(44,50,44,0.58);
}
html[data-theme="light"] .caution p {
  color: rgba(44,50,44,0.82);
}
html[data-theme="light"] .triad .col {
  border-top-color: rgba(60,72,52,0.12);
}
html[data-theme="light"] .weave-stage .w-meta,
html[data-theme="light"] .weave-stage .w-foot {
  color: rgba(44,50,44,0.58);
}
html[data-theme="light"] .weave-stage .w-meta .t {
  color: rgba(44,50,44,0.82);
}
html[data-theme="light"] .door-visual .v-meta {
  color: rgba(44,50,44,0.58);
}

/* — ending / closing sections — */
html[data-theme="light"] .ending,
html[data-theme="light"] .ending-text,
html[data-theme="light"] .ending-stage .ending-text {
  color: rgba(44,50,44,0.85);
}
html[data-theme="light"] .ending .pathways a {
  color: rgba(44,50,44,0.70);
}
html[data-theme="light"] .pathways .label,
html[data-theme="light"] .ending .pathways .label {
  color: rgba(44,50,44,0.55);
}

/* — footer brand paragraph (inline-styled in every page) — */
html[data-theme="light"] .foot .brand + p,
html[data-theme="light"] .foot p[style] {
  color: rgba(44,50,44,0.62) !important;
}

/* — video-reflections page surfaces — */
html[data-theme="light"] .poster .platform,
html[data-theme="light"] .vr-lightbox-meta {
  color: rgba(44,50,44,0.70);
}

/* — generic catch-all: any inline style declaring ivory text — */
html[data-theme="light"] [style*="color: rgba(241,232,216"],
html[data-theme="light"] [style*="color:rgba(241,232,216"] {
  color: rgba(44,50,44,0.70) !important;
}
