/* ══════════════════════════════════════════════
   WBW Beta — site styles
   Sections:
     1. Tokens
     2. Reset / base / background
     3. Topbar
     4. Panels (paged) + bento
     5. Footer
     6. Cell / typography / buttons
     7. Modal (detail)
     8. Per-panel layouts (P1–P6)
     9. Join modal
    10. Animations
    11. Responsive  (a) max-aspect-ratio 4/3
                   (b) max-width 1024 / 768 / 480
   ══════════════════════════════════════════════ */

/* 1 ── Tokens ───────────────────────── */
:root {
  --sky:        #d8edf8;
  --sky-mid:    #7aafc8;
  --leaf:       #3a8a50;
  --leaf-lt:    #5aaa6a;
  --glow:       #4a9a5c;
  --gold:       #b89438;
  --gold-lt:    #d4aa44;
  --citrus:     #d08820;
  --white:      #ffffff;
  --off-white:  #f8f6f2;
  --text:       #1a2a1e;
  --text-mid:   #3a4a3e;
  --text-lt:    #6a7a6e;
  --border:     rgba(58,138,80,0.15);
  --cell-bg:    rgba(255,255,255,0.72);
  --cell-hover: rgba(255,255,255,0.90);
  --topbar-h:   96px;
  --footer-h:   32px;
}

/* 2 ── Reset / base / background ────── */
* { margin:0; padding:0; box-sizing:border-box; }
html, body { width:100vw; height:100vh; overflow:hidden; position:fixed; }
body { font-family:'Nunito',sans-serif; color:var(--text); }

body::before {
  content:'';
  position:fixed; inset:0; z-index:-1;
  background: linear-gradient(160deg, #ffffff 0%, #f0f8f4 30%, #e4f2f8 60%, #d8edd8 100%);
}

/* 3 ── Topbar ──────────────────────── */
.topbar {
  position:fixed; top:0; left:0; right:0; z-index:300;
  height:var(--topbar-h);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 48px;
  background:rgba(255,255,255,0.92);
  backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(58,138,80,0.10);
}

.logo-wrap  { display:flex; flex-direction:column; gap:5px; }
.logo-main  {
  font-family:'Fraunces',serif;
  font-size:34px; font-weight:700; letter-spacing:0.01em;
  color:var(--text); line-height:1;
}
.logo-sub {
  font-family:'Outfit',sans-serif;
  font-size:11px; letter-spacing:0.18em; text-transform:uppercase;
  color:var(--text-lt); font-weight:600;
}

.panel-tabs {
  display:flex; gap:0; list-style:none;
  background:rgba(255,255,255,0.60);
  border:1px solid rgba(58,138,80,0.12);
  border-radius:36px;
  padding:5px;
  backdrop-filter:blur(8px);
  box-shadow:0 1px 8px rgba(0,0,0,0.05);
}

.panel-tabs li button {
  font-family:'Outfit',sans-serif;
  font-size:14px; font-weight:600;
  letter-spacing:0.10em; text-transform:uppercase;
  background:none; border:none; cursor:pointer;
  color:var(--text-lt);
  padding:10px 24px;
  border-radius:30px;
  transition:all 0.22s ease;
  white-space:nowrap;
}
.panel-tabs li button:hover { color:var(--text); }

.panel-tabs li button.active {
  color:var(--white);
  background: linear-gradient(135deg, var(--leaf) 0%, #2a7040 100%);
  box-shadow: 0 2px 10px rgba(58,138,80,0.30), inset 0 1px 0 rgba(255,255,255,0.15);
  font-weight:700;
}

.panel-tabs li button.join-tab {
  color:var(--white);
  background:linear-gradient(135deg, #c8a030 0%, #9a7418 100%);
  border-radius:30px;
  padding:10px 24px;
  font-weight:700;
  box-shadow:
    0 0 0 2px rgba(200,160,48,0.25),
    0 0 16px rgba(200,160,48,0.30),
    0 2px 8px rgba(0,0,0,0.12);
  animation: goldPulse 2.5s ease-in-out infinite;
}
.panel-tabs li button.join-tab:hover {
  box-shadow:
    0 0 0 3px rgba(200,160,48,0.40),
    0 0 24px rgba(200,160,48,0.45),
    0 4px 12px rgba(0,0,0,0.15);
  transform:translateY(-1px);
}
.panel-tabs li button.join-tab.active {
  box-shadow:
    0 0 0 3px rgba(200,160,48,0.50),
    0 0 20px rgba(200,160,48,0.40),
    inset 0 1px 0 rgba(255,255,255,0.2);
  animation:none;
}

@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(200,160,48,0.20), 0 0 12px rgba(200,160,48,0.20), 0 2px 8px rgba(0,0,0,0.10); }
  50%      { box-shadow: 0 0 0 4px rgba(200,160,48,0.35), 0 0 24px rgba(200,160,48,0.40), 0 2px 8px rgba(0,0,0,0.10); }
}

/* 4 ── Panels (paged) + bento ───────── */
#panels { width:100vw; height:100vh; position:relative; }
.panel {
  position:absolute; inset:0;
  opacity:0; pointer-events:none;
  transition:opacity 0.5s ease;
}
.panel.active { opacity:1; pointer-events:all; }

.bento {
  position:absolute;
  top:calc(var(--topbar-h) + 14px);
  bottom:calc(var(--footer-h) + 10px);
  left:20px; right:20px;
  display:grid;
  gap:10px;
  overflow:hidden;
  min-height:0;
}

/* 5 ── Footer ──────────────────────── */
#site-footer {
  position:fixed; bottom:0; left:0; right:0; z-index:300;
  height:var(--footer-h);
  background:rgba(255,255,255,0.92);
  backdrop-filter:blur(12px);
  border-top:1px solid rgba(58,138,80,0.10);
  display:flex; align-items:flex-start; justify-content:space-between;
  padding:0 48px;
  font-family:'Outfit',sans-serif;
  font-size:11px; color:var(--text-lt);
  transition:height 0.3s ease;
  overflow:hidden;
  cursor:pointer;
}

#site-footer .footer-bar {
  display:flex; align-items:center; justify-content:space-between;
  width:100%; height:var(--footer-h); flex-shrink:0;
}

#site-footer.expanded { height:200px; }
#site-footer:not(.expanded) .footer-expanded-content { display:none; }
#site-footer.expanded .footer-expanded-content { display:grid; }

.footer-copy { font-size:11px; color:var(--text-lt); }
.footer-toggle {
  font-size:11px; color:var(--leaf); cursor:pointer;
  font-weight:600; letter-spacing:0.08em;
  background:none; border:none; font-family:'Outfit',sans-serif;
}

.footer-expanded-content {
  width:100%; padding:14px 0 16px;
  grid-template-columns:repeat(3,1fr); gap:32px;
}

.footer-col h4 {
  font-family:'Outfit',sans-serif;
  font-size:11px; font-weight:700; text-transform:uppercase;
  letter-spacing:0.12em; color:var(--leaf); margin-bottom:8px;
}
.footer-col p, .footer-col a {
  font-size:12px; color:var(--text-lt); line-height:1.8;
  text-decoration:none; display:block;
}
.footer-col a:hover { color:var(--leaf); }

/* 6 ── Cell / typography / buttons ─── */
.cell {
  background:rgba(255,255,255,0.58);
  border:1px solid rgba(58,138,80,0.10);
  border-radius:16px;
  padding:26px 28px;
  display:flex; flex-direction:column;
  overflow:hidden; min-width:0; min-height:0;
  transition:background 0.25s, box-shadow 0.25s, transform 0.2s;
  backdrop-filter:blur(6px);
  box-shadow:0 1px 8px rgba(58,138,80,0.05);
}

.cell-mother {
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  backdrop-filter:none !important;
  padding:20px 8px;
}

.cell-hover:hover,
.cell-clickable:hover {
  background:rgba(255,255,255,0.82);
  box-shadow:0 4px 20px rgba(58,138,80,0.10);
  transform:translateY(-2px);
}
.cell-clickable { cursor:pointer; }

.cell-solid { background:rgba(26,42,30,0.88) !important; border:none !important; color:var(--white); }
.cell-solid p, .cell-solid .ostrom-text { color:rgba(255,255,255,0.65); }
.cell-sky   { background:rgba(216,237,248,0.45) !important; }

.eyebrow {
  font-family:'Outfit',sans-serif;
  font-size:12px; letter-spacing:0.20em; text-transform:uppercase;
  font-weight:700; color:var(--leaf); margin-bottom:14px;
  display:flex; align-items:center; gap:8px;
}
.eyebrow::before { content:''; width:14px; height:2px; background:var(--leaf); flex-shrink:0; border-radius:2px; }

h1 {
  font-family:'Fraunces',serif;
  font-size:clamp(40px, 5vw, 68px);
  font-weight:600; line-height:1.02;
  color:var(--text); letter-spacing:-0.01em;
}
h1 em { font-style:italic; color:var(--leaf); }

h2 {
  font-family:'Fraunces',serif;
  font-size:clamp(24px, 2.8vw, 38px);
  font-weight:600; line-height:1.1;
  color:var(--text); margin-bottom:14px;
}

h3 {
  font-family:'Fraunces',serif;
  font-size:clamp(18px, 1.8vw, 24px);
  font-weight:600; color:var(--text); margin-bottom:6px;
}

p { font-size:clamp(15px, 1.1vw, 17px); line-height:1.75; color:var(--text-mid); }

.btn-p {
  font-family:'Space Mono',monospace;
  font-size:11px; letter-spacing:0.08em; text-transform:uppercase;
  background:var(--leaf); color:var(--white); border:none;
  padding:12px 28px; border-radius:20px; cursor:pointer;
  font-weight:700; transition:all 0.2s; align-self:flex-start;
}
.btn-p:hover { background:var(--glow); }

.btn-ghost {
  font-family:'Nunito',sans-serif;
  font-size:15px; color:var(--text-lt); background:none; border:none;
  cursor:pointer; text-decoration:underline; text-underline-offset:4px;
  transition:color 0.2s; padding:0;
}
.btn-ghost:hover { color:var(--text); }

/* 7 ── Modal (detail) ───────────────── */
#modal-overlay {
  position:fixed; inset:0; z-index:500;
  background:rgba(26,42,30,0.55);
  backdrop-filter:blur(8px);
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none;
  transition:opacity 0.3s ease;
}
#modal-overlay.open { opacity:1; pointer-events:all; }

#modal-box {
  width:80vw; height:80vh; max-width:1100px;
  background:var(--off-white);
  border-radius:24px;
  box-shadow:0 24px 80px rgba(0,0,0,0.18);
  display:flex; flex-direction:column;
  overflow:hidden;
  transform:scale(0.96) translateY(12px);
  transition:transform 0.3s ease;
}
#modal-overlay.open #modal-box { transform:scale(1) translateY(0); }

#modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:24px 36px 20px;
  border-bottom:1px solid rgba(58,138,80,0.10);
  flex-shrink:0;
}
#modal-eyebrow {
  font-family:'Space Mono',monospace;
  font-size:10px; letter-spacing:0.22em; text-transform:uppercase;
  color:var(--leaf);
}
#modal-title {
  font-family:'Fraunces',serif;
  font-size:clamp(22px, 2.5vw, 34px);
  font-weight:600; color:var(--text);
  margin-top:6px;
}
#modal-close {
  width:36px; height:36px; border-radius:50%;
  background:rgba(58,138,80,0.10);
  border:none; cursor:pointer; font-size:18px; color:var(--text-mid);
  display:flex; align-items:center; justify-content:center;
  transition:background 0.2s; flex-shrink:0;
}
#modal-close:hover { background:rgba(58,138,80,0.20); }
#modal-body {
  flex:1; overflow-y:auto;
  padding:28px 36px;
  font-size:16px; line-height:1.8; color:var(--text-mid);
}

/* 8 ── Per-panel layouts ────────────── */

/* P1 HERO */
#p1 .bento {
  grid-template-columns:1fr 1fr;
  grid-template-rows:1fr 1fr;
}
#p1 .c-head { grid-column:1; grid-row:1; justify-content:flex-end; padding-bottom:20px; }
#p1 .c-body { grid-column:1; grid-row:2; justify-content:space-between; }
#p1 .c-de   { grid-column:2; grid-row:1/3; align-items:center; justify-content:center; position:relative; background:transparent; border:none; }

.hero-tagline {
  font-family:'Fraunces',serif;
  font-size:clamp(15px, 1.3vw, 18px);
  font-style:italic; color:var(--text-lt);
  margin-top:12px; font-weight:300;
}
.hero-body-text { margin-bottom:20px; }
.hero-actions   { display:flex; gap:14px; align-items:center; flex-wrap:wrap; }

#de-canvas { position:absolute; inset:0; width:100%; height:100%; }

/* P2 PROGRAMS */
#p2 .bento {
  grid-template-columns:1.3fr repeat(5, 1fr);
  grid-template-rows:1fr;
}
.prog-intro { justify-content:center; }
.prog-card  { justify-content:flex-end; }
.prog-emoji { font-size:clamp(24px, 3vmin, 36px); margin-bottom:auto; padding-top:4px; }
.prog-name  { margin-top:24px; margin-bottom:6px; }

/* P3 FRAMEWORK */
#p3 .bento {
  grid-template-columns: 3fr 7fr;
  grid-template-rows: 1fr;
  overflow: hidden;
}
.fw-right-col {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 10px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.vc-grid {
  display:grid; grid-template-columns:repeat(3,1fr);
  gap:8px; margin-top:16px;
}
.vc-item {
  background:rgba(58,138,80,0.06);
  border:1px solid rgba(58,138,80,0.12);
  border-radius:10px; padding:12px 10px;
}
.vc-icon { font-size:18px; margin-bottom:5px; }
.vc-name { font-size:13px; font-weight:700; color:var(--leaf); line-height:1.3; }

.quote-wrap { display:flex; flex-direction:column; justify-content:center; height:100%; }
.quote-text {
  font-family:'Fraunces',serif;
  font-size:clamp(18px, 2vw, 26px);
  font-style:italic; line-height:1.55;
  color:var(--white); margin-bottom:14px;
  transition:opacity 0.5s;
}
.quote-attr {
  font-family:'Space Mono',monospace;
  font-size:11px; letter-spacing:0.15em; text-transform:uppercase;
  color:var(--gold); transition:opacity 0.5s;
}

.ostrom-list { margin-top:14px; display:flex; flex-direction:column; gap:10px; }
.ostrom-item { display:flex; gap:12px; align-items:flex-start; }
.ostrom-num {
  font-family:'Space Mono',monospace;
  font-size:11px; color:var(--gold); min-width:20px; padding-top:1px;
}
.ostrom-text { font-size:15px; line-height:1.65; color:var(--text-mid); }

/* P4 GEOTREE */
#p4 .bento {
  grid-template-columns:1fr 2.2fr;
  grid-template-rows:1fr 1fr;
}
#p4 .c-gt-intro    { grid-column:1; grid-row:1; justify-content:center; }
#p4 .c-gt-features { grid-column:1; grid-row:2; }
#p4 .c-gt-map      { grid-column:2; grid-row:1/3; padding:0; background:rgba(232,244,248,0.6); border-radius:18px; overflow:hidden; position:relative; }

#geo-canvas { position:absolute; inset:0; width:100%; height:100%; }

.geo-journal-card {
  position:absolute;
  bottom:20px; right:20px;
  width:230px;
  background:rgba(255,255,255,0.92);
  border:1px solid rgba(208,136,32,0.35);
  border-radius:12px;
  padding:16px 18px;
  backdrop-filter:blur(10px);
  box-shadow:0 4px 20px rgba(0,0,0,0.1);
}
.gj-label {
  font-family:'Space Mono',monospace;
  font-size:10px; letter-spacing:0.16em; text-transform:uppercase;
  color:var(--citrus); margin-bottom:8px;
  display:flex; align-items:center; gap:6px;
}
.gj-label::before { content:'◉'; font-size:9px; }
.gj-title {
  font-family:'Fraunces',serif;
  font-size:15px; font-weight:600; color:var(--text);
  margin-bottom:6px; line-height:1.3;
}
.gj-body { font-size:13px; line-height:1.6; color:var(--text-mid); }
.gj-tag {
  display:inline-block; margin-top:10px;
  font-family:'Space Mono',monospace;
  font-size:9px; letter-spacing:0.1em;
  background:rgba(208,136,32,0.10);
  color:var(--citrus); padding:4px 10px; border-radius:20px;
}

.gt-feat-grid {
  display:grid; grid-template-columns:1fr 1fr;
  gap:8px; margin-top:12px; flex:1;
}
.gt-feat {
  background:rgba(58,138,80,0.06);
  border:1px solid rgba(58,138,80,0.12);
  border-radius:10px; padding:12px 14px;
}
.gt-feat.accent-citrus { border-color:rgba(232,160,48,0.20); }
.gt-feat.accent-leaf   { border-color:rgba(58,138,80,0.20); }
.gt-feat.span-2        { grid-column:1/3; }
.gt-feat-num  { font-family:'Space Mono',monospace; font-size:10px; color:var(--leaf); letter-spacing:0.2em; margin-bottom:4px; }
.gt-feat.accent-citrus .gt-feat-num { color:var(--citrus); }
.gt-feat-name { font-size:15px; font-weight:700; color:var(--text); margin-bottom:3px; }
.gt-feat-desc { font-size:13px; line-height:1.5; color:var(--text-lt); }

.powered {
  font-family:'Space Mono',monospace;
  font-size:10px; letter-spacing:0.12em;
  color:rgba(58,138,80,0.45); margin-top:10px;
}

/* P5 TEAM */
#p5 .bento {
  grid-template-columns:1.1fr repeat(3, 1fr);
  grid-template-rows:1fr 1fr;
}
#p5 .c-tintro { grid-column:1; grid-row:1/3; justify-content:center; }

.t-avatar {
  width:44px; height:44px; border-radius:50%;
  background:rgba(58,138,80,0.12);
  border:1px solid rgba(58,138,80,0.25);
  display:flex; align-items:center; justify-content:center;
  font-family:'Fraunces',serif; font-size:15px; font-weight:700;
  color:var(--leaf); margin-bottom:14px;
}
.t-name  { font-size:clamp(16px, 1.4vw, 20px); }
.t-role  { font-family:'Space Mono',monospace; font-size:10px; letter-spacing:0.12em; text-transform:uppercase; color:var(--leaf); margin-bottom:3px; }
.t-org   { font-size:13px; color:var(--text-lt); margin-bottom:10px; }
.t-bio   { font-size:13px; line-height:1.65; color:var(--text-lt); }

/* P6 PRODUCTS */
#p6 .bento {
  grid-template-columns:1fr 1fr;
  grid-template-rows:1fr;
}
#p6 .c-pintro { justify-content:center; }
#p6 .c-products-stack { display:grid; grid-template-rows:1fr 1fr; gap:10px; }

/* 9 ── Join modal ──────────────────── */
#join-overlay {
  position:fixed; inset:0; z-index:600;
  background:rgba(20,40,28,0.60);
  backdrop-filter:blur(10px);
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none;
  transition:opacity 0.3s ease;
}
#join-overlay.open { opacity:1; pointer-events:all; }

#join-box {
  width:82vw; max-width:960px;
  background:var(--off-white);
  border-radius:24px;
  box-shadow:0 24px 80px rgba(0,0,0,0.20);
  overflow:hidden;
  transform:scale(0.96) translateY(14px);
  transition:transform 0.3s ease;
  display:flex; flex-direction:column;
  max-height:90vh;
}
#join-overlay.open #join-box { transform:scale(1) translateY(0); }

#join-header {
  padding:28px 36px 20px;
  border-bottom:1px solid rgba(58,138,80,0.10);
  display:flex; align-items:flex-start; justify-content:space-between;
  flex-shrink:0;
}
.join-eyebrow {
  font-family:'Space Mono',monospace;
  font-size:10px; letter-spacing:0.22em; text-transform:uppercase;
  color:var(--leaf); margin-bottom:6px;
}
#join-heading {
  font-family:'Fraunces',serif;
  font-size:clamp(20px, 2.5vw, 30px);
  font-weight:600; color:var(--text);
}
#join-close {
  width:36px; height:36px; border-radius:50%;
  background:rgba(58,138,80,0.10);
  border:none; cursor:pointer; font-size:18px; color:var(--text-mid);
  display:flex; align-items:center; justify-content:center;
  transition:background 0.2s; flex-shrink:0;
}
#join-close:hover { background:rgba(58,138,80,0.20); }

#join-body {
  flex:1; overflow-y:auto;
  padding:24px 36px 32px;
}

#join-step1.join-cards {
  display:grid; grid-template-columns:repeat(5, 1fr); gap:12px;
}
.jcard {
  background:rgba(255,255,255,0.70);
  border:1px solid rgba(58,138,80,0.12);
  border-radius:14px;
  padding:20px 16px;
  cursor:pointer;
  transition:all 0.22s ease;
  display:flex; flex-direction:column;
}
.jcard:hover {
  background:rgba(255,255,255,0.95);
  border-color:rgba(58,138,80,0.30);
  transform:translateY(-3px);
  box-shadow:0 6px 20px rgba(58,138,80,0.12);
}
.jcard.selected {
  background:rgba(58,138,80,0.08);
  border-color:rgba(58,138,80,0.50);
  box-shadow:0 4px 16px rgba(58,138,80,0.15);
}
.jcard-emoji { font-size:28px; margin-bottom:12px; }
.jcard-title { font-family:'Fraunces',serif; font-size:16px; font-weight:600; color:var(--text); margin-bottom:6px; }
.jcard-desc  { font-size:13px; line-height:1.6; color:var(--text-lt); }

#join-step2 { display:none; margin-top:24px; border-top:1px solid rgba(58,138,80,0.10); padding-top:24px; }
.join-selected-row {
  display:flex; align-items:center; gap:12px; margin-bottom:20px;
}
#join-selected-emoji { font-size:28px; }
.join-selected-label {
  font-family:'Space Mono',monospace;
  font-size:10px; letter-spacing:0.18em; text-transform:uppercase;
  color:var(--leaf);
}
#join-selected-type {
  font-family:'Fraunces',serif;
  font-size:20px; font-weight:600; color:var(--text);
}
#join-change {
  margin-left:auto;
  font-size:12px; color:var(--text-lt);
  background:none; border:none; cursor:pointer;
  text-decoration:underline; font-family:'Nunito',sans-serif;
}

.join-form-grid {
  display:grid; grid-template-columns:1fr 1fr 1fr;
  gap:14px; margin-bottom:20px;
}
.join-form-grid label { display:block; }
.join-form-grid label > span {
  font-family:'Outfit',sans-serif;
  font-size:11px; font-weight:600; letter-spacing:0.10em; text-transform:uppercase;
  color:var(--text-lt);
  display:block; margin-bottom:6px;
}
.join-form-grid input {
  width:100%; padding:12px 14px;
  border:1px solid rgba(58,138,80,0.20); border-radius:10px;
  font-family:'Nunito',sans-serif; font-size:15px;
  color:var(--text); background:white;
  outline:none; transition:border 0.2s;
}
.join-form-grid input:focus { border-color:rgba(58,138,80,0.50); }

#join-submit {
  font-family:'Outfit',sans-serif;
  font-size:13px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
  background:linear-gradient(135deg, var(--leaf), #2a7040);
  color:white; border:none;
  padding:14px 40px; border-radius:24px; cursor:pointer;
  box-shadow:0 2px 12px rgba(58,138,80,0.25);
}

#join-step3 { display:none; text-align:center; padding:32px 0; }
.join-success-emoji { font-size:48px; margin-bottom:16px; }
#join-success-heading {
  font-family:'Fraunces',serif;
  font-size:28px; font-weight:600; color:var(--text); margin-bottom:10px;
}
#join-success-body {
  font-size:16px; color:var(--text-mid); max-width:420px; margin:0 auto;
}

/* 10 ── Animations ────────────────── */
@keyframes riseIn {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:translateY(0); }
}
.panel.active .cell { animation:riseIn 0.5s ease both; }
.panel.active .cell:nth-child(1) { animation-delay:0.03s; }
.panel.active .cell:nth-child(2) { animation-delay:0.08s; }
.panel.active .cell:nth-child(3) { animation-delay:0.13s; }
.panel.active .cell:nth-child(4) { animation-delay:0.18s; }
.panel.active .cell:nth-child(5) { animation-delay:0.23s; }
.panel.active .cell:nth-child(6) { animation-delay:0.28s; }
.panel.active .cell:nth-child(7) { animation-delay:0.33s; }

/* 11 ── Responsive ──────────────────────────
   (a) Square-ish viewport (tablets, portrait laptops, phones in portrait):
       collapse multi-column grids to stacks but keep paged-panel mode.
   (b) Real mobile widths: switch out of paged mode entirely — each panel
       becomes a vertically scrolled section so content is readable.
   ──────────────────────────────────────────── */

/* (a) max-aspect-ratio 4/3 — original tablet/portrait adaptation */
@media (max-aspect-ratio: 4/3) {
  .panel-tabs { display:none; }
  .logo-sub   { display:none; }

  #p1 .bento { grid-template-columns:1fr; grid-template-rows:auto 1fr auto; }
  #p1 .c-head { grid-row:1; }
  #p1 .c-de   { grid-row:2; min-height:220px; }
  #p1 .c-body { grid-row:3; }

  #p2 .bento  { grid-template-columns:1fr 1fr; grid-template-rows:auto repeat(3,1fr); }
  #p2 .prog-intro { grid-column:1/3; }

  #p3 .bento  { grid-template-columns:1fr; grid-template-rows:auto auto; overflow-y:auto; }
  .fw-right-col { grid-template-rows:auto auto auto; }

  #p4 .bento  { grid-template-columns:1fr; grid-template-rows:auto 1fr auto; }
  #p4 .c-gt-intro    { grid-column:1; grid-row:1; }
  #p4 .c-gt-map      { grid-column:1; grid-row:2; min-height:240px; }
  #p4 .c-gt-features { grid-column:1; grid-row:3; }

  #p5 .bento  { grid-template-columns:1fr 1fr; grid-template-rows:auto repeat(3,1fr); }
  #p5 .c-tintro { grid-column:1/3; grid-row:1; }

  #p6 .bento  { grid-template-columns:1fr 1fr; }
}

/* (b) 1024px and below — tighter padding, smaller topbar */
@media (max-width: 1024px) {
  :root { --topbar-h: 76px; }
  .topbar { padding:0 24px; }
  .logo-main { font-size:26px; }
  #site-footer { padding:0 24px; }
  .bento { left:14px; right:14px; gap:8px; }
  .cell  { padding:20px 22px; }
}

/* (b) 768px and below — switch out of paged mode to scrolled sections */
@media (max-width: 768px) {
  html, body { position:static; overflow-x:hidden; overflow-y:auto; height:auto; width:100%; }

  .panel-tabs { display:none; }
  .logo-sub   { display:none; }

  #panels { width:100%; height:auto; position:static; }
  .panel {
    position:relative; inset:auto;
    opacity:1; pointer-events:all;
    min-height:auto;
    padding:0;
  }
  .panel.active .cell { animation:none; }

  .bento {
    position:relative; inset:auto;
    top:auto; bottom:auto; left:auto; right:auto;
    padding:24px 16px;
    overflow:visible;
    min-height:auto;
  }

  /* First panel offset from fixed topbar */
  #panels > .panel:first-child .bento { padding-top:calc(var(--topbar-h) + 24px); }
  /* Last panel offset from fixed footer */
  #panels > .panel:last-child  .bento { padding-bottom:calc(var(--footer-h) + 32px); }

  /* All panels: single-column stack */
  #p1 .bento, #p2 .bento, #p3 .bento, #p4 .bento, #p5 .bento, #p6 .bento {
    grid-template-columns:1fr;
    grid-template-rows:auto;
  }
  #p1 .c-head, #p1 .c-body, #p1 .c-de,
  #p4 .c-gt-intro, #p4 .c-gt-map, #p4 .c-gt-features,
  #p5 .c-tintro, #p2 .prog-intro, #p6 .c-pintro {
    grid-column:auto; grid-row:auto;
  }

  /* P1 hero: DE canvas stays a fixed-height block */
  #p1 .c-de { min-height:280px; }

  /* P3 framework: two stacked groups */
  #p3 .bento { grid-template-rows:auto auto; }
  .fw-right-col { grid-template-rows:auto; gap:8px; }

  /* P4 geotree: keep map a usable height */
  #p4 .c-gt-map { min-height:320px; }
  .geo-journal-card { width:auto; left:14px; right:14px; bottom:14px; }

  /* P6 products stack */
  #p6 .c-products-stack { grid-template-rows:auto auto; }

  /* Join modal: cards wrap, form stacks */
  #join-step1.join-cards { grid-template-columns:repeat(2, 1fr); }
  .join-form-grid { grid-template-columns:1fr; }
  #join-box { width:94vw; max-height:92vh; }

  /* Modal box on phone */
  #modal-box { width:94vw; height:88vh; }
  #modal-header { padding:18px 22px 14px; }
  #modal-body   { padding:20px 22px; font-size:15px; }

  /* Footer: stack columns */
  #site-footer.expanded { height:auto; min-height:240px; padding-bottom:18px; }
  .footer-expanded-content { grid-template-columns:1fr; gap:18px; }

  /* Quote cell stays readable */
  .cell-solid { padding:22px 24px; }
}

/* (c) 480px and below — phone tweaks */
@media (max-width: 480px) {
  :root { --topbar-h: 64px; }
  .topbar { padding:0 16px; }
  .logo-main { font-size:22px; }
  #site-footer { padding:0 16px; font-size:10px; }

  .bento { padding:18px 12px; }
  .cell  { padding:18px 18px; border-radius:14px; }

  h1 { font-size:clamp(32px, 9vw, 44px); line-height:1.05; }
  h2 { font-size:clamp(22px, 6vw, 28px); }

  #join-step1.join-cards { grid-template-columns:1fr; }
  .vc-grid { grid-template-columns:repeat(2, 1fr); }
  .gt-feat-grid { grid-template-columns:1fr; }
  .gt-feat.span-2 { grid-column:auto; }

  #p2 .bento, #p5 .bento { grid-template-columns:1fr; }
}
