/* =========================================================
   TubePilot — design tokens
   Palette matches the app's own theme (app_theme.dart):
   teal / light-teal / deep navy / sky accent, on a near-white
   ground. Display face: Space Grotesk (geometric, "instrument
   panel" feel — echoes the compass/flight-path brand mark).
   Body face: Inter.
========================================================= */
:root {
  --teal: #0B7A80;
  --teal-light: #12A4AC;
  --navy: #1F3B4D;
  --sky: #0EA5E9;
  --green: #16A34A;
  --red: #DC2626;

  --bg: #F6FAFA;
  --card: #FFFFFF;
  --card-2: #EDF6F6;
  --border: #DCEAEA;
  --text: #0F2224;
  --text-dim: #5E7879;

  --display: "Space Grotesk", "Segoe UI", sans-serif;
  --body: "Inter", "Segoe UI", sans-serif;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 34, 36, 0.04), 0 12px 32px -16px rgba(15, 34, 36, 0.14);
  --container: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; color: var(--text); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid var(--sky);
  outline-offset: 3px;
  border-radius: 4px;
}

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

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

/* ---------- Flight-path divider — the page's signature element.
   A dashed compass-bearing line with a small paper-airplane glyph
   riding it, echoing the app's own logo mark. Used to separate
   major sections instead of a plain <hr>. ---------- */
.flight-divider {
  position: relative;
  height: 1px;
  margin: 64px 0;
  background: repeating-linear-gradient(
    90deg, var(--border) 0 10px, transparent 10px 18px
  );
}
.flight-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--bg);
  border: 1.5px solid var(--teal-light);
  border-radius: 6px;
}
.flight-divider::before {
  content: "\2708";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  font-size: 11px;
  color: var(--teal);
  z-index: 1;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 250, 250, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
/* Logo mark: no background box — the logo image itself is the mark.
   Previously this had a teal/navy gradient box behind it; removed so
   only the actual logo.png is visible, matching the app icon exactly. */
.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: none;
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: 15px;
  overflow: hidden;
}
.brand .mark svg { width: 18px; height: 18px; }
.brand .mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--text-dim);
  font-size: 14.5px;
  font-weight: 500;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--teal);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal-light), var(--navy));
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(11, 122, 128, 0.55); text-decoration: none; }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--teal-light); color: var(--teal); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 480px;
  background: radial-gradient(60% 60% at 30% 20%, rgba(18, 164, 172, 0.16), transparent 70%),
              radial-gradient(50% 50% at 80% 10%, rgba(14, 165, 233, 0.12), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
  position: relative;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  margin-bottom: 20px;
}
.hero h1 .accent { color: var(--teal); }
.hero p.lead {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 46ch;
  margin-bottom: 28px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-note { font-size: 12.5px; color: var(--text-dim); }

/* Compass illustration */
.compass-wrap {
  position: relative;
  display: grid;
  place-items: center;
}
.compass {
  width: min(340px, 80vw);
  aspect-ratio: 1;
  position: relative;
}
.compass .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px dashed var(--border);
  animation: spin 40s linear infinite;
}
.compass .ring.inner { inset: 34px; border-color: rgba(18,164,172,0.35); animation-duration: 60s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.compass .core {
  position: absolute;
  inset: 74px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.compass .core svg { width: 46%; height: 46%; color: var(--teal); }
.compass .core img { width: 46%; height: 46%; object-fit: contain; background: none; }
.compass .tick { position: absolute; width: 2px; height: 10px; background: var(--teal-light); left: 50%; top: 0; transform-origin: 50% 170px; }

/* ---------- Sections ---------- */
.section { padding: 8px 0 72px; }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); }
.section-head p { color: var(--text-dim); }

.grid {
  display: grid;
  gap: 20px;
}
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.feature-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--card-2);
  display: grid;
  place-items: center;
  color: var(--teal);
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 16.5px; margin-bottom: 6px; }
.feature-card p { color: var(--text-dim); font-size: 14px; margin: 0; }

.steps { counter-reset: step; }
.step {
  display: flex;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.step:first-child { border-top: none; }
.step .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  color: var(--teal);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--teal-light);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.step h3 { font-size: 15.5px; margin-bottom: 4px; }
.step p { color: var(--text-dim); font-size: 14px; margin: 0; }

/* ---------- Legal document layout ---------- */
.legal-hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
}
.legal-hero .eyebrow { margin-bottom: 12px; }
.legal-hero h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 10px; }
.legal-hero .meta { color: var(--text-dim); font-size: 13.5px; }

.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  padding: 48px 0 96px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 96px;
  border-left: 1px solid var(--border);
  padding-left: 18px;
}
.toc p.label {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.toc a {
  counter-increment: toc;
  color: var(--text-dim);
  font-size: 13.5px;
  display: block;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero) "  ";
  color: var(--teal-light);
  font-family: var(--display);
  font-weight: 600;
}
.toc a.active,
.toc a:hover { color: var(--teal); text-decoration: none; }

.legal-body h2 {
  font-size: 20px;
  margin-top: 40px;
  scroll-margin-top: 96px;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 { font-size: 16px; margin-top: 24px; }
.legal-body p, .legal-body li { color: var(--text-dim); font-size: 14.5px; }
.legal-body ul, .legal-body ol { padding-left: 20px; }
.legal-body strong { color: var(--text); }
.legal-body .callout {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 20px 0;
}
.legal-body .callout strong { color: var(--navy); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.contact-card .icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--card-2);
  display: grid; place-items: center;
  color: var(--teal);
  margin-bottom: 14px;
}
.contact-card h3 { font-size: 15.5px; margin-bottom: 4px; }
.contact-card p { color: var(--text-dim); font-size: 13.5px; margin-bottom: 10px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  background: var(--card);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}
.footer-brand p { color: var(--text-dim); font-size: 13.5px; max-width: 32ch; }
.footer-col p.label {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.footer-col a { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 10px; }
.footer-col a:hover { color: var(--teal); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  box-shadow: 0 10px 24px -10px rgba(31, 59, 77, 0.5);
}
.to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .compass-wrap { order: -1; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .legal-layout { grid-template-columns: 1fr; }
  .toc { position: static; border-left: none; border-bottom: 1px solid var(--border); padding: 0 0 20px; margin-bottom: 12px; }
  .toc ol { flex-direction: row; flex-wrap: wrap; gap: 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links { position: fixed; inset: 72px 0 0 0; background: var(--bg); flex-direction: column; align-items: flex-start; padding: 24px; gap: 4px; display: none; overflow-y: auto; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--border); }
  .nav-toggle { display: grid; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}
