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

:root {
  --navy: #0a1628;
  --navy-mid: #0d1f3c;
  --navy-light: #142d54;
  --horizon: #1a6b8a;
  --sky: #4db8d8;
  --gold: #d4a853;
  --mist: #e8f0f8;
  --font-th: 'IBM Plex Sans Thai', 'Sarabun', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-th);
  background: var(--navy);
  color: var(--mist);
  line-height: 1.7;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

/* === Hero === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, #050d1a 0%, var(--navy) 40%, var(--navy-mid) 100%);
}

.ocean-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 80%, rgba(26, 107, 138, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 30% 60%, rgba(77, 184, 216, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sky);
  border: 1px solid rgba(77, 184, 216, 0.3);
  border-radius: 2rem;
  padding: 0.4rem 1.2rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.3s;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.5s;
}

.hero-subtitle-th {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--mist);
  max-width: 600px;
  margin: 0 auto 0.75rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.7s;
}

.hero-subtitle-en {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgba(232, 240, 248, 0.45);
  max-width: 550px;
  margin: 0 auto 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.9s;
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  z-index: 3;
}

.hero-wave svg {
  display: block;
  width: 100%;
  height: 80px;
}

.wave-path {
  animation: waveShift 6s ease-in-out infinite alternate;
}

@keyframes waveShift {
  0% { d: path("M0,60 C360,120 720,0 1080,60 C1260,90 1380,80 1440,60 L1440,120 L0,120 Z"); }
  100% { d: path("M0,70 C360,10 720,100 1080,50 C1260,30 1380,70 1440,60 L1440,120 L0,120 Z"); }
}

.scroll-hint {
  position: absolute;
  bottom: 6rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(232, 240, 248, 0.35);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 1.2s;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid rgba(232, 240, 248, 0.35);
  border-bottom: 2px solid rgba(232, 240, 248, 0.35);
  transform: rotate(45deg);
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(6px); }
}

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

/* === Section Titles === */
.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title .th {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #fff;
}

.section-title .en {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--sky);
  margin-top: 0.3rem;
  letter-spacing: 0.08em;
}

.section-desc {
  text-align: center;
  max-width: 600px;
  margin: -1.5rem auto 3rem;
  color: rgba(232, 240, 248, 0.6);
  font-size: 0.95rem;
}

/* === Oracle Cards === */
.oracles-section {
  background: var(--navy-mid);
}

.oracle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.oracle-card {
  position: relative;
  background: linear-gradient(165deg, rgba(20, 45, 84, 0.8) 0%, rgba(10, 22, 40, 0.9) 100%);
  border: 1px solid rgba(77, 184, 216, 0.1);
  border-radius: 1rem;
  padding: 2rem 1.5rem 1.5rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.oracle-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent, var(--horizon));
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, var(--card-accent, var(--horizon)) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.oracle-card:hover .card-glow {
  opacity: 0.04;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.oracle-icon {
  font-size: 2rem;
  line-height: 1;
}

.oracle-role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--card-accent, var(--sky));
  letter-spacing: 0.05em;
}

.oracle-name {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.oracle-codename {
  font-size: 0.85rem;
  color: rgba(232, 240, 248, 0.5);
  margin-bottom: 1rem;
}

.oracle-tagline {
  font-size: 0.9rem;
  color: var(--gold);
  border-left: 3px solid var(--card-accent, var(--horizon));
  padding-left: 0.75rem;
  margin-bottom: 1.25rem;
  font-style: italic;
}

.oracle-meta {
  margin-bottom: 1rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(232, 240, 248, 0.06);
}

.meta-label {
  font-size: 0.8rem;
  color: rgba(232, 240, 248, 0.4);
  font-family: var(--font-mono);
}

.meta-value {
  font-size: 0.85rem;
  color: var(--mist);
}

.oracle-purpose {
  font-size: 0.9rem;
  color: rgba(232, 240, 248, 0.65);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.oracle-theme-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.color-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(232, 240, 248, 0.4);
}

/* === Timeline === */
.timeline-section {
  background: var(--navy);
}

.timeline {
  position: relative;
  max-width: 650px;
  margin: 0 auto;
  padding-left: 2rem;
}

.timeline-line {
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--horizon) 0%, rgba(26, 107, 138, 0.2) 100%);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
  padding-left: 1.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.35rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--navy);
  box-shadow: 0 0 0 2px currentColor;
}

.timeline-content {
  background: rgba(20, 45, 84, 0.5);
  border: 1px solid rgba(77, 184, 216, 0.08);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--sky);
  letter-spacing: 0.05em;
}

.timeline-content h4 {
  color: #fff;
  font-size: 1.05rem;
  margin: 0.4rem 0;
}

.timeline-content p {
  font-size: 0.88rem;
  color: rgba(232, 240, 248, 0.55);
}

/* === Principles === */
.principles-section {
  background: linear-gradient(180deg, var(--navy-mid) 0%, var(--navy) 100%);
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.principle-card {
  background: rgba(20, 45, 84, 0.4);
  border: 1px solid rgba(77, 184, 216, 0.08);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.principle-card:hover {
  border-color: rgba(212, 168, 83, 0.3);
  background: rgba(20, 45, 84, 0.6);
}

.principle-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: rgba(212, 168, 83, 0.25);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.principle-card h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.principle-card p {
  font-size: 0.9rem;
  color: rgba(232, 240, 248, 0.55);
}

/* === Footer === */
.footer {
  padding: 3rem 0;
  text-align: center;
  background: #050d1a;
  border-top: 1px solid rgba(77, 184, 216, 0.08);
}

.footer-quote {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.footer-attr {
  font-size: 0.85rem;
  color: rgba(232, 240, 248, 0.4);
  margin-bottom: 0.5rem;
}

.footer-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(232, 240, 248, 0.2);
}

/* === Scroll Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 768px) {
  .section {
    padding: 3.5rem 0;
  }

  .oracle-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .principles-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .hero-wave svg {
    height: 50px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .oracle-card {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .timeline-item {
    padding-left: 1rem;
  }

  .timeline-dot {
    left: -1rem;
  }
}
