/* ============================================================
   EDISON TECH — Logo Intro Animation + Horizontal Scroll
   ============================================================ */

/* ══════════════════════════════════════════════════════════════
   LOGO INTRO
══════════════════════════════════════════════════════════════ */

.logo-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--navy-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  /* Circuit grid same as hero */
  background-image:
    linear-gradient(rgba(116,167,199,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116,167,199,0.05) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Dismiss transition: iris clip-path closing */
.logo-intro.dismissing {
  clip-path: circle(150% at 50% 50%);
  animation: iris-close 1.1s cubic-bezier(0.7, 0, 0.3, 1) forwards;
  pointer-events: none;
}

@keyframes iris-close {
  from { clip-path: circle(150% at 50% 50%); }
  to   { clip-path: circle(0% at 50% 50%);   }
}

/* ── Sonar rings ── */
.intro-sonar {
  position: absolute;
  width: 300px; height: 300px;
  display: grid;
  place-items: center;
}

.sonar-ring {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 1.5px solid rgba(200,153,56,0.5);
  animation: sonar-pulse 3s var(--d, 0s) ease-out infinite;
  pointer-events: none;
}

.sonar-ring:nth-child(even) {
  border-color: rgba(116,167,199,0.4);
}

@keyframes sonar-pulse {
  0%   { transform: scale(0.3); opacity: 0.9; }
  100% { transform: scale(3.5); opacity: 0; }
}

/* ── Logo ── */
.intro-logo-wrap {
  position: relative;
  z-index: 2;
  margin-bottom: 2rem;
  transform-style: preserve-3d;
  perspective: 600px;
  /* 3D tilt handled by JS */
}

.intro-logo-img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  /* Power-on flicker animation */
  animation: logo-power-on 1.6s ease-out forwards;
  filter: brightness(0) drop-shadow(0 0 0px transparent);
  will-change: filter, transform;
}

@keyframes logo-power-on {
  0%   { filter: brightness(0) drop-shadow(0 0 0px transparent);              transform: scale(0.8);  }
  18%  { filter: brightness(0.25) drop-shadow(0 0 6px rgba(200,153,56,0.3));  transform: scale(0.88); }
  22%  { filter: brightness(0) drop-shadow(0 0 0px transparent);              transform: scale(0.88); }
  38%  { filter: brightness(0.55) drop-shadow(0 0 14px rgba(200,153,56,0.5)); transform: scale(0.95); }
  40%  { filter: brightness(0.2) drop-shadow(0 0 4px rgba(200,153,56,0.2));  transform: scale(0.95); }
  55%  { filter: brightness(1) drop-shadow(0 0 28px rgba(200,153,56,0.75));   transform: scale(1.02); }
  72%  { filter: brightness(1.08) drop-shadow(0 0 40px rgba(249,247,35,0.4)); transform: scale(1.04); }
  85%  { filter: brightness(1) drop-shadow(0 0 22px rgba(200,153,56,0.6));    transform: scale(1);    }
  100% { filter: brightness(1) drop-shadow(0 0 25px rgba(200,153,56,0.55));   transform: scale(1);    }
}

/* Steady glow pulse after power-on */
.intro-logo-img.powered {
  animation: logo-power-on 1.6s ease-out forwards,
             logo-glow-pulse 3s 1.8s ease-in-out infinite;
}

@keyframes logo-glow-pulse {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 20px rgba(200,153,56,0.5)); }
  50%       { filter: brightness(1.07) drop-shadow(0 0 38px rgba(249,247,35,0.35)); }
}

/* 3D tilt on mouse (JS-driven via CSS var) */
.intro-logo-wrap {
  --rx: 0deg;
  --ry: 0deg;
  transform: perspective(600px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.1s linear;
}

/* ── Typewriter tagline ── */
.intro-typed-wrap {
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--silver);
  z-index: 2;
  min-height: 1.4em;
  display: flex;
  align-items: center;
  gap: 0;
}

.intro-cursor {
  color: var(--gold);
  font-weight: 300;
  animation: blink-cursor 0.7s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Click hint ── */
.intro-click-hint {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 1.8rem;
  z-index: 2;
  opacity: 0;
  animation: hint-appear 0.8s 3.2s ease forwards;
}

@keyframes hint-appear {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ── Skip button ── */
.intro-skip-btn {
  position: absolute;
  bottom: 2rem; right: 2rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  animation: hint-appear 0.6s 1.5s forwards;
}

.intro-skip-btn:hover {
  background: rgba(200,153,56,0.15);
  border-color: rgba(200,153,56,0.4);
  color: var(--gold);
}

/* Hide body scroll while intro is active */
body.intro-active {
  overflow: hidden;
}


/* ══════════════════════════════════════════════════════════════
   HORIZONTAL SCROLL SECTION — DESKTOP
══════════════════════════════════════════════════════════════ */

/* The section gets height set dynamically by JS (numPanels * 100vh) */
.h-scroll-section {
  position: relative;
  background: var(--navy-dark);
}

/* Sticky wrapper that pins the visual content */
.h-scroll-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark) 0%, #0d2035 100%);
  /* Circuit grid */
  background-image:
    linear-gradient(135deg, var(--navy-dark) 0%, #0d2035 100%),
    linear-gradient(rgba(116,167,199,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116,167,199,0.04) 1px, transparent 1px);
  background-size: 100%, 80px 80px, 80px 80px;
}

/* Section label and title top-left */
.h-scroll-label {
  position: absolute;
  top: clamp(4.5rem, 10vh, 6rem);
  left: clamp(1.5rem, 5vw, 5rem);
  z-index: 3;
}

.h-scroll-title {
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  margin-top: 0.2rem;
}
.h-scroll-title span { color: var(--gold); }

/* Viewport clips the track */
.h-scroll-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* The track moves horizontally via JS translateX */
.h-scroll-track {
  display: flex;
  height: 100%;
  will-change: transform;
  transition: transform 0.05s linear; /* very slight smoothing */
}

/* ── Individual panel ── */
.h-panel {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
}

/* Large watermark number */
.h-panel-num {
  position: absolute;
  right: 4vw;
  bottom: -0.1em;
  font-family: var(--font-title);
  font-size: clamp(10rem, 22vw, 18rem);
  font-weight: 900;
  line-height: 1;
  color: rgba(255,255,255,0.025);
  user-select: none;
  pointer-events: none;
  letter-spacing: -0.04em;
}

/* Panel inner content */
.h-panel-inner {
  max-width: 640px;
  width: 100%;
  padding: 3rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 2rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  z-index: 2;
  /* Entry animation driven by JS class */
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}

.h-panel-inner.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Panel icon */
.h-panel-icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--accent, #74A7C7);
  margin-bottom: 1.5rem;
  box-shadow: 0 0 30px rgba(116,167,199,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.h-panel-inner:hover .h-panel-icon {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 0 40px rgba(116,167,199,0.3);
}

/* Tag / category */
.h-panel-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.7rem;
}

/* Panel title */
.h-panel-title {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 800;
}

.h-panel-title em {
  font-style: normal;
  color: var(--gold);
  display: block;
}

/* Description */
.h-panel-desc {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.75;
  margin-bottom: 1.8rem;
}

/* Stat box */
.h-panel-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 1rem 1.4rem;
}

.h-stat-big {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

.h-stat-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
}

/* ── Progress bar ── */
.h-progress-bar {
  position: absolute;
  bottom: 2rem;
  left: clamp(1.5rem, 5vw, 5rem);
  right: clamp(1.5rem, 5vw, 5rem);
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  z-index: 4;
}

.h-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--yellow));
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

/* ── Panel counter ── */
.h-panel-counter {
  position: absolute;
  bottom: 2.8rem;
  right: clamp(1.5rem, 5vw, 5rem);
  font-family: var(--font-title);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
  z-index: 4;
  letter-spacing: 0.05em;
}

#hCurrentPanel {
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
}

/* ── Scroll hint ── */
.h-scroll-down-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 4;
  animation: bounce-subtle 2s ease-in-out infinite;
  transition: opacity var(--transition);
}

.h-scroll-down-hint.hidden { opacity: 0; pointer-events: none; }

@keyframes bounce-subtle {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(5px); }
}

/* ── Mobile fallback ── */
.h-mobile-fallback {
  display: none;
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
}

.h-mobile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-top: 2.5rem;
}

.h-mobile-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.6rem;
  text-align: center;
  transition: var(--transition);
}

.h-mobile-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--gold);
  transform: translateY(-4px);
}

.h-mobile-card i {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
  display: block;
}

.h-mobile-card h3 {
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.h-mobile-card p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
}

/* ── Responsive: swap desktop/mobile ── */
@media (max-width: 768px) {
  /* Hide desktop version */
  .h-scroll-sticky { display: none; }
  /* Show mobile grid */
  .h-mobile-fallback { display: block; }
  /* Reset section height (JS won't run on mobile) */
  .h-scroll-section { height: auto !important; }
}
