:root {
  /* Editorial shell — matches the portfolio (app/globals.css) */
  --shell-bg: #e8e6df;
  --shell-ink: #111;
  --shell-soft: #8a857a;
  --shell-rule: #111;
  --shell-red: #c1272d;
  --shell-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --shell-serif: 'Instrument Serif', 'EB Garamond', Georgia, serif;

  /* Dark in-card world — the demos were designed on these, keep them */
  --bg: #0a0a0f;
  --card-bg: #13131a;
  --card-border: #1e1e2e;
  --accent: #88CE02;
  --accent-dim: #5a8a01;
  --text: #e0e0e0;
  --text-dim: #888;
  --purple: #744BA3;
  --pink: #960027;
  --brown: #93653B;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--shell-mono);
  background: var(--shell-bg);
  color: var(--shell-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(232,230,223,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--shell-rule);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-home {
  font-family: var(--shell-serif);
  font-size: 18px;
  color: var(--shell-ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav-crumb {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--shell-ink);
  text-decoration: none;
  white-space: nowrap;
}
a.nav-crumb:hover { color: var(--shell-red); }
.nav-crumb.is-here { color: var(--shell-soft); }
.nav-crumb-sep { color: var(--shell-soft); font-size: 11px; }
/* Gallery switcher — segmented control so it's obvious there are two
   galleries to flip between. Active cell is filled ink; the other is a
   bordered link. */
.nav-switch {
  display: inline-flex;
  border: 1px solid var(--shell-rule);
  flex-shrink: 0;
}
.nav-switch-cell {
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--shell-ink);
  transition: color 0.15s, background-color 0.15s;
}
.nav-switch-cell.is-here {
  background: var(--shell-ink);
  color: var(--shell-bg);
  cursor: default;
}
a.nav-switch-cell:hover {
  background: var(--shell-red);
  color: var(--shell-bg);
}
.nav-site {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
.nav-site a {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--shell-soft);
  text-decoration: none;
  white-space: nowrap;
}
.nav-site a:hover { color: var(--shell-red); }

.nav-links {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  align-items: center;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-cat {
  color: var(--shell-ink);
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 6px 4px 12px;
  white-space: nowrap;
  opacity: 0.7;
  cursor: pointer;
  text-decoration: none;
}

.nav-cat:hover {
  opacity: 1;
}

.nav-sep {
  width: 1px;
  height: 16px;
  background: rgba(17,17,17,0.25);
  margin: 0 4px;
  flex-shrink: 0;
}

.nav-links a {
  color: var(--shell-soft);
  text-decoration: none;
  font-size: 11px;
  padding: 3px 8px;
  white-space: nowrap;
  transition: color 0.15s;
  border: 1px solid transparent;
}

.nav-links a:hover {
  color: var(--shell-red);
}

/* GALLERY HEAD + CONTENTS (editorial) */
.gallery-head {
  margin: 24px 0 12px;
}
.gallery-filter {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}
.filter-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shell-soft);
}

/* Custom dropdown — native <select> menus can't be themed, so the menu is
   a popover panel styled like the site's index tables. */
.filter-dd { position: relative; }
.filter-btn {
  font-family: var(--shell-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--shell-ink);
  background: transparent;
  border: 1px solid var(--shell-rule);
  border-radius: 0;
  padding: 9px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 24px;
  min-width: 300px;
  justify-content: space-between;
  transition: color 0.15s, border-color 0.15s;
}
.filter-btn:hover { color: var(--shell-red); border-color: var(--shell-red); }
.filter-caret {
  font-size: 9px;
  transition: transform 0.2s;
}
.filter-dd.open .filter-caret { transform: rotate(180deg); }

.filter-menu {
  list-style: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 500;
  min-width: 380px;
  background: var(--shell-bg);
  border: 1px solid var(--shell-rule);
  box-shadow: 6px 6px 0 rgba(17,17,17,0.18);
  padding: 4px 0;
  margin: 0;
  display: none;
}
.filter-dd.open .filter-menu { display: block; }
.filter-menu li {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: baseline;
  gap: 10px;
  padding: 9px 16px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--shell-ink);
  cursor: pointer;
  border-bottom: 1px solid rgba(17,17,17,0.12);
  transition: color 0.12s, background-color 0.12s;
}
.filter-menu li:last-child { border-bottom: 0; }
.filter-menu li .f-num { font-size: 10px; color: var(--shell-soft); }
.filter-menu li .f-count { font-size: 10px; color: var(--shell-soft); text-align: right; }
.filter-menu li:hover { color: var(--shell-red); background: rgba(17,17,17,0.04); }
.filter-menu li.is-active { color: var(--shell-red); }
.filter-menu li.is-active .f-num::before { content: "\25CF "; font-size: 7px; vertical-align: middle; }
.gallery-head-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.gallery-head .kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shell-soft);
}
.gallery-head h1 {
  font-family: var(--shell-serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--shell-ink);
  margin: 18px 0 16px;
}
.gallery-head .lead {
  font-size: 13px;
  line-height: 1.7;
  color: var(--shell-soft);
  max-width: 60ch;
}

.contents {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  margin-bottom: 24px;
  padding-bottom: 16px;
}
.contents-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--shell-soft);
  padding-top: 12px;
}
.contents-body {
  border-top: 1px solid var(--shell-rule);
}
.contents-row {
  display: grid;
  grid-template-columns: 44px 1fr 60px;
  align-items: baseline;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--shell-rule);
  text-decoration: none;
  color: var(--shell-ink);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.contents-row:hover { color: var(--shell-red); }
.contents-row .c-num {
  font-size: 11px;
  color: var(--shell-soft);
}
.contents-row .c-count {
  text-align: right;
  font-size: 11px;
  color: var(--shell-soft);
}
.contents-row.is-standalone .c-name::after {
  content: "  — standalone page";
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--shell-soft);
  text-transform: none;
}
@media (max-width: 720px) {
  .contents { grid-template-columns: 1fr; gap: 10px; }
}

/* TOC (legacy, unused after the editorial contents rewrite) */
.toc {
  margin-bottom: 48px;
}

.toc-title {
  font-family: var(--shell-serif);
  font-size: 44px;
  font-weight: 400;
  color: var(--shell-ink);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.toc-subtitle {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--shell-soft);
  margin-bottom: 32px;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.toc-group {
  background: transparent;
  border: 1px solid var(--shell-rule);
  border-radius: 0;
  padding: 16px 20px;
}

.toc-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--shell-ink);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(17,17,17,0.35);
}

.toc-group-count {
  font-size: 10px;
  color: var(--shell-soft);
  font-weight: normal;
  letter-spacing: 0;
  text-transform: none;
  float: right;
}

.toc-list {
  list-style: none;
}

.toc-list li {
  margin-bottom: 4px;
}

.toc-list a {
  color: var(--shell-soft);
  text-decoration: none;
  font-size: 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  border-radius: 3px;
  transition: color 0.15s;
}

.toc-list a:hover {
  color: var(--shell-red);
}

.toc-list .toc-num {
  color: var(--shell-red);
  font-size: 10px;
  opacity: 0.7;
  min-width: 18px;
}

/* MAIN — two-column card grid, same rhythm as the transitions gallery
   (max-width 1200 / 2 cols / 34px gap). Head + section titles span both
   columns; each demo card sits in one cell. */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 34px;
  align-items: start;
}
main > .gallery-head,
main > .category-title { grid-column: 1 / -1; }
@media (max-width: 820px) { main { grid-template-columns: 1fr; } }

.category-title {
  font-size: 13px;
  color: var(--shell-ink);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 30px 0 -10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--shell-rule);
}

/* DEMO CARD */
/* Card chrome is light editorial (matches the site); only .demo-area —
   the stage the animation actually runs on — stays a dark "screen",
   because the demos' internal colors (GSAP green, white text, gradients)
   were designed against dark. */
.demo-card {
  background: transparent;
  border: 1px solid var(--shell-rule);
  border-radius: 0;
  margin-bottom: 0;
  overflow: hidden;
  color: var(--shell-ink);
  font-family: var(--shell-mono);
}

.demo-header {
  padding: 14px 18px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.demo-header h2 {
  font-size: 13.5px;
  color: var(--shell-ink);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.demo-header .num {
  color: var(--shell-red);
  font-size: 11px;
  margin-right: 8px;
}

.demo-desc {
  padding: 0 18px 12px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--shell-soft);
  max-width: 700px;
}

.demo-area {
  position: relative;
  margin: 0 14px 14px;
  border-radius: 0;
  overflow: hidden;
  background: #0d0d14;
  border: 1px solid var(--shell-rule);
}

.demo-controls {
  padding: 8px 18px 14px;
  display: flex;
  gap: 8px;
}

.btn {
  background: transparent;
  color: var(--shell-ink);
  border: 1px solid var(--shell-rule);
  padding: 5px 12px;
  border-radius: 0;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.04em;
  font-family: inherit;
  transition: all 0.2s;
}

.btn:hover {
  color: var(--shell-red);
  border-color: var(--shell-red);
}

.copy-btn {
  background: var(--shell-ink);
  color: var(--shell-bg);
  border: 1px solid var(--shell-ink);
  padding: 4px 12px;
  border-radius: 0;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.04em;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--shell-red);
  border-color: var(--shell-red);
}

.copy-btn.copied {
  background: transparent;
  border-color: var(--shell-red);
  color: var(--shell-red);
}

/* ===== DEMO 2: Parallax Speed ===== */
.demo2-scroll {
  height: 270px;
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo2-content {
  height: 1200px;
  padding: 60px 40px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.speed-bar {
  width: 60px;
  height: 140px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: #000;
  flex-shrink: 0;
}

/* ===== DEMO 3: Auto Parallax Images ===== */
.demo3-scroll {
  height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo3-content {
  height: 1400px;
  padding: 200px 40px;
  display: flex;
  gap: 24px;
  justify-content: center;
}

.image-cont {
  position: relative;
  overflow: hidden;
  width: 200px;
  height: 200px;
  border-radius: 8px;
  flex-shrink: 0;
}

.image-cont .parallax-img {
  position: absolute;
  top: 0;
  width: 100%;
  height: 160%;
  object-fit: cover;
  border-radius: 8px;
}

/* ===== DEMO 4: Layered Text ===== */
.demo4-scroll {
  height: 270px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo4-content {
  height: 1200px;
  padding: 200px 40px;
}

.text-container {
  position: relative;
  height: 80px;
}

.text-container p {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -1px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(136,206,2,0.15);
}

.text-container p:first-child {
  color: var(--accent);
  -webkit-text-stroke: none;
}

/* ===== DEMO 5: SplitText + Lag ===== */
.demo5-scroll {
  height: 270px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo5-content {
  height: 1200px;
  padding: 200px 40px;
}

#split-stagger {
  font-size: 56px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 4px;
}

#split-stagger .char {
  display: inline-block;
}

/* ===== DEMO 6: Parallax Slab ===== */
.demo6-scroll {
  height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo6-content {
  height: 1400px;
  padding: 100px 0;
}

.parallax-slab {
  position: relative;
  height: 280px;
  width: 100%;
  overflow: hidden;
}

.parallax-slab .slab-img {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 180%;
  object-fit: cover;
}

/* ===== DEMO 8: MorphSVG ===== */
.morph-demo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 200px;
}

.morph-demo-area svg {
  width: 300px;
  height: 150px;
}

/* ===== DEMO 11: Concentric Circles ===== */
.circles-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 250px;
}

.circle-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px solid;
}

/* ===== DEMO 12: Text Reveal ===== */
.text-reveal-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 120px;
}

.reveal-letter {
  display: inline-block;
  font-size: 36px;
  font-weight: 900;
  color: var(--accent);
  margin: 0 1px;
}

/* ===== DEMO 13: Scrubber ===== */
.scrubber-area {
  padding: 40px;
  min-height: 180px;
}

.scrub-track {
  position: relative;
  height: 4px;
  background: #333;
  border-radius: 2px;
  margin: 24px 0;
}

.scrub-handle {
  position: absolute;
  top: 50%;
  left: 0;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  border: 3px solid #000;
}

.scrub-target {
  width: 60px;
  height: 60px;
  background: var(--accent);
  border-radius: 8px;
  margin: 16px auto;
}

/* ===== DEMO 14: Visibility Toggle ===== */
.toggle-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px;
  min-height: 160px;
}

.toggle-box {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: #000;
}

/* ===== DEMO 15-18: Scroll Snap ===== */
.snap-container {
  height: 270px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.snap-panel {
  scroll-snap-align: start;
  height: 270px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: background 0.5s;
}

.snap-panel h3 {
  font-size: 24px;
}

.snap-panel p {
  font-size: 13px;
  color: var(--text-dim);
}

.flair {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--accent);
}

.yoyo-text {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
}

/* ===== DEMO 19: Clamped Parallax ===== */
.demo19-scroll {
  height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo19-content {
  height: 1400px;
  padding: 100px 40px;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.clamp-img {
  width: 120px;
  height: 150px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ===== DEMO 20: DrawSVG ===== */
.draw-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 220px;
}

.draw-area svg {
  width: 100%;
  max-width: 500px;
  height: 160px;
}

.draw-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
}

/* ===== DEMO 21: Scrub ===== */
.demo21-scroll {
  height: 270px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo21-content {
  height: 1200px;
  padding: 150px 40px;
}

.scrub-element {
  width: 60px;
  height: 60px;
  background: var(--accent);
  border-radius: 12px;
}

/* ===== DEMO 23: Pin ===== */
.demo23-scroll {
  height: 270px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo23-content {
  min-height: 1400px;
  position: relative;
}

.pin-heading {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  padding: 40px;
  background: rgba(136,206,2,0.05);
  border-bottom: 1px solid var(--card-border);
}

.pin-images {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pin-img-placeholder {
  height: 200px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-dim);
}

/* ===== DEMO 24: Mix Blend ===== */
.demo24-scroll {
  height: 270px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo24-content {
  min-height: 1200px;
  position: relative;
}

.blend-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  mix-blend-mode: difference;
  font-size: 48px;
  font-weight: 900;
  color: white;
  text-align: center;
  padding: 40px;
  pointer-events: none;
}

.blend-images {
  position: relative;
  z-index: 1;
  padding: 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blend-block {
  height: 180px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(0,0,0,0.3);
}

/* ===== DEMO 10: Character ===== */
.character-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 280px;
  gap: 12px;
  flex-wrap: wrap;
}

.body-part {
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #000;
  font-weight: bold;
}

/* ===== DEMO 9: Cape ===== */
.cape-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 200px;
}

.cape-shape {
  position: relative;
}

/* ===== DEMO 25-28: toggleActions ===== */
.ta-scroll {
  height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.ta-panel {
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 40px;
  gap: 16px;
}

.ta-panel p {
  font-size: 12px;
  color: var(--text-dim);
  max-width: 600px;
  text-align: center;
  line-height: 1.6;
}

.ta-panel p strong {
  color: #fff;
}

.ta-panel p code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--accent);
}

.ta-line {
  width: 100%;
  max-width: 500px;
  height: 8px;
  position: relative;
  display: block;
  background-color: #2a2a35;
  border-radius: 4px;
  overflow: hidden;
}

.ta-line-inner {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  transform-origin: left center;
}

.ta-label {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ta-state {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  min-width: 80px;
  text-align: center;
}

/* ===== DEMO 29-31: Scrub Animations ===== */
.scrub-scroll {
  height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.scrub-panel {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 40px;
  gap: 16px;
  position: relative;
}

.scrub-panel p {
  font-size: 12px;
  color: var(--text-dim);
  max-width: 600px;
  text-align: center;
  line-height: 1.6;
}

.scrub-panel p strong {
  color: #fff;
}

.scrub-panel p code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--accent);
}

.scrub-line {
  width: 100%;
  max-width: 500px;
  height: 8px;
  position: relative;
  display: block;
  background-color: #2a2a35;
  border-radius: 4px;
  overflow: hidden;
}

.scrub-line-inner {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  transform-origin: left center;
}

.scrub-label {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.scrub-progress-label {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  min-width: 80px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ===== DEMO 32: Image Grid ===== */
.grid-scroll {
  height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.grid-content {
  padding-bottom: 100px;
}

.image-grid-demo {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-column-gap: 8px;
  grid-row-gap: 60px;
  width: 100%;
  padding: 0 8px;
}

.grid-img-cont {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.grid-img-cont .grid-img {
  position: absolute;
  width: 100%;
  height: 160%;
  bottom: 0;
  border-radius: 6px;
  object-fit: cover;
}

.grid-img-cont:nth-child(1) { grid-column: 1 / -1;       height: 220px; }
.grid-img-cont:nth-child(2) { grid-column: 1 / span 5;   height: 160px; }
.grid-img-cont:nth-child(3) { grid-column: 7 / span 6;   height: 160px; }
.grid-img-cont:nth-child(4) { grid-column: 1 / -1;       height: 180px; }
.grid-img-cont:nth-child(5) { grid-column: 7 / span 6;   height: 200px; }
.grid-img-cont:nth-child(6) { grid-column: 1 / span 5;   height: 200px; }

/* Placeholder images with gradients */
.gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.gradient-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.gradient-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.gradient-6 { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }

/* Scroll hint */
.scroll-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding: 8px;
  opacity: 0.6;
}

.scroll-hint::before {
  content: "↕ ";
}

/* ===== DEMO 33: DrawSVG on Scroll ===== */
.demo33-scroll {
  height: 270px;
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo33-content {
  height: 1200px;
  padding: 0 20px;
}

.demo33-heading-wrap {
  position: sticky;
  top: 60px;
  text-align: center;
  z-index: 2;
  padding: 30px 0;
  pointer-events: none;
}

.demo33-heading {
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  display: inline-block;
  position: relative;
}

.demo33-heading .annotated-word {
  position: relative;
  display: inline-block;
}

.demo33-heading .annotated-svg {
  position: absolute;
  width: 115%;
  top: 50%;
  transform: translateY(-50%) rotate(2deg);
  left: -7%;
  pointer-events: none;
}

.demo33-heading .draw-stroke {
  fill: none;
  stroke: #8486aa;
  stroke-width: 8;
  stroke-miterlimit: 10;
}

.demo33-progress-label {
  text-align: center;
  font-size: 11px;
  color: #8486aa;
  margin-top: 8px;
}

/* ===== DEMO 34: Images Through Text ===== */
.demo34-scroll {
  height: 500px;
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo34-content {
  min-height: 2200px;
  position: relative;
}

.demo34-blend-heading {
  position: sticky;
  top: 40px;
  z-index: 1;
  mix-blend-mode: difference;
  text-align: center;
  font-size: 64px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 8px;
  text-transform: uppercase;
  padding: 50px 0;
  pointer-events: none;
}

.demo34-images {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 0 8px;
}

.demo34-images img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  position: relative;
}

.demo34-spacer {
  height: 500px;
}

/* ===== DEMO 35: ScrambleText ===== */
.scramble-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 280px;
  background: #0e100f;
}

.scramble-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 600px;
}

.scramble-line {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 18px;
  font-weight: 600;
  color: #dfdcff;
  line-height: 1.4;
  min-height: 26px;
  word-break: break-word;
}

.scramble-custom {
  color: #a18cd1;
}

.scramble-numbers {
  color: #4facfe;
}

.scramble-styled .scramble-highlight {
  color: #88CE02;
  background: none;
}

/* ===== DEMO 36: SplitText Lines ===== */
.splitlines-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 200px;
  background: #0e100f;
}

.splitlines-container {
  width: 100%;
  max-width: 500px;
  overflow: hidden;
}

.splitlines-text {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
  margin: 0;
}

.splitlines-text .line-wrapper {
  display: block;
  overflow: hidden;
}

.splitlines-text .line {
  display: block;
}

/* ===== DEMO 37: Section Transitions ===== */
.sections-area {
  position: relative;
  height: 270px;
  background: #0a0a0a;
  overflow: hidden;
}

.sections-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.section-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
}

.section-outer,
.section-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.section-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.section-heading {
  font-size: clamp(24px, 5vw, 42px);
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin: 0;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.section-heading .char {
  display: inline-block;
}

.sections-nav {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.sections-arrow {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sections-arrow:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

.sections-indicator {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  padding: 4px 8px;
}

/* ===== DEMO 38: Variable Height Stacked Pinning ===== */
.demo38-scroll {
  height: 300px;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 8px;
  position: relative;
}

.demo38-content {
  position: relative;
}

.stack-panel {
  width: 100%;
  min-height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.stack-panel-1 {
  background: linear-gradient(135deg, #88d977 0%, #5cb85c 100%);
}

.stack-panel-2 {
  background: linear-gradient(135deg, #77aadd 0%, #4a90d9 100%);
}

.stack-panel-3 {
  background: linear-gradient(135deg, #dd8877 0%, #d9654a 100%);
}

.stack-panel-4 {
  background: linear-gradient(135deg, #aa77dd 0%, #8e44ad 100%);
}

.stack-num {
  font-size: 5rem;
  font-weight: 700;
  color: rgba(0,0,0,0.25);
  margin: 0;
  user-select: none;
}

/* ===== DEMO 39: Layered Pinning from Bottom ===== */
.demo39-scroll {
  height: 300px;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 8px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.demo39-container {
  width: 100%;
  height: 1600px;  /* 400% of viewport for scrub range (like end: "+=300%") */
  position: relative;
}

/* Wrapper to hold all panels in sticky position */
.demo39-panels-wrapper {
  position: sticky;
  top: 0;
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.demo39-panel {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo39-panel h2 {
  font-size: 8rem;
  font-weight: 700;
  color: rgba(0,0,0,0.2);
  margin: 0;
  user-select: none;
}

.demo39-green {
  background: linear-gradient(135deg, #88d977 0%, #5cb85c 100%);
}

.demo39-solid {
  background: linear-gradient(135deg, #77aadd 0%, #4a90d9 100%);
}

.demo39-purple {
  background: linear-gradient(135deg, #aa77dd 0%, #8e44ad 100%);
}

/* ===== DEMO 40: 3D Perspective Scroll Engine ===== */
.demo40-scroll {
  height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
  background: #030308;
  border-radius: 8px;
}
.demo40-viewport {
  position: sticky;
  top: 0;
  width: 100%;
  height: 360px;
  overflow: hidden;
  perspective: 1000px;
}
.demo40-world {
  position: absolute;
  top: 50%; left: 50%;
  transform-style: preserve-3d;
  will-change: transform;
}
.demo40-spacer {
  height: 6000px;
}
.demo40-item {
  position: absolute;
  left: 0; top: 0;
  backface-visibility: hidden;
  transform-origin: center center;
}
.demo40-card {
  width: 220px;
  height: 130px;
  background: rgba(15,15,20,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: translate(-50%, -50%);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.demo40-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.demo40-card .d40-meta {
  font-size: 9px;
  color: #555;
  font-family: inherit;
}
.demo40-card .d40-tag {
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.demo40-bigtext {
  font-size: 8vw;
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.08);
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  pointer-events: none;
  letter-spacing: -0.2rem;
}
.demo40-star {
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  position: absolute;
}
.demo40-hud {
  position: absolute;
  bottom: 8px; left: 12px; right: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #444;
  font-family: 'SF Mono', 'Fira Code', monospace;
  pointer-events: none;
  z-index: 10;
}
.demo40-hud strong {
  color: #00f3ff;
}

/* ===== DEMO 41: Neon Flicker Text Morph ===== */
.demo41-stage {
  width: 100%;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #0a0a0a;
  border-radius: 8px;
  overflow: hidden;
}
.demo41-short {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Georgia', 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 500;
  color: #f5f0e6;
  white-space: nowrap;
  letter-spacing: -0.3px;
}
.demo41-full {
  opacity: 0;
  text-align: center;
  font-family: 'Georgia', 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 500;
  color: #f5f0e6;
  line-height: 1.2;
  letter-spacing: -0.3px;
}
.demo41-line {
  display: block;
}
.demo41-word {
  display: inline-block;
  position: relative;
}
.demo41-letter {
  display: inline-block;
  opacity: 0;
  transition: opacity 0.06s ease;
}
.demo41-letter.space {
  width: 0.3em;
}

/* ===== DEMO 42: Animated Beam ===== */
.demo42-area {
  position: relative;
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #08080e;
  border-radius: 8px;
}
.demo42-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}
.demo42-nodes {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  z-index: 2;
  position: relative;
}
.demo42-col {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}
.demo42-node {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #111118;
  border: 2px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px -8px rgba(0,0,0,0.8);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.demo42-node:hover {
  border-color: rgba(136,206,2,0.3);
  box-shadow: 0 0 24px -4px rgba(136,206,2,0.2);
}
.demo42-node-lg {
  width: 56px; height: 56px;
}
.demo42-node svg {
  width: 22px; height: 22px;
}
.demo42-node-lg svg {
  width: 26px; height: 26px;
}
