/* Capstone Financial — landing page custom styles */

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Anchor-link targets land below the sticky nav, not under it */
  scroll-padding-top: 80px;
}

body {
  /* faint vertical lines for fintech grain */
  background-color: #0A1628;
}

/* Subtle grid background */
.grid-bg {
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0) 100%);
}

/* Glassmorphism cards */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

/* Feature card */
.feature-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(800px circle at var(--mx, 50%) var(--my, 0%), rgba(201, 168, 76, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 168, 76, 0.4);
  box-shadow: 0 30px 60px -20px rgba(201, 168, 76, 0.15);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.25), rgba(201, 168, 76, 0.05));
  border: 1px solid rgba(201, 168, 76, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #E0C675;
}
.feature-icon svg { width: 22px; height: 22px; }

/* Integration pill */
.integration-pill {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  color: #E2E8F0;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
}
.integration-pill:hover {
  border-color: rgba(201, 168, 76, 0.45);
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.12) 0%, rgba(201, 168, 76, 0.04) 100%);
  color: #F4DB91;
  transform: translateY(-2px);
}

/* Reveal-on-scroll animation */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0ms);
  will-change: transform, opacity;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Floating animation for hero side card */
.floaty {
  animation: floaty 5s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* Sticky nav after scroll */
#nav.scrolled {
  background: rgba(10, 22, 40, 0.78);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Mobile polish */
@media (max-width: 640px) {
  .feature-card { padding: 1.25rem; }
  h1, h2 { letter-spacing: -0.02em; }
}

/* Reduce motion safely */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .floaty { animation: none; }
  html { scroll-behavior: auto; }
}

/* On mobile, reveal animations are disabled entirely (see main.js) — make sure
   the opacity-0 starting state doesn't stick around for users with broken JS. */
@media (max-width: 640px) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE AUDIT — phones up to 640px wide.
   Goal: every section fits the viewport, no horizontal scroll, no text
   clipping, no oversized hero, no broken dashboard mockup.
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* No horizontal overflow ever — even with absolutely-positioned glows */
  html, body { overflow-x: hidden; max-width: 100vw; }

  /* Section padding tighter on phones — gives content more room */
  section { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
  .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl, .max-w-3xl, .max-w-2xl, .max-w-md {
    padding-left: 0 !important; padding-right: 0 !important;
  }

  /* Tailwind font-size overrides for typography that's too aggressive on phones */
  .text-7xl { font-size: 2.5rem !important; line-height: 1.05 !important; }   /* 80px → 40px */
  .text-6xl { font-size: 2.25rem !important; line-height: 1.05 !important; }  /* 64px → 36px */
  .text-5xl { font-size: 2rem !important; line-height: 1.1 !important; }      /* 48px → 32px */
  .text-4xl { font-size: 1.625rem !important; line-height: 1.15 !important; } /* 36px → 26px */
  .text-3xl { font-size: 1.5rem !important; line-height: 1.2 !important; }    /* 30px → 24px */
  .text-2xl { font-size: 1.25rem !important; line-height: 1.3 !important; }   /* 24px → 20px */

  /* Hero — reduce top padding so headline shows above the fold on a 667px iPhone */
  section#top { padding-top: 100px !important; padding-bottom: 56px !important; }

  /* Hero EBITDA card — keep readable but smaller */
  section#top .glass { padding: 1rem !important; }
  section#top .font-display.text-4xl { font-size: 1.875rem !important; }

  /* Floating side card on hero — hide on phones (it overlaps the hero card edge) */
  section#top .floaty { display: none !important; }

  /* Pricing $199 — keep it bold but never larger than half the screen */
  #pricing .text-7xl { font-size: 4rem !important; line-height: 1 !important; }

  /* Dashboard mockup KPI grid — 2 columns on phones instead of 4 */
  section .grid.lg\:grid-cols-4 { grid-template-columns: 1fr 1fr !important; }

  /* Dashboard inner 3-col chart row — stack on phones */
  section .lg\:col-span-2 + div { margin-top: 1rem; }

  /* Integration pills — bigger tap targets */
  .integration-pill { padding: 0.75rem 0.5rem; font-size: 0.85rem; }

  /* Trust strip — wrap to two lines instead of overflowing */
  section#top .flex.flex-wrap.items-center.gap-6 { gap: 0.75rem 1.25rem; }
  section#top .flex.flex-wrap.items-center.gap-6 > div { font-size: 0.7rem !important; }

  /* Buttons in flex rows that should stack on mobile */
  section#top .flex.flex-col.sm\:flex-row { gap: 0.5rem; }
  section#top .flex.flex-col.sm\:flex-row > a { padding: 0.9rem 1.25rem !important; }

  /* Feature cards padding tighter */
  .feature-card { padding: 1rem !important; }

  /* Final CTA — keep the headline from overflowing */
  section.relative.py-24 h2 { font-size: 2.25rem !important; line-height: 1.1 !important; }

  /* Nav — center logo on phones, hide secondary links (kept only the CTA) */
  #nav .max-w-7xl { padding: 0.75rem 1rem !important; }
  #nav .nav-logo div, #nav a[href="#top"] div { display: none !important; }
  #nav .hidden.md\:flex { display: none !important; }

  /* Footer columns stack on phones */
  footer .grid.lg\:grid-cols-4 { grid-template-columns: 1fr !important; gap: 1.5rem !important; }

  /* Card text doesn't go too wide on phones */
  .feature-card p, section p { word-wrap: break-word; overflow-wrap: anywhere; }

  /* Hero dashboard chart — keep readable */
  section#top svg { height: 80px !important; }

  /* Stop blurred background blobs from causing horizontal scroll */
  .fixed.inset-0.-z-10 > div[class*="blur"] { display: none !important; }

  /* Dashboard preview section — tighter padding so content has room */
  section .rounded-3xl.p-6 { padding: 0.875rem !important; }
  section .rounded-3xl.lg\:p-10 { padding: 0.875rem !important; }

  /* Inside dashboard preview: stack 2-up tax category bars */
  section .rounded-xl.p-5 { padding: 0.875rem !important; }
  section .text-sm.font-semibold.text-white { font-size: 0.85rem !important; }

  /* All SVGs in dashboard previews — scale within their containers */
  section svg.w-full { max-width: 100%; height: auto; }

  /* Hero card padding tighter so dashboard mockup actually fits */
  section#top .relative.glass { padding: 1rem !important; }

  /* Hero card KPI tiles — make sure $1.14M etc don't overflow */
  section#top .grid.grid-cols-3 > div { padding: 0.5rem !important; }
  section#top .grid.grid-cols-3 .text-lg { font-size: 0.95rem !important; }

  /* Nav logo text — keep visible on phones (we hid it earlier, restore) */
  #nav .nav-logo div, #nav a[href="#top"] div { display: block !important; }

  /* Glass cards: shrink margin so content gets more screen */
  .glass { margin-left: 0 !important; margin-right: 0 !important; }

  /* CTAs — minimum 44pt tap target, never wrap mid-button */
  a.inline-flex, button { min-height: 44px; }
  section#top a.inline-flex { white-space: nowrap; padding-left: 1rem !important; padding-right: 1rem !important; font-size: 0.95rem !important; }

  /* Comparison table cells — let them wrap */
  table td, table th { word-break: break-word; }

  /* Hide redundant "●●●" indicator on dashboard mockup */
  .text-xs.text-slate-400 + .text-xs.text-slate-400 { display: none; }
}

/* Tablet (641–1024px) — minor tweaks so it doesn't feel too desktop-y */
@media (min-width: 641px) and (max-width: 1024px) {
  .text-7xl { font-size: 3.5rem !important; }
  .text-6xl { font-size: 2.75rem !important; }
}

