/**
 * VALINA Theme Engine 3.0 - Core Styles
 * 
 * The complete design system for all Valina pages.
 * All animations sync to --heartbeat-interval from heartbeat-sync.js
 * 
 * Version: 3.0.0
 */

@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&display=swap");

/* ============================================
   RESET & BASE
============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(
    --font-body,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif
  );
  background: var(--color-background, #0d0d14);
  color: var(--text-primary, #f8fafc);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* VTE Content wrapper */
.vte-content {
  position: relative;
  z-index: var(--z-content, 10);
  min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--val-purple);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--val-cyan);
}

/* ============================================
   HERO SECTION
============================================ */
.hero {
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.hero-content {
  max-width: 900px;
}

.hero-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.hero-v-icon {
  width: clamp(3rem, 10vw, 7rem);
  height: clamp(3rem, 10vw, 7rem);
  vertical-align: middle;
  opacity: 0.9;
  animation: vte-icon-pulse var(--heartbeat-interval, 833ms) ease-in-out
    infinite;
}

@keyframes vte-icon-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px rgba(138, 105, 199, 0.4));
  }
  15% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px rgba(138, 105, 199, 0.8));
  }
  45% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(138, 105, 199, 0.6));
  }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(4rem, 15vw, 10rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(
    135deg,
    var(--text-primary) 0%,
    var(--val-purple) 30%,
    var(--val-cyan) 60%,
    var(--text-primary) 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  animation:
    vte-gradient-shift 8s ease-in-out infinite,
    vte-title-glow var(--heartbeat-interval, 833ms) ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(138, 105, 199, 0.4));
}

@keyframes vte-gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes vte-title-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(138, 105, 199, 0.4));
  }
  15% {
    filter: drop-shadow(0 0 40px rgba(138, 105, 199, 0.7));
  }
  45% {
    filter: drop-shadow(0 0 30px rgba(138, 105, 199, 0.5));
  }
}

/* Glitch effect on hover */
.hero-title::before,
.hero-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-title:hover::before,
.hero-title:hover::after {
  opacity: 1;
}

.hero-title::before {
  animation: vte-glitch-1 3s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  filter: drop-shadow(2px 0 var(--val-cyan));
}

.hero-title::after {
  animation: vte-glitch-2 2s infinite linear alternate-reverse;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  filter: drop-shadow(-2px 0 var(--val-pink));
}

@keyframes vte-glitch-1 {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-2px);
  }
  40% {
    transform: translateX(2px);
  }
  60% {
    transform: translateX(-1px);
  }
  80% {
    transform: translateX(1px);
  }
}

@keyframes vte-glitch-2 {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(3px);
  }
  50% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(1px);
  }
}

.hero-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--text-secondary);
}

.hero-tagline {
  margin-top: 30px;
  font-size: 1.2rem;
  color: var(--text-muted);
  min-height: 1.5em;
}

.typewriter {
  border-right: 2px solid var(--val-purple);
  padding-right: 5px;
  animation: vte-blink var(--heartbeat-interval, 833ms) step-end infinite;
}

@keyframes vte-blink {
  50% {
    border-color: transparent;
  }
}

/* ============================================
   HERO STATS
============================================ */
.hero-stats {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 60px;
  margin-top: 40px;
  flex-wrap: wrap;
  position: relative;
}

.stats-live-badge {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--val-green);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--val-green);
  border-radius: 50%;
  animation: vte-live-pulse var(--heartbeat-interval, 833ms) ease-in-out
    infinite;
  box-shadow: 0 0 10px var(--val-green);
}

@keyframes vte-live-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--val-purple);
  display: inline;
  transition: all 0.3s ease;
}

.stat-suffix {
  font-size: 1.5rem;
  color: var(--val-cyan);
}

.stat-label {
  display: block;
  margin-top: 5px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

/* ============================================
   BUTTONS
============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--val-purple);
  box-shadow: var(--glow-purple);
}

.btn-primary:hover {
  background: rgba(138, 105, 199, 0.15);
  box-shadow: var(--glow-purple-lg);
  transform: translateY(-2px);
}

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

.btn-secondary:hover {
  background: rgba(138, 105, 199, 0.1);
  border-color: var(--val-purple);
  box-shadow: var(--glow-purple);
  transform: translateY(-2px);
}

.btn-tertiary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.btn-tertiary:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.8);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

/* ============================================
   HERO CTA & SCROLL INDICATOR
============================================ */
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 50px;
  flex-wrap: wrap;
}

.hero-divider {
  color: var(--val-purple);
  font-size: 2rem;
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 60px auto 40px;
  padding: 20px 0;
  text-align: center;
  animation: vte-float 2s ease-in-out infinite;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.scroll-indicator:hover {
  transform: scale(1.1);
}

.scroll-indicator span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.scroll-indicator:hover span {
  color: var(--val-purple);
}

.scroll-v-icon {
  width: 60px;
  height: 60px;
  opacity: 0.7;
  animation: vte-scroll-bounce 1.5s ease-in-out infinite;
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(138, 105, 199, 0.5));
}

.scroll-indicator:hover .scroll-v-icon {
  opacity: 1;
  filter: drop-shadow(0 0 16px rgba(138, 105, 199, 0.8));
}

@keyframes vte-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes vte-scroll-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

/* ============================================
   SECTION STYLES
============================================ */
.section {
  padding: 80px 20px;
  position: relative;
  z-index: 10;
}

.container {
  max-width: var(--container-max, 1400px);
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--val-purple);
  margin-bottom: 16px;
  text-align: center;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--text-primary), var(--val-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 60px;
}

.section-subtitle {
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: -40px auto 60px;
}

/* ============================================
   MAIN CONTENT WRAPPER
============================================ */
.main-content {
  position: relative;
  z-index: var(--z-content, 10);
  min-height: 100vh;
  padding-top: var(--val-bar-height, 48px);
}

/* ============================================
   CARDS
============================================ */
.app-card {
  position: relative;
  background: linear-gradient(
    145deg,
    rgba(18, 18, 35, 0.95) 0%,
    rgba(26, 26, 50, 0.9) 100%
  );
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 32px 28px;
  text-decoration: none;
  color: inherit;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at top left,
    rgba(138, 105, 199, 0.08) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.app-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-color-hover);
  box-shadow:
    var(--shadow-xl),
    0 0 60px rgba(138, 105, 199, 0.1);
}

.app-card:hover::before {
  opacity: 1;
}

.app-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(138, 105, 199, 0.15) 0%,
    rgba(99, 102, 241, 0.1) 100%
  );
  border: 1px solid rgba(138, 105, 199, 0.25);
  border-radius: var(--border-radius-xl);
  font-size: 2rem;
  transition: all 0.4s ease;
  animation: vte-icon-gentle-pulse 3s ease-in-out infinite;
}

@keyframes vte-icon-gentle-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(138, 105, 199, 0.4);
  }
  50% {
    box-shadow: 0 0 20px 5px rgba(138, 105, 199, 0.2);
  }
}

.app-card:hover .app-icon {
  transform: scale(1.1) rotate(5deg);
  border-color: var(--val-purple);
  box-shadow: 0 0 30px rgba(138, 105, 199, 0.3);
}

.app-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--val-purple);
  text-align: center;
  letter-spacing: 0.05em;
}

.app-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.7;
  text-align: center;
  flex-grow: 1;
}

/* Tags */
.app-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  padding: 5px 14px;
  background: rgba(138, 105, 199, 0.1);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-full);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.3s ease;
}

.tag.live {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--val-green);
}

.app-card:hover .tag {
  border-color: var(--border-color-hover);
  color: var(--val-purple);
}

/* Verified badge */
.verified-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--border-radius-full);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--val-green);
  letter-spacing: 0.1em;
  box-shadow: var(--glow-green);
}

.verified-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--val-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--val-green);
  animation: vte-live-pulse var(--heartbeat-interval, 833ms) ease-in-out
    infinite;
}

.verified-badge.built {
  background: rgba(138, 105, 199, 0.15);
  border-color: rgba(138, 105, 199, 0.4);
  color: var(--val-purple);
  box-shadow: var(--glow-purple);
}

.verified-badge.built::before {
  background: var(--val-purple);
  box-shadow: 0 0 8px var(--val-purple);
  animation: none;
}

/* ============================================
   SECTIONS
============================================ */
section {
  padding: 100px 20px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--val-purple);
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 8px;
}

/* ============================================
   GRID LAYOUTS
============================================ */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

/* 4 column grid for differentiators */
.differentiator-row .apps-grid {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
  .differentiator-row .apps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .differentiator-row .apps-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   FEATURES
============================================ */
.feature {
  position: relative;
  padding-left: 100px;
  min-height: 120px;
}

.feature-number {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  color: var(--val-purple);
  line-height: 1;
  opacity: 0.85;
  text-shadow: 0 0 20px rgba(138, 105, 199, 0.4);
}

.feature h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.feature p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.feature-badge {
  position: absolute;
  bottom: 0;
  left: 80px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--border-radius-full);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--val-green);
  letter-spacing: 0.05em;
}

/* ============================================
   CTA SECTION
============================================ */
.cta-section {
  text-align: center;
  padding: 120px 20px;
  background: linear-gradient(180deg, transparent, rgba(138, 105, 199, 0.05));
}

.cta-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.cta-description {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* ============================================
   SCROLL INDICATOR
============================================ */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 50px auto 40px;
  padding: 20px 0;
  text-align: center;
  animation: vte-float 2s ease-in-out infinite;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

@keyframes vte-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.scroll-indicator span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.scroll-indicator:hover span {
  color: var(--val-purple);
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  margin: 0 auto;
  border-right: 2px solid var(--val-purple);
  border-bottom: 2px solid var(--val-purple);
  transform: rotate(45deg);
  animation: vte-scroll-bounce 1.5s ease-in-out infinite;
  transition: border-color 0.3s ease;
}

@keyframes vte-scroll-bounce {
  0%,
  100% {
    opacity: 0.5;
    transform: rotate(45deg) translateY(0);
  }
  50% {
    opacity: 1;
    transform: rotate(45deg) translateY(5px);
  }
}

/* ============================================
   UTILITY CLASSES
============================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.text-primary {
  color: var(--text-primary);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-muted {
  color: var(--text-muted);
}
.text-purple {
  color: var(--val-purple);
}
.text-cyan {
  color: var(--val-cyan);
}
.text-green {
  color: var(--val-green);
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.gap-2 {
  gap: var(--space-2);
}
.gap-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}

.mt-4 {
  margin-top: var(--space-4);
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-8 {
  margin-bottom: var(--space-8);
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
  .hero-stats {
    gap: 30px;
  }

  .hero-subtitle {
    flex-direction: column;
    gap: 10px;
    font-size: 1rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .feature {
    padding-left: 70px;
  }

  .feature-number {
    font-size: 2rem;
  }

  .feature-badge {
    left: 0;
    position: relative;
    margin-top: 15px;
    display: inline-block;
  }

  section {
    padding: 60px 20px;
  }
}
