/* ══════════════════════════════════════════════════════════════
   hero-3d.css — Informática Oleiros
   Three.js scroll-driven laptop hero
   ══════════════════════════════════════════════════════════════ */

/* Scoped to the hero section only — these names (--text, --dark…) collide with
   style.css's site-wide :root variables and must not leak into the rest of the page. */
#io-hero-3d {
  --teal:         #00b4cc;
  --teal-mid:     #007a8a;
  --teal-dim:     #004a55;
  --dark:         #0a3540;
  --text:         #f0f4f8;
  --text-muted:   rgba(240,244,248,0.55);
  --glass-bg:     rgba(8,12,22,0.72);
  --glass-border: rgba(0,180,204,0.22);
  --glass-blur:   14px;
}

/* ── Hero wrapper — one viewport tall, animation plays on load, not on scroll ── */
#io-hero-3d {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  background: var(--dark);
}

/* ── Sticky viewport ────────────────────────────────────────── */
#io-hero-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--dark);
}

/* ── Canvas ─────────────────────────────────────────────────── */
#io-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ── Labels overlay ─────────────────────────────────────────── */
#io-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.io-label {
  position: absolute;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  will-change: transform, opacity;
}

.io-label.visible {
  opacity: 1;
}

.io-label-box {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 8px;
  padding: 7px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
}

.io-label-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  line-height: 1.3;
}

.io-label-sub {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 9.5px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

/* ── Final hero text ────────────────────────────────────────── */
#io-hero-text {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: min(580px, 88vw);
  opacity: 0;
  pointer-events: none;
  transition: none; /* driven by GSAP */
}

#io-hero-text.active {
  pointer-events: auto;
}

#io-hero-text h1 {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 0.8rem;
  letter-spacing: -0.02em;
}

.io-h1-accent {
  color: var(--teal);
}

.io-services {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: clamp(0.7rem, 1.1vw, 0.82rem);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin: 0 0 1.6rem;
  line-height: 1.6;
}

.io-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal);
  color: #fff;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 13px 30px;
  border-radius: 50px;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.25s, box-shadow 0.25s, transform 0.2s;
  box-shadow: 0 0 0 0 rgba(0,180,204,0);
}

.io-cta:hover {
  background: var(--teal-mid);
  box-shadow: 0 0 32px rgba(0,180,204,0.35);
  transform: translateY(-2px);
}

/* ── Scroll hint ────────────────────────────────────────────── */
.io-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: shBounce 2.2s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 0.4s;
}

.io-scroll-hint.hidden { opacity: 0; }

.io-scroll-hint::after {
  content: '';
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, rgba(0,180,204,0.7), transparent);
}

@keyframes shBounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(7px); }
}

/* ── Progress bar ───────────────────────────────────────────── */
.io-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 1.5px;
  width: 0%;
  background: linear-gradient(to right, var(--teal-dim), var(--teal));
  opacity: 0.7;
  transition: width 0.08s;
  pointer-events: none;
}

/* ── Phase label (top-left) ─────────────────────────────────── */
.io-phase-label {
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.io-phase-label.visible { opacity: 1; }

/* ── WebGL fallback ─────────────────────────────────────────────
   Visible by default so that a blocked/failed script (CDN import,
   WebGL unavailable, any startup error) still shows the logo, title
   and CTA instead of a blank hero. hero-3d.js hides it once the 3D
   scene is confirmed running. ──────────────────────────────────── */
#io-fallback {
  display: flex;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  gap: 2rem;
  text-align: center;
  padding: 2rem;
}

#io-fallback.hidden { display: none; }

.io-fallback-icon {
  font-size: 3.5rem;
  opacity: 0.5;
  filter: grayscale(1);
}

.io-fallback-logo { width: 180px; height: auto; }

.io-fallback-body .io-fallback-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--text);
  margin: 0 0 0.6rem;
  font-weight: 700;
}

.io-fallback-body p {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0 0 1.5rem;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #io-hero-3d { height: 100vh; }
  .io-scroll-hint { display: none; }
  #io-hero-text {
    opacity: 1 !important;
    pointer-events: auto !important;
    bottom: 10%;
  }
  .io-label { transition: none; }
}
