/* RANK//OS marketing site — palette lifted directly from
   lib/core/theme/app_colors.dart so the site reads as the same product,
   not a generic template. Dark mode only, same as the app. */

:root {
  /* Surfaces, darkest to lightest */
  --void-black: #04060b;
  --bg: #06080f;
  --surface-low: #0a0e18;
  --surface: #0e141f;
  --surface-high: #131a28;
  --surface-elevated: #18202f;

  /* Borders */
  --border-subtle: #1c2433;
  --border: #26314a;
  --border-strong: #33405e;

  /* Accents */
  --cyan: #2fe0f0;
  --cyan-bright: #7ff0fa;
  --gold: #ffc759;
  --blue: #4c9eff;
  --purple: #7e5efa;
  --success: #3ddc97;

  /* Text */
  --text-primary: #e9eef8;
  --text-secondary: #a3afc4;
  --text-tertiary: #7c89a3;
  --text-on-accent: #04060b;

  /* Rank ladder */
  --rank-e: #93a0b8;
  --rank-d: #4ade80;
  --rank-c: #4c9eff;
  --rank-b: #a78bfa;
  --rank-a: #f5b33c;
  --rank-s: #fb7185;
  --rank-national: #e86bff;
  --rank-monarch: #efddff;

  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto,
    'Helvetica Neue', Arial, sans-serif;
  line-height: 1.55;
}

/* Full-bleed atmosphere image, fixed behind every transparent section. Using
   a position:fixed pseudo-element (rather than background-attachment: fixed)
   avoids the janky repaint some mobile browsers do with fixed backgrounds. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url('../assets/background.png');
  background-size: cover;
  background-position: center 15%;
  background-repeat: no-repeat;
}

/* Dark scrim + the original cyan glow, layered on top of the image so body
   text stays readable at every scroll position. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
      ellipse 120% 60% at 50% -10%,
      rgba(47, 224, 240, 0.1),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      rgba(4, 6, 11, 0.55) 0%,
      rgba(4, 6, 11, 0.86) 45%,
      rgba(4, 6, 11, 0.97) 100%
    );
}

a {
  color: var(--cyan);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 96px 0;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

h2.section-title {
  font-size: 32px;
  text-align: center;
  margin-bottom: 12px;
}

p.section-sub {
  text-align: center;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 56px;
}

.hud-label {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--cyan);
}

/* ---------------------------------------------------------------------- */
/* Nav */
/* ---------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 8, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.nav-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------- */
/* Buttons */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-bright));
  color: var(--text-on-accent);
  box-shadow: 0 0 24px rgba(47, 224, 240, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 0 32px rgba(47, 224, 240, 0.55);
}

.btn-secondary {
  background: var(--surface-high);
  color: var(--text-primary);
  border: 1px solid rgba(47, 224, 240, 0.4);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------------------------------------------------------------------- */
/* Hero */
/* ---------------------------------------------------------------------- */

.hero {
  padding: 96px 0 64px;
  text-align: center;
}

.hero img.icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin: 0 auto 28px;
  box-shadow: 0 0 48px rgba(47, 224, 240, 0.3);
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 12px;
}

.hero h1 .slash {
  color: var(--cyan);
}

.hero .tagline {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 460px;
  margin: 0 auto 36px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------- */
/* Feature grid */
/* ---------------------------------------------------------------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface-high);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.feature-card .glyph {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
  background: rgba(47, 224, 240, 0.1);
  border: 1px solid rgba(47, 224, 240, 0.25);
}

.feature-card h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Rank ladder */
/* ---------------------------------------------------------------------- */

.rank-ladder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-high);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
}

.rank-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 16%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, currentColor 35%, transparent);
}

.quote {
  text-align: center;
  font-style: italic;
  color: var(--text-tertiary);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin: 0 0 40px;
}

.rank-name {
  font-weight: 600;
  flex: 1;
}

.rank-bar-track {
  flex: 2;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-low);
  overflow: hidden;
}

.rank-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
}

/* ---------------------------------------------------------------------- */
/* Screenshots */
/* ---------------------------------------------------------------------- */

.screenshot-strip {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.screenshot-placeholder {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
}

.screenshot-placeholder img {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface-high), var(--surface-low));
  border: 1px solid var(--border);
}

/* ---------------------------------------------------------------------- */
/* Pricing / buy */
/* ---------------------------------------------------------------------- */

.pricing-card {
  max-width: 480px;
  margin: 0 auto;
  background: linear-gradient(160deg, var(--surface-high), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  box-shadow: 0 0 60px rgba(47, 224, 240, 0.08);
}

.pricing-card .price {
  font-size: 48px;
  font-weight: 800;
  margin: 4px 0 4px;
}

.pricing-card .price-note {
  color: var(--text-tertiary);
  font-size: 13px;
  margin-bottom: 28px;
}

.pricing-card .device-limit {
  display: inline-block;
  background: rgba(255, 199, 89, 0.1);
  border: 1px solid rgba(255, 199, 89, 0.35);
  color: var(--gold);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 28px;
}

.buy-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  margin-bottom: 20px;
}

.buy-form label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: block;
}

.buy-form input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-low);
  color: var(--text-primary);
  font-size: 15px;
}

.buy-form input:focus {
  outline: none;
  border-color: var(--cyan);
}

#buy-status {
  min-height: 20px;
  font-size: 14px;
  margin-top: 16px;
}

#buy-status.error {
  color: #f4685b;
}

#buy-status.success {
  color: var(--success);
}

.license-result {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: none;
}

.license-result.visible {
  display: block;
}

.license-key {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--cyan-bright);
  margin: 8px 0 16px;
  word-break: break-all;
}

/* ---------------------------------------------------------------------- */
/* FAQ */
/* ---------------------------------------------------------------------- */

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border-subtle);
  padding: 20px 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  color: var(--cyan);
  font-size: 20px;
  margin-left: 12px;
}

.faq-item[open] summary::after {
  content: '\2212';
}

.faq-item p {
  color: var(--text-secondary);
  margin: 12px 0 0;
  font-size: 15px;
}

/* ---------------------------------------------------------------------- */
/* Footer */
/* ---------------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

footer a {
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  section {
    padding: 64px 0;
  }
  .hero h1 {
    font-size: 34px;
  }
  .nav-links {
    display: none;
  }

  /* Two compact columns instead of one full-width stack — cuts the total
     scroll height of the feature grid roughly in half on phones. */
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .card.feature-card {
    padding: 16px;
  }
  .feature-card .glyph {
    width: 34px;
    height: 34px;
    font-size: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
  }
  .feature-card h3 {
    font-size: 14px;
    margin-bottom: 4px;
  }
  .feature-card p {
    font-size: 12.5px;
    line-height: 1.4;
  }
}

@media (max-width: 380px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .card.feature-card {
    padding: 12px;
  }
}
