/**
 * Shared chrome: header/nav, footer, buttons, sections and the primitives every
 * page reuses. Builds on the tokens in utils/variables.css.
 */

/* ---------- extra tokens ---------- */
:root {
  --wrap: 1160px;
  --wrap-narrow: 760px;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --header-h: 68px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- accessibility ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  padding: 12px 20px;
  background: #fff;
  color: #0a0a0f;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

:where(a, button, summary, input, textarea):focus-visible {
  outline: 2px solid #35d6f5;
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- starfield ---------- */
.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.starfield .star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 3s infinite;
}

/* ---------- layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap.narrow { max-width: var(--wrap-narrow); }
.center { text-align: center; }
.center .store-row { justify-content: center; }

.section {
  position: relative;
  z-index: 1;
  padding: 88px 0;
}
.section.alt {
  background: rgba(255, 255, 255, 0.022);
  border-block: 1px solid var(--color-border);
}
.section-head {
  max-width: 640px;
  margin: 0 auto 52px;
  text-align: center;
}
.section-head h2 { margin-bottom: 12px; }

h1 { font-size: clamp(2.25rem, 5.2vw, 3.75rem); letter-spacing: -0.03em; line-height: 1.07; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.35rem); letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }

.lede {
  font-size: clamp(1.02rem, 1.9vw, 1.2rem);
  color: var(--color-text-secondary);
  line-height: 1.65;
}
.grad {
  background: linear-gradient(110deg, #35d6f5 0%, #6aa8ff 45%, #d07ef5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.muted { color: var(--color-text-tertiary); font-size: 0.9rem; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-normal), background var(--transition-normal);
}
.site-header.scrolled {
  border-bottom-color: var(--color-border);
  background: rgba(10, 10, 15, 0.92);
}
.nav {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  flex-shrink: 0;
}
.brand-mark { width: 32px; height: 32px; border-radius: 9px; }

.nav-menu { display: flex; align-items: center; gap: 32px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
}
.nav-links a {
  position: relative;
  font-size: 0.94rem;
  color: var(--color-text-secondary);
  padding: 6px 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--gradient-primary);
  transition: width var(--transition-normal);
}
.nav-links a:hover { color: var(--color-text-primary); }
.nav-links a:hover::after,
.nav-links a.is-active::after { width: 100%; }
.nav-links a.is-active { color: var(--color-text-primary); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 9px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-fast);
}
.nav-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-normal),
    background var(--transition-normal), border-color var(--transition-normal);
  white-space: nowrap;
}
.btn-sm { padding: 9px 18px; font-size: 0.88rem; }
.btn.full { width: 100%; }
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 140, 240, 0.34);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 140, 240, 0.45); }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--color-border-light);
  color: var(--color-text-primary);
}
.btn-ghost:hover { background: var(--surface-hover); transform: translateY(-2px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #35d6f5;
  font-weight: 600;
  font-size: 0.94rem;
}
.link-arrow:hover { color: #7ee8ff; }

/* ---------- store badges ---------- */
.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 32px 0 0;
}
.store-badge { display: inline-block; transition: transform var(--transition-fast), opacity var(--transition-fast); }
.store-badge img { height: 48px; width: auto; }
.store-badge:hover { transform: translateY(-3px); }

/* ---------- breadcrumb ---------- */
.breadcrumb {
  position: relative;
  z-index: 1;
  padding: 20px 0 0;
  font-size: 0.85rem;
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.breadcrumb li { color: var(--color-text-tertiary); }
.breadcrumb li + li::before { content: '/'; margin-right: 8px; opacity: 0.5; }
.breadcrumb a { color: var(--color-text-secondary); }
.breadcrumb a:hover { color: #fff; }

/* ---------- page hero ---------- */
.page-hero {
  position: relative;
  z-index: 1;
  padding: 76px 0 44px;
}
.page-hero h1 { margin-bottom: 16px; }

/* ---------- cta band ---------- */
.cta-band {
  border-top: 1px solid var(--color-border);
  background:
    radial-gradient(700px 340px at 50% 0%, rgba(0, 160, 240, 0.14), transparent 70%);
}
.cta-band h2 { margin-bottom: 12px; }

/* ---------- lists ---------- */
.tick-list { list-style: none; margin: 20px 0; display: grid; gap: 12px; }
.tick-list li {
  position: relative;
  padding-left: 30px;
  color: var(--color-text-secondary);
  line-height: 1.65;
}
.tick-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 16px;
  height: 9px;
  border-left: 2px solid #35d6f5;
  border-bottom: 2px solid #35d6f5;
  transform: rotate(-45deg);
}

/* ---------- faq (details/summary — no JS needed) ---------- */
.faq { display: grid; gap: 10px; margin-top: 28px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition-normal), background var(--transition-normal);
}
.faq-item[open] { background: var(--surface-hover); border-color: var(--color-border-light); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { font-size: 1rem; margin: 0; font-weight: 600; }
.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  transition: transform var(--transition-normal);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 22px 20px; }
.faq-answer p { color: var(--color-text-secondary); margin: 0; line-height: 1.75; }

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 0;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid var(--color-border);
  padding: 72px 0 0;
}
.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px 56px;
  display: grid;
  grid-template-columns: 1.5fr 3fr;
  gap: 56px;
}
.footer-brand p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 16px 0 22px;
  max-width: 34ch;
}
.footer-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-badges img { height: 40px; width: auto; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.footer-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-tertiary);
  margin-bottom: 16px;
  font-weight: 600;
}
.footer-col ul { list-style: none; display: grid; gap: 11px; }
.footer-col a {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}
.footer-col a:hover { color: #fff; }
.footer-bar {
  border-top: 1px solid var(--color-border);
  padding: 22px 24px;
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bar p { margin: 0; font-size: 0.85rem; color: var(--color-text-tertiary); }
.footer-bar a { color: var(--color-text-tertiary); }
.footer-bar a:hover { color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr; gap: 40px; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 24px 28px;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal);
  }
  .nav-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links a {
    display: block;
    padding: 15px 0;
    font-size: 1.02rem;
    border-bottom: 1px solid var(--color-border);
  }
  .nav-links a::after { display: none; }
  .nav-cta { margin-top: 20px; width: 100%; }
  .section { padding: 64px 0; }
  .page-hero { padding: 52px 0 32px; }
}

@media (max-width: 520px) {
  .footer-cols { grid-template-columns: 1fr; }
  .store-row { flex-direction: column; align-items: stretch; }
  .store-badge img { height: 46px; }
  .footer-bar { flex-direction: column; }
}
