@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Spectral:ital,wght@0,300;0,400;0,700;0,800;1,400&display=swap');

:root {
  /* Editorial Foundation */
  --primary: #FFFFFF;
  --accent: #E5E5E5;
  --white: #FFFFFF;
  --charcoal: #050505;
  
  /* Shared Defaults (Dark by default) */
  --bg: #050505;
  --surface: #0a0a0a;
  --text: #FFFFFF;
  --text-dim: rgba(255, 255, 255, 0.5);
  --border: rgba(255, 255, 255, 0.15);
  --hairline: 1px solid var(--border);
  --nav-bg: rgba(5, 5, 5, 0.9);
  
  /* Typography */
  --serif: 'Spectral', serif;
  --sans: 'Inter', sans-serif;
  
  /* Spacing & Style */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  --section-pad: 8rem 0;
  --radius: 0px; /* Sharp edges for editorial look */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
body.light-theme {
  --bg: #FFFFFF;
  --surface: #F9F9F9;
  --text: #050505;
  --text-dim: rgba(0, 0, 0, 0.5);
  --border: rgba(0, 0, 0, 0.15);
  --nav-bg: rgba(255, 255, 255, 0.95);
  --primary: #050505;
  --accent: #222222;
}

body.light-theme header .logo-path {
    stroke: #B35EFF !important;
}

/* Utility Classes for Spacing */
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

/* Flip Card Component */
.flip-card {
  background-color: transparent;
  perspective: 1000px;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}
@media (hover: hover) {
    .flip-card:hover .flip-card-inner {
        transform: rotateY(180deg);
    }
}
.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flip-card-back {
  transform: rotateY(180deg);
}

@media (max-width: 768px) {
  .flip-card-back {
    padding: 0.75rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }
  .flip-card-back p {
    font-size: 0.65rem !important; /* Even smaller to be safe */
    line-height: 1.2 !important;
    margin-bottom: 0.4rem !important;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .flip-card-back div {
    font-size: 0.8rem !important;
  }
}
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
  font-size: 16px; 
  scroll-behavior: auto; 
  -webkit-font-smoothing: antialiased; 
  overflow-x: hidden;
  width: 100%;
}
body { 
  background-color: var(--bg); 
  color: var(--text); 
  font-family: var(--sans); 
  line-height: 1.5; 
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

/* Base Layout */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 4rem;
}

.section {
  padding: 8rem 0;
  border-top: 1px solid var(--border);
}

/* Typography Mastery */
h1, h2, h3, .display-font {
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h1.editorial-title {
  font-family: var(--serif);
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

h1 { font-size: clamp(3.5rem, 8vw, 6.5rem); letter-spacing: -0.05em; }
h2 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.1; letter-spacing: -0.03em; }
h3 { font-size: 1.8rem; letter-spacing: -0.02em; font-weight: 400; }

p { font-size: 1.125rem; color: var(--text-dim); font-weight: 400; line-height: 1.6; }

.label {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  display: block;
}

/* Header Architectural */
.nav-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 3000;
  padding: 1.5rem 0;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link { width: 140px; height: 36px; display: flex; align-items: center; text-decoration: none; }
.logo-svg { width: 100%; height: 100%; }
.logo-path { 
    stroke: var(--primary); 
    fill: none; 
    stroke-width: 45.55px; 
    stroke-linecap: round; 
    stroke-linejoin: round;
}

.nav-actions { display: flex; gap: 2rem; align-items: center; }

.nav-links { display: flex; gap: 3rem; align-items: center; }
.nav-link { 
  color: var(--text); 
  text-decoration: none; 
  font-size: 0.75rem; 
  font-weight: 600; 
  letter-spacing: 0.05em; 
  text-transform: uppercase;
  transition: color 0.3s ease;
}
.nav-link:hover, .nav-link.active { color: var(--primary); }

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* Hamburger Menu Icon */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 3000;
}
.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.4s var(--ease);
}

/* Mobile Nav Overlay */
.nav-mobile {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 2500;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 10rem 2rem 4rem;
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.6s var(--ease);
    overflow-y: auto;
}
.nav-mobile.active { transform: translateX(0); }
.nav-mobile .nav-link { 
    font-size: clamp(1.8rem, 8vw, 2.5rem); 
    line-height: 1.1;
    text-align: center;
    width: 100%;
    font-family: var(--serif);
    text-transform: uppercase;
}
.nav-mobile .btn {
    width: 100%;
    justify-content: center;
    margin-top: 2rem;
}

/* Buttons - Editorial Style */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 400;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.4s var(--ease);
  border: 1px solid var(--text);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.btn:hover { background: transparent; color: var(--text); }

.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: none;
  border-bottom: 1px solid var(--text);
  padding: 0.2rem 0;
  border-radius: 0;
}
.btn-ghost:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Moving Gradient CTA */
.btn-glitch {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2.8rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: transparent;
    text-transform: uppercase;
    font-family: var(--sans);
    font-weight: 600;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-glitch span {
    background: linear-gradient(to right, #ff6b35, #b35eff, #4facfe, #b35eff, #ff6b35);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    to { background-position: 200% center; }
}

.btn-glitch:hover {
    border-color: #b35eff;
    box-shadow: 0 0 20px rgba(179, 94, 255, 0.1);
}

/* Split Hero Architectural */
.hero-nex {
  min-height: 85vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding-top: 10rem; /* Increased for premium header clearance */
  opacity: 1; /* Ensure visibility */
  overflow: hidden;
  position: relative;
}
.hero-left { padding-right: 4rem; border-right: 1px solid var(--border); padding-bottom: 4rem; }
.hero-right { padding-left: 4rem; padding-bottom: 4rem; }

/* Infinite Marquee Engine */
.marquee-container {
  width: 100%;
  overflow: hidden;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  z-index: 2;
}

.marquee-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Service Tags */
.service-tags {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}
.tag {
  padding: 0.8rem 1.8rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  transition: all 0.4s ease;
  background: var(--surface);
}
.tag:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

/* Mission Grid (Bento) */
.mission-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
}
.mission-text { padding: 4rem 4rem 4rem 0; border-right: 1px solid var(--border); }
.mission-assets { padding: 4rem; display: flex; flex-direction: column; gap: 2rem; }

.media-box {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.media-box img, .media-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.media-box:hover img, .media-box:hover video { transform: scale(1.05); }

/* Testimonials */
.quote-area { text-align: center; max-width: 900px; margin: 0 auto; }
.quote-text {
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 3rem;
  font-style: italic;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 5rem;
}
.team-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface);
  border-radius: var(--radius);
  filter: grayscale(1);
  opacity: 0; /* Animated in JS */
  transition: filter 0.8s ease, transform 0.8s var(--ease);
}
.team-img.active-color { filter: grayscale(0); }

/* Portfolio Grid */
.portfolio-nex {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}
.work-card { display: flex; flex-direction: column; }
.work-meta { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 1.5rem; }

/* Mission Rows – alternating image/text layout */
.mission-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
}

.mission-text {
    padding: 4rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mission-assets {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.media-box {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--surface);
}

.media-box img,
.media-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .mission-row {
        grid-template-columns: 1fr;
    }
    .mission-text {
        padding: 2.5rem 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        order: 1 !important; /* Always put text first on mobile */
    }
    .mission-assets {
        order: 2 !important;
        padding: 0 !important;
    }
    /* Collapse the flipped row's left border on mobile */
    .mission-text[style*="border-left"] {
        border-left: none !important;
        padding-left: 0 !important;
    }
    /* Contact bridge grid stacks on mobile */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
}

/* FAQ Accordion — hover to open */
.faq-list { border-top: 1px solid var(--border); }

.faq-item {
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.faq-q {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem 2rem 1.5rem;
    font-family: var(--sans);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 500;
    color: var(--text);
    cursor: default;
    gap: 2rem;
    letter-spacing: -0.02em;
    user-select: none;
}

.faq-plus {
    font-size: 1.8rem;
    font-weight: 300;
    flex-shrink: 0;
    color: #b35eff;
    transition: transform 0.35s var(--ease);
    line-height: 1;
    display: block;
}

.faq-a {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-dim);
    max-height: 0;
    overflow: hidden;
    padding-bottom: 0;
    padding-left: 1.5rem;
    padding-right: 3rem;
    transition: max-height 0.4s var(--ease), padding-bottom 0.4s var(--ease);
}

/* Hover opens the answer */
.faq-item:hover .faq-a {
    max-height: 1000px;
    padding-bottom: 2rem;
}
.faq-item:hover .faq-plus {
    transform: rotate(45deg);
}

/* On mobile, keep click behavior via JS toggle */
@media (max-width: 768px) {
    .faq-q { cursor: pointer; padding-right: 3rem; }
    .faq-item.open .faq-a {
        max-height: 1000px;
        padding-bottom: 2rem;
    }
    .faq-item.open .faq-plus {
        transform: rotate(45deg);
    }
}

/* Footer */
footer { padding: 8rem 0 4rem; background: var(--bg); border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 4rem; }
.footer-link {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}
.footer-link:hover { color: var(--primary); }

/* WebGL Background */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.15;
}

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  background: #0F0F0F;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preloader-track { width: 240px; height: 1px; background: rgba(255,255,255,0.05); position: relative; }
.preloader-fill { width: 100%; height: 100%; background: var(--primary); transform: translateX(-100%); }

/* Responsive Adjustments */
/* Aura Orb Radical Reconstruction */
.contact-rebuild {
    box-shadow: 0 0 100px rgba(109, 39, 171, 0.1);
    backdrop-filter: blur(20px);
    transition: transform 0.6s var(--ease), border-color 0.6s ease;
}

.contact-rebuild::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.05) 40%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.05) 60%,
        transparent
    );
    transform: skewX(-25deg);
    animation: looped-shine 8s infinite var(--ease);
    pointer-events: none;
}

@keyframes looped-shine {
    0% { left: -150%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

.aura-orb-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    filter: blur(120px);
}

.aura-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.4;
    border-radius: 50%;
    top: 10%;
    left: 10%;
    animation: aura-move 15s infinite alternate var(--ease);
}

.aura-orb-2 {
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    width: 500px;
    height: 500px;
    top: auto;
    bottom: 10%;
    left: auto;
    right: 15%;
    animation: aura-move 20s infinite alternate-reverse var(--ease);
}

@keyframes aura-move {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(150px, 100px) scale(1.2); }
    66% { transform: translate(-100px, 50px) scale(0.9); }
    100% { transform: translate(50px, -100px) scale(1.1); }
}

/* 3D Showcase Ring */
.showcase-scene {
    position: relative;
    width: 100vw;
    height: 70vh;
    perspective: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-top: 2rem;
    --radius: 1200px;
}

.showcase-ring {
    position: relative;
    width: 250px;
    height: 350px;
    transform-style: preserve-3d;
    z-index: 10;
    will-change: transform;
    pointer-events: none; /* Ignore hover over empty ring space */
}

.showcase-item {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    transform: rotateY(var(--rotation)) translateZ(calc(var(--radius) * -1));
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    pointer-events: auto; /* Capture hover ONLY when over a physical card */
}

.showcase-card {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.06); /* Extremely subtle shadow */
}

.showcase-card img, .showcase-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@keyframes peaceTilt {
    0%   { transform: rotate(-6deg); }
    50%  { transform: rotate(6deg); }
    100% { transform: rotate(-6deg); }
}

@keyframes teamScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (max-width: 1024px) {
  .hero-nex, .mission-row, .portfolio-nex, .footer-grid { grid-template-columns: 1fr; }
  .hero-left, .hero-right, .mission-text, .mission-assets { padding: 3rem 0; border: none; }
  .container { padding: 0 2.5rem; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-nex { min-height: auto; }
  h1 { font-size: 3rem; }
  h2 { font-size: 2.2rem; }
  .contact-rebuild h2 { font-size: 4.5rem !important; }
}

@media (max-width: 480px) {
  h1 { font-size: 2.8rem; line-height: 1.05; }
  h2 { font-size: 1.8rem; }
  .container { padding: 0 1.5rem; }
  .display-font { font-size: 2.22rem !important; }
  .contact-rebuild { min-height: 60vh !important; }
  .contact-rebuild h2 { font-size: 3.5rem !important; }
  
  .hero-nex { padding-top: 10rem !important; } /* Reduced clearance for mobile */
  .contact-section { padding-top: 8rem; padding-bottom: 4rem; } /* MUST clear fixed navbar */
  
  .showcase-ring { width: 140px; height: 200px; }
  .showcase-scene { height: 40vh; --radius: 400px; perspective: 700px; }
  
  .hero-ctas { 
    flex-direction: column; 
    width: 100%; 
    gap: 1.25rem !important; 
  }
  .hero-ctas .btn { width: 100%; justify-content: center; }
  
  .contact-form-wrap {
    padding: 1.5rem; /* Drastically reduced from 3.5rem to fit 320px */
    border-radius: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
  }
}

/* Base styles for contact form wrapper if above mobile */
@media (min-width: 481px) {
  .contact-section { padding-top: 12rem; padding-bottom: 8rem; }
  .contact-form-wrap {
    background: var(--surface);
    padding: 3.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
  }
}
