/* Night Cut — Meng To / Design+Code
   Skills: vantajs, atmosphere-background, glass-dark-ui, dark-glass-clean-layout,
   progressive-blur, editorial-portfolio-chapters, cinematic-scroll-storytelling
   (CSS + optional GSAP, no Lenis), staggered-word-reveal, number-details,
   beautiful-shadows. */

:root {
  --bg-0: #07040c;
  --bg-1: #120814;
  --ink: #f6f0e8;
  --copy: #c9b8a8;
  --muted: #8a7a72;
  --line: rgba(243, 217, 168, 0.16);
  --line-strong: rgba(246, 240, 232, 0.28);
  --accent: #f3d9a8;
  --accent-2: #b8a4ff;
  --teal: #7edcc4;
  --glass: rgba(18, 8, 22, 0.52);
  --glass-strong: rgba(12, 6, 16, 0.78);
  --safe: #7edcc4;
  --caution: #f4c4b0;
  --display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Sora", "SF Pro Display", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-md:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 1px 1px -0.5px rgba(0, 0, 0, 0.08),
    0 3px 3px -1.5px rgba(0, 0, 0, 0.08),
    0 6px 6px -3px rgba(0, 0, 0, 0.08),
    0 12px 12px -6px rgba(0, 0, 0, 0.08),
    0 24px 24px -12px rgba(0, 0, 0, 0.16);
  --shadow-lg:
    0 2.8px 2.2px rgba(0, 0, 0, 0.04),
    0 6.7px 5.3px rgba(0, 0, 0, 0.055),
    0 12.5px 10px rgba(0, 0, 0, 0.07),
    0 22.3px 17.9px rgba(0, 0, 0, 0.085),
    0 41.8px 33.4px rgba(0, 0, 0, 0.1),
    0 100px 80px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.skin-mengto {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(42rem 28rem at 18% 8%, rgba(184, 164, 255, 0.16), transparent 62%),
    radial-gradient(36rem 30rem at 86% 12%, rgba(243, 217, 168, 0.1), transparent 58%),
    linear-gradient(180deg, #140818, var(--bg-0) 48%, #040208);
}
body.skin-mengto::selection {
  color: #120814;
  background: var(--accent);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #120814;
  font: 600 13px/1 var(--sans);
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

#vantaField,
#foldField {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#vantaField {
  background:
    radial-gradient(40rem 26rem at 16% 10%, rgba(184, 164, 255, 0.18), transparent 64%),
    radial-gradient(34rem 28rem at 84% 6%, rgba(243, 217, 168, 0.12), transparent 60%),
    radial-gradient(46rem 34rem at 72% 92%, rgba(126, 220, 196, 0.08), transparent 62%),
    #07040c;
}
#foldField { display: none; }
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 42%, rgba(4, 2, 8, 0.55) 100%);
}
.page { position: relative; z-index: 2; }

.gradient-blur {
  position: fixed;
  z-index: 70;
  inset: 0 0 auto 0;
  height: 11%;
  pointer-events: none;
}
.gradient-blur > div,
.gradient-blur::before,
.gradient-blur::after {
  position: absolute;
  inset: 0;
}
.gradient-blur::before {
  content: "";
  z-index: 1;
  backdrop-filter: blur(0.5px);
  -webkit-backdrop-filter: blur(0.5px);
  mask: linear-gradient(to top, transparent 0%, #000 12.5%, #000 25%, transparent 37.5%);
}
.gradient-blur > div:nth-of-type(1) { z-index: 2; backdrop-filter: blur(1px); -webkit-backdrop-filter: blur(1px); mask: linear-gradient(to top, transparent 12.5%, #000 25%, #000 37.5%, transparent 50%); }
.gradient-blur > div:nth-of-type(2) { z-index: 3; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); mask: linear-gradient(to top, transparent 25%, #000 37.5%, #000 50%, transparent 62.5%); }
.gradient-blur > div:nth-of-type(3) { z-index: 4; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); mask: linear-gradient(to top, transparent 37.5%, #000 50%, #000 62.5%, transparent 75%); }
.gradient-blur > div:nth-of-type(4) { z-index: 5; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); mask: linear-gradient(to top, transparent 50%, #000 62.5%, #000 75%, transparent 87.5%); }
.gradient-blur > div:nth-of-type(5) { z-index: 6; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); mask: linear-gradient(to top, transparent 62.5%, #000 75%, #000 87.5%, transparent 100%); }
.gradient-blur > div:nth-of-type(6) { z-index: 7; backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px); mask: linear-gradient(to top, transparent 75%, #000 87.5%, #000 100%); }
.gradient-blur::after {
  content: "";
  z-index: 8;
  backdrop-filter: blur(48px);
  -webkit-backdrop-filter: blur(48px);
  mask: linear-gradient(to top, transparent 87.5%, #000 100%);
}

.stage {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 96px;
  position: relative;
}
.rail {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
  pointer-events: none;
}
.rail-l { left: 0; }
.rail-r { right: 0; }
.gate {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  border: 1px solid var(--line-strong);
}
.gate-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.gate-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.gate-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.gate-br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.skin-bar {
  position: sticky;
  top: 14px;
  z-index: 80;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  width: fit-content;
  max-width: calc(100% - 28px);
  margin: 14px auto 0;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(rgba(10, 5, 14, 0.78), rgba(10, 5, 14, 0.78)) padding-box,
    linear-gradient(120deg, rgba(243, 217, 168, 0.42), rgba(184, 164, 255, 0.28), rgba(255, 255, 255, 0.06)) border-box;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.skin-bar a {
  color: var(--copy);
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 11px;
  transition: color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}
.skin-bar a:hover {
  color: var(--ink);
  background: rgba(243, 217, 168, 0.08);
}
.skin-bar a:active { transform: scale(0.97); }
.skin-bar a[aria-current="page"] {
  color: #120814;
  background: var(--accent);
}
.skin-bar a:focus-visible,
button:focus-visible,
textarea:focus-visible,
a.cta:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 3px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.72fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
  padding: clamp(64px, 10vw, 128px) clamp(20px, 4vw, 48px) 28px;
  min-height: min(88vh, 900px);
}
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.iris {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background:
    radial-gradient(circle at 50% 50%, #120814 28%, transparent 30%),
    conic-gradient(from 20deg, var(--accent), transparent 28%, var(--accent-2), transparent 62%, var(--accent));
  box-shadow: 0 0 18px rgba(243, 217, 168, 0.35);
}
.hero-title {
  margin: 0 0 22px;
  max-width: 9ch;
  font-family: var(--display);
  font-size: clamp(56px, 9vw, 118px);
  font-weight: 400;
  font-style: italic;
  line-height: 0.86;
  letter-spacing: -0.04em;
}
.hero-lead {
  max-width: 42ch;
  margin: 0 0 28px;
  color: var(--copy);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cta,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #120814;
  background: var(--accent);
  box-shadow: 0 16px 36px rgba(243, 217, 168, 0.16);
  font: 600 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), filter 180ms var(--ease);
}
.cta:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(243, 217, 168, 0.22);
  filter: brightness(1.04);
}
.cta:active,
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.cta-ghost,
.btn-ghost,
.btn-ctrl,
.filter-btn,
.btn-audio,
.drawer-head button,
.drawer-footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  background:
    linear-gradient(rgba(10, 5, 14, 0.55), rgba(10, 5, 14, 0.55)) padding-box,
    linear-gradient(135deg, rgba(243, 217, 168, 0.38), rgba(184, 164, 255, 0.2), rgba(255, 255, 255, 0.04)) border-box;
  font: 500 13px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease);
}
.cta-ghost:hover,
.btn-ghost:hover,
.filter-btn:hover,
.btn-audio:hover,
.btn-ctrl:hover,
.drawer-head button:hover,
.drawer-footer button:hover {
  background:
    linear-gradient(rgba(243, 217, 168, 0.1), rgba(243, 217, 168, 0.1)) padding-box,
    linear-gradient(135deg, rgba(243, 217, 168, 0.55), rgba(184, 164, 255, 0.32), rgba(255, 255, 255, 0.08)) border-box;
}
.cta-ghost:active,
.btn-ghost:active,
.filter-btn:active,
.btn-audio:active,
.btn-ctrl:active,
.starter:active { transform: scale(0.97); }
.filter-btn.active {
  color: #120814;
  background: var(--accent);
  border-color: transparent;
}

.hero-desk {
  padding: 22px 22px 18px;
}
.desk-kicker {
  margin: 0 0 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.desk-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}
.desk-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
}
.desk-num {
  font-family: var(--display);
  font-size: 28px;
  font-style: italic;
  line-height: 1;
  color: var(--accent);
}
.desk-list strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.desk-list em {
  display: block;
  margin-top: 4px;
  color: var(--copy);
  font-style: normal;
  font-size: 13px;
  line-height: 1.45;
}
.desk-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px clamp(20px, 4vw, 48px) 0;
}
.chapters a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--copy);
  text-decoration: none;
  font-size: 13px;
  background: rgba(10, 5, 14, 0.4);
  border: 1px solid var(--line);
}
.chapters a:hover { color: var(--ink); border-color: var(--line-strong); }
.chapters b {
  font-family: var(--display);
  font-size: 18px;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 22px clamp(20px, 4vw, 48px) 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 22px;
  background:
    linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box,
    linear-gradient(145deg, rgba(243, 217, 168, 0.32), rgba(184, 164, 255, 0.18), rgba(255, 255, 255, 0.04)) border-box;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.proof article {
  padding: 22px 24px 20px;
  background: rgba(8, 4, 12, 0.35);
}
.proof span {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.proof b {
  display: block;
  margin-top: 10px;
  font-family: var(--display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.04em;
  line-height: 1;
}

.session-desk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 48px clamp(20px, 4vw, 48px) 0;
  padding: 14px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  color: var(--accent);
  filter: drop-shadow(0 0 10px rgba(243, 217, 168, 0.28));
}
.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-sub {
  margin: 2px 0 0;
  color: var(--copy);
  font-size: 13px;
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
#statusBadge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--copy);
  font-family: var(--mono);
  font-size: 11px;
}

main { padding: 0 clamp(20px, 4vw, 48px); }
.chapter { margin-top: 72px; }
.chapter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.chapter-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.035em;
  line-height: 0.95;
}
.chapter-num {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.glass-shell {
  position: relative;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid transparent;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    var(--glass);
  background-clip: padding-box;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.glass-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg, rgba(243, 217, 168, 0.38), rgba(184, 164, 255, 0.26) 48%, rgba(255, 255, 255, 0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.section-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.section-label > span { color: var(--copy); }
#historyLinkStatus,
#safetyIndicator { margin-left: auto; text-transform: none; letter-spacing: 0; }
.safety-banner.safe-badge,
.safety-alert {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}
.safety-banner.safe-badge {
  border: 1px solid rgba(126, 220, 196, 0.3);
  background: rgba(126, 220, 196, 0.1);
  color: var(--safe);
}
.safety-alert {
  border: 1px solid rgba(244, 196, 176, 0.36);
  background: rgba(180, 70, 50, 0.16);
  color: var(--caution);
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.starter {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  text-align: left;
  padding: 14px 14px 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: inherit;
  background: rgba(8, 4, 12, 0.42);
  cursor: pointer;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease);
}
.starter:hover {
  border-color: var(--line-strong);
  background: rgba(243, 217, 168, 0.06);
}
.starter-mark {
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--accent);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
}
.starter-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.starter-copy {
  color: var(--copy);
  font-size: 12px;
  line-height: 1.4;
}

textarea#thoughtInput {
  width: 100%;
  min-height: 148px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(4, 2, 8, 0.55);
  font: 400 16px/1.5 var(--sans);
  resize: vertical;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
textarea#thoughtInput::placeholder { color: var(--muted); }
textarea#thoughtInput:focus {
  outline: none;
  border-color: rgba(243, 217, 168, 0.5);
  box-shadow: 0 0 0 4px rgba(184, 164, 255, 0.16);
}
.compose-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}
.hint {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

#pipelineProgress {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px dashed rgba(243, 217, 168, 0.28);
  border-radius: 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}
#pipelineProgress::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(243, 217, 168, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.safety-banner { display: none; margin: 20px 0 0; }
.safety-banner.caution {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(244, 196, 176, 0.4);
  border-radius: 16px;
  background: rgba(120, 40, 32, 0.22);
  color: var(--caution);
}

.instrument { padding: 0; overflow: hidden; }
.canvas-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 18px 20px 14px;
}
.canvas-header h3 {
  margin: 0;
  flex: 1 1 160px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.canvas-filters,
.canvas-controls,
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-ctrl {
  min-width: 40px;
  min-height: 36px;
  padding: 0 12px;
}
#btnTogglePhysics.is-paused {
  color: #120814;
  background: var(--accent);
  border-color: transparent;
}

#canvasWrapper {
  position: relative;
  width: 100%;
  min-height: 420px;
  height: 52vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(184, 164, 255, 0.1), transparent 46%),
    radial-gradient(circle at 78% 88%, rgba(243, 217, 168, 0.08), transparent 40%),
    #0a0610;
}
#graphCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#canvasWrapper:active #graphCanvas { cursor: grabbing; }
#canvasTooltip {
  display: none;
  position: absolute;
  z-index: 20;
  max-width: 280px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 6, 16, 0.9);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: none;
}
#tooltipTitle { font-weight: 600; margin-bottom: 4px; }
.tooltip-mark {
  font-family: var(--display);
  font-style: italic;
  color: var(--accent);
  margin-right: 4px;
}
#tooltipMeta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}
#tooltipSnippet {
  margin-top: 8px;
  color: var(--copy);
  font-size: 13px;
  line-height: 1.4;
}
#graphHud {
  position: absolute;
  right: 14px;
  top: 14px;
  display: flex;
  gap: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 5, 14, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--copy);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#graphHud span span { color: var(--ink); letter-spacing: 0; }

.dual {
  display: grid;
  gap: 16px;
}
@media (min-width: 900px) {
  .dual { grid-template-columns: 1fr 1fr; }
}
.card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.card-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.card h3 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.03em;
}
.card-body {
  flex: 1;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.placeholder-text { color: var(--muted); opacity: 1; }
.card-actions { margin-top: 18px; }
.btn-audio .mark-audio {
  width: 16px;
  height: 16px;
  display: block;
}
.btn-audio.loading { opacity: 0.7; }
.btn-audio.playing {
  color: #120814;
  background: var(--accent);
  border-color: transparent;
}
.soundwave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.soundwave span {
  width: 2px;
  height: 100%;
  background: currentColor;
  animation: wave 0.72s ease-in-out infinite;
}
.soundwave span:nth-child(2) { animation-delay: 0.12s; }
.soundwave span:nth-child(3) { animation-delay: 0.24s; }
.soundwave span:nth-child(4) { animation-delay: 0.36s; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 80px;
  padding: 28px clamp(20px, 4vw, 48px) 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-backdrop {
  background: rgba(4, 2, 8, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.history-drawer {
  background: #100814;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.drawer-head,
.drawer-footer { border-color: var(--line); }
.drawer-head strong {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.03em;
}
.drawer-list { padding: 8px 0; }
.history-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  opacity: 1;
  transition: background 160ms var(--ease);
}
.history-item:hover { background: rgba(243, 217, 168, 0.05); }
.history-item-preview {
  color: var(--copy);
  font-size: 14px;
  line-height: 1.45;
}
.history-empty {
  padding: 28px 18px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 22px;
  font-style: italic;
}

.word-reveal { visibility: visible; }
html.js .word-reveal[data-word-reveal]:not(.is-ready) { opacity: 0; }
.word-reveal__word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
  transition-delay: calc(var(--word-index) * 0.07s);
}
.word-reveal.is-visible .word-reveal__word {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wave {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 56px;
  }
  .proof { grid-template-columns: 1fr; }
  .starter-grid { grid-template-columns: 1fr; }
  .skin-bar { border-radius: 20px; }
  .chapter-head { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .word-reveal__word,
  .soundwave span,
  #pipelineProgress::before {
    animation: none;
    transition: none;
    transform: none;
    opacity: 1;
  }
  html.js .word-reveal[data-word-reveal]:not(.is-ready) { opacity: 1; }
  .cta:hover,
  .btn-primary:hover,
  .cta-ghost:hover { transform: none; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-shell,
  .skin-bar,
  .session-desk,
  #canvasTooltip,
  #graphHud {
    background: var(--glass-strong);
  }
}
