/* ============================================================
   Ambient layer styles — atmosphere + page transitions
   Loaded by every page; safe to skip with prefers-reduced-motion
   ============================================================ */

/* Allow body bg to live on html so atmosphere sits above bg */
html {
  background: var(--bg);
  transition: background 0.5s var(--ease-out);
}
body { background: transparent; }

/* Atmosphere root: fixed full-viewport, behind all content */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}
.atm-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Giant decorative shapes — parallax + rotate (set by JS) */
.atm-shape {
  position: absolute;
  pointer-events: none;
  opacity: 0.045;
  will-change: transform;
  mix-blend-mode: normal;
}
.atm-shape.atm-orange { color: var(--brand-orange); }
.atm-shape.atm-ink    { color: var(--ink); }
[data-theme="dark"] .atm-shape { opacity: 0.055; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .atm-shape { opacity: 0.055; }
}
.atm-shape svg { width: 100%; height: 100%; display: block; }

/* All direct body children must layer ABOVE the atmosphere */
body > header,
body > section,
body > footer,
body > div,
body > main,
body > nav {
  position: relative;
  z-index: 1;
}

/* The hero canvas itself should sit ABOVE the atmosphere */
.hero { z-index: 2; }
.hero-canvas { z-index: 1; }
.hero-content { z-index: 3; }

/* Sections with their own solid bg need to mask atmosphere */
.verticals,
.name-origin,
.plans,
.tech-partners,
.partners {
  isolation: isolate;
}
/* footer too — solid dark bg */
footer { isolation: isolate; }

/* ============================================================
   Page transitions — fade out / fade in + stagger
   ============================================================ */

/* Entry: body starts faded + slightly down, then settles */
html.pt-entering body {
  opacity: 0;
  transform: translateY(6px);
}
/* Fade-in: smooth and not too fast — 220ms with a soft curve */
html.pt-entered body {
  opacity: 1;
  transform: none;
  transition: opacity 0.22s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Fade-out: 140ms with a soft curve — visible but not robotic */
html.pt-leaving body {
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.14s cubic-bezier(0.55, 0, 0.68, 0.2), transform 0.14s cubic-bezier(0.55, 0, 0.68, 0.2);
}

/* Nicer hover transitions on nav links */
.nav-links a { transition: background 0.22s var(--ease-out), color 0.22s var(--ease-out); }

/* Smooth scroll only for hash links within the same page */
html:focus-within { scroll-behavior: smooth; }

/* Reveal staggers — extend the existing reveal ladder with finer steps */
html.pt-entered .reveal { transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }

/* ============================================================
   Rich visual background layers — all GPU-composited
   ============================================================ */

/* 1. Dot grid + slow ripple wave */
.atm-dot-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.atm-dot-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--ink) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.04;
}
/* Slow ripple band sweeping top→bottom */
.atm-dot-grid::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -200%;
  height: 400%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 44%,
    rgba(255,255,255,0.044) 49%,
    rgba(255,255,255,0.062) 50%,
    rgba(255,255,255,0.044) 51%,
    transparent 56%,
    transparent 100%
  );
  animation: atm-grid-wave 26s ease-in-out infinite;
  will-change: transform;
}
@keyframes atm-grid-wave {
  0%   { transform: translateY(0%);   }
  50%  { transform: translateY(50%);  }
  100% { transform: translateY(0%);   }
}

/* 2. Horizontal hairlines */
.atm-hlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    transparent       0px,
    transparent       59px,
    var(--ink)        59px,
    var(--ink)        60px
  );
  opacity: 0.03;
}

/* 3. Large slowly-rotating circles (stroke only) */
.atm-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--ink);
  opacity: 0.04;
  pointer-events: none;
  will-change: transform;
  animation: atm-rotate linear infinite;
}
@keyframes atm-rotate {
  from { transform: rotate(0deg);   }
  to   { transform: rotate(360deg); }
}

/* 4. Morphing organic blob */
.atm-blob {
  position: absolute;
  width: 640px;
  height: 640px;
  left: 58%;
  top: 36%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at 42% 38%, #E8611A 0%, #0A1628 72%);
  opacity: 0.06;
  pointer-events: none;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: atm-morph 34s ease-in-out infinite;
  will-change: border-radius;
}
@keyframes atm-morph {
  0%,100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  20%     { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  40%     { border-radius: 50% 55% 30% 65% / 30% 65% 40% 55%; }
  60%     { border-radius: 40% 70% 55% 35% / 70% 40% 60% 35%; }
  80%     { border-radius: 65% 30% 55% 45% / 40% 55% 60% 45%; }
}

/* 5. Scanline — radar sweep top → bottom */
.atm-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.atm-scanline::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent                                         0%,
    color-mix(in oklab, var(--ink) 30%, transparent)   30%,
    color-mix(in oklab, var(--brand-orange) 45%, transparent) 50%,
    color-mix(in oklab, var(--ink) 30%, transparent)   70%,
    transparent                                         100%
  );
  opacity: 0.03;
  animation: atm-scan 22s linear infinite;
  will-change: transform;
}
@keyframes atm-scan {
  from { transform: translateY(0vh);   }
  to   { transform: translateY(100vh); }
}

/* 6. Grain / noise overlay */
.atm-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: overlay;
}
.atm-grain svg { width: 100%; height: 100%; display: block; }

/* ============================================================
   NEW: Rich enhanced atmosphere layers
   ============================================================ */

/* 7. Animated gradient mesh — slowly shifting color clouds */
.atm-mesh {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  opacity: 0.5;
  filter: blur(80px);
  background:
    radial-gradient(circle at 18% 22%, rgba(232, 97, 26, 0.18) 0%, transparent 38%),
    radial-gradient(circle at 82% 28%, rgba(10, 22, 40, 0.22) 0%, transparent 42%),
    radial-gradient(circle at 28% 78%, rgba(232, 97, 26, 0.12) 0%, transparent 36%),
    radial-gradient(circle at 76% 82%, rgba(10, 22, 40, 0.18) 0%, transparent 40%);
  animation: atm-mesh-drift 48s ease-in-out infinite;
  will-change: transform, opacity;
}
[data-theme="dark"] .atm-mesh { opacity: 0.7; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .atm-mesh { opacity: 0.7; }
}
@keyframes atm-mesh-drift {
  0%,100% { transform: translate(0, 0) scale(1); }
  25%     { transform: translate(-3%, 2%) scale(1.04); }
  50%     { transform: translate(2%, -2%) scale(0.98); }
  75%     { transform: translate(-2%, -3%) scale(1.02); }
}

/* 8. Neural network connector lines — appear/disappear with fade */
.atm-neural {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  overflow: hidden;
}
[data-theme="dark"] .atm-neural { opacity: 0.12; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .atm-neural { opacity: 0.12; }
}
.atm-neural svg {
  position: absolute;
  width: 100%; height: 100%;
  animation: atm-neural-pulse 9s ease-in-out infinite;
}
@keyframes atm-neural-pulse {
  0%,100% { opacity: 0.3; }
  50%     { opacity: 1;   }
}
.atm-neural-line {
  stroke: var(--brand-orange);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 4 8;
  animation: atm-neural-flow 14s linear infinite;
}
@keyframes atm-neural-flow {
  to { stroke-dashoffset: -120; }
}
.atm-neural-node {
  fill: var(--brand-orange);
  animation: atm-neural-blink 4s ease-in-out infinite;
}
@keyframes atm-neural-blink {
  0%,100% { opacity: 0.3; }
  50%     { opacity: 1;   }
}

/* 9. Pulsing glow orbs at strategic positions */
.atm-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  opacity: 0.4;
  background: radial-gradient(circle, var(--brand-orange) 0%, transparent 70%);
  animation: atm-pulse 7s ease-in-out infinite;
  will-change: transform, opacity;
}
[data-theme="dark"] .atm-glow { opacity: 0.5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .atm-glow { opacity: 0.5; }
}
.atm-glow.atm-glow-ink {
  background: radial-gradient(circle, var(--ink) 0%, transparent 70%);
}
@keyframes atm-pulse {
  0%,100% { transform: scale(1);   opacity: 0.3; }
  50%     { transform: scale(1.2); opacity: 0.55; }
}

/* 10. Subtle vertical light beams (column gradients) */
.atm-beam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in oklab, var(--brand-orange) 40%, transparent) 30%,
    color-mix(in oklab, var(--brand-orange) 70%, transparent) 50%,
    color-mix(in oklab, var(--brand-orange) 40%, transparent) 70%,
    transparent 100%
  );
  opacity: 0.15;
  animation: atm-beam-fade 12s ease-in-out infinite;
  will-change: opacity;
}
[data-theme="dark"] .atm-beam { opacity: 0.2; }
@keyframes atm-beam-fade {
  0%,100% { opacity: 0.05; }
  50%     { opacity: 0.22; }
}

/* 11. Floating geometric badges (small) */
.atm-badge {
  position: absolute;
  width: 6px;
  height: 6px;
  pointer-events: none;
  border: 1px solid var(--brand-orange);
  opacity: 0.4;
  animation: atm-badge-float 18s ease-in-out infinite;
  will-change: transform;
}
.atm-badge.b-square    { transform: rotate(45deg); }
.atm-badge.b-circle    { border-radius: 50%; }
.atm-badge.b-triangle  {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 7px solid var(--brand-orange);
  background: none;
}
@keyframes atm-badge-float {
  0%,100% { transform: translateY(0)   rotate(0deg); }
  50%     { transform: translateY(-30px) rotate(180deg); }
}

/* ============================================================
   Card hover light beam — glass-sheen diagonal swipe
   ============================================================ */

/* Ensure positioning context + clipping for all card types */
.partner-card,
.b2b-card {
  position: relative;
}
.partner-card,
.plan-card,
.b2b-card {
  overflow: hidden;
}

/* The beam pseudo-element */
.vert-card::after,
.partner-card::after,
.bc-hl-card::after,
.plan-card::after,
.b2b-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    108deg,
    transparent              0%,
    transparent              28%,
    rgba(255,255,255,0.065)  44%,
    rgba(255,255,255,0.065)  56%,
    transparent              72%,
    transparent              100%
  );
  transform: translateX(-160%) skewX(-12deg);
  pointer-events: none;
  z-index: 6;
}
.vert-card:hover::after,
.partner-card:hover::after,
.bc-hl-card:hover::after,
.plan-card:hover::after,
.b2b-card:hover::after {
  animation: card-shine 0.72s ease-out forwards;
}
@keyframes card-shine {
  from { transform: translateX(-160%) skewX(-12deg); opacity: 1;   }
  to   { transform: translateX( 260%) skewX(-12deg); opacity: 0.3; }
}

/* ============================================================
   Don't run atmosphere/transitions when reduced motion is set
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .atmosphere { display: none; }
  html.pt-entering body,
  html.pt-leaving body { opacity: 1; transform: none; }
  .atm-dot-grid::after,
  .atm-circle,
  .atm-blob,
  .atm-scanline::after { animation: none; }
}

/* ============================================================
   WHATSAPP FLOATING BUTTON
   ============================================================ */
#wa-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.35), 0 2px 8px rgba(0,0,0,0.18);
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
  animation: wa-pop 0.5s var(--ease-out) 0.6s both, wa-pulse 2.6s ease-in-out 1.5s infinite;
}
#wa-float svg {
  width: 30px;
  height: 30px;
  display: block;
}
#wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.5), 0 3px 10px rgba(0,0,0,0.22);
}
#wa-float:active { transform: scale(0.96); }
@keyframes wa-pop {
  from { opacity: 0; transform: scale(0.4) translateY(20px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
@keyframes wa-pulse {
  0%   { box-shadow: 0 6px 22px rgba(37, 211, 102, 0.35), 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70%  { box-shadow: 0 6px 22px rgba(37, 211, 102, 0.35), 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 6px 22px rgba(37, 211, 102, 0.35), 0 0 0 0 rgba(37, 211, 102, 0); }
}
@media (max-width: 768px) {
  #wa-float {
    width: 52px;
    height: 52px;
    bottom: 16px;
    right: 16px;
  }
  #wa-float svg { width: 28px; height: 28px; }

  /* Mobile performance: kill heavy ambient animations.
     We keep light decorations static so the page still feels rich
     but the GPU isn't spinning on every paint. */
  .atm-circle,
  .atm-blob,
  .atm-scanline::after,
  .atm-gradient-mesh,
  .atm-neural,
  .atm-neural-line,
  .atm-glow,
  .atm-beam,
  .atm-badge { animation: none !important; }
  .atm-blob { filter: blur(40px); } /* lower blur radius on mobile */
  .atm-glow { filter: blur(28px); }
  .atm-gradient-mesh { display: none; } /* heaviest layer */
  .atm-neural { display: none; }
  .atm-beam { display: none; }
}

/* ============================================================
   LANGUAGE SWITCHER MODAL
   ============================================================ */
.lang-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lang-modal.open {
  display: flex;
  animation: lm-fade 0.18s var(--ease-out);
}
@keyframes lm-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lang-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 28, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lang-modal-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: 22px;
  padding: 22px 18px 18px;
  box-shadow: 0 22px 70px rgba(0,0,0,0.32);
  animation: lm-slide 0.22s var(--ease-out);
}
[data-theme="dark"] .lang-modal-panel {
  background: #0F1B30;
  border-color: rgba(255,255,255,0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lang-modal-panel {
    background: #0F1B30;
    border-color: rgba(255,255,255,0.08);
  }
}
@keyframes lm-slide {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.lang-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
}
.lang-modal-head h3 {
  margin: 0;
  font-family: var(--f-display, serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.lang-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
}
.lang-close:hover {
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  border-color: color-mix(in oklab, var(--ink) 22%, transparent);
}
.lang-close svg { width: 16px; height: 16px; }
.lang-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lang-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 0.18s var(--ease-out), border-color 0.18s var(--ease-out), transform 0.18s var(--ease-out);
  min-height: 60px;
}
.lang-option:hover {
  background: color-mix(in oklab, var(--brand-orange) 6%, transparent);
  border-color: color-mix(in oklab, var(--brand-orange) 35%, transparent);
}
.lang-option:active { transform: scale(0.98); }
.lang-option.is-active {
  background: color-mix(in oklab, var(--brand-orange) 10%, transparent);
  border-color: color-mix(in oklab, var(--brand-orange) 50%, transparent);
}
.lang-active-dot {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-orange);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand-orange) 24%, transparent);
}
.lang-warn {
  margin-top: 14px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--brand-orange) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--brand-orange) 22%, transparent);
  color: color-mix(in oklab, var(--ink) 75%, transparent);
  font-size: 12.5px;
  line-height: 1.5;
  transition: background 0.3s var(--ease-out);
}
.lang-warn svg { width: 18px; height: 18px; color: var(--brand-orange); flex-shrink: 0; margin-top: 1px; }
.lang-warn.flash {
  background: color-mix(in oklab, var(--brand-orange) 22%, transparent);
  animation: lw-shake 0.5s ease-out;
}
@keyframes lw-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-4px); }
  40%     { transform: translateX(4px); }
  60%     { transform: translateX(-3px); }
  80%     { transform: translateX(3px); }
}
.lang-flag {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}
.lang-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.lang-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.lang-native {
  font-size: 12px;
  color: color-mix(in oklab, var(--ink) 60%, transparent);
}
@media (max-width: 520px) {
  .lang-modal-grid { grid-template-columns: 1fr; gap: 8px; }
  .lang-modal-panel { padding: 18px 14px 14px; border-radius: 18px; }
  .lang-option { padding: 14px 12px; min-height: 56px; }
  .lang-flag { font-size: 24px; }
}

/* Hide the Google Translate top banner that it injects */
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }
.goog-tooltip,
.goog-tooltip:hover { display: none !important; }
.goog-text-highlight {
  background-color: transparent !important;
  box-shadow: none !important;
}
