/* ============================================================
   Infirst Global — Visual Enhancement Layer
   Global atmosphere, section flow, dynamic elements
   ============================================================ */

/* ── Page-wide noise texture overlay ────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ── Global ambient gradient bg ─────────────────────────── */
body {
  background-image:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(245,166,35,0.045) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(139,37,0,0.03) 0%, transparent 55%);
  background-attachment: fixed;
}

/* ── Section alternating backgrounds ────────────────────── */
#about    { background: #FFFFFF; }
#philosophy {
  background: linear-gradient(180deg, #FAFAF8 0%, #F5F1EC 100%);
  position: relative;
}
#structure { background: #FFFFFF; }
#brands {
  background: linear-gradient(180deg, #F5F1EC 0%, #FAFAF8 100%);
}
#business  { background: #FFFFFF; }
/* technology is already dark charcoal */
#partners {
  background: linear-gradient(180deg, #F5F1EC 0%, #FAFAF8 100%);
}
#partnership { background: #FFFFFF; }
#contact {
  background: linear-gradient(180deg, #FAFAF8 0%, #F0ECE7 100%);
}

/* ── Diagonal section separators ────────────────────────── */
.section-wave-top,
.section-wave-bot {
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.section-wave-top { top: -1px; }
.section-wave-bot { bottom: -1px; }

/* ── Page-level dotted grid (subtle) ─────────────────────── */
.page-grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(61,61,61,0.055) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 30%, transparent 100%);
  opacity: 0.45;
}

/* Make all sections sit above fixed bg layers */
section, header, footer {
  position: relative;
  z-index: 1;
}

/* ── HERO with Globe ──────────────────────────────────────── */
#hero {
  background: #FAFAF8;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Full-width 2-col grid — NOT inside .container */
.hero-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  width: 100%;
}

/* LEFT column: padded like a container, content left-aligned */
.hero-left {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 8rem 3rem 5rem calc((100vw - 1200px) / 2 + 2rem);
  background: transparent;
}

/* Fallback for small viewports where calc goes negative */
@supports not (padding-left: max(2rem, 2rem)) {
  .hero-left { padding-left: 3rem; }
}
.hero-left {
  padding-left: max(2rem, calc((100vw - 1200px) / 2 + 2rem));
}

.hero-left-inner {
  max-width: 560px;
  width: 100%;
}

/* RIGHT column: globe fills entire half */
.hero-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
    rgba(245,166,35,0.03) 0%,
    rgba(250,250,248,0) 50%,
    rgba(139,37,0,0.025) 100%);
  overflow: hidden;
}

/* Subtle right-panel top border accent */
.hero-right::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.25), transparent);
}

#globe-canvas {
  width: 90%;
  max-width: 560px;
  height: 560px;
  display: block;
  cursor: grab;
  flex-shrink: 0;
}
#globe-canvas:active { cursor: grabbing; }

/* Glow beneath globe */
.globe-glow {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 50px;
  background: radial-gradient(ellipse at center, rgba(245,166,35,0.16) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
  filter: blur(16px);
}

/* ── TICKER STRIP ─────────────────────────────────────────── */
#global-ticker {
  background: var(--charcoal);
  overflow: hidden;
  padding: 0.6rem 0;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(245,166,35,0.15);
  border-bottom: 1px solid rgba(245,166,35,0.15);
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  will-change: transform;
}

.ticker-track span {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
  padding: 0 1rem;
  animation: tickerScroll 42s linear infinite;
  font-family: 'Inter', sans-serif;
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── WORLD MAP section (about bg) ────────────────────────── */
.worldmap-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}

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

#about {
  position: relative;
  overflow: hidden;
}

#about .container {
  position: relative;
  z-index: 2;
}

/* ── FLOATING MERIDIAN LINES (hero decor) ────────────────── */
.meridian-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.meridian-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(245,166,35,0.07) 30%, rgba(245,166,35,0.07) 70%, transparent);
  animation: meridianPulse var(--dur, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes meridianPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ── SECTION number labels ────────────────────────────────── */
.section-num {
  position: absolute;
  top: 3rem;
  right: 2rem;
  font-size: 5rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  color: rgba(245,166,35,0.055);
  letter-spacing: -0.05em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* ── ANIMATED COUNTER stats ──────────────────────────────── */
.stat-value[data-count] {
  transition: none;
}

/* ── PHILOSOPHY: floating keyword chips ───────────────────── */
.philosophy-keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245,166,35,0.07);
  border: 1px solid rgba(245,166,35,0.18);
  border-radius: 100px;
  padding: 0.3rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--charcoal);
  letter-spacing: 0.04em;
  animation: chipFloat var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ── STRUCTURE: animated flow arrows ─────────────────────── */
.structure-flow-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 0 0 2rem;
}

.flow-arrow-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.3), transparent);
  position: relative;
  overflow: hidden;
}

.flow-arrow-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.8), transparent);
  animation: flowPulse 3s ease-in-out infinite;
}

.flow-arrow-line:nth-child(2)::after { animation-delay: 1s; }
.flow-arrow-line:nth-child(4)::after { animation-delay: 2s; }

@keyframes flowPulse {
  0% { left: -100%; }
  100% { left: 100%; }
}

.flow-arrow-node {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0 rgba(245,166,35,0.4);
  animation: nodePulse 2s ease-out infinite;
}

@keyframes nodePulse {
  0% { box-shadow: 0 0 0 0 rgba(245,166,35,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(245,166,35,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); }
}

/* ── NUMBERS STRIP ────────────────────────────────────────── */
#numbers-strip {
  background: var(--charcoal);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

#numbers-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 20% 50%, rgba(245,166,35,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 80% 50%, rgba(139,37,0,0.05) 0%, transparent 60%);
}

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.number-item {
  padding: 2.5rem 2rem;
  background: rgba(255,255,255,0.01);
  text-align: center;
  transition: background var(--transition);
}

.number-item:hover { background: rgba(245,166,35,0.06); }

.number-val {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--orange);
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.number-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
  word-break: keep-all;
}

/* ── MARQUEE BRAND STRIP ─────────────────────────────────── */
#brand-marquee {
  padding: 2.5rem 0;
  background: #FAFAF8;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marqueeScroll 30s linear infinite;
}

.marquee-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--transition);
}

.marquee-item:hover { color: var(--orange); }

.marquee-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--orange);
  opacity: 0.5;
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── HERO stat bar ────────────────────────────────────────── */
.hero-stat-bar {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--orange);
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.03em;
  line-height: 1;
}

.hero-stat-lbl {
  font-size: 0.72rem;
  color: var(--gray);
  letter-spacing: 0.04em;
  word-break: keep-all;
}

/* ── SCROLL-TRIGGERED section entry line ─────────────────── */
.section-entry-line {
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--redbrown));
  border-radius: 2px;
  margin-bottom: 1.5rem;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1) 0.1s;
}
.fade-up.visible ~ .section-entry-line,
.section-entry-line.visible {
  transform: scaleX(1);
}

/* ── DARK SECTION ambient ─────────────────────────────────── */
#technology {
  position: relative;
}
#technology .tech-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245,166,35,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,166,35,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
#technology .container { position: relative; z-index: 2; }

/* ── PARTNERSHIP section diagonal bg ──────────────────────── */
#partnership {
  position: relative;
  overflow: hidden;
}
#partnership::before {
  content: '';
  position: absolute;
  right: -10%;
  top: -20%;
  width: 55%;
  height: 140%;
  background: linear-gradient(135deg, rgba(245,166,35,0.04) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}

/* ── CONTACT section pattern ──────────────────────────────── */
#contact::after {
  content: '';
  position: absolute;
  left: -5%;
  bottom: 0;
  width: 40%;
  height: 60%;
  background: radial-gradient(ellipse at bottom left, rgba(139,37,0,0.03) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ── Animated border gradient cards ──────────────────────── */
.animated-border {
  position: relative;
}
.animated-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(245,166,35,0.3), transparent 40%, rgba(139,37,0,0.2));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}
.animated-border:hover::before { opacity: 1; }

/* ── Live dot indicator ──────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4CAF50;
  box-shadow: 0 0 0 0 rgba(76,175,80,0.4);
  animation: livePulse 2s ease-out infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(76,175,80,0.4); }
  70% { box-shadow: 0 0 0 7px rgba(76,175,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
/* ─ 태블릿: 1컬럼으로 스택 ─────────────────────────────── */
@media (max-width: 960px) {
  .hero-two-col {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  /* 텍스트 좌측 패딩을 표준 컨테이너와 동일하게 */
  .hero-left {
    padding: 7rem 2rem 2.5rem 2rem;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .hero-left-inner {
    max-width: 100%;
  }

  /* 글로브 패널: 텍스트 아래 */
  .hero-right {
    min-height: 320px;
    padding: 0 2rem 4rem;
  }

  #globe-canvas {
    width: 100%;
    max-width: 420px;
    height: 320px;
  }

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

/* ─ 모바일 ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero-left {
    padding: 6rem 1.5rem 2rem 1.5rem;
  }

  .hero-right {
    min-height: 260px;
    padding: 0 1.5rem 3rem;
  }

  #globe-canvas {
    height: 260px;
  }

  .hero-stat-bar {
    flex-wrap: wrap;
    gap: 1.25rem;
  }

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

  .section-num { display: none; }
}
