/* ============================================================
   Synastrix — Landing Page Styles
   Design tokens match Flutter app: client/lib/app/theme/
   ============================================================ */

/* 1. DESIGN TOKENS
   ============================================================ */
:root {
  --bg:           #0a0514;
  --bg-surface:   #0e0528;
  --bg-card:      rgba(20, 12, 50, 0.55);
  --bg-card-hover:rgba(28, 18, 64, 0.65);
  --border:       rgba(255, 255, 255, 0.08);
  --border-subtle:rgba(255, 255, 255, 0.04);
  --violet:       #8B5CF6;
  --violet-light: #A78BFA;
  --teal:         #2DD4BF;
  --teal-light:   #5EEAD4;
  --gold:         #cfb58c;
  --gold-warm:    #FBD024;
  --text:         #FFFFFF;
  --subtext:      rgba(255, 255, 255, 0.6);
  --muted:        rgba(255, 255, 255, 0.35);

  --radius-sm:    10px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    28px;

  --font: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* 2. RESET + BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  color: var(--teal-light);
  text-decoration: underline;
}

/* 3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4 {
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: 1.125rem; font-weight: 600; }

p { color: var(--subtext); }

/* 4. LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

/* 5. COMPONENTS
   ============================================================ */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: var(--violet);
  color: #fff;
}

.btn-sm {
  padding: 10px 22px;
  font-size: 0.875rem;
}

.btn-outline {
  background: transparent;
  color: var(--subtext);
  border: 1px solid var(--border);
}

.btn-coming-soon {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: background 0.2s, border-color 0.2s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.card-icons {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
}

.card-icon-violet { background: rgba(139, 92, 246, 0.2); }
.card-icon-dark   { background: rgba(255, 255, 255, 0.06); }
.card-icon-teal   { background: rgba(45, 212, 191, 0.2); }
.card-icon-gold   { background: rgba(207, 181, 140, 0.2); }
.card-icon-violet-star {
  background: rgba(139, 92, 246, 0.15);
  color: var(--violet-light);
}

/* Feature cards with visual headers */
.card.card-feature {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-visual {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  margin: 0;
  padding: 0;
}

.card-visual-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: linear-gradient(180deg, transparent, rgba(16, 10, 40, 0.95));
  pointer-events: none;
}

.card-body {
  padding: 20px 28px 32px;
  flex: 1;
}

.card h3 {
  margin-bottom: 10px;
  color: var(--text);
}

.card p {
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- Phone frame mockup --- */
.phone-frame {
  width: 160px;
  height: 280px;
  border-radius: 28px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.2) 0%, rgba(14, 5, 40, 0.9) 100%);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(139, 92, 246, 0.08);
}

.phone-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 25px;
}

.phone-frame::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  z-index: 2;
}

.phone-frame-hero {
  width: 220px;
  height: 440px;
  border-radius: 32px;
  border-width: 3px;
}

.phone-frame-hero img {
  border-radius: 29px;
}

.phone-frame-hero::before {
  width: 50px;
  height: 5px;
  top: 11px;
}

.phone-frame-lg {
  width: 260px;
  height: 520px;
  border-radius: 36px;
  border-width: 3px;
}

.phone-frame-lg img {
  border-radius: 33px;
}

.phone-frame-lg::before {
  width: 56px;
  height: 6px;
  top: 12px;
}

/* --- Phone + score overlay --- */
.hero-phone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}

.phone-score {
  text-align: center;
  margin-top: 12px;
}

.score-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.score-max {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--muted);
}

.score-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtext);
  margin-top: 4px;
}

/* --- Nav header --- */
.site-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 3, 26, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.site-logo:hover { text-decoration: none; }

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 22px;
}

.logo-mark svg {
  width: 36px;
  height: 22px;
}

.logo-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.08em;
}

.site-nav {
  display: none;
  gap: 32px;
}

.nav-link {
  color: var(--subtext);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s;
}

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

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

.header-cta {
  display: none;
}

/* --- Gradient text --- */
.gradient-text {
  background: linear-gradient(135deg, var(--violet-light), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Badge / pill --- */
.badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-violet {
  background: rgba(139, 92, 246, 0.2);
  color: var(--violet-light);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-teal {
  background: rgba(45, 212, 191, 0.15);
  color: var(--teal-light);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

/* 6. SECTION STYLES
   ============================================================ */

/* --- Hero --- */
.hero {
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* bg1 image layer */
.hero-bg-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/bg1.png') center top / cover no-repeat;
  opacity: 0.35;
}

/* Fade edges into page bg */
.hero-bg-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 5, 20, 0.1) 0%, transparent 20%, transparent 60%, var(--bg) 100%),
    linear-gradient(90deg, var(--bg) 0%, transparent 15%, transparent 85%, var(--bg) 100%);
}

.hero-split {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  position: relative;
  z-index: 1;
}

.hero-content {
  text-align: center;
  max-width: 480px;
}

.hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  width: 72px;
  height: 44px;
}

.hero-icon svg {
  width: 72px;
  height: 44px;
  filter: drop-shadow(0 0 16px rgba(139, 92, 246, 0.6));
}

.hero-content h1 {
  margin-bottom: 16px;
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--subtext);
  margin-bottom: 36px;
}

.hero-cta {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}

.cta-label {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 4px;
  text-align: center;
}

/* --- Features --- */
.features {
  padding: 64px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* --- Screenshots --- */
.screenshots {
  position: relative;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.constellation-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* bg2 image layer */
.constellation-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/bg2.png') center center / cover no-repeat;
  opacity: 0.3;
}

/* Fade edges into page bg */
.constellation-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--bg) 0%, transparent 15%, transparent 80%, var(--bg) 100%),
    linear-gradient(90deg, var(--bg) 0%, transparent 20%, transparent 80%, var(--bg) 100%);
}

.screenshots-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  position: relative;
  z-index: 1;
}

.screenshots-text {
  text-align: center;
  max-width: 420px;
}

.screenshots-text .badge {
  margin-bottom: 20px;
}

.screenshots-text h2 {
  margin-bottom: 16px;
}

.screenshots-text p {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.phone-frames {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* --- Footer --- */
.site-footer {
  padding: 48px 0 56px;
  border-top: 1px solid var(--border);
}

.footer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.footer-left {
  display: flex;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 32px;
}

.footer-links a {
  color: var(--subtext);
  font-size: 0.9375rem;
}

.footer-links a:hover { color: var(--text); text-decoration: none; }

.footer-right {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.footer-meta {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

/* 7. PROSE PAGES (privacy, terms, support)
   ============================================================ */
.prose-page .site-header {
  margin-bottom: 0;
}

.prose-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 0.9375rem;
  color: var(--subtext);
}

.prose-back:hover {
  color: var(--text);
  text-decoration: none;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.prose h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 8px;
}

.prose .prose-date {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 40px;
}

.prose h2 {
  font-size: 1.25rem;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--text);
}

.prose p {
  margin-bottom: 16px;
}

.prose ul, .prose ol {
  padding-left: 24px;
  margin-bottom: 16px;
  color: var(--subtext);
}

.prose li {
  margin-bottom: 8px;
}

.prose a {
  color: var(--teal);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* Support page */
.support-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 480px;
  margin: 40px auto 0;
}

.support-card h2 {
  margin-bottom: 12px;
}

.support-card p {
  margin-bottom: 24px;
}

.support-email {
  font-size: 1.125rem;
  color: var(--teal);
  font-weight: 600;
}

/* 8. RESPONSIVE
   ============================================================ */
@media (max-width: 400px) {
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
}

@media (min-width: 600px) {
  .screenshots-strip {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 64px;
  }

  .screenshots-text {
    text-align: left;
  }
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .site-nav {
    display: flex;
  }

  .header-cta {
    display: inline-flex;
  }

  .hero {
    padding: 72px 0 64px;
  }

  .hero-split {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
  }

  .hero-content {
    flex: 0 1 420px;
  }

  .hero-phone {
    flex: 0 0 auto;
  }

}

@media (min-width: 1024px) {
  .hero {
    padding: 100px 0 80px;
  }

  .phone-frame-hero {
    width: 240px;
    height: 480px;
  }

  .phone-frame-lg {
    width: 280px;
    height: 560px;
  }

  .hero-split {
    gap: 56px;
  }

  .features-grid {
    gap: 24px;
  }

  .card {
    padding: 40px 32px;
  }
}
