/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  /* Lenis handles scroll — disable native smooth */
  scroll-behavior: auto;
}

:root {
  /* SkyGlobal Brand */
  --brand:       #23508e;
  --brand-light: #4a7bc7;
  --brand-pale:  #afd0f5;
  --gold:        #c8a84b;
  --gold-light:  #e8cc7a;

  /* Backgrounds */
  --bg:          #ffffff;
  --bg-surface:  #f4f6f9;

  /* Text */
  --text:        #1a2233;
  --text-muted:  #556070;
  --text-dim:    #a0aab4;

  /* Fonts */
  --font-display: 'Montserrat', sans-serif;
  --font-body:    'Inter', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════
   LOADER
═══════════════════════════════════════════ */
#loader {
  position: fixed;
  inset: 0;
  background: #0d1528;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 2rem;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: #ffffff;
}

.loader-brand span {
  color: #ffffff;
}

.loader-bar-track {
  width: 180px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

#loader-bar {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 0.3s ease;
}

#loader-percent {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.45);
}

/* ═══════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 3rem;
  transition: background 0.5s ease, padding 0.4s ease, border-color 0.5s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.8rem 3rem;
  border-bottom-color: rgba(35, 80, 142, 0.12);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--text);
  text-decoration: none;
}

.nav-logo span {
  color: var(--gold);
}

.nav-logo-img {
  height: 36px;
  max-height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text);
}

.nav-cta {
  border: 1px solid var(--brand);
  color: var(--brand);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 1.4rem;
  transition: background 0.2s, color 0.2s;
}

.nav-cta:hover {
  background: var(--brand);
  color: #ffffff;
}

/* ═══════════════════════════════════════════
   HERO — standalone 100vh
   Sits above scroll container, fades out as
   canvas circle-wipes in
═══════════════════════════════════════════ */
.hero-standalone {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 4rem 5vw 10vh;
  background: var(--bg);
  z-index: 2;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 85vw;
}

.hero-eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero-heading {
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 8vw, 10.4rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.03em;
  display: flex;
  flex-direction: column;
}

.hero-word {
  display: block;
  overflow: hidden; /* for word-clip entrance */
}

.hero-word--accent {
  color: var(--brand);
}

.hero-tagline {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.55;
  max-width: 52ch;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 3.5rem;
  right: 5vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.scroll-arrow {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--brand-light), transparent);
  animation: arrowPulse 2s ease-in-out infinite;
}

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

/* ═══════════════════════════════════════════
   SCROLL BADGE — rotating circular text (hero)
═══════════════════════════════════════════ */
.scroll-badge {
  position: absolute;
  bottom: 3.5rem;
  right: 5vw;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-ring {
  position: absolute;
  inset: 0;
  animation: badgeSpin 10s linear infinite;
}

.badge-text {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  fill: var(--brand);
  text-transform: uppercase;
}

.badge-icon {
  font-size: 1.2rem;
  color: var(--brand);
  font-weight: 300;
  z-index: 1;
  line-height: 1;
}

@keyframes badgeSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   NETWORK CARDS — 003 section left zone
   Fixed horizontal card strip, scroll-driven
═══════════════════════════════════════════ */
#network-cards-wrap {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 48vw;
  overflow: hidden;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#network-cards-strip {
  position: relative;
  width: 100%;
  height: 100%;
}

.network-card-item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28vw;
  aspect-ratio: 1;
  margin-top: -14vw;
  margin-left: -14vw;
  opacity: 0;
}

.network-card-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

/* ═══════════════════════════════════════════
   CANVAS — fixed, full viewport
   Three.js renders the globe here.
   Starts hidden via clip-path circle(0%)
═══════════════════════════════════════════ */
#canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
  clip-path: circle(0% at 50% 50%);
  /* JS drives clip-path — no CSS transition */
}

#globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════
   AIRPLANE CANVAS — scroll-driven frame animation
   Sits above globe (z-index:1), below text sections (z-index:4)
═══════════════════════════════════════════ */
#airplane-canvas {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 45vw;
  right: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

#reach-canvas {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 45vw;
  right: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   DARK OVERLAY
   Fixed, full viewport. Fades in for stats section.
═══════════════════════════════════════════ */
#dark-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: rgba(4, 8, 16, 0.92);
  opacity: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   MARQUEE — fixed horizontal sliding text
   12vw+ font per SKILL.md spec
═══════════════════════════════════════════ */
.marquee-wrap {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.marquee-wrap.marquee-lower {
  top: auto;
  bottom: 7vh;
  transform: none;
}

.marquee-text {
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 12vw;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(35, 80, 142, 0.18);
  will-change: transform;
}

.marquee-lower .marquee-text {
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35);
}

/* ═══════════════════════════════════════════
   SCROLL CONTAINER — 1000vh
   Sections are absolutely positioned within
═══════════════════════════════════════════ */
#scroll-container {
  position: relative;
  height: 1000vh;
}

/* ═══════════════════════════════════════════
   SCROLL SECTIONS — absolutely positioned
   Centered at midpoint of enter/leave range.
   Top is set in JS.
═══════════════════════════════════════════ */
.scroll-section {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 100vh;
  transform: translateY(-50%);
  z-index: 4;
  pointer-events: none;
}

.scroll-section.is-active {
  pointer-events: auto;
}

#s-network.is-pinned {
  position: fixed !important;
  top: 50% !important;
}

/* ── Side-aligned text zones (SKILL.md: outer 40% only) ── */
.align-left {
  padding-left: 5vw;
  padding-right: 55vw;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.align-right {
  padding-left: 55vw;
  padding-right: 5vw;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.section-inner {
  max-width: 40vw;
}

/* ── Section typography ── */
.section-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 1.25rem;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 1.75rem;
}

.section-body {
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  color: var(--text-muted);
  line-height: 1.75;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.section-note {
  font-size: 0.8rem;
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 0.5rem;
}

.section-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.section-list li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 1rem;
  border-left: 1px solid var(--brand-light);
  font-weight: 400;
  transition: color 0.3s ease, font-weight 0.1s, border-left-color 0.3s ease;
}

.section-list li.active {
  font-weight: 800;
  color: var(--brand);
  border-left-color: var(--brand);
  border-left-width: 2px;
}

/* ── University card grid (003 section) ── */
.uni-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.uni-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.uni-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.uni-card:nth-child(5) {
  grid-column: 1 / -1;
  max-width: calc(50% - 0.325rem);
}

.uni-card-name {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

/* ── Country tag list ── */
.country-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 1.75rem;
}

.country-list span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

/* ─────────────────────────────────────────
   STATS SECTION
   Center text is allowed per SKILL.md
   (only exception when dark overlay is active)
───────────────────────────────────────── */
.section-stats {
  justify-content: center;
  align-items: center;
  padding: 5rem 5vw;
  min-height: 100vh;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem 4rem;
  text-align: center;
  max-width: 1000px;
  width: 100%;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.stat-number-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.1em;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 6vw, 7rem);
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
}

.stat-suffix {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 5rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

/* ─────────────────────────────────────────
   CTA BUTTON
───────────────────────────────────────── */
.cta-button {
  display: inline-block;
  background: var(--brand);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1rem 2.5rem;
  margin-top: 2.25rem;
  margin-bottom: 1.5rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cta-button:hover {
  background: var(--brand-light);
  transform: translateX(4px);
}

/* ═══════════════════════════════════════════
   CTA PROFILE CARDS — 006 섹션 인물 카드
   #scroll-container 직접 자식으로 absolute 배치
═══════════════════════════════════════════ */

/* 패널: #s-cta와 동일 위치, scroll-container 기준 absolute */
#cta-profiles-panel {
  position: absolute;
  left: 0;
  top: 96.5%;              /* (93 + 100) / 2 */
  width: 55vw;
  height: 72vh;
  transform: translateY(-50%);
  box-sizing: border-box;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease 0.2s;
}

/* #s-cta.is-active → adjacent sibling 패널 표시 */
#s-cta.is-active + #cta-profiles-panel {
  pointer-events: auto;
  opacity: 1;
}

/* 슬라이드 — cross-fade */
.cta-slide {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 16px;
  padding: 5vh 3.5vw;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
.cta-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* Navigation dots */
#cta-dots {
  position: absolute;
  bottom: 1.5vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.cta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  cursor: pointer;
  transition: background 0.3s ease;
}
.cta-dot.active {
  background: rgba(0,0,0,0.55);
}

/* 카드 — AROMVI 스타일 이미지 리빌 */
.cta-profile-card {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #edeae4;
  border: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
  position: relative;
}

/* 이미지 래퍼: 우하단 기준 썸네일 → 카드 전체 확장 */
.cta-profile-img-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 40px;
  transform-origin: calc(100% - 20px) calc(100% - 20px);
  transform: scale(0.42);
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.cta-profile-card:hover .cta-profile-img-wrap {
  transform: scale(1);
  border-radius: 16px;
}

.cta-profile-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* 텍스트: 상단 절대 위치, 크림 그라디언트 배경 */
.cta-profile-info {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 22px 22px;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(237,234,228,0.98) 0%, rgba(237,234,228,0) 100%);
}

.cta-profile-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cta-profile-role {
  font-size: 0.78rem;
  color: #555555;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}
.cta-profile-countries {
  font-size: 0.72rem;
  color: rgba(0,0,0,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════
   MOBILE — ≤768px
   Collapse side-aligned zones, reduce scroll height,
   add backdrop to text for readability
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  #scroll-container {
    height: 550vh;
  }

  .align-left,
  .align-right {
    padding: 5rem 6vw;
  }

  .section-inner {
    max-width: 100%;
    background: rgba(255, 255, 255, 0.88);
    padding: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 2rem;
  }

  .marquee-text {
    font-size: 18vw;
  }

  .nav-links .nav-link {
    display: none;
  }

  .site-header {
    padding: 1.25rem 1.5rem;
  }

  .hero-standalone {
    padding: 0 6vw 10vh;
    height: 100dvh;
  }

  /* Fix: reach-canvas 숨김 → 005 섹션 침범 방지 */
  #reach-canvas {
    display: none;
  }

  /* Fix: CTA 프로필 카드 패널 숨김 → 006 텍스트 덮임 방지 */
  #cta-profiles-panel {
    display: none;
  }
}

/* ═══════════════════════════════════════════
   ACCESSIBILITY
═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  .scroll-arrow {
    animation: none;
  }
}
