/* Heyxia Design System - styles.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Typography Scales */
  --size-heading: 40px;
  --size-body: 17px;

  /* Light Mode */
  --color-accent: #2D2F94;
  --color-accent-glow: rgba(45, 47, 148, 0.2);
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #FFFFFF;
  --color-modal-overlay: rgba(240, 240, 244, 0.9);
  --color-glass: #FFFFFF;
  --color-glass-heavy: #FFFFFF;
  --color-text-primary: #1F1F2A;
  --color-text-secondary: #5A5A6A;
  --color-gst: #1A6FD4;
  --color-gst-glow: rgba(26, 111, 212, 0.1);
  --color-ana: #A855F7;
  --color-ana-glow: rgba(168, 85, 247, 0.1);
  --color-border: rgba(0, 0, 0, 0.04);
  --color-border-bright: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.08);
  --glass-blur: blur(0px);
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark {
  --color-bg-primary: #1C1919;
  --color-bg-secondary: #262222;
  --color-modal-overlay: rgba(28, 25, 25, 0.9);
  --color-glass: #262222;
  --color-glass-heavy: #262222;
  --color-text-primary: #F8F8F6;
  --color-text-secondary: #A0A0B0;
  --color-border: rgba(255, 255, 255, 0.05);
  --color-border-bright: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
}

html.dark .bg-mesh {
  background-color: transparent;
  background-image: linear-gradient(135deg, rgba(45, 47, 148, 0.15) 0%, transparent 100%);
}

html.dark .nav-logo img {
  filter: invert(1) hue-rotate(180deg) brightness(1.2);
  mix-blend-mode: screen;
}




/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: color 0.5s ease;
}

html.dark body {
  background-color: transparent;
  background-image: none;
}

/* Iridescent Shimmer Effect */
body::before {
  content: '';
  position: fixed;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    rgba(255, 100, 100, 0.04),
    rgba(100, 100, 255, 0.04),
    rgba(180, 100, 255, 0.04),
    rgba(100, 200, 255, 0.04),
    rgba(255, 100, 100, 0.04)
  );
  pointer-events: none;
  z-index: -1;
  animation: iridescent-drift 35s linear infinite;
  opacity: 0.5;
  mix-blend-mode: screen;
}

@keyframes iridescent-drift {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Light mode specific background reset */
html:not(.dark) body {
  background: #FFFFFF !important;
  background-image: none !important;
  background-attachment: unset !important;
}

html:not(.dark) body::before {
  display: none !important; /* Remove iridescent overlay in light mode */
}

html:not(.dark) {
  background-color: #FFFFFF !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

/* Section Headings */
h2, .brilliance-heading, .section-header h2, #audience h2, .stories-section h2, #pipeline h3 {
  font-size: var(--size-heading) !important;
  font-weight: 500 !important;
  margin-bottom: 1.5rem;
}

/* Global Body Text */
p, .brilliance-subtitle, .section-header p, .story-text, .hero-sub {
  font-family: var(--font-body);
  font-size: var(--size-body) !important;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

/* Hero Exception */
.hero-title {
  font-size: 4rem !important;
  font-weight: 700 !important;
  margin-bottom: 1rem;
}

/* Card & CTA Headings (Preserve Bold) */
.card-title, .product-card h3, .story-card h3, .cta-card p, #final-cta h2, .audience-card h3 {
  font-weight: 700 !important;
}

/* Link Reset */
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.grid { display: grid; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Section Styling */
section {
  padding: 8rem 0;
  position: relative;
}

/* Glassmorphism Utilities */
.glass-panel {
  background: var(--color-glass);
  border: 1px solid var(--color-border);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
  overflow: hidden;
}

.glass-panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border-bright);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 100px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  outline: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #FFFFFF;
  box-shadow: 0 4px 12px var(--color-accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--color-accent-glow);
  background-color: #3B3DAA;
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  background-color: var(--color-glass);
  border-color: var(--color-text-primary);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent-glow);
  transform: translateY(-2px);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.story-badge {
  white-space: nowrap;
}

.badge-red { background: var(--color-accent-glow); color: var(--color-accent); }
.badge-blue { background: rgba(26, 111, 212, 0.1); color: var(--color-gst); }
.badge-purple { background: var(--color-ana-glow); color: var(--color-ana); }

/* Theme Toggle Switch */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  transition: var(--transition-smooth);
}

.theme-toggle:hover {
  background: var(--color-glass);
}

/* Background Gradients */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background-color: transparent;
  background-image: none;
  overflow: hidden;
  pointer-events: none;
  transition: background-color 0.5s ease;
}

.mesh-orb {
  position: absolute;
  filter: blur(100px);
  border-radius: 50%;
  opacity: 0.85;
  animation: orb-float 25s infinite alternate ease-in-out;
}

.orb-1 {
  top: -10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
}

.orb-2 {
  bottom: -10%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-gst-glow) 0%, transparent 70%);
  animation-delay: -5s;
}

.orb-3 {
  top: 40%;
  left: 50%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--color-ana-glow) 0%, transparent 70%);
  animation-delay: -10s;
}

@keyframes orb-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 100px) scale(1.2); }
}

/* Grid Pattern Background */
.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(var(--color-border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
  z-index: -1;
  pointer-events: none;
}

/* 3D Interactive Books */
.product-showcase-item {
  position: relative;
  margin-bottom: 2rem;
}

.book-wrapper {
  perspective: 2000px;
  width: 500px;
  height: 70px;
  margin: 2rem auto 3rem auto;
  cursor: pointer;
  z-index: 2;
  position: relative;
}

.book {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(10deg) rotateZ(0deg);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.book-wrapper:hover .book {
  transform: rotateX(20deg) rotateZ(-1deg) scale(1.05);
}

.book-face {
  position: absolute;
  backface-visibility: hidden;
}

/* Spine is the front face */
.book-spine {
  width: 100%;
  height: 100%;
  top: 0; left: 0;
  transform: translateZ(150px);
  border-radius: 4px;
  box-shadow: 
    inset 0 4px 8px rgba(255,255,255,0.7),
    inset 0 -12px 16px rgba(0,0,0,0.25),
    inset 6px 0 10px rgba(0,0,0,0.1),
    inset -6px 0 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  overflow: hidden;
}

.book-spine::after {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
  pointer-events: none; mix-blend-mode: overlay;
}

.book-spine span {
  font-weight: 700;
  letter-spacing: 2px;
  opacity: 0.9;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* Front Cover is the top face */
.book-front {
  width: 100%;
  height: 300px;
  top: -115px; /* (70 - 300)/2 */
  left: 0;
  transform: rotateX(90deg) translateZ(35px); /* half of height 70 */
  border-radius: 4px 4px 12px 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5), inset 0 6px 15px rgba(255,255,255,0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.book-front::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: 
    linear-gradient(to top, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.05) 2%, rgba(255,255,255,0.6) 3.5%, rgba(255,255,255,0) 8%),
    linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 15%);
  pointer-events: none;
  z-index: 2;
}

.book-front::after {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
  pointer-events: none; mix-blend-mode: overlay;
}

/* Back Cover is the bottom face */
.book-back {
  width: 100%;
  height: 300px;
  top: -115px;
  left: 0;
  transform: rotateX(-90deg) translateZ(35px);
  background: #F8F8F8;
  border-radius: 12px 12px 4px 4px;
  box-shadow: 
    0 10px 20px rgba(0,0,0,0.05),
    0 30px 60px rgba(0,0,0,0.1),
    0 50px 100px rgba(0,0,0,0.1);
}

html.dark .book-back {
  box-shadow: 
    0 10px 20px rgba(0,0,0,0.5),
    0 30px 60px rgba(0,0,0,0.6),
    0 50px 100px rgba(0,0,0,0.6);
}

/* Pages */
.book-pages-right {
  width: 300px;
  height: 100%;
  top: 0;
  left: 100px; /* (500 - 300)/2 */
  transform: rotateY(90deg) translateZ(250px); /* half of width 500 */
  background: 
    linear-gradient(to right, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 15%),
    repeating-linear-gradient(to bottom, #FCFCFC, #FCFCFC 2px, #EAEAEA 2px, #EAEAEA 4px);
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.1), inset 0 -3px 6px rgba(0,0,0,0.1), inset -4px 0 8px rgba(0,0,0,0.1);
}

.book-pages-left {
  width: 300px;
  height: 100%;
  top: 0;
  left: 100px;
  transform: rotateY(-90deg) translateZ(250px);
  background: 
    linear-gradient(to left, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 15%),
    repeating-linear-gradient(to bottom, #FCFCFC, #FCFCFC 2px, #EAEAEA 2px, #EAEAEA 4px);
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.1), inset 0 -3px 6px rgba(0,0,0,0.1), inset 4px 0 8px rgba(0,0,0,0.1);
}

.book-pages-back {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  transform: rotateY(180deg) translateZ(150px);
  background: repeating-linear-gradient(to right, #FCFCFC, #FCFCFC 2px, #EAEAEA 2px, #EAEAEA 4px);
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.1), inset 0 -3px 6px rgba(0,0,0,0.1);
}

.book-gst .book-front { background: linear-gradient(135deg, #E0EFFF 0%, #FFFFFF 100%); }
.book-gst .book-spine { background: linear-gradient(to right, #E0EFFF, #F0F7FF); color: #1A6FD4; }

.book-ana .book-front { background: linear-gradient(135deg, #EBE0FF 0%, #FFFFFF 100%); }
.book-ana .book-spine { background: linear-gradient(to right, #EBE0FF, #F5EEFF); color: #6B21A8; }

.book-content-hidden {
  display: none;
}

.product-showcase-item.is-open .book-wrapper {
  display: none;
}

.product-showcase-item.is-open .book-content-hidden {
  display: grid;
  animation: cardReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardReveal {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: 100px;
  background-color: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.form-control-compact {
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
}

.transparent-modal {
  background-color: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

html.dark .transparent-modal {
  background-color: rgba(38, 34, 34, 0.5) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-glow);
}

/* Success Modal */
.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: popIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  80% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  section { padding: 6rem 0; }
  .container { padding: 0 1.5rem; }
  .hero-content { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
  .hero-text { align-items: center; }
  .hero-mockup { height: 450px; }
  .mockup-card { width: 340px; }
  .card-gst { top: 5%; left: 10%; }
  .card-ana { bottom: 5%; right: 10%; }
  .hero-btns { justify-content: center; flex-wrap: wrap; }
  .problem-grid, .audience-grid, .stories-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 1.5rem; }
  .book-wrapper { width: 400px; }
}

@media (max-width: 768px) {
  section { padding: 4rem 0; }
  .container { padding: 0 1.25rem; }
  h2, .brilliance-heading, .section-header h2, #audience h2, .stories-section h2, #pipeline h3 { font-size: 2rem !important; }
  .story-badge { font-size: 0.65rem; }
  .hero-title { font-size: 2.25rem !important; }
  .hero-sub { font-size: 1rem !important; }
  .hero-content { gap: 2rem; }
  .hero-mockup { height: 350px; }
  .mockup-card { width: 280px; padding: 1.2rem; }
  .card-gst { top: 0; left: 5%; }
  .card-ana { bottom: 0; right: 5%; }
  
  /* Mobile Nav */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 1.5rem;
    flex-direction: column;
    gap: 1rem;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 10px;
  }
  .nav-links.mobile-open {
    display: flex;
  }
  .nav-link { width: 100%; text-align: left; }
  .mobile-toggle { display: block; }
  
  /* Dropdown reset for mobile */
  .nav-item-dropdown:hover .dropdown-menu, .dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0.5rem 0 0 1rem;
    opacity: 1;
    visibility: visible;
    margin-top: 0;
  }
  .dropdown-menu { display: none; }
  .nav-item-dropdown:hover .dropdown-menu { display: block; }
  
  /* Stacking */
  .problem-grid, .audience-grid, .stories-grid, .footer-grid, .case-studies-grid { grid-template-columns: 1fr !important; }
  .footer-col { text-align: left; margin-bottom: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; align-items: flex-start; text-align: left; }
  
  /* CTAs */
  .hero-btns { flex-direction: column; width: 100%; }
  .hero-btns > div { flex-direction: column; width: 100%; }
  .hero-btns .btn { width: 100%; justify-content: center; }
  .story-footer { flex-direction: column; align-items: flex-start; }
  
  /* Books */
  .book-wrapper { width: 300px; height: 50px; margin: 1rem auto; }
  .book-pages-right { width: 220px; left: 40px; transform: rotateY(90deg) translateZ(150px); }
  .book-pages-left { width: 220px; left: 40px; transform: rotateY(-90deg) translateZ(150px); }
  .book-front, .book-back { height: 220px; top: -85px; }
  .book-front { transform: rotateX(90deg) translateZ(25px); }
  .book-back { transform: rotateX(-90deg) translateZ(25px); }
  .book-spine { transform: translateZ(110px); padding: 0 0.75rem !important; overflow: hidden; }
  .book-gst .book-spine .spine-text-sub { font-size: 0.4rem !important; }
  .book-gst .book-spine .spine-text-main { font-size: 0.7rem !important; }
  .book-ana .book-spine .spine-text-sub { font-size: 0.5rem !important; }
  .book-ana .book-spine .spine-text-main { font-size: 0.7rem !important; }
  .book-spine .spine-logo { width: 45px !important; height: auto !important; flex-shrink: 0; }
  
  /* Modals */
  .modal-content { padding: 2rem 1.5rem; border-radius: 24px; }
  .lightbox-content { width: 95vw; }
  .lightbox-card { padding: 1.5rem; border-radius: 20px; }
  .close-modal, .lightbox-close { top: 1rem; right: 1rem; }
  
  /* Resources Tabs */
  .tabs-nav { flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
  .tab-btn { padding: 0.6rem 1.2rem; font-size: 0.85rem; }
}

@media (max-width: 430px) {
  .hero-mockup { height: 300px; }
  .mockup-card { width: 240px; padding: 1rem; }
  .card-gst { left: 0; }
  .card-ana { right: 0; }
  .metrics-grid { grid-template-columns: 1fr !important; }
}
