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

html,
body {
  height: 100%;
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   FULLSCREEN 5-SECOND INTRO OVERLAY
   Light Stage (#F8FAFC) for #0F172A SVG Ink
   ========================================= */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, #ffffff 0%, var(--color-intro-bg) 100%);
  padding: var(--space-lg);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.7s;
}

.intro-overlay.is-hidden {
  opacity: 0;
  transform: scale(1.03);
  visibility: hidden;
  pointer-events: none;
}

.intro-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(92vw, 960px);
}

.intro-logo-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* 5-second progress bar */
.intro-progress-track {
  margin-top: var(--space-lg);
  width: min(220px, 60vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.intro-progress-bar {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--color-brand-cyan), var(--color-border), var(--color-accent));
  animation: progressFill 5s linear forwards;
}

/* =========================================
   MAIN LANDING PAGE (DARK MODE OLED)
   ========================================= */
.main-content {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-lg) clamp(1.25rem, 5vw, var(--space-xl));
  background-color: var(--color-background);
  color: var(--color-foreground);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease 0.15s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

.main-content.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ambient-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(67, 56, 202, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 56, 202, 0.12) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 45%, black 18%, transparent 76%);
  pointer-events: none;
  z-index: 0;
}

.ambient-spotlight {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(85vw, 720px);
  height: min(85vw, 720px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(49, 46, 129, 0.35) 0%,
    rgba(30, 27, 75, 0.18) 45%,
    transparent 72%
  );
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

/* Header */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
}

.header-logo-svg {
  width: clamp(160px, 22vw, 230px);
  height: auto;
  display: block;
}

.header-logo-svg .wordmark {
  font-family: var(--font-logo);
  font-size: 150px;
  font-weight: 700;
}

.header-logo-svg .tagline {
  font-family: var(--font-logo);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

/* Hero Section (Spacious Density 3/10) */
.hero {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(67, 56, 202, 0.55);
  background: rgba(27, 27, 48, 0.85);
  backdrop-filter: blur(10px);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--color-foreground);
}

.pulse-ring {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-accent);
  box-shadow: 0 0 0 0 rgba(202, 138, 4, 0.65);
  animation: pulseDot 2.2s infinite;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 5.4vw, 4.1rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--color-foreground);
  text-shadow: 0 0 10px rgba(248, 250, 252, 0.08);
}

.editorial-accent {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 600;
  background: linear-gradient(95deg, #f8fafc 0%, #eab308 55%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-actions {
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
}

/* Touch & Interaction: min 44x44px, cursor-pointer, 150-300ms hover, visible focus ring */
.replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(67, 56, 202, 0.7);
  background: var(--color-card);
  color: var(--color-card-foreground);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, transform 200ms ease, color 200ms ease;
}

.replay-btn:hover {
  background: var(--color-secondary);
  border-color: var(--color-accent);
  color: var(--color-on-secondary);
  transform: translateY(-1px);
}

.replay-btn:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 3px;
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
}

.visitor-count {
  position: fixed;
  right: 0.65rem;
  bottom: 0.45rem;
  z-index: 10;
  display: inline-flex;
  gap: 0.08em;
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  user-select: none;
}

.visitor-count .digit-0 { color: #64748B; }
.visitor-count .digit-1 { color: #06B6D4; }
.visitor-count .digit-2 { color: #10B981; }
.visitor-count .digit-3 { color: #6366F1; }
.visitor-count .digit-4 { color: #F59E0B; }
.visitor-count .digit-5 { color: #EC4899; }
.visitor-count .digit-6 { color: #8B5CF6; }
.visitor-count .digit-7 { color: #38BDF8; }
.visitor-count .digit-8 { color: #34D399; }
.visitor-count .digit-9 { color: #FB7185; }

/* =========================================
   KEYFRAMES & REDUCED MOTION
   ========================================= */
@keyframes progressFill {
  to {
    transform: scaleX(1);
  }
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(202, 138, 4, 0.65);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(202, 138, 4, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(202, 138, 4, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-overlay,
  .main-content,
  .replay-btn {
    transition: none;
  }

  .pulse-ring {
    animation: none;
  }
}
