/* Threshold — marketing site
 *
 * Design tokens are lifted directly from the app's CAVTheme.swift so the site
 * and the product read as one thing. The app substitutes system fonts for the
 * three families below; on the web we can use the real ones.
 *
 * Fonts are self-hosted rather than loaded from Google. A German court held
 * that hotlinking Google Fonts transmits visitor IPs without consent in breach
 * of GDPR, and this site tells European pilots it collects nothing.
 */

/* ---------- fonts ---------- */

@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 500;
  src: url('/static/fonts/spacegrotesk-500.woff2') format('woff2'); font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 700;
  src: url('/static/fonts/spacegrotesk-700.woff2') format('woff2'); font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans'; font-style: normal; font-weight: 400;
  src: url('/static/fonts/instrumentsans-400.woff2') format('woff2'); font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans'; font-style: normal; font-weight: 600;
  src: url('/static/fonts/instrumentsans-600.woff2') format('woff2'); font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400;
  src: url('/static/fonts/jetbrainsmono-400.woff2') format('woff2'); font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 600;
  src: url('/static/fonts/jetbrainsmono-600.woff2') format('woff2'); font-display: swap;
}

/* ---------- tokens (CAVTheme.swift) ---------- */

:root {
  --bg:        #07090C;
  --card:      #0F141B;
  --track:     #07090C;
  --text:      #E8EDF2;
  --accent:    #37E0A6;
  --accent-ink:#04140D;

  /* Flight categories — same values the map draws with. */
  --vfr:  #37E0A6;
  --mvfr: #7DB1FF;
  --ifr:  #FF8080;
  --lifr: #E58FEC;

  --line:      rgba(255,255,255,.07);
  --line-soft: rgba(255,255,255,.045);
  --mut:       rgba(255,255,255,.56);
  --mut-dim:   rgba(255,255,255,.38);

  --display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --body:    'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --shell: 1140px;
}

/* ---------- base ---------- */

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

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

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

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.1rem); }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.22rem; }
p  { margin: 0 0 1.05em; color: var(--mut); }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* Small caps label — the app uses this above every card group. */
.eyebrow {
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--mut-dim);
  margin: 0 0 14px;
}
.lede { font-size: 1.2rem; line-height: 1.6; color: var(--mut); }

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,9,12,.86);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 30px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 700; font-size: 1.12rem; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: auto; height: 22px; flex: none; }
.nav-links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--mut); font-size: .94rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.on { color: var(--text); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 8px; cursor: pointer; margin-left: auto; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 24px 18px; margin-left: 0; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 0; width: 100%; font-size: 1rem; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--display); font-weight: 700; font-size: .96rem;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: .92; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.03); }
.btn-row { display: flex; flex-wrap: wrap; gap: 13px; align-items: center; }

/* ---------- sections ---------- */

section { padding: 92px 0; }
section.tight { padding: 62px 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head p { font-size: 1.08rem; margin-bottom: 0; }

/* ---------- hero ---------- */

.hero {
  position: relative; overflow: hidden;
  padding: 104px 0 88px;
  /* The app's detail-header sky gradient. */
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(18,58,94,.55) 0%, rgba(11,42,74,.28) 42%, transparent 72%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
/* Faint isobar-like arcs, echoing the airspace rings on the map. */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 50% 118%, transparent 41%, rgba(55,224,166,.10) 41.4%, transparent 42%),
    radial-gradient(circle at 50% 118%, transparent 53%, rgba(55,224,166,.07) 53.4%, transparent 54%),
    radial-gradient(circle at 50% 118%, transparent 66%, rgba(55,224,166,.05) 66.4%, transparent 67%);
}
.hero .shell { position: relative; z-index: 1; }
.hero h1 { max-width: 15ch; margin-bottom: 22px; }
.hero .lede { max-width: 54ch; margin-bottom: 32px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .74rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: rgba(55,224,166,.10);
  border: 1px solid rgba(55,224,166,.22);
  padding: 7px 14px; border-radius: 999px; margin-bottom: 26px;
}

/* ---------- cards ---------- */

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 26px 24px;
}
.card h3 { margin-bottom: 9px; }
.card p:last-child { margin-bottom: 0; }
.card .ico {
  width: 38px; height: 38px; border-radius: 11px; margin-bottom: 16px;
  display: grid; place-items: center;
  background: rgba(55,224,166,.10); border: 1px solid rgba(55,224,166,.2);
  color: var(--accent);
}
.card .ico svg { width: 19px; height: 19px; }

/* ---------- data strip ---------- */

.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.014); }
.stats .grid { gap: 0; }
.stat { padding: 30px 24px; border-right: 1px solid var(--line-soft); }
.stat:last-child { border-right: 0; }
.stat .n { font-family: var(--display); font-size: 2.05rem; font-weight: 700; color: var(--text); line-height: 1; letter-spacing: -.02em; }
.stat .l { font-family: var(--mono); font-size: .72rem; letter-spacing: .11em; text-transform: uppercase; color: var(--mut-dim); margin-top: 9px; }
@media (max-width: 640px) { .stat { border-right: 0; border-bottom: 1px solid var(--line-soft); } }

/* ---------- screenshot frames ---------- */

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .shots { grid-template-columns: 1fr; max-width: 340px; margin: 0 auto; } }

.phone {
  border-radius: 30px; padding: 9px;
  background: linear-gradient(160deg, rgba(255,255,255,.13), rgba(255,255,255,.03));
  box-shadow: 0 26px 60px rgba(0,0,0,.55);
}
.phone-in {
  border-radius: 23px; overflow: hidden; background: var(--card);
  aspect-ratio: 393 / 852; display: grid; place-items: center;
}
.phone-in img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* Shown until a real screenshot is dropped in. */
.shot-todo {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .07em;
  color: var(--mut-dim); text-align: center; padding: 20px; text-transform: uppercase;
}
.shot-cap { font-family: var(--mono); font-size: .74rem; letter-spacing: .07em; color: var(--mut-dim); text-align: center; margin-top: 14px; text-transform: uppercase; }

/* ---------- category chips (from the app) ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-family: var(--mono); font-size: .76rem; font-weight: 600; letter-spacing: .06em;
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
}
.chip-vfr  { color: var(--vfr);  background: rgba(55,224,166,.16); }
.chip-mvfr { color: var(--mvfr); background: rgba(59,130,246,.18); }
.chip-ifr  { color: var(--ifr);  background: rgba(255,90,90,.16); }
.chip-lifr { color: var(--lifr); background: rgba(217,86,224,.16); }

/* ---------- pricing ---------- */

.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 900px) { .price-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }
.price { position: relative; display: flex; flex-direction: column; }
.price.featured { border-color: rgba(55,224,166,.38); background: linear-gradient(180deg, rgba(55,224,166,.05), var(--card) 46%); }
.price .tag {
  position: absolute; top: -11px; left: 24px;
  font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink); padding: 4px 11px; border-radius: 999px;
}
.price .amt { font-family: var(--display); font-size: 2.5rem; font-weight: 700; letter-spacing: -.03em; margin: 6px 0 2px; }
.price .per { font-family: var(--mono); font-size: .78rem; color: var(--mut-dim); }
.price ul { list-style: none; padding: 20px 0 0; margin: 20px 0 0; border-top: 1px solid var(--line); flex: 1; }
.price li { color: var(--mut); font-size: .96rem; padding: 7px 0 7px 26px; position: relative; }
.price li::before {
  content: ""; position: absolute; left: 3px; top: 15px; width: 11px; height: 6px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.price .btn { margin-top: 22px; justify-content: center; }

/* ---------- comparison ---------- */

.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.cmp { width: 100%; border-collapse: collapse; min-width: 560px; }
table.cmp th, table.cmp td { padding: 15px 20px; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: .96rem; }
table.cmp thead th { font-family: var(--mono); font-size: .72rem; letter-spacing: .11em; text-transform: uppercase; color: var(--mut-dim); background: rgba(255,255,255,.02); }
table.cmp td { color: var(--mut); }
table.cmp td:first-child { color: var(--text); font-weight: 500; }
table.cmp tr:last-child td { border-bottom: 0; }
table.cmp .yes { color: var(--accent); font-weight: 600; }
table.cmp .no  { color: var(--mut-dim); }

/* ---------- faq ---------- */

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 22px 0;
  font-family: var(--display); font-weight: 700; font-size: 1.08rem;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 1.35rem; color: var(--mut-dim); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 22px; max-width: 74ch; }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- callouts ---------- */

.note {
  border-radius: var(--r); padding: 20px 22px; border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.note.warn { border-color: rgba(255,128,128,.3); background: rgba(255,128,128,.06); }
.note.warn strong { color: var(--ifr); }
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--text); font-family: var(--display); }

/* ---------- legal / prose pages ---------- */

.prose { max-width: 78ch; }
.prose h2 { font-size: 1.32rem; margin: 40px 0 12px; }
.prose h2:first-of-type { margin-top: 0; }
.prose h3 { font-size: 1.06rem; margin: 28px 0 10px; }
.prose ul { color: var(--mut); padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose .updated { font-family: var(--mono); font-size: .78rem; color: var(--mut-dim); }
.page-head { padding: 74px 0 0; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: 14px; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); padding: 60px 0 44px; margin-top: 20px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 34px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.foot h4 { font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--mut-dim); margin-bottom: 15px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 10px; }
.foot a { color: var(--mut); font-size: .94rem; }
.foot a:hover { color: var(--text); text-decoration: none; }
.foot-base { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.foot-base p { margin: 0; font-size: .88rem; color: var(--mut-dim); }
.disclaimer { font-size: .86rem; color: var(--mut-dim); max-width: 62ch; line-height: 1.55; }

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