/* ========================================================================
   WaveTracer — Design System & Styles
   ======================================================================== */

:root {
  --color-bg:        #060B18;
  --color-bg-alt:    #0A1628;
  --color-surface:   #101D34;
  --color-border:    rgba(255, 255, 255, 0.06);
  --color-text:      #E8EDF5;
  --color-text-muted:#8899B4;
  --color-accent:    #00B4FF;
  --color-accent-2:  #00D4FF;
  --color-glow:      rgba(0, 180, 255, 0.15);
  --color-white:     #FFFFFF;

  --font:            'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       20px;
  --radius-xl:       28px;
  --radius-full:     9999px;

  --shadow-sm:       0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:       0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:       0 12px 48px rgba(0,0,0,0.5);
  --shadow-glow:     0 0 60px rgba(0, 180, 255, 0.12);

  --max-width:       1200px;
  --transition:      0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Reset ──────────────────────────────────────────────────────────── */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul { list-style: none; }

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

/* ── Animations ─────────────────────────────────────────────────────── */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes wave-flow {
  from { background-position: 0 0; }
  to   { background-position: -600px 0; }
}

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

@keyframes wave {
  0%   { transform: translateX(0) translateZ(0) scaleY(1); }
  50%  { transform: translateX(-25%) translateZ(0) scaleY(0.55); }
  100% { transform: translateX(-50%) translateZ(0) scaleY(1); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 180, 255, 0.2); }
  50%      { box-shadow: 0 0 40px rgba(0, 180, 255, 0.35); }
}

.feature-card,
.testimonial-card,
.stat,
.showcase-text,
.showcase-phones {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.feature-card.in-view,
.testimonial-card.in-view,
.stat.in-view,
.showcase-text.in-view,
.showcase-phones.in-view {
  opacity: 1;
  transform: translateY(0);
}

.feature-card:nth-child(2) { transition-delay: 0.08s; }
.feature-card:nth-child(3) { transition-delay: 0.16s; }
.feature-card:nth-child(4) { transition-delay: 0.24s; }
.feature-card:nth-child(5) { transition-delay: 0.32s; }
.feature-card:nth-child(6) { transition-delay: 0.40s; }
.testimonial-card:nth-child(2) { transition-delay: 0.1s; }
.testimonial-card:nth-child(3) { transition-delay: 0.2s; }
.stat:nth-child(2) { transition-delay: 0.08s; }
.stat:nth-child(3) { transition-delay: 0.16s; }
.stat:nth-child(4) { transition-delay: 0.24s; }

/* ── Navigation ─────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}

.nav--scrolled {
  background: rgba(6, 11, 24, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--color-border);
  padding: 10px 0;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  height: 32px;
  width: auto;
}

.nav-wordmark {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-white);
}

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

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--color-white);
}

.nav-cta {
  background: var(--color-accent);
  color: var(--color-bg) !important;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-weight: 600 !important;
  transition: background var(--transition), transform var(--transition) !important;
}

.nav-cta:hover {
  background: var(--color-accent-2);
  transform: translateY(-1px);
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 100, 200, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(0, 180, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 20% 80%, rgba(0, 100, 180, 0.06) 0%, transparent 50%);
}

.hero-wave {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 120px;
  background: var(--color-bg-alt);
  clip-path: ellipse(75% 100% at 50% 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 720px;
  animation: fadeInUp 1s ease forwards;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 180, 255, 0.1);
  border: 1px solid rgba(0, 180, 255, 0.2);
  color: var(--color-accent-2);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-white);
  margin-bottom: 24px;
}

.hero-title-accent {
  background-size: 600px 100%;
  background-repeat: repeat-x;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: wave-flow 8s linear infinite;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  display: none;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
  box-shadow: 0 0 20px rgba(0, 180, 255, 0.25);
}

.btn-primary:hover {
  background: var(--color-accent-2);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.35);
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

/* ── Stats Bar ───────────────────────────────────────────────────────── */

.stats {
  background: var(--color-bg-alt);
  padding: 48px 0;
  border-bottom: 1px solid var(--color-border);
}

.stats-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-white);
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
}

/* ── Section Headers ─────────────────────────────────────────────────── */

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

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-white);
  margin-bottom: 20px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ── Features ────────────────────────────────────────────────────────── */

.features {
  padding: 120px 0;
  background: var(--color-bg);
}

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

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-card:hover {
  border-color: rgba(0, 180, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

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

.feature-card--highlight {
  grid-column: span 1;
  background: linear-gradient(145deg, rgba(0, 100, 200, 0.08), var(--color-surface));
  border-color: rgba(0, 180, 255, 0.1);
}

.feature-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 180, 255, 0.08);
  border: 1px solid rgba(0, 180, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--color-accent);
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ── App Showcase ────────────────────────────────────────────────────── */

.showcase {
  padding: 120px 0;
  background: var(--color-bg-alt);
  overflow: hidden;
}

.showcase-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.showcase-description {
  font-size: 17px;
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: 32px;
}

.showcase-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.showcase-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: var(--color-text);
  font-weight: 500;
}

.showcase-list li svg {
  flex-shrink: 0;
}

.showcase-phones {
  position: relative;
  height: 580px;
  display: flex;
  justify-content: center;
}

.showcase-phone {
  position: absolute;
}

.showcase-phone--back {
  top: 40px;
  right: 20px;
  transform: rotate(6deg);
  z-index: 1;
}

.showcase-phone--front {
  top: 0;
  right: 100px;
  transform: rotate(-3deg);
  z-index: 2;
}

.phone-frame {
  width: 260px;
  background: #1A1A2E;
  border-radius: 36px;
  padding: 12px;
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.phone-screen {
  border-radius: 26px;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  background: var(--color-surface);
}

.showcase-phone--front .phone-frame {
  animation: float 6s ease-in-out infinite;
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 80px rgba(0, 180, 255, 0.08);
}

.showcase-phone--back .phone-frame {
  animation: float 6s ease-in-out 1s infinite;
}

/* ── Phone frame in hero ─────────────────────────────────────────────── */

.hero-phone {
  position: relative;
}

.hero-phone-frame {
  width: 280px;
  background: #1A1A2E;
  border-radius: 40px;
  padding: 14px;
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 80px rgba(0, 180, 255, 0.1);
  animation: float 6s ease-in-out infinite, pulse-glow 4s ease infinite;
}

.hero-phone-screen {
  border-radius: 28px;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  background: var(--color-surface);
}

/* ── Testimonials ────────────────────────────────────────────────────── */

.testimonials {
  padding: 120px 0;
  background: var(--color-bg);
}

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

.testimonial-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all var(--transition);
}

.testimonial-card:hover {
  border-color: rgba(0, 180, 255, 0.12);
  transform: translateY(-4px);
}

.testimonial-stars {
  color: #FFB800;
  font-size: 16px;
  letter-spacing: 2px;
}

.testimonial-card blockquote {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  font-style: normal;
  flex: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), #0066CC);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-white);
  flex-shrink: 0;
}

.testimonial-author strong {
  display: block;
  font-size: 14px;
  color: var(--color-white);
}

.testimonial-author span {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ── CTA Section ─────────────────────────────────────────────────────── */

.cta {
  position: relative;
  padding: 120px 0;
  overflow: hidden;
}

.cta-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cta-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, rgba(0, 100, 200, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 180, 255, 0.06) 0%, transparent 50%),
    var(--color-bg-alt);
}

.cta-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 580px;
  margin: 0 auto;
}

.cta-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-white);
  margin-bottom: 16px;
}

.cta-subtitle {
  font-size: 17px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
}

.cta-actions {
  margin-bottom: 48px;
}

.cta-signup p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.signup-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.signup-form input[type="email"] {
  padding: 14px 20px;
  width: 300px;
  max-width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.signup-form input[type="email"]::placeholder {
  color: var(--color-text-muted);
}

.signup-form input[type="email"]:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.1);
}

.signup-form .btn {
  padding: 14px 28px;
  font-size: 15px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 64px 0 32px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-logo {
  height: 28px;
  width: auto;
}

.footer-wordmark {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-white);
}

.footer-tagline {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 14px;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--color-white);
}

.footer-bottom {
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (min-width: 1024px) {
  .hero {
    flex-direction: row;
    gap: 60px;
    padding: 140px 48px 100px;
  }

  .hero-content {
    text-align: left;
    flex: 1;
  }

  .hero-subtitle {
    margin: 0 0 40px;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero-visual {
    display: block;
    flex: 0 0 300px;
    position: relative;
    z-index: 2;
  }
}

@media (max-width: 1023px) {
  .hero {
    flex-direction: column;
    padding: 140px 24px 80px;
  }
}

@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonial-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  .showcase-layout {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .showcase-phones {
    height: 440px;
    order: -1;
  }

  .showcase-phone--front {
    right: auto;
    left: 50%;
    margin-left: -150px;
  }

  .showcase-phone--back {
    right: auto;
    left: 50%;
    margin-left: -60px;
  }

  .phone-frame {
    width: 220px;
  }
}

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    gap: 32px;
  }

  .stat-divider {
    display: none;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .hero-title {
    font-size: 36px;
  }

  .footer-top {
    flex-direction: column;
  }

  .signup-form {
    flex-direction: column;
  }

  .signup-form input[type="email"] {
    width: 100%;
  }

  .showcase-phones {
    height: 380px;
  }

  .phone-frame {
    width: 200px;
  }

  .showcase-phone--front {
    margin-left: -130px;
  }

  .showcase-phone--back {
    margin-left: -40px;
  }
}

/* ── Selection ───────────────────────────────────────────────────────── */

::selection {
  background: rgba(0, 180, 255, 0.3);
  color: var(--color-white);
}

/* ── Scrollbar ───────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
