/* Corporate polish + motion — brand colors untouched: #a60df2, #00f0ff, #1c1022 */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Global geometric field ---- */
#corp-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none !important;
  z-index: 0;
  overflow: hidden;
}
#corp-scroll-progress {
  pointer-events: none !important;
}
#root {
  position: relative;
  z-index: 1;
  touch-action: pan-y pinch-zoom;
}
.corp-hex {
  position: absolute;
  width: 140px;
  height: 140px;
  opacity: 0.18;
  background: transparent;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  border: 0;
  box-shadow: inset 0 0 0 1.5px rgba(0, 240, 255, 0.45);
  animation: corp-drift 18s ease-in-out infinite;
}
.corp-hex::after {
  content: "";
  position: absolute;
  inset: 10px;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  box-shadow: inset 0 0 0 1px rgba(166, 13, 242, 0.35);
}
.corp-hex-a { top: 12%; left: 4%; }
.corp-hex-b {
  top: 58%;
  right: 6%;
  width: 100px;
  height: 100px;
  animation-delay: -6s;
  box-shadow: inset 0 0 0 1.5px rgba(166, 13, 242, 0.4);
}
.corp-hex-c {
  bottom: 8%;
  left: 18%;
  width: 72px;
  height: 72px;
  animation-delay: -11s;
}
.corp-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
  animation: corp-orb-pulse 10s ease-in-out infinite;
}
.corp-orb-a {
  width: 420px;
  height: 420px;
  top: -80px;
  right: -60px;
  background: radial-gradient(circle, rgba(166, 13, 242, 0.55), transparent 70%);
}
.corp-orb-b {
  width: 360px;
  height: 360px;
  bottom: 10%;
  left: -100px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.35), transparent 70%);
  animation-delay: -4s;
}
@keyframes corp-drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(12deg); }
}
@keyframes corp-orb-pulse {
  0%, 100% { opacity: 0.18; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.08); }
}

/* Cursor glow follow — always under content, never blocks taps */
#corp-cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  margin-left: -210px;
  margin-top: -210px;
  border-radius: 50%;
  pointer-events: none !important;
  z-index: 0;
  background: radial-gradient(circle, rgba(166, 13, 242, 0.16) 0%, rgba(0, 240, 255, 0.06) 35%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  mix-blend-mode: screen;
  will-change: transform;
}
body.corp-ready #corp-cursor-glow {
  opacity: 1;
}

/* ---- Scroll / entrance reveals (left · right · up · scale) ---- */
.corp-reveal,
.corp-reveal-left,
.corp-reveal-right,
.corp-reveal-up,
.corp-reveal-scale {
  opacity: 0;
  filter: blur(8px);
  will-change: opacity, transform, filter;
  transition:
    opacity 0.95s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.95s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.85s ease;
}
.corp-reveal { transform: translateY(48px); }
.corp-reveal-left { transform: translate3d(-72px, 18px, 0); }
.corp-reveal-right { transform: translate3d(72px, 18px, 0); }
.corp-reveal-up { transform: translateY(56px); }
.corp-reveal-scale { transform: translateY(28px) scale(0.92); }

.corp-reveal.corp-in,
.corp-reveal-left.corp-in,
.corp-reveal-right.corp-in,
.corp-reveal-up.corp-in,
.corp-reveal-scale.corp-in {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

/* Stronger distance on desktop */
@media (min-width: 768px) {
  .corp-reveal-left { transform: translate3d(-110px, 24px, 0); }
  .corp-reveal-right { transform: translate3d(110px, 24px, 0); }
}

/* Stagger helpers */
.corp-stagger > *:nth-child(1) { transition-delay: 0.04s !important; }
.corp-stagger > *:nth-child(2) { transition-delay: 0.14s !important; }
.corp-stagger > *:nth-child(3) { transition-delay: 0.24s !important; }
.corp-stagger > *:nth-child(4) { transition-delay: 0.34s !important; }
.corp-stagger > *:nth-child(5) { transition-delay: 0.44s !important; }
.corp-stagger > *:nth-child(6) { transition-delay: 0.54s !important; }

/* Hero cinematic entrance */
#home.corp-hero-ready h1.corp-reveal-left,
#home.corp-hero-ready p.corp-reveal-right,
#home.corp-hero-ready .corp-reveal-scale {
  transition-duration: 1.15s;
}
#home h1.corp-in {
  text-shadow: 0 0 40px rgba(166, 13, 242, 0.25);
}

/* Project cards — glide + soft glow when in */
#work .grid > a.corp-in {
  box-shadow: 0 0 0 rgba(166, 13, 242, 0);
  animation: corp-card-settle 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes corp-card-settle {
  0% { box-shadow: 0 0 0 rgba(166, 13, 242, 0); }
  40% { box-shadow: 0 18px 50px rgba(166, 13, 242, 0.18); }
  100% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); }
}

/* Agent cards directional polish */
#agent .ai-card.corp-reveal-left.corp-in,
#agent .ai-card.corp-reveal-right.corp-in {
  transition-duration: 1s;
}

/* ---- Top navbar polish ---- */
#root nav.fixed.top-0 {
  min-height: 72px;
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(166, 13, 242, 0.12) !important;
  background: rgba(28, 16, 34, 0.72) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  transition:
    background 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    min-height 0.35s ease !important;
}
#root nav.fixed.top-0.corp-nav-scrolled {
  min-height: 64px;
  background: rgba(28, 16, 34, 0.92) !important;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45), 0 0 40px rgba(166, 13, 242, 0.08);
  border-bottom-color: rgba(166, 13, 242, 0.28) !important;
}
#root nav.fixed.top-0::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-brand), var(--color-cyan-neon), transparent);
  background-size: 200% 100%;
  opacity: 0.85;
  animation: corp-shine 6s linear infinite;
}
@keyframes corp-shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
#root nav.fixed.top-0::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}
#root nav.fixed.top-0 > div {
  width: 100%;
  min-height: inherit;
  align-items: center;
  transition: min-height 0.35s ease;
}
#root nav.fixed.top-0 a img {
  height: 36px !important;
  width: auto;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, filter 0.3s ease;
}
#root nav.fixed.top-0 a:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 0 10px rgba(166, 13, 242, 0.45));
}
#root nav.fixed.top-0 .hidden.md\:flex {
  gap: 2rem;
  column-gap: 2rem;
}
#root nav.fixed.top-0 .hidden.md\:flex > a {
  font-size: 11px;
  letter-spacing: 0.18em;
  padding: 8px 2px;
  color: rgba(229, 231, 235, 0.85);
  transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease !important;
}
#root nav.fixed.top-0 .hidden.md\:flex > a:hover {
  transform: translateY(-1px);
  text-shadow: 0 0 18px rgba(166, 13, 242, 0.45);
}
#root nav.fixed.top-0 .hidden.md\:flex > a:last-child {
  margin-left: 0.5rem;
  padding: 10px 22px !important;
  border: 1px solid rgba(166, 13, 242, 0.45) !important;
  background: rgba(166, 13, 242, 0.08);
  box-shadow: 0 0 20px rgba(166, 13, 242, 0.12);
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    color 0.35s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
#root nav.fixed.top-0 .hidden.md\:flex > a:last-child:hover {
  background: var(--color-brand) !important;
  border-color: var(--color-brand) !important;
  color: #fff !important;
  box-shadow: 0 0 32px rgba(166, 13, 242, 0.45);
  transform: translateY(-2px) scale(1.03);
}

/* Mobile menu panel */
#root nav.fixed .fixed.inset-0 {
  backdrop-filter: blur(20px);
  animation: corp-fade-in 0.35s ease;
}
@keyframes corp-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Section framing ---- */
#root section {
  position: relative;
}
#root section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 48px));
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(166, 13, 242, 0.35), rgba(0, 240, 255, 0.25), transparent);
  pointer-events: none;
  z-index: 2;
}
#root section > * {
  position: relative;
  z-index: 1;
}

/* Cards / panels — richer hover */
#root .glass-card,
#root .glass-panel,
#root [class*="rounded-2xl"][class*="border"] {
  position: relative;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease,
    box-shadow 0.45s ease,
    background 0.4s ease !important;
}
#root .glass-card:hover,
#root .glass-panel:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    0 0 40px rgba(166, 13, 242, 0.14) !important;
}
#root .glass-card::before,
#root .glass-panel::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 14px;
  height: 14px;
  border-top: 1.5px solid rgba(0, 240, 255, 0.55);
  border-left: 1.5px solid rgba(0, 240, 255, 0.55);
  pointer-events: none;
  z-index: 3;
  opacity: 0.7;
  transition: opacity 0.3s, width 0.35s ease, height 0.35s ease;
}
#root .glass-card::after,
#root .glass-panel::after {
  content: "";
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  border-bottom: 1.5px solid rgba(166, 13, 242, 0.55);
  border-right: 1.5px solid rgba(166, 13, 242, 0.55);
  pointer-events: none;
  z-index: 3;
  opacity: 0.7;
  transition: opacity 0.3s, width 0.35s ease, height 0.35s ease;
}
#root .glass-card:hover::before,
#root .glass-card:hover::after,
#root .glass-panel:hover::before,
#root .glass-panel:hover::after {
  opacity: 1;
  width: 22px;
  height: 22px;
}

/* Image hover zoom inside cards */
#root img {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, filter 0.4s ease;
}
#root a:hover img,
#root .group:hover img,
#root [class*="group"]:hover img {
  transform: scale(1.04);
}

/* Headings soft glow on hover sections */
#root h1, #root h2, #root h3 {
  transition: text-shadow 0.4s ease, color 0.3s ease;
}

/* Links / buttons */
#root a,
#root button {
  transition:
    color 0.3s ease,
    background-color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.4s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease !important;
}
#root a[class*="rounded-full"],
#root button[class*="rounded-full"] {
  position: relative;
  overflow: hidden;
}
#root a[class*="rounded-full"]::after,
#root button[class*="rounded-full"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
#root a[class*="rounded-full"]:hover::after,
#root button[class*="rounded-full"]:hover::after {
  transform: translateX(120%);
}
#root a[class*="border"][class*="rounded"]:hover,
#root button[class*="border"][class*="rounded"]:hover {
  box-shadow: 0 0 28px rgba(166, 13, 242, 0.28);
  transform: translateY(-2px);
}

/* Progress / neon accents breathe */
.neon-line,
.progress-glow {
  animation: corp-neon-breathe 2.8s ease-in-out infinite;
}
@keyframes corp-neon-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}

/* Hero / home breathing room under sticky nav */
#root section#home,
#root [id="home"],
#root section#about,
#root section#work,
#root section#blog,
#root section#contact,
#root [id="about"],
#root [id="work"],
#root [id="blog"],
#root [id="contact"],
#agent,
#contact,
#work,
#about,
#blog,
#home {
  scroll-margin-top: 96px;
}

/* Never show agent suite off the home page */
body:not([data-route="home"]) #agent {
  display: none !important;
}

#root main {
  position: relative;
  z-index: 1;
}

/* Footer polish */
#root footer {
  position: relative;
  border-top: 1px solid rgba(166, 13, 242, 0.18);
  background-image:
    linear-gradient(180deg, rgba(166, 13, 242, 0.06), transparent 40%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
}
#root footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-brand), var(--color-cyan-neon), transparent);
  background-size: 200% 100%;
  animation: corp-shine 8s linear infinite;
}

/* Diagonal accent */
#root section:nth-of-type(odd)::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 42%,
    rgba(0, 240, 255, 0.02) 48%,
    rgba(166, 13, 242, 0.04) 52%,
    transparent 58%,
    transparent 100%
  );
  z-index: 0;
  animation: corp-sweep 14s ease-in-out infinite;
}
@keyframes corp-sweep {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Page load fade */
body {
  animation: corp-page-in 0.7s ease both;
}
@keyframes corp-page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Agent suite brand + motion ---- */
#agent {
  background: #150b1a !important;
  border-top: 1px solid rgba(166, 13, 242, 0.2);
  border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}
#agent .ai-eyebrow {
  color: var(--color-cyan-neon, #00f0ff) !important;
}
#agent .ai-eyebrow::before {
  background: var(--color-cyan-neon, #00f0ff) !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.8) !important;
}
#agent .ai-title span {
  background: linear-gradient(135deg, #00f0ff, #a60df2) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}
#agent .ai-card {
  transition:
    border-color 0.45s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease !important;
}
#agent .ai-card:hover {
  border-color: rgba(166, 13, 242, 0.45) !important;
  transform: translateY(-8px) scale(1.01) !important;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.4), 0 0 48px rgba(166, 13, 242, 0.16) !important;
}
#agent .ai-card-visual {
  transition: filter 0.45s ease;
}
#agent .ai-card:hover .ai-card-visual {
  filter: brightness(1.15) saturate(1.15);
}
#agent .ai-cta {
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease,
    box-shadow 0.4s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
#agent .ai-cta:hover {
  background: var(--color-brand, #a60df2) !important;
  border-color: var(--color-brand, #a60df2) !important;
  color: #fff !important;
  box-shadow: 0 0 32px rgba(166, 13, 242, 0.5) !important;
  transform: translateY(-2px) scale(1.03);
}
#agent .ai-card[data-theme="community"] .ai-card-label { color: #00f0ff !important; }
#agent .ai-card[data-theme="community"] .ai-card-line {
  background: linear-gradient(90deg, transparent, #00f0ff, transparent) !important;
}
#agent .ai-card[data-theme="content"] .ai-card-label { color: #c084fc !important; }
#agent .ai-card[data-theme="crew"] .ai-card-label { color: #e879f9 !important; }

/* Scroll progress bar */
#corp-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 100;
  background: linear-gradient(90deg, var(--color-brand), var(--color-cyan-neon));
  box-shadow: 0 0 12px rgba(166, 13, 242, 0.6);
  pointer-events: none;
  transition: width 0.08s linear;
}

@media (max-width: 768px) {
  #root nav.fixed.top-0,
  #root nav.fixed.top-0 > div {
    min-height: 64px;
  }
  .corp-hex-a,
  .corp-hex-c {
    display: none;
  }
  #corp-shapes {
    opacity: 0.45;
    pointer-events: none !important;
  }
  #corp-cursor-glow {
    display: none !important;
  }
  /* Never hide content behind reveals on phones */
  .corp-reveal,
  .corp-reveal-left,
  .corp-reveal-right,
  .corp-reveal-up,
  .corp-reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  html, body, #root {
    touch-action: pan-y pinch-zoom;
    overscroll-behavior-y: auto;
  }
}

@media (hover: none), (pointer: coarse) {
  #corp-cursor-glow,
  #corp-shapes {
    display: none !important;
    pointer-events: none !important;
  }
  .corp-reveal,
  .corp-reveal-left,
  .corp-reveal-right,
  .corp-reveal-up,
  .corp-reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  html, body, #root {
    touch-action: pan-y pinch-zoom;
  }
}
