/* ============================================
   QUI AI — Page-Specific Styles (Dark Blue AI)
   ============================================ */

/* ==========================================
   HOME — HERO SECTION
   ========================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  color: var(--color-text-primary);
  background: var(--color-bg);
}

/* Video / Poster */
.hero__video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__video {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.hero__video.is-loaded { opacity: 0.5; }

/* Pexels iframe background */
.hero__iframe-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.hero__iframe-wrap iframe {
  position: absolute;
  top: 50%; left: 50%;
  width: 177.78vh; /* 16:9 */
  height: 56.25vw;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border: none;
  opacity: 0.45;
}

.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

/* Overlays */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  z-index: 1;
}
.hero__overlay-color {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(59,130,246,0.12) 0%,
    transparent 50%,
    rgba(139,92,246,0.08) 100%
  );
  z-index: 2;
}

/* Neural Canvas */
#neural-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.55;
}

/* Hero Content */
.hero__content {
  position: relative;
  z-index: 5;
  max-width: 900px;
  padding: 0 var(--gutter);
  padding-top: 80px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accent-2);
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.25);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-8);
  animation: fadeSlideDown 0.8s var(--ease-out) forwards;
}

.hero__badge-dot {
  width: 5px; height: 5px;
  background: var(--color-accent-2);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-accent-2);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero__heading {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-6);
  animation: fadeSlideUp 0.9s var(--ease-out) 0.15s both;
}

.hero__heading-accent {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

/* Animated underline glow */
.hero__heading-accent::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-primary);
  filter: blur(2px);
  animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; transform: scaleX(1); }
  50%       { opacity: 1;   transform: scaleX(1.02); }
}

.hero__tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  line-height: var(--leading-snug);
  min-height: 2em;
  animation: fadeSlideUp 0.9s var(--ease-out) 0.3s both;
}

/* Typewriter cursor */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--color-accent-2);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink-cursor 0.8s step-end infinite;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  animation: fadeSlideUp 0.9s var(--ease-out) 0.45s both;
}

/* Scroll indicator */
.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-10);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  animation: fadeIn 1.5s ease 1s both;
}
.scroll-mouse {
  width: 22px; height: 36px;
  border: 1px solid rgba(59,130,246,0.4);
  border-radius: 11px;
  position: relative;
  display: flex;
  justify-content: center;
}
.scroll-mouse::after {
  content: '';
  width: 3px; height: 7px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  margin-top: 6px;
  animation: scroll-mouse 2s ease-in-out infinite;
  box-shadow: 0 0 6px var(--color-accent);
}
@keyframes scroll-mouse {
  0%   { transform: translateY(0); opacity: 1; }
  80%  { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* Animation keyframes */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ==========================================
   HOME — MISSION SECTION
   ========================================== */

.mission-section {
  padding: var(--space-32) var(--gutter);
  position: relative;
  text-align: center;
  overflow: hidden;
}
.mission-section::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 1px; height: 80px;
  background: linear-gradient(to bottom, transparent, var(--color-accent));
  opacity: 0.6;
}

.mission-quote {
  max-width: 780px;
  margin: 0 auto;
}
.mission-quote__text {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  color: var(--color-text-primary);
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-6);
}
.mission-quote__text .highlight {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mission-quote__attr {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
}


/* ==========================================
   HOME — PILLARS / FEATURES GRID
   ========================================== */

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 900px) { .pillars-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .pillars-grid { grid-template-columns: 1fr; } }


/* ==========================================
   HOME — STATS STRIP
   ========================================== */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(59,130,246,0.04);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}
.stats-strip::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.5;
}

.stat-item {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  border-right: 1px solid var(--color-border);
  position: relative;
}
.stat-item:last-child { border-right: none; }

.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-2);
  display: block;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

@media (max-width: 560px) {
  .stats-strip { grid-template-columns: 1fr; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--color-border); }
}


/* ==========================================
   PRODUCTS — HERO
   ========================================== */

.products-hero {
  padding: calc(80px + var(--space-20)) var(--gutter) var(--space-20);
  background: var(--color-bg-2);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.products-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(59,130,246,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.products-hero__title { color: var(--color-text-primary); position: relative; z-index: 1; }
.products-hero__subtitle {
  color: var(--color-text-secondary);
  max-width: 540px;
  margin: var(--space-4) auto 0;
  position: relative; z-index: 1;
}

/* Service number */
.service-number {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: rgba(59,130,246,0.1);
  line-height: 1;
  margin-bottom: var(--space-4);
  transition: color var(--duration-base);
}
.card:hover .service-number { color: rgba(59,130,246,0.25); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-16);
}


/* ==========================================
   TEAM PAGE — HERO
   ========================================== */

.team-page-hero {
  padding: calc(80px + var(--space-20)) var(--gutter) var(--space-20);
  background: var(--color-bg-2);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.team-page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 65% 35%, rgba(139,92,246,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.team-page-hero__title { color: var(--color-text-primary); position: relative; z-index: 1; }
.team-page-hero__subtitle {
  color: var(--color-text-secondary);
  max-width: 480px;
  margin: var(--space-4) auto 0;
  position: relative; z-index: 1;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-10);
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 700px) {
  .team-grid { grid-template-columns: 1fr; max-width: 460px; }
}


/* ==========================================
   TEAM — VALUES STRIP
   ========================================== */

.values-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-border);
}
.value-item {
  background: var(--color-bg-2);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  transition: background var(--duration-base);
}
.value-item:hover { background: rgba(59,130,246,0.05); }

.value-item__icon {
  font-size: 2rem;
  margin-bottom: var(--space-4);
  display: block;
}
.value-item__label {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}
.value-item__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

@media (max-width: 768px) { .values-strip { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .values-strip { grid-template-columns: 1fr; } }


/* ==========================================
   PAGE HERO GOLD LINE (now blue)
   ========================================== */

.page-hero-gold-line {
  width: 80px; height: 2px;
  background: var(--gradient-primary);
  margin: var(--space-6) auto;
  box-shadow: 0 0 8px rgba(59,130,246,0.6);
}


/* ==========================================
   MOBILE RESPONSIVENESS — Pages
   ========================================== */

/* ── 768px and below ── */
@media (max-width: 768px) {

  /* Hero section */
  .hero__content {
    padding-top: 100px;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
  .hero__heading {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    letter-spacing: -0.02em;
  }
  .hero__tagline {
    font-size: 0.9rem;
  }
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  /* Mission section: stack vertically */
  .mission-section { padding: var(--space-16) var(--gutter); }
  .mission-quote__text { font-size: clamp(1.1rem, 4vw, 1.4rem); }

  /* Products / Consulting hero header */
  .products-hero {
    padding: calc(80px + var(--space-12)) var(--gutter) var(--space-12);
  }
  .products-hero__title {
    font-size: clamp(1.8rem, 6vw, 2.5rem) !important;
  }
  .products-hero__subtitle {
    font-size: var(--text-base);
    max-width: 100%;
  }

  /* SciGrabber, Dolfin & Turbomood spotlight: stack vertically */
  #scigrabber-spotlight .reveal,
  #dolfin-spotlight .reveal,
  #turbomood-spotlight .reveal {
    grid-template-columns: 1fr !important;
    gap: var(--space-10) !important;
  }

  /* Process steps: 2-column grid */
  #process .reveal {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Consulting offerings: single column */
  #offerings > .container > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Team hero */
  .team-page-hero {
    padding: calc(80px + var(--space-12)) var(--gutter) var(--space-12);
  }
  /* Single product pages mobile optimizations */
  .prod-pipeline-banner {
    display: none !important;
  }
  .prod-about {
    font-size: 0.88rem !important;
    line-height: 1.65 !important;
  }
}

/* ── 640px and below (phones) ── */
@media (max-width: 640px) {

  /* Mission section heading & centralization on mobile */
  .mission-section {
    background: var(--color-bg-2) !important;
  }
  #mission .reveal {
    grid-template-columns: 1fr !important;
    gap: var(--space-6) !important;
  }
  #mission .reveal > div:nth-child(1) {
    padding: var(--space-6) var(--space-4) !important;
    text-align: center !important;
    background: var(--color-surface) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  }
  #mission .reveal > div:nth-child(2) {
    width: 100% !important;
    height: 1px;
    min-height: unset !important;
    background: linear-gradient(to right, transparent, rgba(59,130,246,0.5), transparent) !important;
    display: none !important;
  }
  #mission .reveal > div:nth-child(3) {
    padding: var(--space-6) var(--space-4) !important;
    text-align: center !important;
    background: var(--color-surface) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  }

  /* Consulting offerings grid: 1 col */
  #offerings .container > div[style] {
    grid-template-columns: 1fr !important;
  }
}

/* ── 480px and below (small phones) ── */
@media (max-width: 480px) {

  /* Process steps: 1 column */
  #process .reveal {
    grid-template-columns: 1fr !important;
  }

  /* Hero heading tighten */
  .hero__heading {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
  }

  /* Products hero */
  .products-hero {
    padding: calc(70px + var(--space-10)) var(--gutter) var(--space-10);
  }
  .products-hero__title {
    font-size: clamp(1.5rem, 7vw, 2rem) !important;
  }

  /* Teaser CTA section */
  #teaser-cta .section-header__title {
    font-size: var(--text-xl) !important;
  }
}
