html,
body {
  overflow-x: hidden;
}

.cluster-brain-page {
  background: #061110;
}

.cluster-brain-page .site-nav {
  background: rgba(6, 17, 16, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.cluster-brain-page .nav-drawer {
  transform: none;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.cluster-brain-page .nav-drawer.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.brain-hero {
  min-height: 100vh;
  background:
    radial-gradient(circle at 68% 42%, rgba(92, 75, 122, 0.34), transparent 34%),
    radial-gradient(circle at 46% 58%, rgba(45, 106, 79, 0.22), transparent 38%),
    linear-gradient(135deg, #030909 0%, #071715 48%, #0b1419 100%);
  color: var(--white);
  padding: 92px 18px 18px;
}

.brain-stage {
  position: relative;
  min-height: calc(100vh - 110px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(116, 217, 159, 0.08), transparent 48%);
  background-size: 42px 42px, 42px 42px, auto;
  overflow: hidden;
  isolation: isolate;
}

.brain-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 17, 16, 0.9) 0%, rgba(6, 17, 16, 0.28) 27%, transparent 43%),
    linear-gradient(270deg, rgba(6, 17, 16, 0.86) 0%, rgba(6, 17, 16, 0.24) 25%, transparent 42%);
  z-index: 2;
}

.brain-stage::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(116, 217, 159, 0.16);
  pointer-events: none;
  z-index: 3;
}

.brain-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.brain-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.brain-copy,
.sequence-panel,
.layer-panel,
.structure-panel,
.drag-note {
  position: absolute;
  z-index: 4;
}

.brain-copy {
  top: clamp(24px, 4vw, 52px);
  left: clamp(18px, 4vw, 52px);
  width: min(348px, calc(100% - 36px));
}

.brain-back {
  display: inline-flex;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}

.brain-back:hover {
  color: #74d99f;
}

.brain-kicker,
.panel-label,
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brain-kicker {
  color: #74d99f;
  margin-bottom: 14px;
}

.brain-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 3.8vw, 4.05rem);
  line-height: 0.96;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--white);
  max-width: 430px;
  margin-bottom: 18px;
}

.brain-copy p {
  max-width: 326px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.92rem;
  line-height: 1.62;
  margin-bottom: 20px;
}

.brain-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.brain-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.88);
  min-height: 44px;
  padding: 0 18px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.brain-btn:hover,
.brain-btn:focus-visible {
  border-color: rgba(116, 217, 159, 0.7);
  outline: none;
}

.brain-btn--primary {
  background: #74d99f;
  border-color: #74d99f;
  color: #061110;
}

.sequence-panel {
  top: clamp(24px, 4vw, 52px);
  right: clamp(18px, 4vw, 52px);
  width: min(280px, calc(100% - 36px));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-label {
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 6px;
}

.step-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 10, 10, 0.68);
  color: rgba(255, 255, 255, 0.72);
  min-height: 42px;
  padding: 0 12px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}

.step-btn span {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: rgba(116, 217, 159, 0.62);
  letter-spacing: 0.1em;
}

.step-btn:hover,
.step-btn:focus-visible,
.step-btn.is-active {
  border-color: rgba(116, 217, 159, 0.62);
  background: rgba(116, 217, 159, 0.1);
  color: var(--white);
  outline: none;
}

.layer-panel {
  right: clamp(18px, 4vw, 52px);
  top: 408px;
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  gap: 7px 10px;
  width: min(280px, calc(100% - 36px));
  padding: 14px 16px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 10, 10, 0.56);
  backdrop-filter: blur(14px);
}

.layer-panel .panel-label {
  grid-column: 1 / -1;
}

.layer-panel label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 31px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
}

.layer-panel input {
  accent-color: #74d99f;
}

.structure-panel {
  left: clamp(18px, 4vw, 52px);
  right: auto;
  bottom: clamp(18px, 4vw, 46px);
  transform: none;
  width: min(330px, calc(100% - 36px));
  border-left: 2px solid #74d99f;
  padding: 16px 18px;
  background: rgba(4, 10, 10, 0.8);
  backdrop-filter: blur(14px);
  z-index: 5;
}

.sequence-panel,
.layer-panel {
  z-index: 6;
}

.structure-panel__name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: 8px;
}

.structure-panel p {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.88rem;
  line-height: 1.62;
  margin: 0;
}

.drag-note {
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.34);
  white-space: nowrap;
}

.pathway-section,
.anatomy-section,
.evidence-section {
  padding: clamp(72px, 9vw, 120px) 0;
}

.pathway-section {
  background: #f8f7f3;
}

.anatomy-section {
  background: #071512;
  color: var(--white);
}

.evidence-section {
  background: var(--white);
}

.pathway-inner,
.anatomy-inner,
.evidence-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.section-heading {
  display: grid;
  grid-template-columns: 0.58fr 1fr;
  gap: clamp(26px, 5vw, 72px);
  align-items: start;
  margin-bottom: clamp(36px, 6vw, 72px);
}

.section-heading .eyebrow,
.evidence-inner .eyebrow {
  color: var(--accent);
}

.anatomy-section .section-heading .eyebrow {
  color: #74d99f;
}

.section-heading h2,
.evidence-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1.05;
  font-weight: 700;
  color: var(--ink);
  max-width: 760px;
}

.anatomy-section .section-heading h2 {
  color: var(--white);
}

.pathway-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid rgba(7, 21, 18, 0.11);
}

.pathway-card {
  min-height: 280px;
  padding: clamp(24px, 3vw, 34px);
  border-right: 1px solid rgba(7, 21, 18, 0.11);
  background: #fffdf8;
}

.pathway-card:last-child {
  border-right: none;
}

.pathway-card span {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 52px;
}

.pathway-card h3 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.16;
  color: var(--ink);
  margin-bottom: 16px;
}

.pathway-card p {
  color: var(--ink-mid);
  font-size: 0.94rem;
  line-height: 1.72;
}

.anatomy-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.anatomy-list div {
  min-height: 190px;
  padding: clamp(22px, 3vw, 34px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.anatomy-list b {
  display: block;
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.15rem;
  line-height: 1.2;
  margin-bottom: 14px;
}

.anatomy-list p {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.92rem;
  line-height: 1.65;
}

.evidence-inner {
  max-width: 840px;
}

.evidence-inner h2 {
  margin: 14px 0 18px;
}

.evidence-inner p {
  color: var(--ink-mid);
  font-size: 1.02rem;
  line-height: 1.82;
  max-width: 760px;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.source-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(45, 106, 79, 0.22);
  color: var(--accent);
  text-decoration: none;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.source-links a:hover,
.source-links a:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.article-nav {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: var(--sp-7) 0;
}

.article-nav .container {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-5);
}

.article-nav a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(45, 106, 79, 0.3);
  padding-bottom: 2px;
}

@media (max-width: 1180px) {
  .brain-stage {
    min-height: 1180px;
  }

  .brain-stage::before {
    background:
      linear-gradient(rgba(6, 17, 16, 0.82), rgba(6, 17, 16, 0.2) 34%, rgba(6, 17, 16, 0.76) 78%, rgba(6, 17, 16, 0.9)),
      radial-gradient(circle at 50% 40%, transparent, rgba(6, 17, 16, 0.28));
  }

  .sequence-panel {
    top: auto;
    bottom: 260px;
    left: clamp(18px, 4vw, 52px);
    right: auto;
  }

  .layer-panel {
    top: auto;
    bottom: 42px;
    left: clamp(18px, 4vw, 52px);
    right: auto;
    width: min(340px, calc(100% - 36px));
    grid-template-columns: repeat(2, minmax(118px, 1fr));
  }

  .structure-panel {
    left: auto;
    right: clamp(18px, 4vw, 52px);
    bottom: 42px;
    transform: none;
  }

  .drag-note {
    bottom: 230px;
  }

  .pathway-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pathway-card:nth-child(2) {
    border-right: none;
  }

  .pathway-card:nth-child(1),
  .pathway-card:nth-child(2) {
    border-bottom: 1px solid rgba(7, 21, 18, 0.11);
  }
}

@media (max-width: 760px) {
  .cluster-brain-page .qm-trigger {
    display: none;
  }

  .brain-hero {
    padding: 82px 10px 10px;
  }

  /* Mobile: stack the stage as a normal vertical flow. The previous layout
     absolutely positioned each panel at hardcoded pixel offsets inside a fixed
     1680px stage, which collided once the fluid title wrapped differently. */
  .brain-stage {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 16px;
  }

  .brain-stage::before {
    display: none;
  }

  .brain-stage::after {
    inset: 6px;
  }

  .brain-copy,
  .sequence-panel,
  .layer-panel,
  .structure-panel {
    position: relative;
    inset: auto;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-width: none;
  }

  .brain-copy { order: 1; }
  .brain-canvas { order: 2; }
  .sequence-panel { order: 3; }
  .layer-panel { order: 4; }
  .structure-panel { order: 5; }

  .brain-copy h1 {
    font-size: clamp(2.05rem, 9vw, 3.2rem);
    max-width: none;
  }

  .brain-copy p {
    max-width: none;
  }

  .brain-canvas {
    position: relative;
    inset: auto;
    width: 100%;
    height: 58vh;
    min-height: 340px;
    max-height: 520px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, rgba(116, 217, 159, 0.08), transparent 60%);
  }

  .sequence-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .sequence-panel .panel-label {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .layer-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: none;
  }

  .structure-panel {
    border-left: 2px solid #74d99f;
  }

  .drag-note {
    display: none;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .pathway-grid,
  .anatomy-list {
    grid-template-columns: 1fr;
  }

  .pathway-card,
  .pathway-card:nth-child(2) {
    border-right: none;
    border-bottom: 1px solid rgba(7, 21, 18, 0.11);
    min-height: 220px;
  }

  .pathway-card:last-child {
    border-bottom: none;
  }

  .pathway-card span {
    margin-bottom: 34px;
  }

  .article-nav .container {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brain-btn,
  .step-btn,
  .source-links a {
    transition: none;
  }
}
