/* ═══════════════════════════════════════════════════════════
   Golden Owl — Antigravity 3D Scroll Experience
   Inspired by bitfalk.com / immersive scroll WebGL sites
   ═══════════════════════════════════════════════════════════ */

:root {
  --ag-black: #030303;
  --ag-void: #050505;
  --ag-gold: #c5a46e;
  --ag-gold-light: #e8d5a3;
  --ag-white: #f7f4ef;
  --ag-muted: #8b8b9a;
  --ag-glass: rgba(12, 12, 16, 0.55);
  --ag-border: rgba(255, 255, 255, 0.1);
  --ag-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: auto; } /* GSAP owns scroll feel */

body.app-loading {
  overflow: hidden;
  height: 100vh;
}
body.app-ready {
  overflow-x: hidden;
  overflow-y: auto;
}

/* Hard safety: if JS dies, still unlock page after ~3s */
@keyframes ag-force-hide-loader {
  0%, 85% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}
body.app-loading #ag-loader {
  animation: ag-force-hide-loader 3.2s forwards;
}
body.app-loading {
  animation: ag-unlock-body 3.2s forwards;
}
@keyframes ag-unlock-body {
  0%, 85% { overflow: hidden; }
  100% { overflow-x: hidden; overflow-y: auto; height: auto; }
}

#ag-loader {
  z-index: 9999 !important;
}
#scrollProgress {
  z-index: 200 !important;
}

/* Dim body ambient so background video shows through */
body.app-ready::before {
  opacity: 0.12;
}

/* ── Fixed background video ─────────────────────────────── */
.ag-bg-video-wrap {
  position: fixed !important;
  inset: 0;
  z-index: 0 !important;
  overflow: hidden;
  pointer-events: none;
}
.ag-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%) scale(1.18);
  object-fit: cover;
  object-position: center 46%;
  display: block;
  background: var(--ag-black);
  opacity: 0;
  transition: opacity 1.2s var(--ag-ease);
}
body.video-ready .ag-bg-video,
body.video-playing .ag-bg-video {
  opacity: 1;
}
body.app-ready .ag-bg-video {
  animation: ag-video-drift 28s ease-in-out infinite alternate;
}
@keyframes ag-video-drift {
  from { transform: translate(-50%, -50%) scale(1.14); }
  to { transform: translate(-48%, -52%) scale(1.22); }
}
.ag-bg-video-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(3, 3, 3, 0.35) 0%,
    rgba(3, 3, 3, 0.5) 50%,
    rgba(3, 3, 3, 0.65) 100%
  );
}

/* ── Loader ─────────────────────────────────────────────── */
#ag-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #030303;
  transition: opacity 0.8s var(--ag-ease), visibility 0.8s;
}
#ag-loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-mark {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader-logo {
  height: 32px;
  width: auto;
  max-width: min(70vw, 220px);
  object-fit: contain;
  opacity: 0.95;
}
.loader-pct {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--ag-white);
  font-variant-numeric: tabular-nums;
}
.loader-label {
  margin-top: 0.75rem;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ag-gold);
}
.loader-bar-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
}
.loader-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ag-gold), var(--ag-gold-light), #fff);
  transition: width 0.15s linear;
  box-shadow: 0 0 20px rgba(197, 164, 110, 0.5);
}
/* vertical fill used by JS as height % on alternate indicator */
#loaderBar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  width: 100%;
  background: linear-gradient(to top, var(--ag-gold), transparent);
  opacity: 0.15;
  pointer-events: none;
}

/* ── Scroll progress ────────────────────────────────────── */
#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 200;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--ag-gold), var(--ag-gold-light), #fff);
  box-shadow: 0 0 12px rgba(197, 164, 110, 0.55);
  pointer-events: none;
}

/* ── Scroll track / panels ──────────────────────────────── */
#main-content.scroll-track,
#scroll-track {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.ag-panel {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem 0 4rem;
  perspective: 1200px;
  transform-style: preserve-3d;
  background: transparent;
}

.ag-panel--tall {
  min-height: 140vh;
}

.ag-panel--cta {
  min-height: 110vh;
}

/* Header + nav must stay fixed and clickable above content/video */
.site-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500 !important;
  pointer-events: none; /* only the shell receives clicks */
}
.site-header .container,
.site-header .nav-shell,
.site-header .logo-link,
.site-header .nav-desktop,
.site-header .header-actions,
.site-header .menu-btn,
.site-header a,
.site-header button {
  pointer-events: auto;
}

/* Closed menu is full-screen (inset:0) — must NOT steal clicks from the header */
.mobile-menu {
  position: fixed !important;
  z-index: 600 !important;
  pointer-events: none !important;
}
.mobile-menu.open {
  pointer-events: auto !important;
}

/* ── Typography blocks ──────────────────────────────────── */
.ag-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ag-gold);
  margin-bottom: 1.25rem;
}
.ag-kicker::before {
  content: '';
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--ag-gold), transparent);
}
.ag-kicker.center {
  justify-content: center;
  width: 100%;
}
.ag-kicker.center::before { display: none; }

.ag-display {
  font-size: clamp(2.8rem, 9vw, 6.5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: var(--ag-white);
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.85),
    0 12px 48px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(0, 0, 0, 0.45);
}
.ag-hero .ag-lede {
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.85);
}
.ag-display .gold {
  background: linear-gradient(135deg, #fff 0%, var(--ag-gold-light) 40%, var(--ag-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ag-lede {
  max-width: 34rem;
  margin-top: 1.5rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.7;
  color: rgba(247, 244, 239, 0.72);
}

.ag-reveal {
  /* Visible by default so a JS failure never blanks the site */
  opacity: 1;
  transform: none;
  transform-style: preserve-3d;
}
body.app-loading .ag-reveal:not(.is-visible),
.js-anim .ag-reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(28px);
}
.ag-reveal.is-visible {
  opacity: 1 !important;
  transform: none;
}

/* ── Hero (content scrolls over fixed bg video) ─────────── */
.ag-hero {
  text-align: center;
  align-items: center;
  overflow: hidden;
  justify-content: center;
}
.ag-hero-glow {
  position: absolute;
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  border-radius: 50%;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.12), transparent 70%);
  filter: blur(48px);
  mix-blend-mode: screen;
}
.ag-hero-content {
  position: relative;
  z-index: 1;
}
.ag-hero .scroll-hint {
  z-index: 1;
}
.ag-hero .ag-lede {
  margin-left: auto;
  margin-right: auto;
}
.ag-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.25rem;
}
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--ag-muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  pointer-events: none;
}
.scroll-hint-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--ag-gold), transparent);
  animation: hint-pulse 2s ease-in-out infinite;
}
@keyframes hint-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* ── Manifesto split ────────────────────────────────────── */
.ag-manifesto-inner {
  display: grid;
  gap: 2rem;
  max-width: 720px;
}
@media (min-width: 900px) {
  .ag-manifesto-inner {
    max-width: 520px;
    margin-left: 0;
  }
  [data-panel="manifesto"] .container {
    display: flex;
    justify-content: flex-start;
  }
}
.ag-quote {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--ag-white);
}
.ag-quote em {
  font-style: normal;
  color: var(--ag-gold-light);
}

/* ── Engine room (services) ─────────────────────────────── */
.engine-head {
  margin-bottom: 2.5rem;
  max-width: 640px;
}
.engine-console {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ag-gold);
  opacity: 0.8;
  margin-bottom: 0.75rem;
}
.engine-viewport {
  overflow: visible;
  perspective: 1400px;
}
.engine-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  transform-style: preserve-3d;
}
@media (min-width: 1100px) {
  .engine-rail {
    display: flex;
    width: max-content;
    gap: 1.5rem;
  }
  .engine-card {
    width: 280px;
    flex-shrink: 0;
  }
}

.engine-card {
  position: relative;
  padding: 1.75rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(20, 18, 14, 0.85), rgba(10, 10, 12, 0.75));
  border: 1px solid rgba(197, 164, 110, 0.22);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform-style: preserve-3d;
  transition: border-color 0.4s, transform 0.5s var(--ag-ease), box-shadow 0.4s;
  opacity: 1;
}
.engine-card:hover {
  border-color: rgba(197, 164, 110, 0.55);
  transform: translateY(-8px) rotateX(2deg) !important;
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(197, 164, 110, 0.12);
}
.engine-card .tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ag-gold);
  margin-bottom: 1rem;
}
.engine-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.engine-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ag-muted);
}
.engine-card .card-num {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 12px;
  font-weight: 600;
  color: rgba(197, 164, 110, 0.45);
  font-variant-numeric: tabular-nums;
}
.engine-card .arrow {
  display: inline-flex;
  margin-top: 1.25rem;
  color: var(--ag-gold-light);
  font-size: 18px;
  transition: transform 0.35s var(--ag-ease);
}
.engine-card:hover .arrow { transform: translate(4px, -4px); }

/* ── Process steps ──────────────────────────────────────── */
.process-3d {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .process-3d {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }
}
.process-step {
  padding: 1.5rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ag-border);
  backdrop-filter: blur(12px);
  transition: transform 0.4s var(--ag-ease), border-color 0.35s;
}
.process-step:hover {
  transform: translateY(-6px);
  border-color: rgba(197, 164, 110, 0.4);
}
.process-step .num {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--ag-gold-light), var(--ag-gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.75rem;
}
.process-step h3 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.process-step p {
  font-size: 13px;
  color: var(--ag-muted);
  line-height: 1.6;
}

/* ── Stats ──────────────────────────────────────────────── */
.ag-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}
@media (min-width: 768px) {
  .ag-stats { grid-template-columns: repeat(4, 1fr); }
}
.ag-stat {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ag-border);
}
.ag-stat .stat-num {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--ag-white);
  line-height: 1;
}
.ag-stat .stat-label {
  margin-top: 0.5rem;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ag-muted);
}

/* ── Work grid ──────────────────────────────────────────── */
.work-3d {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .work-3d { grid-template-columns: 1fr 1fr; }
}
.work-3d-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--ag-border);
  background: #0c0c0f;
  transition: transform 0.5s var(--ag-ease), border-color 0.35s;
}
.work-3d-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(197, 164, 110, 0.4);
}
.work-3d-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.4s, transform 0.6s var(--ag-ease);
}
.work-3d-card:hover img {
  opacity: 1;
  transform: scale(1.04);
}
.work-3d-card .body {
  padding: 1.25rem 1.5rem 1.5rem;
}
.work-3d-card h3 {
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}
.work-3d-card p {
  font-size: 13px;
  color: var(--ag-muted);
}

/* ── CTA panel ──────────────────────────────────────────── */
.ag-cta-box {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(197, 164, 110, 0.12), rgba(12, 12, 16, 0.6));
  border: 1px solid rgba(197, 164, 110, 0.28);
  backdrop-filter: blur(24px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 60px rgba(197, 164, 110, 0.08);
}
.ag-cta-box .ag-display {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

/* ── Footer above background video ──────────────────────── */
.site-footer {
  position: relative;
  z-index: 2;
  background: linear-gradient(to top, rgba(3, 3, 3, 0.92) 40%, transparent);
  pointer-events: auto;
}

/* Chat above everything */
.chat-fab, .chat-panel { z-index: 300; }

/* ── Trust strip ────────────────────────────────────────── */
.ag-trust {
  margin-top: 3rem;
  text-align: center;
}
.ag-trust p {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ag-muted);
  margin-bottom: 1rem;
}
.ag-trust-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
}
.ag-trust-logos span {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
}

/* ── FAQ compact ────────────────────────────────────────── */
.ag-faq .faq-item {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 767px) {
  .ag-panel { padding: 6rem 0 3rem; }
  .scroll-hint { bottom: 1.5rem; }
  .engine-card { opacity: 1; } /* fallback if GSAP late */
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ag-reveal,
  .engine-card {
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-hint-line {
    animation: none;
  }
  .ag-bg-video-wrap {
    background: #030303 url('../assets/images/owl-hero-dark.jpg') center / cover no-repeat;
  }
  .ag-bg-video {
    display: none !important;
  }
}
