@import "tailwindcss";

/* ============================================
   SILICON BALI - Design System
   Brand: Sage green (#A8BDBA), Ikigai philosophy
   Theme: Tropical Premium Dark
   ============================================ */

@theme inline {
  --color-background: #0D1117;
  --color-surface: #161B22;
  --color-border: rgba(168, 189, 186, 0.1);
  --color-sage: #A8BDBA;
  --color-sage-light: #C4D4D1;
  --color-sage-dark: #7A9994;
  --color-gold: #D4A373;
  --color-gold-light: #E0BB94;
  --color-text: #E6EDF3;
  --color-text-secondary: #8B949E;

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
}

/* ============================================
   Base Styles
   ============================================ */

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lenis smooth scroll */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.5rem, 2rem + 4vw, 5rem);
}

h2 {
  font-size: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
}

h3 {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
}

/* ============================================
   Glassmorphism
   ============================================ */

.glass-card {
  background: rgba(22, 27, 34, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 189, 186, 0.1);
  border-radius: 1rem;
}

.glass-nav {
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ============================================
   Gradient Utilities
   ============================================ */

.gradient-sage {
  background: linear-gradient(135deg, #A8BDBA 0%, #7A9994 100%);
}

.gradient-sage-text {
  background: linear-gradient(135deg, #A8BDBA 0%, #C4D4D1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-gold-text {
  background: linear-gradient(135deg, #D4A373 0%, #E0BB94 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Glow Effects
   ============================================ */

.sage-glow {
  position: relative;
}

.sage-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(168, 189, 186, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   Button Styles
   ============================================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--color-sage);
  color: var(--color-background);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 0.5rem;
  transition: all 300ms cubic-bezier(0.645, 0.045, 0.355, 1);
  min-height: 48px;
}

.btn-primary:hover {
  background: var(--color-sage-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(168, 189, 186, 0.3);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: transparent;
  color: var(--color-sage);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border: 1px solid rgba(168, 189, 186, 0.3);
  border-radius: 0.5rem;
  transition: all 300ms cubic-bezier(0.645, 0.045, 0.355, 1);
  min-height: 48px;
}

.btn-outline:hover {
  background: rgba(168, 189, 186, 0.1);
  border-color: var(--color-sage);
  transform: translateY(-2px);
}

/* ============================================
   Section Styles
   ============================================ */

.section {
  position: relative;
  padding: clamp(4rem, 8vw, 8rem) clamp(1.5rem, 5vw, 4rem);
  overflow: hidden;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   Scroll Indicator
   ============================================ */

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

.scroll-indicator {
  animation: bounce-scroll 2s ease-in-out infinite;
}

/* ============================================
   Noise Overlay
   ============================================ */

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ============================================
   Phone Mockup (CSS-only)
   ============================================ */

.phone-mockup {
  position: relative;
  width: 280px;
  height: 560px;
  background: #1a1f2e;
  border-radius: 2.5rem;
  border: 3px solid rgba(168, 189, 186, 0.2);
  box-shadow:
    0 0 0 1px rgba(168, 189, 186, 0.1),
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #0D1117;
  border-radius: 0 0 1rem 1rem;
  z-index: 10;
}

/* ============================================
   Connecting Lines (Token Economy)
   ============================================ */

@keyframes flow-line {
  0% { stroke-dashoffset: 24; }
  100% { stroke-dashoffset: 0; }
}

.flow-line {
  stroke-dasharray: 8 4;
  animation: flow-line 1.5s linear infinite;
}

/* ============================================
   GSAP Anti-Flash (FOUC Prevention)
   Hide elements before GSAP initializes.
   Reduced-motion users see them immediately.
   ============================================ */

.eco-header,
.eco-card,
.feature-content,
.feature-image,
.token-header,
.flow-step,
.stat-card,
.app-header,
.phone-container,
.app-feature-item,
.app-feature-right,
.community-header,
.community-stat,
.testimonial-card,
.hiw-header,
.hiw-mobile-step,
.cta-bg-text,
.cta-content > *,
.features-header {
  opacity: 0;
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .scroll-indicator {
    animation: none;
  }

  /* Show all GSAP-hidden elements immediately */
  .eco-header,
  .eco-card,
  .feature-content,
  .feature-image,
  .token-header,
  .flow-step,
  .stat-card,
  .app-header,
  .phone-container,
  .app-feature-item,
  .app-feature-right,
  .community-header,
  .community-stat,
  .testimonial-card,
  .hiw-header,
  .hiw-mobile-step,
  .cta-bg-text,
  .cta-content > *,
  .features-header,
  .hero-badge,
  .hero-subtitle,
  .hero-ctas,
  .hero-scroll {
    opacity: 1 !important;
  }
}

/* ============================================
   Selection
   ============================================ */

::selection {
  background: rgba(168, 189, 186, 0.3);
  color: var(--color-text);
}
