/* Rankpulse Landing — Deep Purple design system
   Brand tokens copied from the Flutter app (lib/core/theme/app_colors.dart).
   Pure CSS, no framework — easier on Cloudflare Pages, faster on first paint. */

:root {
  --brand-primary: #311B92;
  --brand-active:  #5E35B1;
  --brand-accent:  #7E57C2;
  --brand-muted:   #B39DDB;
  --brand-surface: #EDE7F6;
  --success:       #2E7D32;
  --danger:        #C62828;
  --warning:       #EF6C00;
  --text-primary:   #1a1a1a;
  --text-secondary: #555;
  --text-tertiary:  #888;
  --bg:             #ffffff;
  --bg-surface:     #fafafa;
  --border:         #e8e8e8;
  --border-light:   #f1f1f1;
  --max-width:      1100px;
  --max-narrow:     720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Navbar ─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--brand-primary);
}
.brand svg { width: 28px; height: 28px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.nav-links a {
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--brand-primary);
  background: var(--brand-surface);
}
.lang-switcher {
  position: relative;
}
.lang-switcher summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
}
.lang-switcher summary::-webkit-details-marker { display: none; }
.lang-switcher summary:hover { color: var(--brand-primary); background: var(--brand-surface); }
.lang-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 6px 0;
  font-size: 14px;
  z-index: 60;
}
.lang-menu a {
  display: block;
  padding: 8px 14px;
  color: var(--text-primary);
  text-decoration: none;
}
.lang-menu a:hover { background: var(--brand-surface); color: var(--brand-primary); }
.lang-menu a.current { font-weight: 600; color: var(--brand-primary); }

/* ─── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 72px 24px 56px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
  text-align: center;
}
@media (min-width: 920px) {
  .hero { padding: 96px 24px 72px; }
  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 64px;
    text-align: left;
  }
  .hero-grid .cta-row,
  .hero-grid .store-badges { justify-content: flex-start; }
}
.hero-text { min-width: 0; }
.hero-phone {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.hero-phone img {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
  /* Subtle floating animation */
  animation: phoneFloat 6s ease-in-out infinite;
}
@keyframes phoneFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-phone img { animation: none; }
}

.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
  background: var(--brand-surface);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-weight: 800;
}
.hero h1 em {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}
.hero p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 28px;
  line-height: 1.55;
}
@media (min-width: 920px) {
  .hero-grid .hero-text > p { margin-left: 0; margin-right: 0; }
}
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.06s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--brand-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(49, 27, 146, 0.25);
}
.btn-primary:hover { background: var(--brand-active); box-shadow: 0 6px 18px rgba(49, 27, 146, 0.32); }
.btn-secondary {
  background: white;
  color: var(--brand-primary);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--brand-primary); background: var(--brand-surface); }
.app-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.app-badges img { height: 44px; }

/* ─── Store badges (Coming Soon) ─────────────────────────── */
.store-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 14px;
  border-radius: 12px;
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
  cursor: default;
  border: 1px solid #1a1a1a;
  min-width: 158px;
  user-select: none;
}
.store-badge:hover {
  text-decoration: none;
  /* Subtle hover: stays consistent with "not yet downloadable" */
  background: #2a2a2a;
}
.store-badge-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: currentColor;
}
.store-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.store-badge-eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.65;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.store-badge-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ─── Marketplaces strip ─────────────────────────────────── */
.marketplaces {
  padding: 24px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.marketplaces-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px 32px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.marketplaces-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.marketplace {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.marketplace .flag { font-size: 18px; }

/* ─── Sections ─────────────────────────────────────────── */
section { padding: 80px 24px; }
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-header h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  margin: 0 0 10px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.section-header p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin: 0 0 8px;
}

/* ─── Feature grid ─────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.feature-card {
  padding: 28px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--border-light);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.feature-card:hover {
  border-color: var(--brand-muted);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(49, 27, 146, 0.06);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--brand-surface);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 {
  font-size: 17px;
  margin: 0 0 8px;
  font-weight: 700;
}
.feature-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ─── Pricing ─────────────────────────────────────────── */
.pricing {
  background: var(--bg-surface);
}
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
}
.plan {
  position: relative;
  padding: 32px 28px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 16px;
}
.plan.popular {
  border-color: var(--brand-primary);
  border-width: 2px;
  box-shadow: 0 10px 30px rgba(49, 27, 146, 0.10);
}
.plan-badge {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--brand-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
}
.plan h3 {
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 800;
}
.plan-tagline {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 22px;
}
.plan-price .num {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.plan-price .unit {
  font-size: 14px;
  color: var(--text-secondary);
}
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.5;
}
.plan-features svg {
  flex-shrink: 0;
  margin-top: 3px;
  width: 16px;
  height: 16px;
}
.plan.popular .plan-features svg { color: var(--brand-primary); }
.plan:not(.popular) .plan-features svg { color: var(--success); }
.plan .btn {
  width: 100%;
  justify-content: center;
}
.plan:not(.popular) .btn-primary {
  background: var(--text-primary);
  box-shadow: none;
}

/* ─── FAQ ─────────────────────────────────────────────── */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
details.faq-item {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}
details.faq-item[open] {
  border-color: var(--brand-muted);
}
details.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: '＋';
  font-size: 18px;
  color: var(--brand-primary);
  font-weight: 400;
  transition: transform 0.15s;
}
details.faq-item[open] summary::after { content: '−'; }
details.faq-item p {
  margin: 0;
  padding: 0 22px 20px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── Footer ───────────────────────────────────────────── */
.footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 40px 24px 32px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-secondary);
}
.footer-links a:hover { color: var(--brand-primary); }
.footer-copy {
  color: var(--text-tertiary);
}

/* ─── Legal pages ───────────────────────────────────────── */
.legal {
  max-width: var(--max-narrow);
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.legal h1 {
  font-size: 28px;
  margin: 0 0 8px;
}
.legal .updated {
  color: var(--text-tertiary);
  font-size: 13px;
  margin-bottom: 32px;
}
.legal h2 {
  font-size: 19px;
  margin: 32px 0 8px;
}
.legal p, .legal li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.legal ul {
  padding-left: 22px;
}

/* ─── Mobile tweaks ────────────────────────────────────── */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-links.lang-only-mobile { display: flex; }
  section { padding: 56px 20px; }
  .hero { padding: 48px 20px 32px; }
  .hero-grid { gap: 36px; }
  .hero-phone img { max-width: 280px; }
  .feature-card { padding: 22px; }
  .plan { padding: 26px 22px; }
  .store-badge { min-width: 0; flex: 1 1 auto; }
}
