/* ═══════════════════════════════════════════════
   AWARD-WINNING ENHANCEMENT LAYER
   Preloader · Custom Cursor · Marquee · Noise ·
   Mouse Glow · Scroll Progress · Text Reveal ·
   Bento Grid · Section Numbers · Massive Footer
   ═══════════════════════════════════════════════ */

/* ───────────────── PRELOADER ───────────────── */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-12);
  transition: transform 0.85s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.6s ease;
}
.preloader--done {
  transform: translateY(-100%);
  pointer-events: none;
}
.preloader__brand {
  font-family: 'Syne', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 10vw, 7rem);
  letter-spacing: -0.04em;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 0.05em;
}
.preloader__brand span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  animation: brandPulse 1.4s ease-in-out infinite;
}
@keyframes brandPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}
.preloader__counter {
  font-family: 'Syne', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}
.preloader__bar {
  width: min(320px, 60vw);
  height: 2px;
  background: var(--color-bg-border);
  overflow: hidden;
  border-radius: 1px;
}
.preloader__bar-fill {
  width: 0;
  height: 100%;
  background: var(--gradient-brand);
  transition: width 120ms ease;
}

/* Page enters after preloader */
body:not(.is-loaded) main,
body:not(.is-loaded) footer,
body:not(.is-loaded) nav {
  opacity: 0;
}
body.is-loaded main,
body.is-loaded footer,
body.is-loaded nav {
  opacity: 1;
  transition: opacity 0.8s ease 0.1s;
}

/* ───────────────── CUSTOM CURSOR ───────────────── */
@media (pointer: fine) {
  html, body { cursor: none; }
  a, button, input, textarea, select, [data-cursor] { cursor: none; }
}

.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  will-change: transform;
  transition: opacity 0.3s ease;
}
.cursor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-primary);
  mix-blend-mode: difference;
}
.cursor-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--color-accent-1);
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.3s ease;
}
.cursor-ring--active {
  border-color: var(--color-accent-2);
  background: rgba(124, 58, 237, 0.12);
}

@media (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html, body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* ───────────────── MOUSE GLOW ───────────────── */
.mouse-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
  filter: blur(40px);
  will-change: transform;
}
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .mouse-glow { display: none; }
}

/* ───────────────── NOISE OVERLAY ───────────────── */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ───────────────── SCROLL PROGRESS BAR ───────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-brand);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: calc(var(--z-nav) + 1);
  transition: transform 80ms linear;
}

/* ───────────────── TEXT REVEAL (word split) ───────────────── */
[data-text-reveal] { display: inline-block; }
[data-text-reveal] .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
[data-text-reveal] .word__inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-text-reveal].text-reveal--shown .word__inner {
  transform: translateY(0);
}

[data-text-reveal] .word:nth-child(1)  .word__inner { transition-delay: 0.00s; }
[data-text-reveal] .word:nth-child(2)  .word__inner { transition-delay: 0.05s; }
[data-text-reveal] .word:nth-child(3)  .word__inner { transition-delay: 0.10s; }
[data-text-reveal] .word:nth-child(4)  .word__inner { transition-delay: 0.15s; }
[data-text-reveal] .word:nth-child(5)  .word__inner { transition-delay: 0.20s; }
[data-text-reveal] .word:nth-child(6)  .word__inner { transition-delay: 0.25s; }
[data-text-reveal] .word:nth-child(7)  .word__inner { transition-delay: 0.30s; }
[data-text-reveal] .word:nth-child(8)  .word__inner { transition-delay: 0.35s; }
[data-text-reveal] .word:nth-child(9)  .word__inner { transition-delay: 0.40s; }
[data-text-reveal] .word:nth-child(10) .word__inner { transition-delay: 0.45s; }

/* ───────────────── MARQUEE ───────────────── */
.marquee {
  position: relative;
  overflow: hidden;
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-bg-border);
  border-bottom: 1px solid var(--color-bg-border);
  background: var(--color-bg-base);
}
.marquee__track {
  display: flex;
  gap: var(--space-12);
  width: max-content;
  animation: marqueeSlide 35s linear infinite;
}
.marquee__item {
  font-family: 'Syne', system-ui, sans-serif;
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
  white-space: nowrap;
}
.marquee__item--outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--color-text-secondary);
}
.marquee__star {
  width: clamp(20px, 3vw, 36px);
  height: clamp(20px, 3vw, 36px);
  flex-shrink: 0;
  animation: spinSlow 8s linear infinite;
}

@keyframes marqueeSlide {
  to { transform: translateX(-50%); }
}
@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

.marquee:hover .marquee__track { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .marquee__star { animation: none; }
}

/* ───────────────── SECTION NUMBER INDICATORS ───────────────── */
.section-number {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: 'Syne', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
}
.section-number::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--color-text-muted);
}
.section-number__digit {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.9rem;
}

/* ───────────────── MASSIVE FOOTER WORDMARK ───────────────── */
.brand-massive {
  font-family: 'Syne', system-ui, sans-serif;
  font-size: clamp(4rem, 22vw, 22rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.85;
  background: linear-gradient(180deg, var(--color-text-primary) 0%, transparent 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  user-select: none;
  pointer-events: none;
  margin-top: var(--space-16);
  margin-bottom: calc(-1 * var(--space-8));
  overflow: hidden;
  white-space: nowrap;
}

/* ───────────────── BUTTON MAGNETIC WRAPPER ───────────────── */
[data-magnetic] {
  display: inline-flex;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
[data-magnetic] > * {
  pointer-events: none;
}

/* ───────────────── ENHANCED HERO ───────────────── */
.hero__heading-line {
  display: block;
  overflow: hidden;
  line-height: 1;
  padding-block: 0.05em;
}

/* Hero "scroll cue" indicator */
.scroll-cue {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  z-index: var(--z-above);
}
.scroll-cue__line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, transparent, var(--color-text-secondary));
  animation: scrollCue 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scrollCue {
  0%, 100% { transform: scaleY(0.3); opacity: 0.4; }
  50%       { transform: scaleY(1); opacity: 1; }
}
@media (max-width: 640px) {
  .scroll-cue { display: none; }
}

/* ───────────────── CARD TILT WRAPPER ───────────────── */
[data-tilt] {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ───────────────── COLOR-INVERT SECTION ───────────────── */
.section--invert {
  background: var(--color-text-primary);
  color: var(--color-bg-base);
}
.section--invert h2, .section--invert h3 { color: var(--color-bg-base); }
.section--invert p { color: rgba(8,11,20,0.7); }
.section--invert .section-label { color: var(--color-accent-2); }
.section--invert .section-number { color: rgba(8,11,20,0.5); }
.section--invert .section-number::before { background: rgba(8,11,20,0.3); }

/* Award badge in hero */
.award-badge {
  position: absolute;
  top: 110px;
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  z-index: var(--z-above);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-align: center;
  width: 90px;
}
.award-badge__circle {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.award-badge__rotate {
  position: absolute;
  inset: 0;
  animation: spinSlow 18s linear infinite;
}
@media (max-width: 768px) {
  .award-badge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .award-badge__rotate { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   THE "3RD VIBE" — AI-forward layered visual system
   Aurora · Neural lattice mount · Agents online ticker ·
   Built-to-be-cited · CIPC active badge · Booking CTA polish
   ═══════════════════════════════════════════════════════════════════ */

/* ───────────────── AURORA OVERLAY ───────────────── */
.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background: var(--gradient-aurora);
  filter: blur(60px);
  animation: auroraShift 22s ease-in-out infinite alternate;
  will-change: transform, filter, opacity;
}
@keyframes auroraShift {
  0% {
    transform: translate(0%, 0%) scale(1);
    filter: blur(60px) hue-rotate(0deg);
  }
  50% {
    transform: translate(2%, -2%) scale(1.05);
    filter: blur(70px) hue-rotate(15deg);
  }
  100% {
    transform: translate(-2%, 2%) scale(1.02);
    filter: blur(60px) hue-rotate(-10deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .aurora {
    animation: none;
    opacity: 0.3;
  }
}

/* ───────────────── NEURAL LATTICE MOUNT ───────────────── */
.neural-lattice {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  mix-blend-mode: screen;
  pointer-events: none;
  overflow: hidden;
}
.neural-lattice canvas {
  display: block;
  width: 100%;
  height: 100%;
}
@media (max-width: 768px) {
  .neural-lattice { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .neural-lattice { display: none; }
}

/* Hero canvas (existing particle layer) needs to sit above neural lattice */
#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero__orb,
.hero__content,
.scroll-cue,
.hero__stats,
.award-badge {
  position: relative;
  z-index: 2;
}

/* ───────────────── AGENTS ONLINE TICKER ───────────────── */
.agents-ticker {
  position: relative;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(8, 11, 20, 0.0) 0%, rgba(8, 11, 20, 0.85) 12%, rgba(8, 11, 20, 0.85) 88%, rgba(8, 11, 20, 0.0) 100%),
    linear-gradient(180deg, rgba(13, 18, 32, 0.6) 0%, rgba(8, 11, 20, 0.4) 100%);
  border-top: 1px solid var(--color-bg-border);
  border-bottom: 1px solid var(--color-bg-border);
  padding: var(--space-3) 0;
  font-family: 'Inter', system-ui, sans-serif;
}
.agents-ticker__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  flex-wrap: wrap;
  justify-content: center;
}
.agents-ticker__pulse {
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.agents-ticker__pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  position: relative;
  z-index: 2;
}
.agents-ticker__pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--color-success);
  animation: tickerPulse 1.8s ease-out infinite;
  opacity: 0.8;
}
@keyframes tickerPulse {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}
.agents-ticker__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-success);
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-success-soft);
  border: 1px solid var(--color-success-ring);
}
.agents-ticker__metric {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
}
.agents-ticker__metric-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.agents-ticker__metric-value {
  font-family: 'Syne', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.agents-ticker__divider {
  color: var(--color-text-muted);
  opacity: 0.5;
}
@media (max-width: 720px) {
  .agents-ticker__divider { display: none; }
  .agents-ticker__inner { gap: var(--space-3); }
  .agents-ticker__metric-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .agents-ticker__pulse-ring { animation: none; opacity: 0.4; }
}

/* ───────────────── BUILT TO BE CITED ───────────────── */
.cited-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-top: var(--space-8);
}
@media (min-width: 720px) {
  .cited-grid { grid-template-columns: repeat(3, 1fr); }
}
.cited-tile {
  position: relative;
  padding: var(--space-6);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-bg-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform var(--transition-base), border-color var(--transition-base), background var(--transition-base);
  overflow: hidden;
}
.cited-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #06B6D4, #7C3AED);
  opacity: 0.4;
  transition: opacity var(--transition-base);
}
.cited-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(13, 18, 32, 0.8);
}
.cited-tile:hover::before { opacity: 1; }
.cited-tile__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cited-tile h3 {
  font-family: 'Syne', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  margin: 0;
}
.cited-tile p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
}
.cited-tile p a {
  color: var(--color-text-accent);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.cited-tile__tag {
  margin-top: auto;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 9999px;
  font-family: 'Inter', system-ui, monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-bg-border);
  width: fit-content;
}
.cited-footnote {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: rgba(245, 158, 11, 0.04);
  border: 1px dashed rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}
.cited-footnote svg { color: #F59E0B; flex-shrink: 0; margin-top: 2px; }
.cited-footnote p { margin: 0; }
.cited-footnote a {
  color: var(--color-text-accent);
  font-weight: 600;
  text-decoration: none;
}
.cited-footnote a:hover { text-decoration: underline; }

/* ───────────────── CIPC ACTIVE BADGE (footer chip) ───────────────── */
.compliance-badge--active {
  background: var(--color-success-soft) !important;
  border-color: var(--color-success-ring) !important;
  color: var(--color-success) !important;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.compliance-badge--active .compliance-badge__pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 0 var(--color-success-ring);
  animation: ciplsePulse 2s ease-in-out infinite;
}
@keyframes ciplsePulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--color-success-ring); }
  50%      { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.0); }
}
@media (prefers-reduced-motion: reduce) {
  .compliance-badge--active .compliance-badge__pulse { animation: none; }
}

/* ───────────────── CTA BANNER — dual-CTA layout ───────────────── */
.cta-banner__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

/* ───────────────── HERO Z-INDEX SAFETY ───────────────── */
.hero {
  position: relative;
  isolation: isolate;
}
