/* ========================================
   THE INTERNAL TERRAIN — Core Styles
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Palette — rich charcoal, not dead black */
  --bg-deep: #0e0f14;
  --bg-surface: #151720;
  --bg-elevated: #1c1e2a;
  --bg-hover: #242636;

  --text-primary: #ece9e3;
  --text-secondary: #a09b94;
  --text-muted: #635e56;

  --ridge-color: #d4613f;
  --ridge-glow: rgba(212, 97, 63, 0.25);
  --ridge-subtle: rgba(212, 97, 63, 0.06);

  --sealevel-color: #dbb050;
  --sealevel-glow: rgba(219, 176, 80, 0.25);
  --sealevel-subtle: rgba(219, 176, 80, 0.06);

  --depths-color: #4a8fd4;
  --depths-glow: rgba(74, 143, 212, 0.25);
  --depths-subtle: rgba(74, 143, 212, 0.06);

  --transition-color: #777;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'EB Garamond', Georgia, serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;
  --space-3xl: 8rem;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ========================================
   MAP PAGE — Layout
   ======================================== */

.terrain-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Hero / Title Section */
.terrain-hero {
  position: relative;
  padding: var(--space-3xl) var(--space-lg) var(--space-xl);
  text-align: center;
  z-index: 2;
}

.terrain-hero__glow {
  position: absolute;
  width: 700px;
  height: 400px;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(219, 176, 80, 0.06) 0%, rgba(219, 176, 80, 0.02) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.terrain-hero__label {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.terrain-hero__title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
  text-shadow: 0 0 80px rgba(219, 176, 80, 0.08);
}

.terrain-hero__subtitle {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-style: italic;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 400;
  opacity: 0.85;
}

/* ========================================
   "WHERE AM I?" SELECTOR
   ======================================== */

.terrain-selector {
  text-align: center;
  padding: 0 var(--space-lg) var(--space-xl);
  max-width: 780px;
  margin: 0 auto;
}

.terrain-selector__prompt {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.terrain-selector__options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.terrain-selector__btn {
  padding: 0.6rem 1.3rem;
  border-radius: 100px;
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.terrain-selector__btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.terrain-selector__btn.is-active {
  background: var(--text-primary);
  color: var(--bg-deep);
  border-color: var(--text-primary);
  box-shadow: 0 2px 20px rgba(236, 233, 227, 0.15);
}

/* Quiz CTA */
.terrain-quiz-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-xl);
  border-radius: 16px;
  border: 1px solid rgba(219, 176, 80, 0.15);
  background: rgba(219, 176, 80, 0.04);
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  text-decoration: none;
  cursor: pointer;
}

.terrain-quiz-cta:hover {
  border-color: rgba(219, 176, 80, 0.3);
  background: rgba(219, 176, 80, 0.07);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(219, 176, 80, 0.08);
}

.terrain-quiz-cta__label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.terrain-quiz-cta__action {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--sealevel-color);
}

.terrain-selector__reset {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  padding: var(--space-sm) var(--space-md);
  transition: color 0.3s ease;
  display: none;
}

.terrain-selector__reset.is-visible {
  display: inline-block;
}

.terrain-selector__reset:hover {
  color: var(--text-primary);
}

/* ========================================
   SAVED STATE BANNER
   ======================================== */

.saved-state {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  max-width: 480px;
  margin: 0 auto var(--space-lg);
  border-radius: 16px;
  background: rgba(219, 176, 80, 0.06);
  border: 1px solid rgba(219, 176, 80, 0.12);
}

.saved-state.is-visible {
  display: flex;
}

.saved-state__row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.saved-state__label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.saved-state__name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--sealevel-color);
}

.saved-state__clear,
.saved-state__retake {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s ease;
  text-decoration: none;
}

.saved-state__clear:hover,
.saved-state__retake:hover {
  color: var(--text-primary);
}

.saved-state__clear {
  border-left: 1px solid var(--border-subtle);
  margin-left: var(--space-xs);
  padding-left: var(--space-sm);
}

.saved-state__insight {
  display: none;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  line-height: 1.4;
  padding-top: var(--space-xs);
}

.saved-state__insight.is-visible {
  display: block;
}

/* ========================================
   MAP — The Terrain Visualization
   ======================================== */

.terrain-map {
  position: relative;
  flex: 1;
  padding: var(--space-lg);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* Zone containers */
.terrain-zone {
  position: relative;
  padding: var(--space-xl) 0 var(--space-lg);
  margin-bottom: var(--space-md);
}

/* Ambient zone glow */
.terrain-zone::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.terrain-zone--ridge::before {
  background: radial-gradient(ellipse at 50% 30%, rgba(212, 97, 63, 0.035) 0%, transparent 65%);
}

.terrain-zone--sealevel::before {
  background: radial-gradient(ellipse at 50% 40%, rgba(219, 176, 80, 0.03) 0%, transparent 60%);
}

.terrain-zone--depths::before {
  background: radial-gradient(ellipse at 50% 50%, rgba(74, 143, 212, 0.035) 0%, transparent 65%);
}

.terrain-zone__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: 0 var(--space-md);
}

.terrain-zone__line {
  flex: 1;
  height: 1px;
}

.terrain-zone__name {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Zone-specific colors */
.terrain-zone--ridge .terrain-zone__line { background: linear-gradient(90deg, transparent, var(--ridge-color), transparent); opacity: 0.4; }
.terrain-zone--ridge .terrain-zone__name { color: var(--ridge-color); }

.terrain-zone--sealevel .terrain-zone__line { background: linear-gradient(90deg, transparent, var(--sealevel-color), transparent); opacity: 0.4; }
.terrain-zone--sealevel .terrain-zone__name { color: var(--sealevel-color); }

.terrain-zone--depths .terrain-zone__line { background: linear-gradient(90deg, transparent, var(--depths-color), transparent); opacity: 0.4; }
.terrain-zone--depths .terrain-zone__name { color: var(--depths-color); }

/* Zone description */
.terrain-zone__desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 560px;
  margin: calc(-1 * var(--space-sm)) auto var(--space-lg);
  line-height: 1.5;
}

/* State node grid */
.terrain-zone__nodes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding: 0 var(--space-md);
}

/* ========================================
   STATE NODE — The clickable map points
   ======================================== */

.state-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  border-radius: 16px;
  background: linear-gradient(165deg, var(--bg-surface) 0%, var(--bg-deep) 100%);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.state-node::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.state-node:hover,
.state-node.is-touch-open {
  transform: translateY(-6px);
  border-color: var(--border-medium);
  background: linear-gradient(165deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
}

.state-node:hover::before,
.state-node.is-touch-open::before {
  opacity: 1;
}

/* Zone-specific node glows */
.terrain-zone--ridge .state-node::before { background: radial-gradient(ellipse at 50% 0%, rgba(212, 97, 63, 0.08), transparent 70%); }
.terrain-zone--ridge .state-node:hover { border-color: rgba(212, 97, 63, 0.2); box-shadow: 0 8px 40px rgba(212, 97, 63, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(212, 97, 63, 0.06); }

.terrain-zone--sealevel .state-node::before { background: radial-gradient(ellipse at 50% 0%, rgba(219, 176, 80, 0.08), transparent 70%); }
.terrain-zone--sealevel .state-node:hover { border-color: rgba(219, 176, 80, 0.2); box-shadow: 0 8px 40px rgba(219, 176, 80, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(219, 176, 80, 0.06); }

.terrain-zone--depths .state-node::before { background: radial-gradient(ellipse at 50% 0%, rgba(74, 143, 212, 0.08), transparent 70%); }
.terrain-zone--depths .state-node:hover { border-color: rgba(74, 143, 212, 0.2); box-shadow: 0 8px 40px rgba(74, 143, 212, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(74, 143, 212, 0.06); }

/* Node pulse dot */
.state-node__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-bottom: var(--space-md);
  position: relative;
}

.state-node__pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
}

.terrain-zone--ridge .state-node__pulse { background: var(--ridge-color); }
.terrain-zone--ridge .state-node__pulse::after { background: var(--ridge-color); }

.terrain-zone--sealevel .state-node__pulse { background: var(--sealevel-color); }
.terrain-zone--sealevel .state-node__pulse::after { background: var(--sealevel-color); }

.terrain-zone--depths .state-node__pulse { background: var(--depths-color); }
.terrain-zone--depths .state-node__pulse::after { background: var(--depths-color); }

@keyframes pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(2.5); }
}

/* Stagger pulse animations */
.state-node:nth-child(2) .state-node__pulse::after { animation-delay: 0.5s; }
.state-node:nth-child(3) .state-node__pulse::after { animation-delay: 1s; }
.state-node:nth-child(4) .state-node__pulse::after { animation-delay: 1.5s; }
.state-node:nth-child(5) .state-node__pulse::after { animation-delay: 2s; }
.state-node:nth-child(6) .state-node__pulse::after { animation-delay: 0.3s; }

/* Node text */
.state-node__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: var(--space-xs);
  line-height: 1.3;
}

.state-node__tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 180px;
  transition: opacity 0.3s ease;
}

/* Hover preview panel */
.state-node__preview {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease 0.05s;
  width: 100%;
  margin-top: 0;
}

.state-node:hover .state-node__preview,
.state-node.is-touch-open .state-node__preview {
  max-height: 140px;
  opacity: 1;
  margin-top: var(--space-md);
}

.state-node:hover .state-node__tagline,
.state-node.is-touch-open .state-node__tagline {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.state-node__hook {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-sm);
}

.state-node__cta {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.state-node:hover .state-node__cta,
.state-node.is-touch-open .state-node__cta {
  opacity: 1;
}

/* Filter dimming */
.state-node.is-dimmed {
  opacity: 0.15;
  transform: scale(0.97);
  pointer-events: none;
}

.state-node.is-highlighted {
  border-color: var(--border-medium);
}

.terrain-zone--ridge .state-node.is-highlighted { box-shadow: 0 4px 30px var(--ridge-glow); border-color: rgba(196, 85, 58, 0.25); }
.terrain-zone--sealevel .state-node.is-highlighted { box-shadow: 0 4px 30px var(--sealevel-glow); border-color: rgba(212, 165, 74, 0.25); }
.terrain-zone--depths .state-node.is-highlighted { box-shadow: 0 4px 30px var(--depths-glow); border-color: rgba(58, 126, 196, 0.25); }

/* Quiz target: the detected state — pulsing glow */
.state-node.is-quiz-target {
  animation: quizPulseGlow 2s ease-in-out 3;
}

.terrain-zone--ridge .state-node.is-quiz-target { box-shadow: 0 4px 40px rgba(212, 97, 63, 0.35), 0 0 0 1px rgba(212, 97, 63, 0.2); border-color: rgba(212, 97, 63, 0.3); }
.terrain-zone--sealevel .state-node.is-quiz-target { box-shadow: 0 4px 40px rgba(219, 176, 80, 0.35), 0 0 0 1px rgba(219, 176, 80, 0.2); border-color: rgba(219, 176, 80, 0.3); }
.terrain-zone--depths .state-node.is-quiz-target { box-shadow: 0 4px 40px rgba(74, 143, 212, 0.35), 0 0 0 1px rgba(74, 143, 212, 0.2); border-color: rgba(74, 143, 212, 0.3); }

@keyframes quizPulseGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Pathway target: the healthy direction — softer highlight */
.state-node.is-pathway-target {
  opacity: 0.85;
  border-color: var(--border-medium);
  box-shadow: 0 2px 20px rgba(219, 176, 80, 0.1);
}

/* Pathway fallback: common patterns — faintest */
.state-node.is-pathway-fallback {
  opacity: 0.45;
  border-color: var(--border-subtle);
}

/* ========================================
   FLOW ARROWS — Between zones
   ======================================== */

.terrain-flow {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  max-width: 1100px;
  margin: 0 auto;
}

.terrain-flow__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.terrain-flow__arrows {
  display: flex;
  gap: var(--space-xl);
}

.terrain-flow__arrow {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: default;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.terrain-flow__arrow:hover {
  color: var(--text-secondary);
}

.terrain-flow__arrow svg {
  opacity: 0.5;
  transition: opacity 0.3s ease;
  animation: flowPulse 2.5s ease-in-out infinite;
}

.terrain-flow__arrow:nth-child(2) svg { animation-delay: 0.8s; }
.terrain-flow__arrow:nth-child(3) svg { animation-delay: 1.6s; }

@keyframes flowPulse {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 0.7; transform: translateY(2px); }
}

/* Upward arrows */
.terrain-flow__arrow svg[viewBox] path[d*="L10 4"] {
  /* The upward arrows already defined in HTML */
}

/* ========================================
   TRANSITIONS — Connection lines
   ======================================== */

.terrain-transitions {
  position: relative;
  padding: var(--space-lg) var(--space-md);
  max-width: 1100px;
  margin: 0 auto var(--space-2xl);
  width: 100%;
}

.terrain-transitions__title {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.transition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.transition-card {
  padding: var(--space-md) var(--space-lg);
  border-radius: 12px;
  background: linear-gradient(165deg, var(--bg-surface) 0%, var(--bg-deep) 100%);
  border: 1px solid var(--border-subtle);
  cursor: default;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.transition-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.transition-card__name {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: var(--space-xs);
}

.transition-card__path {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.transition-card__desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
}

.transition-card:hover .transition-card__desc,
.transition-card.is-expanded .transition-card__desc {
  max-height: 120px;
  opacity: 1;
}

/* ========================================
   FOOTER — Map page
   ======================================== */

.terrain-footer {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.terrain-footer__text {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto var(--space-lg);
  line-height: 1.6;
}

.terrain-footer__return {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

/* Share button */
.state-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.state-share__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.state-share__btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.state-share__btn.is-copied {
  color: var(--sealevel-color);
  border-color: rgba(219, 176, 80, 0.2);
}

.state-share__btn svg {
  width: 14px;
  height: 14px;
}

.terrain-footer__cta {
  display: inline-block;
  padding: 0.75rem 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.03);
}

.terrain-footer__cta:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

/* ========================================
   BACKGROUND — Atmospheric layers
   ======================================== */

.terrain-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.terrain-atmosphere__gradient {
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 5%, rgba(212, 97, 63, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 0%, rgba(212, 97, 63, 0.04) 0%, transparent 35%),
    radial-gradient(ellipse at 50% 45%, rgba(219, 176, 80, 0.03) 0%, transparent 35%),
    radial-gradient(ellipse at 30% 90%, rgba(74, 143, 212, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 75% 95%, rgba(74, 143, 212, 0.04) 0%, transparent 35%),
    radial-gradient(ellipse at 50% 15%, rgba(255, 255, 255, 0.01) 0%, transparent 30%);
}

.terrain-atmosphere__noise {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
}

/* Breathing animation on the atmosphere */
.terrain-atmosphere__breath {
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  left: 50%;
  top: 35%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(219, 176, 80, 0.025), rgba(219, 176, 80, 0.008) 40%, transparent 70%);
  animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* ========================================
   STATE PAGE — Layout
   ======================================== */

.state-page {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}

/* Back navigation */
.state-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(14, 15, 20, 0.95) 40%, transparent);
  pointer-events: none;
}

.state-nav > * {
  pointer-events: auto;
}

.state-nav__back {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
  cursor: pointer;
}

.state-nav__back:hover {
  color: var(--text-primary);
}

.state-nav__back svg {
  width: 16px;
  height: 16px;
}

.state-nav__zone {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* State hero */
.state-hero {
  padding: calc(var(--space-3xl) + 2rem) var(--space-lg) var(--space-2xl);
  max-width: 720px;
  margin: 0 auto;
}

.state-hero__zone {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.state-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.state-hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* State content sections */
.state-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-3xl);
}

.state-section {
  margin-bottom: var(--space-2xl);
}

.state-section__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.state-section__text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.state-section__text p {
  margin-bottom: var(--space-md);
}

.state-section__text p:last-child {
  margin-bottom: 0;
}

/* Pull quote */
.state-pullquote {
  padding: var(--space-xl) 0;
  margin: var(--space-xl) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.state-pullquote__text {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--text-primary);
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

/* Signals list */
.state-signals {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.state-signals li {
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

/* Adjacent states / transitions */
.state-connections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.state-connection-card {
  display: block;
  padding: var(--space-md);
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.state-connection-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.state-connection-card__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.state-connection-card__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

/* Action sections — Next Move, What NOT to Do */
.state-section--action {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: var(--space-lg);
}

.state-section--action .state-section__label {
  border-bottom: none;
  padding-bottom: 0;
  color: var(--sealevel-color);
}

.state-section--warning {
  background: var(--bg-surface);
  border: 1px solid rgba(196, 85, 58, 0.12);
  border-radius: 16px;
  padding: var(--space-lg);
}

.state-section--warning .state-section__label {
  border-bottom: none;
  padding-bottom: 0;
  color: var(--ridge-color);
}

.state-action-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.state-action-list li {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
  padding-left: 1.2rem;
  position: relative;
}

.state-action-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

.state-section--action .state-action-list li::before {
  background: var(--sealevel-color);
}

.state-section--warning .state-action-list li::before {
  background: var(--ridge-color);
}

.state-action-list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Reality Check — shame removal block */
.state-reality-check {
  position: relative;
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(212, 165, 74, 0.04), rgba(212, 165, 74, 0.01));
  border: 1px solid rgba(212, 165, 74, 0.12);
}

.state-reality-check__label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sealevel-color);
  margin-bottom: var(--space-md);
  display: block;
}

.state-reality-check__myth {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-decoration: line-through;
  text-decoration-color: rgba(196, 85, 58, 0.4);
}

.state-reality-check__truth {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.5;
  color: var(--text-primary);
}

/* Where You Go From Here — Navigation section */
.state-pathways {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.state-pathway {
  display: block;
  padding: var(--space-lg);
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.state-pathway:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.state-pathway__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.state-pathway__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.state-pathway--primary .state-pathway__arrow {
  background: rgba(212, 165, 74, 0.15);
  color: var(--sealevel-color);
}

.state-pathway--fallback .state-pathway__arrow {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.state-pathway__title {
  flex: 1;
}

.state-pathway__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.3;
}

.state-pathway__type {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.state-pathway--primary .state-pathway__type {
  color: var(--sealevel-color);
}

.state-pathway--fallback .state-pathway__type {
  color: var(--text-muted);
}

.state-pathway__body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.state-pathway__body p {
  margin-bottom: var(--space-sm);
}

.state-pathway__body p:last-child {
  margin-bottom: 0;
}

.state-pathway__trigger {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  font-style: italic;
}

/* Primary path has subtle gold left border */
.state-pathway--primary {
  border-left: 2px solid rgba(212, 165, 74, 0.3);
}

.state-pathway--primary:hover {
  border-left-color: var(--sealevel-color);
  box-shadow: 0 4px 24px rgba(212, 165, 74, 0.08);
}

/* Zone color helpers for state pages */
.zone-ridge { color: var(--ridge-color); }
.zone-sealevel { color: var(--sealevel-color); }
.zone-depths { color: var(--depths-color); }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .terrain-selector {
    padding: 0 var(--space-md) var(--space-lg);
  }

  .terrain-selector__options {
    gap: var(--space-xs);
  }

  .terrain-selector__btn {
    font-size: 0.75rem;
    padding: 0.45rem 0.9rem;
  }

  .terrain-flow {
    display: none;
  }

  .terrain-hero {
    padding: var(--space-2xl) var(--space-md) var(--space-lg);
  }

  .terrain-map {
    padding: var(--space-md);
  }

  .terrain-zone__nodes {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .state-hero {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .state-content {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .transition-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .terrain-zone__nodes {
    grid-template-columns: 1fr;
  }

  .state-node {
    padding: var(--space-md);
  }

  .state-node__preview {
    font-size: 0.75rem;
  }

  .saved-state {
    margin-left: var(--space-md);
    margin-right: var(--space-md);
    padding: var(--space-sm) var(--space-md);
  }

  .saved-state__row {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs);
  }

  .state-reality-check {
    padding: var(--space-md);
  }

  .state-section--action,
  .state-section--warning {
    padding: var(--space-md);
  }

  .state-pathway {
    padding: var(--space-md);
  }

  .state-share {
    padding: 0 var(--space-md);
  }
}

/* ========================================
   PAGE LOAD ANIMATION
   ======================================== */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeIn 0.6s ease forwards;
}

.fade-in--delay-1 { animation-delay: 0.1s; }
.fade-in--delay-2 { animation-delay: 0.2s; }
.fade-in--delay-3 { animation-delay: 0.3s; }
.fade-in--delay-4 { animation-delay: 0.4s; }
.fade-in--delay-5 { animation-delay: 0.5s; }

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal for state nodes — start hidden, JS reveals them */
.terrain-map .state-node {
  opacity: 0;
  transform: translateY(20px);
}

.terrain-map .state-node.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Fallback: if JS hasn't run after 2s, show all nodes */
@keyframes fallbackReveal {
  to { opacity: 1; transform: translateY(0); }
}

.no-js .terrain-map .state-node,
.terrain-map .state-node {
  animation: fallbackReveal 0.6s ease 1.5s forwards;
}
