/* ==========================================================================
   BUNKWISE DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

:root {
  /* Colors */
  --bg-dark: #05070f;
  --bg-darker: #020408;
  --bg-card: rgba(13, 17, 30, 0.45);
  --bg-card-hover: rgba(20, 26, 46, 0.65);
  
  --text-white: #f8fafd;
  --text-gray: #b0b9cf;
  --text-muted: #6b7794;
  
  /* Accents */
  --accent-cyan: #39d3ff;
  --accent-violet: #8c70ff;
  --accent-lime: #86f990;
  --accent-gold: #ffb547;
  --accent-rose: #ff5b8c;
  --accent-blue: #4086ff;
  
  /* Gradients */
  --primary-gradient: linear-gradient(135deg, #8c70ff 0%, #39d3ff 50%, #86f990 100%);
  --blue-glow: radial-gradient(circle, rgba(57, 211, 255, 0.15) 0%, transparent 70%);
  --purple-glow: radial-gradient(circle, rgba(140, 112, 255, 0.12) 0%, transparent 70%);
  --lime-glow: radial-gradient(circle, rgba(134, 249, 144, 0.08) 0%, transparent 70%);
  
  /* Layout */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-active: rgba(140, 112, 255, 0.25);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-pill: 999px;
  
  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-cyan-glow: 0 10px 30px rgba(57, 211, 255, 0.2);
  
  /* Transitions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-default: all 0.3s var(--ease-smooth);
}

/* 1. Base Styles & Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  overflow-x: hidden;
  width: 100%;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  width: 100%;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
  position: relative;
  z-index: 2;
}

/* 2. Layout Elements */
.section-container {
  width: min(1200px, 100% - 40px);
  margin: 0 auto;
  position: relative;
}

/* Ambient BG Orbs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  filter: blur(80px);
  opacity: 0.8;
}

.bg-orb-1 {
  width: 600px;
  height: 600px;
  background: var(--blue-glow);
  top: -10%;
  left: -10%;
}

.bg-orb-2 {
  width: 500px;
  height: 500px;
  background: var(--purple-glow);
  top: 40%;
  right: -10%;
}

.bg-orb-3 {
  width: 400px;
  height: 400px;
  background: var(--lime-glow);
  bottom: -5%;
  left: 20%;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-size: 64px 64px;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  pointer-events: none;
  z-index: 1;
  mask-image: radial-gradient(circle at top center, black, transparent 80%);
}

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

/* 3. Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 20px 0;
  transition: var(--transition-default);
}

.navbar.scrolled {
  background: rgba(5, 7, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 14px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.nav-container {
  width: min(1200px, 100% - 40px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.app-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease-spring);
}

.logo-group:hover .app-logo {
  transform: scale(1.06) rotate(3deg);
}

.wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-gray);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width 0.25s ease;
}

.nav-link:hover {
  color: var(--text-white);
}

.nav-link:hover::after {
  width: 100%;
}

/* 4. Button System */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--primary-gradient);
  color: var(--bg-darker);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-cyan-glow);
  text-decoration: none;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease, filter 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(57, 211, 255, 0.35);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.large {
  padding: 14px 28px;
  font-size: 1.05rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-white);
  border: 1px solid var(--border-glass);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-default);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-secondary.large {
  padding: 14px 28px;
  font-size: 1.05rem;
}

.btn-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

/* 5. Hero Section */
.hero-section {
  padding: 160px 0 60px;
  position: relative;
  z-index: 10;
}

.hero-container {
  width: min(1200px, 100% - 40px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-content {
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-lime);
  box-shadow: 0 0 10px var(--accent-lime);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 14px var(--accent-lime); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.05em;
  margin-bottom: 24px;
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-gray);
  margin-bottom: 36px;
  max-width: 680px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 36px;
}

.hero-notes {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.note-separator {
  opacity: 0.5;
}

/* 6. Showcase Section (3D Perspective Screenshots) */
.showcase-section {
  padding: 60px 0 100px;
  position: relative;
  z-index: 10;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 64px;
}

.kicker {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--accent-violet);
  display: block;
  margin-bottom: 12px;
}

.section-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.section-subtext {
  color: var(--text-gray);
  font-size: 1.05rem;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  perspective: 1200px;
  padding-top: 20px;
}

/* 3D Tilted Card */
.screenshot-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-style: preserve-3d;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease-smooth), border-color 0.3s ease, box-shadow 0.4s ease;
  backdrop-filter: blur(12px);
}

.screenshot-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent 60%);
  pointer-events: none;
}

/* Card Glow Effect */
.card-glow {
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan), transparent);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.screenshot-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.6), 0 0 30px rgba(140, 112, 255, 0.15);
}

.screenshot-card:hover .card-glow {
  opacity: 0.65;
}

/* Mobile Phone Frame Mockup */
.phone-frame {
  width: 250px;
  height: 520px;
  background: #090a10;
  border: 8px solid #1a1e2a;
  border-radius: 36px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8), inset 0 0 10px rgba(255,255,255,0.03);
  overflow: hidden;
  margin-bottom: 24px;
  transform: translateZ(30px); /* Lift in 3D space */
  transition: transform 0.3s ease;
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
}

.screenshot-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dynamic Island Notch */
.phone-island {
  width: 72px;
  height: 16px;
  background: #000;
  border-radius: 8px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}

.phone-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
  z-index: 4;
}

.card-caption {
  text-align: center;
  transform: translateZ(20px); /* 3D layer pop */
}

.card-caption h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-caption p {
  font-size: 0.9rem;
  color: var(--text-gray);
  line-height: 1.5;
}

/* Showcase grid offset positioning for 3D stack look */
@media (min-width: 1025px) {
  .screenshot-card:nth-child(1) {
    transform: rotateY(12deg) rotateX(4deg) translateY(20px);
  }
  .screenshot-card:nth-child(2) {
    transform: translateZ(40px) translateY(-10px);
  }
  .screenshot-card:nth-child(3) {
    transform: rotateY(-12deg) rotateX(4deg) translateY(20px);
  }

  .screenshot-card:nth-child(1):hover {
    transform: rotateY(2deg) rotateX(1deg) scale(1.05) translateY(0);
  }
  .screenshot-card:nth-child(2):hover {
    transform: translateZ(60px) scale(1.05) translateY(-15px);
  }
  .screenshot-card:nth-child(3):hover {
    transform: rotateY(-2deg) rotateX(1deg) scale(1.05) translateY(0);
  }
}

/* 7. Features Section */
.features-section {
  padding: 80px 0 100px;
  position: relative;
  z-index: 10;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: var(--transition-default);
  backdrop-filter: blur(8px);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.icon-svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Color codes */
.bg-cyan { background: rgba(57, 211, 255, 0.08); border: 1px solid rgba(57, 211, 255, 0.15); }
.color-cyan { stroke: var(--accent-cyan); }

.bg-violet { background: rgba(140, 112, 255, 0.08); border: 1px solid rgba(140, 112, 255, 0.15); }
.color-violet { stroke: var(--accent-violet); }

.bg-emerald { background: rgba(134, 249, 144, 0.08); border: 1px solid rgba(134, 249, 144, 0.15); }
.color-emerald { stroke: var(--accent-lime); }

.bg-amber { background: rgba(255, 181, 71, 0.08); border: 1px solid rgba(255, 181, 71, 0.15); }
.color-amber { stroke: var(--accent-gold); }

.bg-rose { background: rgba(255, 91, 140, 0.08); border: 1px solid rgba(255, 91, 140, 0.15); }
.color-rose { stroke: var(--accent-rose); }

.bg-blue { background: rgba(64, 134, 255, 0.08); border: 1px solid rgba(64, 134, 255, 0.15); }
.color-blue { stroke: var(--accent-blue); }

.feature-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

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

/* 8. Call To Action (CTA) Section */
.cta-section {
  padding: 80px 0 120px;
  position: relative;
  z-index: 10;
}

.cta-inner {
  width: min(1000px, 100% - 40px);
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.cta-gradient-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(circle, rgba(140, 112, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}

.cta-inner h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

.cta-inner p {
  color: var(--text-gray);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 36px;
  position: relative;
  z-index: 2;
}

.cta-btn {
  position: relative;
  z-index: 2;
}

/* 9. Footer */
.footer {
  background-color: var(--bg-darker);
  border-top: 1px solid var(--border-glass);
  padding: 60px 0;
  position: relative;
  z-index: 10;
}

.footer-container {
  width: min(1200px, 100% - 40px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  max-width: 450px;
}

.footer-actions {
  margin-bottom: 28px;
}

.kofi-btn {
  color: var(--accent-cyan);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition-default);
  border: 1px solid rgba(57, 211, 255, 0.2);
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  background: rgba(57, 211, 255, 0.03);
}

.kofi-btn:hover {
  color: var(--text-white);
  background: rgba(57, 211, 255, 0.1);
  border-color: rgba(57, 211, 255, 0.4);
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* 10. Scroll & Reveal Animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-smooth), transform 0.8s var(--ease-smooth);
}

.scroll-reveal.reveal-active {
  opacity: 1;
  transform: translateY(0);
}

/* 11. Responsive Breakpoints */
@media (max-width: 1024px) {
  .screenshot-grid {
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
    gap: 24px;
  }
  .screenshot-card:nth-child(3) {
    grid-column: span 2;
  }
  .screenshot-card {
    transform: none !important;
  }
  .screenshot-card:hover {
    transform: translateY(-4px) !important;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 16px 0;
  }
  .nav-links {
    gap: 16px;
  }
  .nav-link {
    display: none; /* Hide standard links to keep nav clean on mobile */
  }
  .nav-cta {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .hero-section {
    padding: 120px 0 40px;
  }
  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }
  .hero-notes {
    flex-direction: column;
    gap: 6px;
  }
  .note-separator {
    display: none;
  }

  .screenshot-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .screenshot-card:nth-child(3) {
    grid-column: span 1;
  }
  .phone-frame {
    width: 220px;
    height: 460px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .feature-card {
    padding: 24px;
  }

  .cta-inner {
    padding: 48px 20px;
  }
}
