/* Custom additions on top of Tailwind */

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

/* Background grid patterns */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(48, 82, 196, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(48, 82, 196, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.bg-grid-dark {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Floating animation for hero card */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

@keyframes pulseSlow {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.04); }
}

.animate-pulse-slow {
  animation: pulseSlow 4.5s ease-in-out infinite;
}

/* Marquee ticker */
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  animation: marquee 38s linear infinite;
  width: max-content;
}

/* Voice cards marquee (slower, pauses on hover) */
@keyframes voice-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.animate-voice-marquee {
  animation: voice-marquee 60s linear infinite;
}
.voice-marquee-wrapper:hover .animate-voice-marquee {
  animation-play-state: paused;
}

/* line-clamp utility (Tailwind sometimes missing in CDN) */
.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* New signal slide-in */
@keyframes signalIn {
  0%   { opacity: 0; transform: translateY(-12px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.signal-item-new {
  animation: signalIn 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Number flip flash */
@keyframes flashUpdate {
  0%   { color: inherit; }
  20%  { color: #22D3EE; text-shadow: 0 0 12px rgba(34,211,238,0.6); }
  100% { color: inherit; text-shadow: none; }
}

.flash-update {
  animation: flashUpdate 700ms ease-out;
}

/* Toast pop */
@keyframes toastPop {
  0%   { opacity: 0; transform: translateY(8px) scale(0.92); }
  60%  { opacity: 1; transform: translateY(0) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

[data-toast-card].toast-popping {
  animation: toastPop 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* FEATURES (B-plan): big tab + stage */
.bigtab {
  background-color: #F1F2F5;
  color: #383838;
  border: 1px solid transparent;
}
.bigtab .bigtab-num {
  background: rgba(0, 35, 93, 0.08);
  color: #00235D;
}
.bigtab.is-active {
  background: linear-gradient(135deg, #003386, #00235D);
  color: #ffffff;
  box-shadow: 0 12px 30px -10px rgba(0, 51, 134, 0.5);
}
.bigtab.is-active .bigtab-num {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Big stage: stack panels as absolute layers so the container height stays
   fixed regardless of which tab is active (no flicker, no layout jumps). */
.bigstage {
  position: relative;
}
.bigpanel {
  position: absolute;
  inset: 0;
  display: grid;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 320ms ease;
}
.bigpanel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
  animation: bigpanelFade 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bigpanelFade {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Voice waveform bars (Closing tab speaker) */
@keyframes waveBar1 { 0%,100%{ height: 4px; } 50%{ height: 12px; } }
@keyframes waveBar2 { 0%,100%{ height: 8px; } 50%{ height: 4px; } }
@keyframes waveBar3 { 0%,100%{ height: 12px; } 50%{ height: 6px; } }
@keyframes waveBar4 { 0%,100%{ height: 6px; } 50%{ height: 10px; } }

[data-wave] > span:nth-child(1) { animation: waveBar1 0.7s ease-in-out infinite; }
[data-wave] > span:nth-child(2) { animation: waveBar2 0.7s ease-in-out infinite; }
[data-wave] > span:nth-child(3) { animation: waveBar3 0.7s ease-in-out infinite; }
[data-wave] > span:nth-child(4) { animation: waveBar4 0.7s ease-in-out infinite; }

/* Reveal on scroll (used by app.js IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s ease, transform .7s ease;
}

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

/* details (FAQ) marker fix for Safari */
details > summary::-webkit-details-marker {
  display: none;
}

/* Hide horizontal scroll caused by blurs */
body {
  overflow-x: hidden;
}

/* Selection */
::selection {
  background-color: rgba(48, 82, 196, 0.25);
  color: #00235D;
}

/* Anchor offset for fixed header */
section[id] {
  scroll-margin-top: 80px;
}

/* Header transparent → solid on scroll (Sales-Marker style) */
[data-scroll-header] {
  background-color: transparent;
  box-shadow: none;
}

[data-scroll-header].is-scrolled {
  background-color: #00235D;
  box-shadow: 0 6px 24px -8px rgba(0, 0, 0, 0.35);
}
