/* ─── Self-hosted fonts (variable, latin + latin-ext) ─── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── Design tokens — lifted from the app's own Theme.swift ───
   Structural chrome uses --accent (endurance-racing pit-board amber).
   --critical is reserved for the redline (>=85%) so it stays meaningful. */
:root {
  --carbon:        #0A0A0C;
  --graphite:       #16161A;
  --graphite-hover: #1B1B20;
  --hairline:       #2A2A2F;
  --hairline-bright: rgba(232,163,61,.28);

  --accent:      #B8752B;
  --accent-text: #E8A33D;
  --flag-green:  #00D26A;
  --flag-yellow: #FFD400;
  --critical:      #E10600;
  --critical-text: #FF3B30;

  --text:        #F5F5F7;
  --text-dim:    #8E8E93;
  --text-faint:  rgba(245,245,247,.36);

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;

  --font-display: 'JetBrains Mono', ui-monospace, monospace;
  --font-body:    'Inter', -apple-system, sans-serif;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--carbon);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* Faint instrument grid backdrop */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(232,163,61,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,163,61,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(184,117,43,.14), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ─── Nav ─── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline);
  background: rgba(10,10,12,.78);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .82rem;
  font-family: var(--font-body);
  transition: color .2s;
  flex-shrink: 0;
}
.nav-back:hover { color: var(--text); }
.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
  margin-left: 28px;
}
.nav-logo-mark {
  width: 20px; height: 20px;
  border-radius: 5px;
}
.nav-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-gh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 100px;
  border: 1px solid var(--hairline);
  color: var(--text-dim);
  transition: border-color .2s, color .2s;
}
.nav-gh:hover { border-color: var(--hairline-bright); color: var(--text); }
.nav-gh svg { width: 16px; height: 16px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn-sm { padding: 9px 16px; font-size: .8rem; }
.btn-primary {
  color: #0A0A0C;
  background: linear-gradient(135deg, var(--accent-text), var(--accent));
  box-shadow: 0 6px 24px rgba(232,163,61,.22);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(232,163,61,.32); }
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.02);
}
.btn-ghost:hover { border-color: var(--hairline-bright); background: rgba(255,255,255,.05); transform: translateY(-2px); }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ─── Placard / eyebrow typography ─── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--accent-text);
  opacity: .7;
}
.eyebrow-center { justify-content: center; }
.eyebrow-center::before { display: none; }

/* ─── Hero ─── */
.hero {
  padding: 148px 0 100px;
  position: relative;
  z-index: 1;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr .92fr;
  gap: 56px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 16px;
  border: 1px solid var(--hairline-bright);
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: .68rem;
  font-weight: 600;
  color: var(--accent-text);
  background: rgba(184,117,43,.08);
  margin-bottom: 30px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--flag-green);
  box-shadow: 0 0 8px var(--flag-green);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.35;transform:scale(.7)} }

.hero-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.1vw, 3.15rem);
  line-height: 1.14;
  letter-spacing: -.02em;
  margin-bottom: 24px;
}
.hero-headline .hl-accent {
  background: linear-gradient(135deg, var(--accent-text), var(--flag-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 480px;
  margin-bottom: 36px;
  font-weight: 400;
}
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-note {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--text-faint);
}

/* ─── Hero instrument cluster (signature visual) ─── */
.hero-visual { position: relative; }
.menubar-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  height: 28px;
  padding: 0 16px;
  background: rgba(20,20,24,.9);
  border: 1px solid var(--hairline);
  border-radius: 8px 8px 0 0;
  position: relative;
}
.menubar-strip .mb-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--hairline);
}
.menubar-icon {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: .64rem;
  letter-spacing: .05em;
  color: var(--accent-text);
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(232,163,61,.12);
}
.menubar-icon svg { width: 11px; height: 11px; }
.panel-thread {
  position: absolute;
  left: calc(100% - 46px);
  top: 28px;
  width: 1px;
  height: 20px;
  background: linear-gradient(to bottom, var(--hairline-bright), transparent);
}

.panel {
  background: var(--graphite);
  border: 1px solid var(--hairline);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 22px 22px 20px;
  box-shadow: 0 30px 70px rgba(0,0,0,.55);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--accent);
}
.panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .14em;
}
.panel-gear { width: 17px; height: 17px; color: var(--text-dim); }

.panel-provider {
  font-family: var(--font-display);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 12px;
}
.panel-section + .panel-provider { margin-top: 20px; }

.gauge-row + .gauge-row { margin-top: 16px; }
.gauge-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: .68rem;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.gauge-row-head .gr-label { color: var(--text); font-weight: 600; }
.gauge-row-head .gr-reset { color: var(--text-dim); }

.gauge-bar {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 3px;
  margin-bottom: 6px;
}
.gauge-seg {
  height: 9px;
  border-radius: 2px;
  background: rgba(255,255,255,.06);
}
.gauge-seg.on-green  { background: var(--flag-green);  box-shadow: 0 0 6px rgba(0,210,106,.5); }
.gauge-seg.on-yellow { background: var(--flag-yellow); box-shadow: 0 0 6px rgba(255,212,0,.45); }
.gauge-seg.on-red    { background: var(--critical);    box-shadow: 0 0 6px rgba(225,6,0,.5); }

.gauge-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: .64rem;
}
.gauge-meta .gm-range { color: var(--text-faint); }
.gauge-meta .gm-pct { font-weight: 700; font-size: .78rem; }
.gm-pct.pct-green  { color: var(--flag-green); }
.gm-pct.pct-yellow { color: var(--flag-yellow); }
.gm-pct.pct-red    { color: var(--critical-text); }

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.panel-updated {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: .62rem;
  color: var(--text-faint);
  letter-spacing: .04em;
}
.panel-updated::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--flag-green);
  box-shadow: 0 0 6px var(--flag-green);
  animation: blink 2.4s ease-in-out infinite;
}
.panel-actions { display: flex; gap: 6px; }
.p-btn {
  font-family: var(--font-display);
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .08em;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  color: var(--text-dim);
}

.panel-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: .62rem;
  letter-spacing: .04em;
  color: var(--text-faint);
  flex-wrap: wrap;
}
.panel-legend span { display: inline-flex; align-items: center; gap: 6px; }
.leg-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.leg-dot.green { background: var(--flag-green); }
.leg-dot.yellow { background: var(--flag-yellow); }
.leg-dot.red { background: var(--critical); }

/* ─── Section commons ─── */
section {
  padding: 92px 0;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--hairline);
}
.sec-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -.01em;
  line-height: 1.25;
  margin-bottom: 46px;
  max-width: 620px;
}
.sec-title-center { text-align: center; margin-left: auto; margin-right: auto; }
.sec-head-center { text-align: center; }

/* ─── Features ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.feature-card {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--graphite);
  border: 1px solid var(--hairline);
  transition: border-color .25s, transform .25s;
}
.feature-card:hover { border-color: var(--hairline-bright); transform: translateY(-2px); }
.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(232,163,61,.1);
  color: var(--accent-text);
  margin-bottom: 18px;
}
.feature-icon svg { width: 20px; height: 20px; }
.feature-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .96rem;
  letter-spacing: -.01em;
  margin-bottom: 9px;
}
.feature-desc {
  font-size: .88rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ─── How it works ─── */
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.how-text p {
  color: var(--text-dim);
  font-size: .96rem;
  line-height: 1.75;
  margin-bottom: 16px;
}
.how-text strong { color: var(--text); font-weight: 600; }
.how-text code {
  font-family: var(--font-display);
  font-size: .84em;
  color: var(--accent-text);
  background: rgba(232,163,61,.1);
  padding: .1em .4em;
  border-radius: 4px;
}

.readout {
  border-radius: var(--radius);
  background: var(--graphite);
  border: 1px solid var(--hairline);
  font-family: var(--font-display);
  font-size: .78rem;
  overflow: hidden;
}
.readout-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.readout-head .rh-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--flag-green); }
.readout-body { padding: 18px 18px 20px; line-height: 2; }
.readout-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-verb { color: var(--accent-text); margin-right: 6px; }
.rl-url  { color: var(--text); }
.rl-status { color: var(--flag-green); margin-left: 8px; }
.readout-caret {
  display: inline-block;
  width: 7px; height: 1em;
  background: var(--accent-text);
  vertical-align: text-bottom;
  animation: blink-cursor 1s step-end infinite;
}
@keyframes blink-cursor { 0%,100%{opacity:1} 50%{opacity:0} }

.callout {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-bright);
  border-left: 3px solid var(--accent);
  background: rgba(232,163,61,.05);
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.65;
}
.callout strong { color: var(--accent-text); font-weight: 600; }

/* ─── Privacy ─── */
.privacy-rows {
  border-top: 1px solid var(--hairline);
}
.privacy-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
}
.privacy-row .pr-label {
  font-family: var(--font-display);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-text);
  padding-top: 2px;
}
.privacy-row .pr-desc {
  font-size: .92rem;
  color: var(--text-dim);
  line-height: 1.7;
}
.privacy-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: .78rem;
  color: var(--accent-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.privacy-link:hover { border-color: var(--accent-text); }
.privacy-link svg { width: 13px; height: 13px; }

/* ─── Download ─── */
.download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 36px 40px;
  border-radius: var(--radius-lg);
  background: var(--graphite);
  border: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.download-reqs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dl-req {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: .78rem;
  color: var(--text-dim);
}
.dl-req svg { width: 14px; height: 14px; color: var(--flag-green); flex-shrink: 0; }
.download-ctas {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.download-ctas .btn { width: 100%; justify-content: center; }
.dl-version {
  font-family: var(--font-display);
  font-size: .66rem;
  color: var(--text-faint);
  letter-spacing: .06em;
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0;
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.footer-logo { width: 18px; height: 18px; border-radius: 4px; }
.footer-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .08em;
  color: var(--text);
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: .8rem;
}
.footer-links a { color: var(--text-dim); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: .76rem; color: var(--text-faint); font-family: var(--font-display); }

/* ─── Scroll reveal — only under html.js, invisible content is a hard no ─── */
html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
html.js .reveal.in { opacity: 1; transform: translateY(0); }

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

/* ─── Responsive ─── */
@media (max-width: 940px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { max-width: 420px; }
  .how-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .hero { padding: 120px 0 70px; }
  .nav-inner { padding: 0 18px; gap: 10px; }
  .nav-back span { display: none; }
  .nav-brand { margin-left: 0; }
  .nav-gh { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .privacy-row { grid-template-columns: 1fr; gap: 6px; }
  .download-panel { padding: 28px 22px; flex-direction: column; align-items: stretch; }
  .download-ctas { align-items: stretch; }
  .footer-inner { flex-direction: column; text-align: center; }
  section { padding: 64px 0; }
  .gauge-bar { grid-template-columns: repeat(16, 1fr); gap: 2px; }
}

.install-note { color: var(--text-muted, #b0b0b8); font-size: .95rem; line-height: 1.6; }
:focus-visible { outline: 3px solid #f5a623; outline-offset: 4px; }
.real-preview { margin: 0; text-align: center; }
.real-preview img { display: block; width: 100%; max-width: 415px; height: auto; margin: 0 auto; border: 1px solid #34343a; border-radius: 12px; }
.real-preview figcaption { color: #b0b0b8; font-size: .875rem; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; } }
