:root {
  --brand-start: #0384F2;
  --brand-end: #21F472;
  --brand-gradient: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  --bg: #ffffff;
  --bg-alt: #f5f8fb;
  --text: #16202a;
  --text-muted: #55606b;
  --border: #e4e9ee;
  --card-bg: #ffffff;
  --card-shadow: 0 6px 24px rgba(16, 40, 60, 0.08);
  --radius: 14px;
  --max-width: 1120px;
  --header-height: 108px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1116;
    --bg-alt: #10181f;
    --text: #eef3f7;
    --text-muted: #9fb0bd;
    --border: #22303b;
    --card-bg: #121b23;
    --card-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-start);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand-start);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  /* No backdrop-filter/filter/transform here: any of those on an ancestor turns its
     position:fixed descendants (the mobile nav tray) into descendants positioned relative to
     THIS box instead of the viewport, squashing the full-screen tray to the header's own height.
     A solid-enough background gets a similar effect without that side effect. */
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  width: 100%;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-bottom {
  display: flex;
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; opacity: 0.85; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }

.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--card-bg);
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: transform 0.2s ease;
}
.nav-toggle-label span::before { position: absolute; top: -6px; }
.nav-toggle-label span::after { position: absolute; top: 6px; }

.main-nav {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 0.3rem;
  column-gap: 0;
  margin: 0;
  padding: 0;
}

.main-nav li {
  display: flex;
  align-items: center;
  line-height: 1.1;
}
.main-nav li:not(:last-child)::after {
  content: "|";
  margin: 0 0.65rem;
  color: var(--border);
  font-weight: 400;
}

.main-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.1;
}
.main-nav a:hover,
.main-nav a.active { color: var(--text); text-decoration: none; }

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}

.lang-switch {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.lang-switch a {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.lang-switch a.active {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
}
.lang-switch a:hover { text-decoration: none; border-color: var(--brand-start); }

@media (max-width: 640px) {
  .nav-toggle-label { display: flex; }
  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 1.25rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    z-index: 400;
  }
  .main-nav ul {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.25rem;
  }
  .main-nav li { display: block; }
  .main-nav li:not(:last-child)::after { content: none; }
  .main-nav a {
    display: block;
    padding: 0.7rem 0.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.02rem;
  }
  .nav-toggle:checked ~ .header-bottom .main-nav { transform: translateX(0); }
  .nav-toggle:checked ~ .header-top .header-right .nav-toggle-label span { background: transparent; }
  .nav-toggle:checked ~ .header-top .header-right .nav-toggle-label span::before { transform: rotate(45deg) translate(4px, 5px); }
  .nav-toggle:checked ~ .header-top .header-right .nav-toggle-label span::after { transform: rotate(-45deg) translate(4px, -5px); }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4.5rem;
  background: var(--bg-alt);
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 480px;
  background: var(--brand-gradient);
  opacity: 0.18;
  filter: blur(70px);
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  margin: 0 auto 1.1rem;
  max-width: 820px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero .gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2.2rem;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary {
  background: #fff;
  border-color: var(--border);
  /* Always a dark, near-black text — the background here is intentionally fixed white
     regardless of theme, so var(--text) (which flips light in dark mode) would be
     unreadable against it. */
  color: #16202a;
}
.btn-secondary:hover { border-color: var(--brand-start); }

.hero-trust {
  margin-top: 2.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.hero-trust span { display: flex; align-items: center; gap: 0.4rem; }
.hero-trust span::before {
  content: "✓";
  color: var(--brand-start);
  font-weight: 800;
}

/* ---------- Feature grid (home) ---------- */

.section {
  padding: 4rem 0;
}
.section-alt { background: var(--bg-alt); }

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.8rem;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 0.6rem;
}
.section-head p { color: var(--text-muted); margin: 0; }

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--card-shadow);
}
.card h3 { margin-top: 0.6rem; margin-bottom: 0.5rem; font-size: 1.1rem; }
.card p { color: var(--text-muted); margin: 0; font-size: 0.95rem; }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-icon svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Platform pills ---------- */

.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 2.2rem;
}
.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--card-bg);
}

/* ---------- Article / single page ---------- */

.page-header {
  padding: 3.2rem 0 1.6rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.page-header .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-start);
}
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0.4rem 0 0.6rem;
}
.page-header p { color: var(--text-muted); max-width: 720px; margin: 0; }

.content-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  padding: 3rem 0 5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; padding-top: 2rem; }
}

article.prose {
  max-width: 760px;
}
article.prose h2 {
  font-size: 1.45rem;
  margin-top: 2.4rem;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}
article.prose h3 {
  font-size: 1.15rem;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}
article.prose p, article.prose li { color: var(--text); }
article.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.9rem 1.2rem;
  border-left: 4px solid var(--brand-start);
  background: var(--bg-alt);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}
article.prose blockquote p { margin: 0.4rem 0; }
article.prose code {
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  font-size: 0.88em;
}
article.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-size: 0.92rem;
}
article.prose th, article.prose td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}
article.prose th { background: var(--bg-alt); }
article.prose img {
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 0.5rem 0 1rem;
}

/* App/Play/Windows Store badges on the Download page — logos, not screenshots, so none of the
   border/radius/margin above applies; a shared fixed height keeps Apple's own (correctly sized)
   badge, Google Play's oversized PNG, and Microsoft's square app-icon-shaped image all visually
   consistent at a glance. */
article.prose .store-badge {
  height: 40px;
  width: auto;
  border: none;
  border-radius: 0;
  margin: 0;
  vertical-align: middle;
}

.screenshot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 864px;
  margin: 1.5rem auto 0;
}
.screenshot-row img { margin: 0; width: 100%; }
@media (max-width: 640px) {
  .screenshot-row { grid-template-columns: 1fr; max-width: 432px; }
}
article.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

.page-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
  font-weight: 600;
}

.toc-card, .nav-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}
.toc-card .label, .nav-card .label {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.toc-card nav ul { padding-left: 1rem; margin: 0.2rem 0; }
.toc-card nav > ul { padding-left: 0; }
.toc-card nav a, .nav-card a { font-size: 0.88rem; }
.nav-card ul { list-style: none; margin: 0; padding: 0; }
.nav-card li { margin: 0.35rem 0; }
.nav-card a.current { color: var(--text); font-weight: 700; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 3rem 0 2rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-grid h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 0.45rem 0; }
.footer-grid a { color: var(--text-muted); font-size: 0.92rem; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.4rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}
