/* ============================================
   RESONANT STUDIO — Design System & Styles
   Built entirely with Claude Code
   ============================================ */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600&display=swap');

/* === CSS Variables === */
:root {
  /* Backgrounds */
  --bg-0: #06061a;
  --bg-1: #0a0a20;
  --bg-2: #10102a;
  --bg-3: #171734;
  --bg-card: #13132e;
  --bg-card-hover: #1a1a3a;

  /* Accent Colors */
  --purple: #8b5cf6;
  --purple-light: #a78bfa;
  --purple-dim: rgba(139, 92, 246, 0.15);
  --cyan: #22d3ee;
  --cyan-light: #67e8f9;
  --cyan-dim: rgba(34, 211, 238, 0.15);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.15);
  --pink: #f472b6;
  --green: #34d399;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
  --grad-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-cool: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --grad-card-border: linear-gradient(135deg, rgba(139,92,246,0.4), rgba(34,211,238,0.4));

  /* Text — kept bright for readability on dark backgrounds */
  --text-1: #f8fafc;
  --text-2: #e2e8f0;
  --text-3: #b0bec8;
  --text-4: #6b7a99;

  /* Borders */
  --border-1: rgba(255, 255, 255, 0.06);
  --border-2: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(139, 92, 246, 0.35);

  /* Shadows / Glows */
  --glow-purple: 0 0 40px rgba(139, 92, 246, 0.25), 0 0 80px rgba(139, 92, 246, 0.1);
  --glow-cyan: 0 0 40px rgba(34, 211, 238, 0.25), 0 0 80px rgba(34, 211, 238, 0.1);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);

  /* Spacing */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;
  --space-8: 128px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.3s;
  --duration-slow: 0.6s;

  /* Nav height */
  --nav-h: 72px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-1);
  color: var(--text-2);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul, ol { list-style: none; }

/* === Typography === */
h1, h2, h3, h4, h5 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-1);
  line-height: 1.15;
  font-weight: 700;
}
h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }
p { line-height: 1.75; }

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

/* === Layout === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}
.section { padding: var(--space-7) 0; }
.section-sm { padding: var(--space-5) 0; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}
.btn-ghost {
  background: var(--border-1);
  color: var(--text-1);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: var(--border-2);
  border-color: var(--border-accent);
  color: var(--purple-light);
}
.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}
.btn-outline {
  background: transparent;
  color: var(--purple-light);
  border: 1px solid var(--border-accent);
}
.btn-outline:hover {
  background: var(--purple-dim);
}

/* === Badges & Tags === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-primary {
  background: var(--purple-dim);
  color: var(--purple-light);
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.badge-cyan {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
}
.badge-amber {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-3);
  transition: all var(--duration);
}
.tag:hover {
  border-color: var(--border-accent);
  color: var(--purple-light);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background var(--duration), border-color var(--duration);
}
.nav.scrolled {
  background: rgba(10, 10, 32, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-1);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-1);
  transition: opacity var(--duration);
}
.logo:hover { opacity: 0.85; }
.logo-icon { flex-shrink: 0; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-3);
  transition: all var(--duration);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-1);
  background: var(--border-1);
}
.nav-links .btn { margin-left: var(--space-1); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all var(--duration);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: calc(var(--nav-h) + var(--space-6)) var(--space-3) var(--space-7);
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.4), transparent 70%);
  top: -200px; left: -150px;
  animation: floatOrb 12s ease-in-out infinite;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(34,211,238,0.3), transparent 70%);
  top: -100px; right: -150px;
  animation: floatOrb 15s ease-in-out infinite reverse;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(251,191,36,0.2), transparent 70%);
  bottom: 50px; left: 30%;
  animation: floatOrb 10s ease-in-out infinite 3s;
}
.hero-grid-overlay {
  position: absolute;
  inset: 0;
  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);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.hero h1 {
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
}
.hero-desc {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-3);
  max-width: 620px;
  margin: 0 auto var(--space-5);
  line-height: 1.7;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}
.hero-cta .btn { font-size: 1rem; padding: 14px 32px; }
.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-4);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: scrollBounce 2s ease-in-out infinite;
}
.scroll-mouse {
  width: 22px;
  height: 36px;
  border: 2px solid var(--border-2);
  border-radius: 11px;
  position: relative;
}
.scroll-mouse::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 6px;
  background: var(--text-4);
  border-radius: 2px;
  animation: scrollDot 2s ease-in-out infinite;
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
  background: var(--bg-2);
  border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
  padding: var(--space-5) 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.stat-item {
  text-align: center;
  padding: var(--space-3);
  border-right: 1px solid var(--border-1);
}
.stat-item:last-child { border-right: none; }
.stat-number {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 6px;
  /* Prevent data-suffix spans from stacking as separate blocks */
  white-space: nowrap;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
  text-align: center;
  margin-bottom: var(--space-6);
}
.section-header h2 { margin-bottom: var(--space-2); }
.section-header p {
  font-size: 1.1rem;
  color: var(--text-3);
  max-width: 520px;
  margin: 0 auto;
}
.section-header .section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-2);
  color: var(--purple-light);
  font-weight: 500;
  font-size: 0.95rem;
  transition: gap var(--duration);
}
.section-header .section-link:hover { gap: 10px; }

/* ============================================
   APP CARDS
   ============================================ */
.apps-section { padding: var(--space-7) 0; }
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-3);
}
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
}
.app-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-6px);
  box-shadow: var(--shadow-card), var(--glow-purple);
}
.app-card-preview {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-card-preview-gradient {
  position: absolute;
  inset: 0;
}
.app-card-preview-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  transition: opacity var(--duration);
}
.app-card:hover .app-card-preview-overlay { opacity: 0.2; }
.app-card-emoji {
  position: relative;
  z-index: 1;
  font-size: 4rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  transition: transform var(--duration) var(--ease);
}
.app-card:hover .app-card-emoji {
  transform: scale(1.1) rotate(-3deg);
}
.app-card-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease);
}
.app-card:hover .app-card-preview img { transform: scale(1.05); }
.app-card-body {
  padding: var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.app-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.app-release-date {
  font-size: 0.75rem;
  color: var(--text-4);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.app-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}
.app-card-desc {
  font-size: 0.9rem;
  color: var(--text-3);
  line-height: 1.65;
  flex: 1;
  margin-bottom: var(--space-2);
}
.app-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-2);
}
.app-card-actions {
  display: flex;
  gap: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-1);
}
.app-card-actions a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  transition: all var(--duration);
}
.app-card-actions .btn-live {
  background: var(--purple-dim);
  color: var(--purple-light);
  border: 1px solid rgba(139,92,246,0.2);
}
.app-card-actions .btn-live:hover {
  background: var(--purple);
  color: white;
}
.app-card-actions .btn-github {
  background: var(--border-1);
  color: var(--text-3);
  border: 1px solid var(--border-1);
}
.app-card-actions .btn-github:hover {
  background: var(--border-2);
  color: var(--text-1);
}
.placeholder-card .app-card-body {
  opacity: 0.5;
}

/* ============================================
   PHILOSOPHY / ABOUT SECTION
   ============================================ */
.about-section {
  padding: var(--space-7) 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: center;
}
.about-eyebrow {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple-light);
  margin-bottom: var(--space-2);
}
.about-content h2 { margin-bottom: var(--space-3); }
.about-content p {
  color: var(--text-3);
  margin-bottom: var(--space-3);
  font-size: 1.05rem;
}
.about-content .btn { margin-top: var(--space-1); }
.philosophy-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.philosophy-card {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  transition: all var(--duration);
}
.philosophy-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}
.philosophy-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.philosophy-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text-1);
}
.philosophy-card p {
  font-size: 0.88rem;
  color: var(--text-4);
  line-height: 1.6;
}

/* ============================================
   BLOG PREVIEW
   ============================================ */
.blog-preview { padding: var(--space-7) 0; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-3);
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}
.blog-card-cover {
  aspect-ratio: 21/9;
  overflow: hidden;
  position: relative;
}
.blog-card-cover-bg {
  position: absolute;
  inset: 0;
}
.blog-card-cover-label {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
}
.blog-card-body {
  padding: var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-meta {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
  font-size: 0.8rem;
  color: var(--text-4);
}
.blog-meta-dot { width: 3px; height: 3px; background: var(--text-4); border-radius: 50%; }
.blog-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 10px;
  line-height: 1.4;
  flex: 1;
}
.blog-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: var(--space-2);
}
.blog-card-footer {
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.read-more {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--purple-light);
  font-family: 'Outfit', sans-serif;
  transition: gap var(--duration);
}
.blog-card:hover .read-more { gap: 8px; }
.read-time {
  font-size: 0.78rem;
  color: var(--text-4);
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
  padding: var(--space-8) 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border-1);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section .orb {
  opacity: 0.3;
}
.cta-section .orb-1 {
  width: 400px; height: 400px;
  top: -150px; left: -100px;
}
.cta-section .orb-2 {
  width: 350px; height: 350px;
  bottom: -100px; right: -100px;
}
.cta-content { position: relative; z-index: 1; }
.cta-section h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: var(--space-3);
}
.cta-section p {
  font-size: 1.15rem;
  color: var(--text-3);
  max-width: 560px;
  margin: 0 auto var(--space-5);
}
.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}
.cta-note {
  margin-top: var(--space-4);
  font-size: 0.85rem;
  color: var(--text-4);
}
.cta-note a { color: var(--cyan); }
.cta-note a:hover { text-decoration: underline; }

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: var(--bg-0);
  border-top: 1px solid var(--border-1);
  padding: var(--space-7) 0 var(--space-4);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.footer-brand .logo { margin-bottom: var(--space-2); }
.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-4);
  max-width: 240px;
  line-height: 1.6;
}
.footer-col h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin-bottom: var(--space-2);
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: 0.9rem;
  color: var(--text-3);
  transition: color var(--duration);
}
.footer-col a:hover { color: var(--purple-light); }
.footer-bottom {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-1);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-4);
}
.footer-built-with {
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-built-with span { color: var(--purple-light); font-weight: 600; }

/* ============================================
   NEWSLETTER SECTION
   ============================================ */
.newsletter-section {
  padding: var(--space-7) 0;
  background: var(--bg-0);
  border-top: 1px solid var(--border-1);
}
.newsletter-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.newsletter-text h2 {
  margin-bottom: var(--space-2);
}
.newsletter-text p {
  font-size: 1.05rem;
  color: var(--text-3);
  margin-bottom: var(--space-4);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.newsletter-form {
  display: flex;
  gap: var(--space-2);
  max-width: 480px;
  margin: 0 auto var(--space-2);
  justify-content: center;
}
.newsletter-form input {
  flex: 1;
  padding: 12px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-full);
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--duration);
}
.newsletter-form input::placeholder { color: var(--text-4); }
.newsletter-form input:focus { border-color: var(--border-accent); }
.newsletter-note {
  font-size: 0.8rem;
  color: var(--text-4);
}

/* ============================================
   APP DETAIL PAGE
   ============================================ */
.app-detail-hero {
  padding: calc(var(--nav-h) + var(--space-6)) 0 var(--space-6);
  border-bottom: 1px solid var(--border-1);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-4);
  font-size: 0.85rem;
  color: var(--text-4);
}
.breadcrumb a { color: var(--text-3); transition: color var(--duration); }
.breadcrumb a:hover { color: var(--purple-light); }
.breadcrumb-sep { color: var(--text-4); }
.app-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: center;
}
.app-hero-info .badge { margin-bottom: var(--space-3); }
.app-hero-info h1 { margin-bottom: var(--space-2); }
.app-hero-tagline {
  font-size: 1.15rem;
  color: var(--text-3);
  margin-bottom: var(--space-4);
}
.app-hero-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.app-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-4);
}
.app-hero-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.app-preview-container {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-1);
  aspect-ratio: 16/9;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.app-preview-container .placeholder-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
}

/* Tabs */
.app-tabs-section {
  padding: var(--space-6) 0;
}
.tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: var(--space-5);
}
.tab-btn {
  padding: 12px 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-4);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--duration);
  background: none;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active {
  color: var(--purple-light);
  border-bottom-color: var(--purple);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.content-prose {
  max-width: 720px;
}
.content-prose h3 {
  font-size: 1.3rem;
  margin-bottom: var(--space-2);
  margin-top: var(--space-4);
  color: var(--text-1);
}
.content-prose h3:first-child { margin-top: 0; }
.content-prose p {
  color: var(--text-3);
  margin-bottom: var(--space-2);
  font-size: 1rem;
}
.content-prose ul {
  list-style: disc;
  padding-left: var(--space-3);
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-3);
}
.content-prose ul li { font-size: 0.95rem; line-height: 1.6; }
.tech-stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.tech-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-2);
  font-weight: 500;
}
.tech-icon { font-size: 1.2rem; }

/* Comments */
.comments-section {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border-1);
}
.comments-section h3 {
  font-size: 1.4rem;
  margin-bottom: var(--space-2);
  color: var(--text-1);
}
.comments-no-login-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--purple-dim);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: var(--space-4);
}
#cusdis_thread {
  min-height: 220px;
}
/* Cusdis iframe dark-mode nudge via color-scheme */
#cusdis_thread iframe {
  color-scheme: dark;
}
/* Setup placeholder (shown before App ID is configured) */
.cusdis-setup-note {
  background: var(--bg-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  color: var(--text-4);
  font-size: 0.9rem;
}
.cusdis-setup-note a { color: var(--purple-light); }
.cusdis-setup-note code {
  background: var(--bg-3);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--cyan);
  font-size: 0.85em;
}

/* ============================================
   BLOG PAGE
   ============================================ */
.blog-page-hero {
  padding: calc(var(--nav-h) + var(--space-5)) 0 var(--space-5);
  border-bottom: 1px solid var(--border-1);
  text-align: center;
}
.blog-page-hero h1 { margin-bottom: var(--space-2); }
.blog-page-hero p {
  color: var(--text-3);
  font-size: 1.1rem;
}
.blog-page-content {
  padding: var(--space-6) 0;
}
.featured-post {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-5);
  display: grid;
  grid-template-columns: 1fr 1fr;
  transition: all var(--duration);
}
.featured-post:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card);
}
.featured-post-cover {
  aspect-ratio: unset;
  min-height: 300px;
  position: relative;
}
.featured-post-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-post-body .blog-meta { margin-bottom: var(--space-2); }
.featured-post-body h2 {
  font-size: 1.8rem;
  margin-bottom: var(--space-2);
  line-height: 1.3;
}
.featured-post-body p {
  color: var(--text-3);
  margin-bottom: var(--space-4);
}
.blog-posts-section h3 {
  font-size: 1.2rem;
  color: var(--text-2);
  margin-bottom: var(--space-4);
  font-family: 'Outfit', sans-serif;
}

/* ============================================
   BLOG POST PAGE
   ============================================ */
.blog-post-hero {
  padding: calc(var(--nav-h) + var(--space-5)) 0 var(--space-5);
  border-bottom: 1px solid var(--border-1);
}
.post-meta-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.blog-post-hero h1 { margin-bottom: var(--space-3); }
.blog-post-hero .post-subtitle {
  font-size: 1.2rem;
  color: var(--text-3);
}
.blog-post-cover {
  aspect-ratio: 21/7;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin: var(--space-5) 0 0;
  position: relative;
}
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-6);
  padding: var(--space-6) 0;
  align-items: start;
}
.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-2);
}
.article-content h2 {
  font-size: 1.6rem;
  margin: var(--space-5) 0 var(--space-3);
  color: var(--text-1);
}
.article-content h3 {
  font-size: 1.25rem;
  margin: var(--space-4) 0 var(--space-2);
  color: var(--text-1);
}
.article-content p { margin-bottom: var(--space-3); }
.article-content ul, .article-content ol {
  list-style: revert;
  padding-left: var(--space-3);
  margin-bottom: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-3);
}
.article-content blockquote {
  border-left: 3px solid var(--purple);
  padding-left: var(--space-3);
  margin: var(--space-4) 0;
  color: var(--text-3);
  font-style: italic;
}
.article-content code {
  background: var(--bg-3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--cyan);
}
.article-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-3));
}
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.sidebar-card h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin-bottom: var(--space-2);
}
.toc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toc-list a {
  font-size: 0.88rem;
  color: var(--text-3);
  transition: color var(--duration);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.toc-list a:hover { color: var(--purple-light); }
.toc-list a::before {
  content: '—';
  color: var(--text-4);
  flex-shrink: 0;
  margin-top: 1px;
}
.author-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.author-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-1);
}
.author-bio {
  font-size: 0.82rem;
  color: var(--text-4);
  line-height: 1.5;
}
.share-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.share-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--border-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-3);
  transition: all var(--duration);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}
.share-btn:hover {
  background: var(--purple-dim);
  border-color: var(--border-accent);
  color: var(--purple-light);
}
.article-footer {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border-1);
}
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================
   SCROLL ANIMATIONS
   Progressive enhancement: only hide elements when JS has loaded.
   Without JS, everything is visible by default.
   ============================================ */
.js-ready .fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.js-ready .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.js-ready .fade-in-delay-1 { transition-delay: 0.08s; }
.js-ready .fade-in-delay-2 { transition-delay: 0.16s; }
.js-ready .fade-in-delay-3 { transition-delay: 0.24s; }

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(10, 10, 32, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-1);
  padding: var(--space-3);
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text-2);
  font-weight: 500;
  transition: all var(--duration);
}
.mobile-menu a:hover {
  background: var(--border-1);
  color: var(--text-1);
}
.mobile-menu .btn-primary {
  margin-top: var(--space-1);
  text-align: center;
  justify-content: center;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */
@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}
@keyframes scrollDot {
  0% { top: 6px; opacity: 1; }
  100% { top: 18px; opacity: 0; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(139,92,246,0.2); }
  50% { box-shadow: 0 0 40px rgba(139,92,246,0.4); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Nav toggle → X animation */
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .app-hero-grid { grid-template-columns: 1fr; }
  .app-preview-container { max-width: 600px; margin: 0 auto; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post-cover { min-height: 220px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }

  /* Container tighter on mobile */
  .container { padding: 0 var(--space-2); }

  /* Reduce section padding */
  .apps-section,
  .about-section,
  .blog-preview,
  .cta-section { padding: var(--space-6) 0; }

  /* Nav */
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  /* Hero */
  .hero { padding: calc(var(--nav-h) + var(--space-4)) var(--space-2) var(--space-6); }
  .hero-desc { font-size: 1rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-cta .btn { width: 100%; max-width: 300px; justify-content: center; }
  .hero-scroll-hint { display: none; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border-1); padding: var(--space-2); }
  .stat-item:nth-child(odd) { border-right: 1px solid var(--border-1); }
  .stat-item:nth-last-child(-n+2) { border-bottom: none; }

  /* Section headers */
  .section-header { margin-bottom: var(--space-4); }
  .section-header p { font-size: 1rem; }

  /* App/Blog grids */
  .apps-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }

  /* About */
  .about-content { order: 1; }
  .philosophy-cards { order: 2; }

  /* CTA */
  .cta-buttons { flex-direction: column; align-items: center; }
  .cta-buttons .btn { width: 100%; max-width: 300px; justify-content: center; }
  .cta-section p { font-size: 1rem; }

  /* App detail */
  .app-hero-actions { flex-direction: column; }
  .app-hero-actions .btn { justify-content: center; }
  .tabs-nav { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .footer-bottom { flex-direction: column; text-align: center; gap: var(--space-1); }

  /* Newsletter */
  .newsletter-form { flex-direction: column; }
  .newsletter-form input,
  .newsletter-form button { width: 100%; }
}

@media (max-width: 480px) {
  /* Container very tight */
  .container { padding: 0 16px; }

  /* Typography scale down */
  h1 { font-size: 2rem; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Cards go full width */
  .apps-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }

  /* Blog post pages */
  .blog-post-cover { border-radius: var(--radius-md); }

  /* Smaller hero eyebrow */
  .hero-eyebrow { flex-direction: column; gap: var(--space-1); }

  /* Chatbot */
  .chatbot-panel { width: calc(100vw - 32px); right: 16px; bottom: 80px; }
}

/* ============================================
   IDEA CHATBOT WIDGET
   ============================================ */
#idea-chatbot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
}
.chatbot-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--grad-primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(139,92,246,0.45);
  transition: all var(--duration) var(--ease);
}
.chatbot-trigger:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(139,92,246,0.6);
}
.chatbot-trigger-label { white-space: nowrap; }
.chatbot-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.chatbot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.chatbot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border-1);
}
.chatbot-avatar {
  width: 36px; height: 36px;
  background: var(--purple-dim);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.chatbot-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-1);
}
.chatbot-subtitle {
  font-size: 0.75rem;
  color: var(--text-4);
}
.chatbot-close {
  margin-left: auto;
  padding: 4px;
  color: var(--text-4);
  border-radius: var(--radius-sm);
  transition: color var(--duration);
  flex-shrink: 0;
}
.chatbot-close:hover { color: var(--text-1); }
.chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 280px;
}
.chatbot-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}
.chatbot-msg-bot {
  background: var(--bg-3);
  color: var(--text-2);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chatbot-msg-user {
  background: var(--purple-dim);
  color: var(--purple-light);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(139,92,246,0.2);
}
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}
.chatbot-typing span {
  width: 7px; height: 7px;
  background: var(--text-4);
  border-radius: 50%;
  animation: typingDot 1.2s ease-in-out infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}
.chatbot-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-1);
}
.chatbot-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-full);
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--duration);
}
.chatbot-input::placeholder { color: var(--text-4); }
.chatbot-input:focus { border-color: var(--border-accent); }
.chatbot-send {
  width: 38px; height: 38px;
  background: var(--grad-primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform var(--duration);
}
.chatbot-send:hover { transform: scale(1.1); }
.chatbot-final-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-1);
  width: 100%;
}
.chatbot-newsletter-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.chatbot-newsletter-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--purple);
  cursor: pointer;
}
.chatbot-newsletter-check:disabled { opacity: 0.4; cursor: not-allowed; }
.chatbot-newsletter-text {
  font-size: 0.83rem;
  color: var(--text-3);
  line-height: 1.5;
}
.chatbot-privacy-note {
  font-size: 0.75rem;
  color: var(--text-4);
  margin: 0;
}
.chatbot-send-final {
  width: 100%;
  padding: 12px;
  background: var(--grad-primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity var(--duration);
}
.chatbot-send-final:hover { opacity: 0.9; }
.chatbot-send-final:disabled { opacity: 0.5; cursor: not-allowed; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-scroll-hint { animation: none; }
}
