/* hangeul.day - Horizontal Scroll Ceremonial Experience */
/* Colors: #c9a84c (gold), #b87851 (copper), #0d0a2e (deep indigo), #18102e, #111a3a, #2a1858, #2ad4bf (teal), #d4cdb8 (parchment), #8a7d6a, #0a0820, #1a1040 */

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #0d0a2e;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #d4cdb8;
}

/* Horizontal Scroll Container */
#scroll-container {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  height: 100vh;
  width: 100vw;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

#scroll-container::-webkit-scrollbar {
  display: none;
}

#scroll-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Panel Base */
.panel {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
}

.panel-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 80px;
}

/* Gold Lines */
.gold-line {
  position: absolute;
  left: 60px;
  right: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c9a84c, transparent);
}

.gold-line-top {
  top: 40px;
}

.gold-line-bottom {
  bottom: 40px;
}

/* Panel Backgrounds */
.panel-1 {
  background: linear-gradient(135deg, #0a0820 0%, #0d0a2e 40%, #18102e 100%);
}

.panel-2 {
  background: linear-gradient(135deg, #0d0a2e 0%, #111a3a 100%);
}

.panel-3 {
  background: linear-gradient(135deg, #18102e 0%, #1a1040 100%);
}

.panel-4 {
  background: linear-gradient(135deg, #111a3a 0%, #0d0a2e 100%);
}

.panel-5 {
  background: linear-gradient(135deg, #0a0820 0%, #2a1858 100%);
}

.panel-6 {
  background: linear-gradient(135deg, #18102e 0%, #111a3a 100%);
}

.panel-7 {
  background: linear-gradient(135deg, #0d0a2e 0%, #1a1040 100%);
}

.panel-8 {
  background: linear-gradient(135deg, #0a0820 0%, #0d0a2e 50%, #18102e 100%);
}

/* Panel BG Pattern - subtle grid */
.panel-bg-pattern {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Panel Number */
.panel-number {
  position: absolute;
  top: 40px;
  right: 80px;
  z-index: 3;
}

.panel-number span {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: #8a7d6a;
  text-transform: uppercase;
}

/* ========== PANEL 1: HERO ========== */
.hero-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hero-subtitle {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.25em;
  color: #8a7d6a;
  text-transform: uppercase;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(80px, 12vw, 160px);
  font-weight: 900;
  color: #c9a84c;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-shadow: 0 0 60px rgba(201, 168, 76, 0.3);
}

.hero-title-latin {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 900;
  color: #c9a84c;
  letter-spacing: 0.15em;
  line-height: 0.95;
  text-transform: uppercase;
}

.hero-date {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #b87851;
  margin-top: 8px;
}

.hero-icon {
  margin-top: 24px;
  opacity: 0.7;
}

.hero-icon svg {
  width: 140px;
  height: auto;
}

.scroll-hint {
  position: absolute;
  bottom: 60px;
  right: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-hint-text {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #c9a84c;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: translateX(0); }
  50% { opacity: 0.5; transform: translateX(8px); }
}

/* ========== PANEL CONTENT GRID ========== */
.panel-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  width: 100%;
  max-width: 1200px;
  align-items: center;
}

.panel-text-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 900;
  color: #c9a84c;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: #d4cdb8;
  max-width: 520px;
}

.section-body strong {
  font-weight: 500;
  color: #c9a84c;
}

.section-body em {
  font-style: italic;
  color: #2ad4bf;
}

.panel-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.panel-visual svg {
  width: 220px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.2));
}

/* ========== PANEL 3: JAMO GRID ========== */
.jamo-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 900px;
}

.jamo-intro {
  text-align: center;
  max-width: 600px;
}

.jamo-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  width: 100%;
}

.jamo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  border: 1px solid rgba(201, 168, 76, 0.2);
  background: rgba(201, 168, 76, 0.03);
  transition: all 0.3s ease;
  cursor: default;
}

.jamo-card:hover {
  border-color: #c9a84c;
  background: rgba(201, 168, 76, 0.08);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.15);
}

.jamo-card.jamo-vowel {
  border-color: rgba(42, 212, 191, 0.2);
  background: rgba(42, 212, 191, 0.03);
}

.jamo-card.jamo-vowel:hover {
  border-color: #2ad4bf;
  background: rgba(42, 212, 191, 0.08);
  box-shadow: 0 8px 24px rgba(42, 212, 191, 0.15);
}

.jamo-char {
  font-size: clamp(28px, 4vw, 48px);
  color: #c9a84c;
  line-height: 1;
  margin-bottom: 8px;
}

.jamo-vowel .jamo-char {
  color: #2ad4bf;
}

.jamo-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #8a7d6a;
  text-transform: uppercase;
}

/* ========== PANEL 4: SOUND DIAGRAM ========== */
.sound-diagram {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.sound-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
}

.sound-char {
  font-size: 32px;
  color: #c9a84c;
  width: 50px;
  text-align: center;
  flex-shrink: 0;
}

.sound-desc {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: #d4cdb8;
}

.mouth-diagram {
  width: 240px;
  height: 240px;
}

.mouth-diagram svg {
  width: 100%;
  height: 100%;
}

/* ========== PANEL 5: SYLLABLE BLOCKS ========== */
.syllable-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 900px;
  text-align: center;
}

.syllable-demo {
  display: flex;
  gap: 60px;
  justify-content: center;
  flex-wrap: wrap;
}

.syllable-block-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.block-assembly {
  display: flex;
  align-items: center;
  gap: 12px;
}

.block-piece {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 168, 76, 0.4);
  font-size: 28px;
  color: #c9a84c;
  background: rgba(201, 168, 76, 0.05);
  transition: all 0.4s ease;
}

.block-piece.block-medial {
  color: #2ad4bf;
  border-color: rgba(42, 212, 191, 0.4);
  background: rgba(42, 212, 191, 0.05);
}

.block-plus, .block-equals {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  color: #8a7d6a;
}

.block-result {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #c9a84c;
  font-size: 42px;
  color: #c9a84c;
  background: rgba(201, 168, 76, 0.08);
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.4);
}

.block-label {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #8a7d6a;
}

.syllable-note {
  font-size: 20px;
  font-weight: 400;
  color: #c9a84c;
  margin-top: 16px;
}

/* ========== PANEL 7: MODERN STATS ========== */
.modern-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  max-width: 1000px;
  text-align: center;
}

.modern-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  width: 100%;
}

.modern-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 16px;
  border: 1px solid rgba(201, 168, 76, 0.15);
  background: rgba(201, 168, 76, 0.02);
  transition: border-color 0.3s ease;
}

.modern-stat:hover {
  border-color: #c9a84c;
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 900;
  color: #c9a84c;
  line-height: 1;
}

.stat-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #8a7d6a;
  text-transform: uppercase;
}

.modern-quote {
  font-style: italic;
  font-size: 18px;
  max-width: 700px;
  line-height: 1.8;
  color: #d4cdb8;
}

.quote-attr {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: 13px;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.1em;
  color: #b87851;
}

/* ========== PANEL 8: CLOSING ========== */
.closing-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
}

.closing-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(64px, 10vw, 140px);
  font-weight: 900;
  color: #c9a84c;
  line-height: 0.95;
  text-shadow: 0 0 80px rgba(201, 168, 76, 0.4);
}

.closing-subtitle {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: #b87851;
}

.closing-body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.8;
  color: #d4cdb8;
  max-width: 560px;
}

.closing-emblem {
  margin: 16px 0;
}

.closing-emblem svg {
  width: 100px;
  height: 100px;
  opacity: 0.8;
}

.closing-domain {
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  letter-spacing: 0.3em;
  color: #c9a84c;
  margin-top: 8px;
}

#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ========== NAV DOTS ========== */
#panel-nav {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 100;
}

.nav-dot {
  width: 24px;
  height: 3px;
  background: rgba(201, 168, 76, 0.25);
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-dot.active {
  background: #c9a84c;
  width: 40px;
}

.nav-dot:hover {
  background: rgba(201, 168, 76, 0.6);
}

/* ========== PANEL COUNTER ========== */
#panel-counter {
  position: fixed;
  top: 40px;
  left: 80px;
  z-index: 100;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #8a7d6a;
}

#current-panel {
  color: #c9a84c;
}

/* ========== ANIMATIONS ========== */
.panel-inner > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel.in-view .panel-inner > * {
  opacity: 1;
  transform: translateY(0);
}

.panel.in-view .panel-inner > *:nth-child(1) { transition-delay: 0.1s; }
.panel.in-view .panel-inner > *:nth-child(2) { transition-delay: 0.2s; }
.panel.in-view .panel-inner > *:nth-child(3) { transition-delay: 0.3s; }
.panel.in-view .panel-inner > *:nth-child(4) { transition-delay: 0.4s; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .panel-inner {
    padding: 40px 32px;
  }

  .panel-content-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .jamo-grid {
    grid-template-columns: repeat(5, 1fr);
  }

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

  .scroll-hint {
    right: 32px;
    bottom: 48px;
  }

  #panel-counter {
    left: 32px;
  }

  .panel-number {
    right: 32px;
  }

  .gold-line {
    left: 32px;
    right: 32px;
  }

  .block-assembly {
    gap: 8px;
  }

  .block-piece {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .block-result {
    width: 60px;
    height: 60px;
    font-size: 32px;
  }

  .syllable-demo {
    gap: 32px;
  }
}

@media (max-width: 600px) {
  .jamo-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .jamo-card {
    padding: 10px 4px;
  }

  .modern-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .syllable-demo {
    flex-direction: column;
    gap: 24px;
  }
}
