/* ==========================================================================
   Aircaster official site — v1 functional theme
   Design tokens mirror the Flutter app's dark ColorScheme
   (lib/core/theme/aircaster_tokens.dart). No external fonts or assets.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #0b0a14;
  --surface: #11101c;
  --surface-high: #1a1929;
  --surface-bright: #232231;
  --outline: #34334a;
  --outline-soft: #26253a;

  /* Text */
  --text: #f2f1fb;
  --on-surface: #dbdbed;
  --muted: #908fa9;
  --muted-dim: #6f6e87;

  /* Brand / accent */
  --primary: #7b6ef6;       /* brief accent */
  --primary-bright: #bab6ff;
  --primary-deep: #4035b5;
  --on-primary: #ffffff;

  /* Status */
  --live: #e94545;
  --ok: #34c759;
  --warn: #ff9f0a;

  /* Radii / spacing */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --maxw: 1080px;
  --gap: clamp(16px, 4vw, 28px);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

/* ---------- Reset / base -------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* offset for the sticky header when jumping to anchors */
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 750;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

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

a:hover {
  text-decoration: underline;
}

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

code,
kbd,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* Visible focus for keyboard users */
:focus-visible {
  outline: 3px solid var(--primary-bright);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout helpers ------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 32px);
}

section {
  padding-block: clamp(48px, 8vw, 88px);
}

.section-head {
  max-width: 56ch;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-bright);
  margin-bottom: 10px;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 60ch;
}

/* ---------- Header / nav -------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--outline-soft);
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--text);
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand .logo-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  box-shadow: 0 0 0 1px rgba(123, 110, 246, 0.4),
    0 6px 18px -6px rgba(123, 110, 246, 0.7);
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  list-style: none;
  padding: 0;
}

.nav-links a {
  color: var(--on-surface);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover {
  background: var(--surface-high);
  text-decoration: none;
  color: var(--text);
}

.nav-cta {
  margin-left: 6px;
}

/* mobile nav toggle */
.nav-toggle {
  margin-left: auto;
  display: none;
  background: var(--surface-high);
  border: 1px solid var(--outline);
  color: var(--text);
  width: 44px;
  height: 40px;
  border-radius: var(--r-sm);
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 650;
  font-size: 0.98rem;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  text-align: center;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 8px 24px -10px rgba(123, 110, 246, 0.8);
}

.btn-primary:hover {
  background: #8b80f8;
}

.btn-ghost {
  background: var(--surface-high);
  color: var(--text);
  border-color: var(--outline);
}

.btn-ghost:hover {
  background: var(--surface-bright);
}

.btn-lg {
  font-size: 1.05rem;
  padding: 15px 26px;
}

.btn-block {
  width: 100%;
}

/* ---------- Cards / surfaces --------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 28px);
}

.card-bright {
  background: var(--surface-high);
  border-color: var(--outline);
}

/* ---------- Hero ---------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 9vw, 104px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      120% 90% at 78% -10%,
      rgba(123, 110, 246, 0.28),
      transparent 60%
    ),
    radial-gradient(90% 70% at 0% 100%, rgba(64, 53, 181, 0.22), transparent 55%);
  pointer-events: none;
}

.hero > .wrap {
  position: relative;
}

.hero h1 {
  max-width: 16ch;
}

.hero .hero-sub {
  font-size: 1.18rem;
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 32px;
}

/* dual CTA cards */
.dual-cta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 720px;
}

.cta-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 22px 20px;
  background: var(--surface-high);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}

.cta-card:hover {
  text-decoration: none;
  border-color: var(--primary);
  background: var(--surface-bright);
  transform: translateY(-2px);
}

.cta-card .cta-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-bright);
}

.cta-card .cta-title {
  font-size: 1.22rem;
  font-weight: 750;
  color: var(--text);
}

.cta-card .cta-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.cta-card .cta-arrow {
  margin-top: 6px;
  color: var(--primary-bright);
  font-weight: 700;
  font-size: 0.92rem;
}

/* Phone-first: the primary CTA is visually heavier than the "also on TV" one. */
.cta-card-primary {
  background: var(--surface-bright);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset;
}

.cta-card-primary:hover {
  transform: translateY(-3px);
}

/* Cast method matrix (Other TVs → non-Android cast list). */
.cast-matrix {
  margin: 4px 0 10px;
  padding-left: 18px;
}

.cast-matrix li {
  margin-bottom: 6px;
}

/* trust strip */
.trust-strip {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.trust-strip li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trust-strip ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.trust-strip .dot {
  color: var(--ok);
}

/* ---------- Features grid ------------------------------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: var(--r-md);
  padding: 24px;
}

.feature .ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(123, 110, 246, 0.14);
  border: 1px solid rgba(123, 110, 246, 0.3);
  margin-bottom: 14px;
  font-size: 22px;
}

.feature h3 {
  margin-bottom: 6px;
}

.feature p {
  color: var(--muted);
  font-size: 0.96rem;
  margin: 0;
}

/* ---------- How it works -------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  counter-reset: step;
}

.step {
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: var(--r-md);
  padding: 24px;
  position: relative;
}

.step .num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
  margin-bottom: 14px;
}

.step h3 {
  margin-bottom: 6px;
}

.step p {
  color: var(--muted);
  margin: 0;
  font-size: 0.96rem;
}

/* ---------- Download tracks ----------------------------------------------- */
.download-tracks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.track {
  display: flex;
  flex-direction: column;
}

.track .track-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.track .platform-ic {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(123, 110, 246, 0.14);
  border: 1px solid rgba(123, 110, 246, 0.3);
  font-size: 20px;
}

.meta-line {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--outline-soft);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin: 14px 0;
  word-break: break-word;
}

.meta-line .pending {
  color: var(--warn);
}

.fineprint {
  color: var(--muted-dim);
  font-size: 0.85rem;
  margin-top: 12px;
}

/* ---------- Accordion (details/summary) ----------------------------------- */
details {
  border: 1px solid var(--outline-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}

details[open] {
  border-color: var(--outline);
}

summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--primary-bright);
  line-height: 1;
  transition: transform 0.15s ease;
}

details[open] summary::after {
  content: "\2212"; /* minus */
}

.details-body {
  padding: 0 20px 18px;
  color: var(--muted);
}

.details-body ol,
.details-body ul {
  margin: 0;
  padding-left: 1.2em;
}

.details-body li {
  margin-bottom: 8px;
}

/* ---------- Callout boxes ------------------------------------------------- */
.callout {
  border-radius: var(--r-md);
  padding: 20px 22px;
  border: 1px solid var(--outline);
  background: var(--surface-high);
  margin: 18px 0;
}

.callout-primary {
  border-color: rgba(123, 110, 246, 0.55);
  background: linear-gradient(
    180deg,
    rgba(123, 110, 246, 0.16),
    rgba(123, 110, 246, 0.05)
  );
}

.callout-warn {
  border-color: rgba(255, 159, 10, 0.5);
  background: linear-gradient(
    180deg,
    rgba(255, 159, 10, 0.12),
    rgba(255, 159, 10, 0.04)
  );
}

.callout h3 {
  margin-bottom: 8px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.enter-this {
  font-family: var(--mono);
  font-size: clamp(1.1rem, 3.5vw, 1.6rem);
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  border: 1px dashed var(--primary);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  display: inline-block;
  margin: 6px 0 4px;
  word-break: break-all;
}

.warn-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--warn);
}

/* ---------- Fire TV numbered steps + screenshot slots --------------------- */
.tv-steps {
  list-style: none;
  counter-reset: tvstep;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.tv-steps > li {
  counter-increment: tvstep;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: var(--r-md);
  padding: 18px;
}

.tv-steps > li::before {
  content: counter(tvstep);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
}

.tv-step-body h3 {
  font-size: 1.02rem;
  margin-bottom: 4px;
}

.tv-step-body p {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 0.96rem;
}

.tv-step-body p:last-child {
  margin-bottom: 0;
}

/* screenshot placeholder slot */
.shot {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 360px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--outline);
  background: repeating-linear-gradient(
    -45deg,
    var(--surface-high),
    var(--surface-high) 12px,
    var(--surface) 12px,
    var(--surface) 24px
  );
  display: grid;
  place-items: center;
  color: var(--muted-dim);
  font-size: 0.82rem;
  text-align: center;
  padding: 8px;
}

kbd {
  background: var(--surface-bright);
  border: 1px solid var(--outline);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.85em;
  color: var(--text);
}

/* ---------- Two-up generic ------------------------------------------------ */
.two-up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* ---------- Pricing ------------------------------------------------------- */
.price-card {
  text-align: center;
  max-width: 520px;
  margin-inline: auto;
}

.price-card .price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
}

.price-card .price small {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- Footer -------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--outline-soft);
  background: var(--surface);
  padding-block: 48px 36px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
}

.footer-grid h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 12px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 8px;
}

.footer-grid a {
  color: var(--on-surface);
  font-size: 0.95rem;
}

.footer-grid a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--outline-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  color: var(--muted-dim);
  font-size: 0.88rem;
}

.footer-bottom .mono {
  color: var(--muted);
}

/* ---------- Responsive ---------------------------------------------------- */
@media (max-width: 760px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--surface);
    border-bottom: 1px solid var(--outline);
    padding: 10px 18px 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px;
  }

  .nav-links .nav-cta {
    margin-left: 0;
    margin-top: 6px;
  }

  .nav-toggle {
    display: block;
  }

  .dual-cta {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 460px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .tv-steps > li {
    grid-template-columns: 1fr;
  }
}
