/* ============================================
   BUILDING THE ROOM
   SWIFT Summit — Dalhousie University
   QuinanWeb Design + Scrollytelling Engine
   ============================================ */

/* === CSS Variables / Design System === */
:root {
  /* QuinanWeb Palette — Warm, Light, Elegant */
  --bg-primary: #faf8f4;
  --bg-secondary: #f5f0e8;
  --bg-warm: #f0ebe0;
  --bg-card: rgba(255,255,255,0.85);
  --primary-black: #1a1a1a;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-dim: #8a8a8a;
  --white: #ffffff;

  /* Accent Colors */
  --accent-gold: #b8956a;
  --accent-gold-light: rgba(184, 149, 106, 0.12);
  --accent-rose: #9e6b7b;
  --accent-rose-light: rgba(158, 107, 123, 0.10);
  --accent-blue: #2c5282;
  --accent-blue-light: rgba(44, 82, 130, 0.08);
  --accent-charcoal: #3a3a3a;

  /* Gradients */
  --gradient-glow: linear-gradient(135deg, #b8956a 0%, #9e6b7b 50%, #7b6b8a 100%);
  --gradient-warm: linear-gradient(135deg, #f5f0e8 0%, #ffffff 50%, #ede5d8 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(184,149,106,0.1), rgba(158,107,123,0.1));

  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;

  /* Layout */
  --section-padding: 100vh;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  background: var(--bg-primary);
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--primary-black);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 300; letter-spacing: 0.05em; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 300; letter-spacing: 0.04em; }
h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 400; }
h4 { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 500; }

p {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 720px;
  line-height: 1.8;
}

.gradient-text {
  background: var(--gradient-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent-gold);
  margin-bottom: 1rem;
  display: block;
}

/* Speech text — the actual speech content */
.speech-text {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  line-height: 1.9;
  max-width: 800px;
  font-weight: 300;
}

/* === Loading Screen === */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-text {
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 300;
  background: var(--gradient-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* === Progress Bar (Top) === */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--gradient-glow);
  z-index: 10000;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(184, 149, 106, 0.4), 0 0 24px rgba(158, 107, 123, 0.2);
}

/* === Section Navigation Dots (Right Side) === */
#section-nav {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-end;
}

.nav-dot-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.nav-dot-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s var(--ease-smooth);
  white-space: nowrap;
  pointer-events: none;
}

.nav-dot-wrapper:hover .nav-dot-label,
.nav-dot-wrapper.active .nav-dot-label {
  opacity: 1;
  transform: translateX(0);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.3s var(--ease-smooth);
  flex-shrink: 0;
  border: 1.5px solid transparent;
}

.nav-dot-wrapper.active .nav-dot {
  background: var(--accent-gold);
  box-shadow: 0 0 10px rgba(184, 149, 106, 0.5);
  transform: scale(1.4);
  border-color: var(--accent-gold);
}

.nav-dot-wrapper:hover .nav-dot {
  background: var(--accent-rose);
  transform: scale(1.2);
}

/* === Three.js Canvas === */
#three-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* === Sections General === */
.section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 60px;
}

.section-content {
  max-width: 1000px;
  width: 100%;
  position: relative;
  background: rgba(250, 248, 244, 0.88);
  border-radius: 24px;
  padding: 60px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(184, 149, 106, 0.1);
  box-shadow: 0 8px 60px rgba(0,0,0,0.04);
}

.section-tall {
  min-height: 200vh;
}

.section-extra-tall {
  min-height: 280vh;
}

/* === Hero Section === */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: var(--gradient-warm);
}

#hero h1 {
  opacity: 0;
  transform: translateY(40px);
  color: var(--primary-black);
  margin-bottom: 0;
}

.hero-badge {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 400;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
}

.hero-opening-quote {
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(30px);
}

.hero-opening-quote p {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--text-secondary);
  font-weight: 300;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.quote-attribution {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.8rem;
  font-weight: 400;
  font-style: normal;
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeInUp 1s ease 2.5s forwards;
}

.scroll-indicator span {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 400;
}

.scroll-arrow {
  width: 16px;
  height: 16px;
  border-right: 1.5px solid var(--text-dim);
  border-bottom: 1.5px solid var(--text-dim);
  transform: rotate(45deg);
  animation: bounceDown 2.5s ease infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(6px); }
}

@keyframes fadeInUp {
  to { opacity: 1; }
}

/* === Reveal Animations === */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.9s var(--ease-smooth);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.9s var(--ease-smooth);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.9s var(--ease-smooth);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.88);
  transition: all 1.1s var(--ease-smooth);
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* === Narrative Blocks === */
.narrative-block {
  padding: 30px 0;
}

.highlight-quote {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-family: var(--font-heading);
  font-weight: 300;
  line-height: 1.6;
  color: var(--primary-black);
  padding: 40px 0;
  max-width: 850px;
  position: relative;
}

.highlight-quote::before {
  content: '\201C';
  position: absolute;
  top: 10px;
  left: -25px;
  font-size: 5rem;
  background: var(--gradient-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.2;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
}

/* === Cards & Panels === */
.info-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
  transition: all 0.4s var(--ease-smooth);
}

.info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  border-color: rgba(184, 149, 106, 0.15);
}

/* === Vision Cards (Double Vision section) === */
.vision-card {
  padding: 36px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.06);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vision-lived {
  background: linear-gradient(135deg, rgba(184,149,106,0.08), rgba(184,149,106,0.02));
  border-color: rgba(184, 149, 106, 0.15);
}

.vision-inherited {
  background: linear-gradient(135deg, rgba(60,60,60,0.05), rgba(60,60,60,0.01));
  border-color: rgba(60,60,60,0.1);
}

.vision-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 100%;
}

/* === Grid Layouts === */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* === Construct Grid (Section 2 keyword badges) === */
.construct-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 40px 0;
  justify-content: flex-start;
}

.construct-badge {
  padding: 12px 24px;
  background: var(--white);
  border: 1px solid rgba(184, 149, 106, 0.2);
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
}

.construct-badge:hover {
  background: var(--accent-gold-light);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

/* === Flow Arrow Center === */
.flow-arrow-center {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-dim);
  font-weight: 300;
}

/* === Data Flow (Hegemony cycle) === */
.data-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 0;
  flex-wrap: wrap;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
  min-width: 130px;
  background: var(--white);
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.06);
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
  transition: all 0.3s ease;
}

.flow-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.flow-step-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-rose);
}

.flow-arrow {
  font-size: 1.3rem;
  color: var(--text-dim);
  font-weight: 300;
}

/* === Fortress Grid (Room / World cards) === */
.fortress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 40px 0;
}

.fortress-card {
  padding: 36px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.06);
}

.fortress-card.myth {
  background: linear-gradient(135deg, rgba(158,107,123,0.06), rgba(158,107,123,0.01));
  border-color: rgba(158,107,123,0.15);
}

.fortress-card.reality {
  background: linear-gradient(135deg, rgba(44,82,130,0.06), rgba(44,82,130,0.01));
  border-color: rgba(44,82,130,0.12);
}

.fortress-card h4 {
  margin-bottom: 8px;
}

/* === Big Statement (Civilization Work) === */
.big-stat-container {
  text-align: center;
  padding: 60px 0;
}

.big-stat-text {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.big-stat-emphasis {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 300;
  color: var(--primary-black);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

/* === Final Quote === */
.final-quote {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 300;
  line-height: 1.5;
  max-width: 850px;
  margin: 0 auto 30px;
  color: var(--primary-black);
  letter-spacing: 0.01em;
}

/* === Glow Effects (Light theme adapted) === */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
}

.glow-orb.warm {
  background: var(--accent-gold);
}

.glow-orb.rose {
  background: var(--accent-rose);
}

/* === Section Background Glow === */
.section-bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* === Section Divider === */
.section-divider {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 149, 106, 0.15), transparent);
}

/* === Badge System === */
.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: var(--font-heading);
}

.badge-gold {
  background: var(--accent-gold-light);
  color: var(--accent-gold);
}

.badge-rose {
  background: var(--accent-rose-light);
  color: var(--accent-rose);
}

.badge-blue {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
}

.badge-charcoal {
  background: rgba(60,60,60,0.08);
  color: var(--accent-charcoal);
}

/* === Footer / Sources === */
.sources {
  padding: 60px 40px;
  text-align: center;
  background: var(--primary-black);
  color: var(--white);
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--white);
}

.footer-sep {
  color: rgba(255,255,255,0.3);
}

.footer-tagline {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  font-weight: 300;
}

.footer-contact {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
  max-width: 100%;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .section {
    padding: 60px 30px;
  }
  .section-content {
    padding: 40px 30px;
  }
  .two-col, .fortress-grid {
    grid-template-columns: 1fr;
  }
  .three-col {
    grid-template-columns: 1fr 1fr;
  }
  #section-nav {
    display: none;
  }
  .flow-arrow-center {
    display: none;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 40px 20px;
  }
  .section-content {
    padding: 30px 20px;
    border-radius: 16px;
  }
  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  .three-col {
    grid-template-columns: 1fr;
  }
  .data-flow {
    flex-direction: column;
  }
  .flow-arrow {
    transform: rotate(90deg);
  }
  .highlight-quote {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    padding-left: 10px;
  }
  .highlight-quote::before {
    left: -15px;
    font-size: 3.5rem;
  }
  .hero-opening-quote p {
    font-size: clamp(1rem, 3.5vw, 1.2rem);
  }
  .speech-text {
    font-size: clamp(1rem, 3vw, 1.15rem);
  }
}

@media (max-width: 480px) {
  .section {
    padding: 30px 15px;
  }
  .section-content {
    padding: 24px 16px;
    border-radius: 14px;
  }
  .info-card {
    padding: 24px 18px;
  }
  .vision-card {
    padding: 24px 18px;
  }
  .fortress-card {
    padding: 24px 18px;
  }
  .construct-badge {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
  .big-stat-emphasis {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  .final-quote {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }
  .footer-brand {
    flex-direction: column;
    gap: 8px;
  }
  .footer-sep {
    display: none;
  }
}

/* === Smooth scroll-linked opacity for narrative blocks === */
.parallax-fade {
  will-change: opacity, transform;
}
