/* ============================================================
   IsaacOriginals — Clean, Grounded, Masculine
   Kingdom-first. Cinematic. Premium. Simple.
   ============================================================ */

:root {
  --bg: #0A0A0A;
  --bg-soft: #111111;
  --bg-card: #141414;
  --bg-line: rgba(255, 255, 255, 0.08);
  --ink: #F5F5F5;
  --ink-muted: #6B6760;
  --accent: #FFFFFF;
}

/* K.I.T. warm overrides */
.kit-theme {
  --accent: #D4A24C;
  --bg-line: rgba(212, 162, 76, 0.12);
}

/* ApexAERA cyan overrides */
.apex-theme {
  --bg: #0A0A0E;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-line: rgba(255, 255, 255, 0.07);
  --accent: #2DD4FF;
  --ink-body: rgba(255, 255, 255, 0.75);
  --ink-label: rgba(255, 255, 255, 0.35);
}
.apex-theme body,
.apex-theme { background: #0A0A0E; }
.apex-theme .text-ink\/70,
.apex-theme .text-ink\/80,
.apex-theme .text-ink\/85 { color: rgba(255, 255, 255, 0.75); }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ===================== NAV ===================== */

.glass-nav {
  background: rgba(10, 10, 10, 0.9);
  border-bottom: 1px solid var(--bg-line);
}

.nav-link {
  position: relative;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 200ms ease, background 200ms ease;
}
.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.nav-link[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ===================== CARDS ===================== */

.card {
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  transition: border-color 300ms ease, transform 300ms ease, box-shadow 300ms ease, background 300ms ease;
  position: relative;
}

.card:hover,
.card:active {
  border-color: rgba(255, 255, 255, 0.45) !important;
  transform: translateY(-4px) scale(1.025) !important;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.12), 0 0 50px rgba(255, 255, 255, 0.05) !important;
}

/* K.I.T gold card hover */
.kit-theme .card {
  border: 2px solid rgba(212, 162, 76, 0.12);
}
.kit-theme .card:hover,
.kit-theme .card:active {
  border-color: rgba(212, 162, 76, 0.5) !important;
  box-shadow: 0 0 20px rgba(212, 162, 76, 0.2), 0 0 50px rgba(212, 162, 76, 0.08) !important;
}

/* ApexAERA card overrides */
.apex-theme .card {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.08);
}
.apex-theme .card:hover,
.apex-theme .card:active {
  border-color: rgba(45, 212, 255, 0.45) !important;
  box-shadow: 0 0 20px rgba(45, 212, 255, 0.15), 0 0 50px rgba(45, 212, 255, 0.06) !important;
}

/* Touch device tap states — ensure glow triggers on tap */
.is-touch .card:active {
  transform: translateY(-4px) scale(1.025) !important;
}
.is-touch .kit-theme .card:active {
  border-color: rgba(212, 162, 76, 0.5) !important;
  box-shadow: 0 0 20px rgba(212, 162, 76, 0.2), 0 0 50px rgba(212, 162, 76, 0.08) !important;
}
.is-touch .apex-theme .card:active {
  border-color: rgba(45, 212, 255, 0.45) !important;
  box-shadow: 0 0 20px rgba(45, 212, 255, 0.15), 0 0 50px rgba(45, 212, 255, 0.06) !important;
}

/* ===================== AGENT CARDS ===================== */

.agent-card {
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
}

.agent-card:hover,
.agent-card:active {
  background: rgba(255, 255, 255, 0.07) !important;
  transform: translateY(-4px) scale(1.03) !important;
}

.agent-card .agent-name {
  transition: color 0.25s ease;
}

/* Sarah — AERA (#2DD4FF) */
.agent-sarah:hover {
  border-left-color: #2DD4FF !important;
  box-shadow: 0 0 30px rgba(45, 212, 255, 0.25), 0 0 60px rgba(45, 212, 255, 0.10) !important;
}
.agent-sarah:hover .agent-name { color: #2DD4FF !important; }
.agent-sarah .agent-tag { color: rgba(45, 212, 255, 0.55) !important; }

/* Marcus (#F59E0B) */
.agent-marcus:hover {
  border-left-color: #F59E0B !important;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.25), 0 0 60px rgba(245, 158, 11, 0.10) !important;
}
.agent-marcus:hover .agent-name { color: #F59E0B !important; }
.agent-marcus .agent-tag { color: rgba(245, 158, 11, 0.55) !important; }

/* Sophia (#A78BFA) */
.agent-sophia:hover {
  border-left-color: #A78BFA !important;
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.25), 0 0 60px rgba(167, 139, 250, 0.10) !important;
}
.agent-sophia:hover .agent-name { color: #A78BFA !important; }
.agent-sophia .agent-tag { color: rgba(167, 139, 250, 0.55) !important; }

/* Julian (#34D399) */
.agent-julian:hover {
  border-left-color: #34D399 !important;
  box-shadow: 0 0 30px rgba(52, 211, 153, 0.25), 0 0 60px rgba(52, 211, 153, 0.10) !important;
}
.agent-julian:hover .agent-name { color: #34D399 !important; }
.agent-julian .agent-tag { color: rgba(52, 211, 153, 0.55) !important; }

/* Charlotte (#F472B6) */
.agent-charlotte:hover {
  border-left-color: #F472B6 !important;
  box-shadow: 0 0 30px rgba(244, 114, 182, 0.25), 0 0 60px rgba(244, 114, 182, 0.10) !important;
}
.agent-charlotte:hover .agent-name { color: #F472B6 !important; }
.agent-charlotte .agent-tag { color: rgba(244, 114, 182, 0.55) !important; }

/* Victor Voss (#60A5FA) */
.agent-victor:hover {
  border-left-color: #60A5FA !important;
  box-shadow: 0 0 30px rgba(96, 165, 250, 0.25), 0 0 60px rgba(96, 165, 250, 0.10) !important;
}
.agent-victor:hover .agent-name { color: #60A5FA !important; }
.agent-victor .agent-tag { color: rgba(96, 165, 250, 0.55) !important; }

/* ===================== LOADING SEQUENCE ===================== */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 800ms ease, visibility 800ms ease;
}
.page-loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Welcome gate button inside loader */
#welcome-gate {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
#welcome-gate.visible {
  opacity: 1;
  pointer-events: auto;
}

/* SPA page transitions */
#page-content {
  transition: opacity 0.35s ease;
}
#page-content.spa-out {
  opacity: 0;
}

/* Theme accent overrides for SPA (unified tailwind config uses white accent) */
.kit-theme .text-accent { color: #D4A24C !important; }
.kit-theme .bg-accent { background-color: #D4A24C !important; }
.apex-theme .text-accent { color: #2DD4FF !important; }
.apex-theme .bg-accent { background-color: #2DD4FF !important; }

@keyframes deltaFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* ===================== BRAND LOGOS ON SUBPAGES ===================== */

.brand-logo-wrap {
  position: relative;
  display: inline-block;
  opacity: 0;
  animation: brandLogoRise 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.brand-logo-wrap img {
  display: block;
  max-height: 320px;
  width: auto;
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Responsive logo sizing for mobile */
@media (max-width: 768px) {
  .brand-logo-wrap img {
    max-height: 180px;
  }
}
@media (max-width: 480px) {
  .brand-logo-wrap img {
    max-height: 140px;
  }
}

/* Glow bloom behind logo */
.brand-logo-wrap::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  width: 300%;
  height: 300%;
  border-radius: 50%;
  opacity: 0;
  animation: logoGlowBloom 1.8s ease 0.4s forwards;
  pointer-events: none;
}

@keyframes brandLogoRise {
  0% { opacity: 0; transform: translateY(20px) scale(0.92); }
  60% { opacity: 1; transform: translateY(-3px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes logoGlowBloom {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.1); }
}

/* Hover effect — scale + glow intensify */
.brand-logo-wrap:hover img {
  transform: scale(1.05);
}

/* Kit logo golden glow */
.kit-theme .brand-logo-wrap img {
  filter: drop-shadow(0 0 20px rgba(212, 162, 76, 0.3))
         drop-shadow(0 0 50px rgba(212, 162, 76, 0.1));
}
.kit-theme .brand-logo-wrap::before {
  background: radial-gradient(circle, rgba(212, 162, 76, 0.2) 0%, transparent 55%);
}
.kit-theme .brand-logo-wrap:hover img {
  filter: drop-shadow(0 0 28px rgba(212, 162, 76, 0.45))
         drop-shadow(0 0 60px rgba(212, 162, 76, 0.15));
}

/* Apex logo cyan glow */
.apex-theme .brand-logo-wrap img {
  filter: drop-shadow(0 0 20px rgba(45, 212, 255, 0.3))
         drop-shadow(0 0 50px rgba(45, 212, 255, 0.1));
}
.apex-theme .brand-logo-wrap::before {
  background: radial-gradient(circle, rgba(45, 212, 255, 0.2) 0%, transparent 55%);
}
.apex-theme .brand-logo-wrap:hover img {
  filter: drop-shadow(0 0 28px rgba(45, 212, 255, 0.45))
         drop-shadow(0 0 60px rgba(45, 212, 255, 0.15));
}

/* ===================== HERO ===================== */

.hero-line {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.hero-line.typed { opacity: 1; transform: none; }

/* ===================== TYPOGRAPHY ===================== */

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  opacity: 0.6;
}

.h-display {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.verse {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--ink);
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  padding-left: 1.25rem;
}
.kit-theme .verse { border-left-color: var(--accent); }

.accent-underline {
  background-image: linear-gradient(90deg, rgba(255,255,255,0.3), transparent);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 100%;
  padding-bottom: 2px;
}

/* ===================== STATUS ===================== */

.dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  display: inline-block;
}
.dot-active {
  background: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,0.3);
}
.dot-dim {
  background: rgba(255,255,255,0.2);
}
.kit-theme .dot { background: var(--accent); }

/* ===================== UTILITIES ===================== */

.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

.hair-top { border-top: 1px solid rgba(255,255,255,0.06); }

/* Film grain — subtle texture */
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.015;
  mix-blend-mode: overlay;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.9'/></svg>");
}

/* ===================== REVEAL ===================== */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-line { opacity: 1; transform: none; }
}

/* Video placeholder */
.video-16x9 {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
}
.video-16x9 > * {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
