/* gabs.bar - Bauhaus Cocktail Lounge / Data Observatory */

:root {
  --bg-deep: #1E1E2A;
  --bg-surface: #2A2745;
  --bg-elevated: #38355E;
  --text-primary: #D8D4E3;
  --text-muted: #8B87A3;
  --accent-red: #D4503A;
  --accent-blue: #2B5DA0;
  --accent-yellow: #E8C847;
  --bg-midnight: #0F1628;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  overflow-x: hidden;
  line-height: 1.65;
}

/* Utility type classes */
.mono-text {
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.serif-text {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
}

.display-text {
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 0.9;
}

/* === NOISE OVERLAY === */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.03;
}

/* === BLUR ORBS === */
.blur-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--bg-elevated);
  top: -200px;
  left: -100px;
  opacity: 0.4;
  animation: orbDrift1 20s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--bg-surface);
  bottom: -150px;
  right: -100px;
  opacity: 0.3;
  animation: orbDrift2 25s ease-in-out infinite alternate;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: var(--bg-elevated);
  top: 50%;
  left: 50%;
  opacity: 0.2;
  animation: orbDrift3 18s ease-in-out infinite alternate;
}

@keyframes orbDrift1 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(100px, 80px); }
}

@keyframes orbDrift2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-80px, -60px); }
}

@keyframes orbDrift3 {
  0% { transform: translate(-50%, -50%); }
  100% { transform: translate(-30%, -40%); }
}

/* === DOT NAVIGATION === */
.dot-nav {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.dot.active {
  background-color: var(--accent-yellow);
  border-color: var(--accent-yellow);
}

/* === SPREAD BASE === */
.spread {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.spread-inner {
  width: 92%;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.spread.visible .spread-inner {
  opacity: 1;
  transform: translateY(0);
}

/* === SPREAD 1: THE ENTRANCE === */
#spread-1 {
  background: linear-gradient(180deg, var(--bg-midnight) 0%, var(--bg-deep) 60%, var(--bg-surface) 100%);
}

.hero-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
  padding: 4rem 0;
}

.hero-construction {
  position: relative;
}

.hangul-svg {
  width: clamp(200px, 40vw, 400px);
  height: auto;
}

.hangul-stroke {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: strokeDraw 2s ease forwards;
}

.hangul-stroke:nth-child(1) { animation-delay: 0s; }
.hangul-stroke:nth-child(2) { animation-delay: 0.15s; }
.hangul-stroke:nth-child(3) { animation-delay: 0.3s; }
.hangul-stroke:nth-child(4) { animation-delay: 0.45s; }
.hangul-stroke:nth-child(5) { animation-delay: 0.6s; }
.hangul-stroke:nth-child(6) { animation-delay: 0.75s; }
.hangul-stroke:nth-child(7) { animation-delay: 0.9s; }
.hangul-stroke:nth-child(8) { animation-delay: 1.05s; }
.hangul-stroke:nth-child(9) { animation-delay: 1.2s; }

.hangul-accent {
  opacity: 0;
  animation: accentFade 0.6s ease forwards;
}

.hangul-accent:nth-of-type(1) { animation-delay: 1.6s; }
.hangul-accent:nth-of-type(2) { animation-delay: 1.8s; }
.hangul-accent:nth-of-type(3) { animation-delay: 2.0s; }

@keyframes strokeDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes accentFade {
  to { opacity: 0.6; }
}

/* Hero blur dissolution */
.hero-construction.dissolving .hangul-svg {
  transition: filter 3s ease;
  filter: blur(12px);
}

.hero-domain {
  min-height: 1.5em;
}

.typewriter-text {
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  border-right: 2px solid var(--accent-red);
  padding-right: 4px;
  animation: blink 530ms step-end infinite;
}

.typewriter-text.done {
  border-right-color: transparent;
  animation: none;
}

@keyframes blink {
  0%, 50% { border-color: transparent; }
  51%, 100% { border-color: var(--accent-red); }
}

.hero-subtitle {
  font-size: clamp(10px, 1.2vw, 14px);
  color: var(--text-muted);
  letter-spacing: 0.25em;
  opacity: 0;
  animation: fadeUp 0.8s 3.5s ease forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 3;
}

.scroll-indicator .mono-text {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.3; transform: scaleY(0.6); }
}

/* === SPREAD 2: THE MENU === */
#spread-2 {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-deep) 40%, var(--bg-midnight) 100%);
}

.menu-layout {
  display: grid;
  grid-template-columns: 38% 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4rem 0;
}

.menu-left {
  padding-left: 4%;
}

.section-number {
  font-size: 11px;
  color: var(--accent-red);
  letter-spacing: 0.3em;
  display: block;
  margin-bottom: 1.5rem;
}

.pull-quote {
  font-size: clamp(36px, 6vw, 80px);
  color: var(--text-primary);
  margin-bottom: 0;
}

.menu-right {
  padding-right: 4%;
}

.menu-body {
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--text-primary);
  line-height: 1.65;
  letter-spacing: 0.01em;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.menu-body.typing {
  border-right: 2px solid var(--accent-red);
  animation: blink 530ms step-end infinite;
}

.sparklines {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sparkline {
  width: 100%;
  max-width: 300px;
  height: auto;
}

.spark-label {
  font-family: 'Space Mono', monospace;
  font-size: 5px;
  letter-spacing: 0.15em;
}

/* === SPREAD 3: THE DATA WALL === */
#spread-3 {
  background: var(--bg-deep);
}

.datawall-layout {
  padding: 4rem 0;
}

.section-heading {
  font-size: clamp(28px, 5vw, 64px);
  color: var(--text-primary);
  margin-bottom: 3rem;
}

.datawall-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 3rem;
}

/* Bar chart */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 250px;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(139, 135, 163, 0.2);
}

.bar {
  flex: 1;
  height: 0;
  background: var(--color);
  border-radius: 2px 2px 0 0;
  position: relative;
  transition: height 2s cubic-bezier(0.25, 0.1, 0.25, 1);
  transition-delay: var(--delay);
  animation: barBreathe 4s ease-in-out infinite;
  animation-play-state: paused;
}

.spread.visible .bar {
  height: var(--target-h);
  animation-play-state: running;
}

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

.bar-label {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  white-space: nowrap;
  color: var(--text-muted);
}

/* Scatter plot */
.scatter-plot {
  position: relative;
  height: 250px;
  border: 1px solid rgba(139, 135, 163, 0.1);
  border-radius: 2px;
}

.scatter-dot {
  position: absolute;
  border-radius: 50%;
  animation: drift 8s ease-in-out infinite alternate;
}

.scatter-dot.shape-square {
  border-radius: 0;
}

.scatter-dot.shape-triangle {
  border-radius: 0;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

@keyframes drift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(5px, -8px); }
  50% { transform: translate(-3px, 4px); }
  75% { transform: translate(7px, 2px); }
  100% { transform: translate(-4px, -6px); }
}

/* Sankey flows */
.sankey-flows {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 200px;
}

.sankey-path {
  filter: blur(3px);
  opacity: 0;
  transition: opacity 1.5s ease;
  transition-delay: 1s;
}

.spread.visible .sankey-path {
  opacity: 1;
}

/* === SPREAD 4: THE CITY WINDOW === */
#spread-4 {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #0a0e1a 50%, var(--bg-midnight) 100%);
}

.city-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem 0;
}

.cityscape-svg {
  width: 100%;
  max-width: 1200px;
}

.window {
  fill: var(--bg-deep);
  animation: windowFlicker var(--dur) var(--delay) infinite;
}

@keyframes windowFlicker {
  0%, 40% { fill: #1E1E2A; }
  45%, 55% { fill: #E8C847; }
  60%, 100% { fill: #1E1E2A; }
}

.city-text {
  text-align: center;
}

.city-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1rem;
  letter-spacing: 0.15em;
}

/* === SPREAD 5: THE EXIT === */
#spread-5 {
  background: radial-gradient(ellipse at 50% 50%, var(--bg-surface) 0%, var(--bg-midnight) 70%);
}

.exit-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3rem;
  min-height: 60vh;
}

.exit-quote {
  font-size: clamp(22px, 3.5vw, 42px);
  color: var(--text-primary);
  line-height: 1.5;
  opacity: 0.9;
  max-width: 700px;
}

.exit-domain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.exit-label {
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

.exit-underline {
  width: 60px;
  height: 1px;
  background: var(--accent-yellow);
  animation: underlinePulse 3s ease-in-out infinite;
}

@keyframes underlinePulse {
  0%, 100% { opacity: 1; width: 60px; }
  50% { opacity: 0.4; width: 40px; }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .menu-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .menu-left { padding-left: 0; }
  .menu-right { padding-right: 0; }

  .datawall-container {
    grid-template-columns: 1fr;
  }

  .dot-nav {
    right: 1rem;
  }
}
