/* Marginal — marketing site (top, pricing, download, blog).
   Plain CSS, no external requests. Tokens follow the app's Marginal Light /
   Marginal Dark themes; the vermilion comes from the app icon. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1f2430;
  --muted: #6b7280;
  --surface: #f6f7f9;
  --border: #e2e5ea;
  --accent: #4f6bed;
  --brand: #e4572e;
  --brand-fg: #faf6ef;
  --ink: #1a1a1e;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 16px 40px rgb(0 0 0 / 0.08);
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --show-moon: block;
  --show-sun: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e14;
  --fg: #edf1f7;
  --muted: #8b95a5;
  --surface: #161b22;
  --border: #2a2f38;
  --accent: #6e87f5;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 16px 40px rgb(0 0 0 / 0.55);
  --show-moon: none;
  --show-sun: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0e14;
    --fg: #edf1f7;
    --muted: #8b95a5;
    --surface: #161b22;
    --border: #2a2f38;
    --accent: #6e87f5;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 16px 40px rgb(0 0 0 / 0.55);
    --show-moon: none;
    --show-sun: block;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
code, kbd, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }

/* ---------- header ---------- */

.header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; height: 64px; gap: 24px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg); font-weight: 650; font-size: 18px; letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.nav { margin-left: auto; display: flex; gap: 28px; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 500; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); text-decoration: none; }
.theme-toggle {
  flex: none; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.theme-toggle:hover { color: var(--fg); background: var(--surface); }
.theme-toggle .moon { display: var(--show-moon); }
.theme-toggle .sun { display: var(--show-sun); }
@media (max-width: 520px) {
  .header .container { gap: 12px; }
  .header .brand span { display: none; }
  .nav { gap: 16px; }
  .nav a { font-size: 14px; }
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: 16px; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: var(--brand-fg); border-color: var(--brand); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: var(--bg); color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface); }
.btn-lg { padding: 14px 26px; font-size: 17px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.fine { font-size: 14px; color: var(--muted); margin: 16px 0 0; }

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

.hero { padding: 72px 0 40px; text-align: center; }
.hero h1 {
  font-size: clamp(38px, 6.4vw, 68px); line-height: 1.04; letter-spacing: -0.035em;
  font-weight: 700; margin: 0 auto 20px; max-width: 17ch; text-wrap: balance;
}
.hero .lede {
  font-size: clamp(17px, 2vw, 20px); color: var(--muted);
  max-width: 58ch; margin: 0 auto 32px; text-wrap: pretty;
}
.shot-hero { max-width: 1280px; margin: 36px auto 0; padding: 0 12px; }
.shot-hero img { width: 100%; height: auto; display: block; }

/* ---------- agents strip ---------- */

.agents { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.agents .container {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px 28px; padding: 18px 24px; font-size: 14px; color: var(--muted);
}
.agents strong { color: var(--fg); font-weight: 600; }
.agents span { white-space: nowrap; }

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

.section { padding: 80px 0 0; }
.section-head { max-width: 64ch; margin: 0 0 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 12px;
}
.title {
  font-size: clamp(28px, 3.8vw, 42px); line-height: 1.1; letter-spacing: -0.03em;
  font-weight: 700; margin: 0 0 14px; text-wrap: balance;
}
.section-head p { font-size: 18px; color: var(--muted); margin: 0; text-wrap: pretty; }

/* ---------- feature rows ---------- */

.feature {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px; align-items: center; padding: 56px 0;
}
.feature.flip .feature-text { order: 2; }
.feature h2 {
  font-size: clamp(26px, 3.2vw, 36px); line-height: 1.12; letter-spacing: -0.025em;
  font-weight: 700; margin: 0 0 16px; text-wrap: balance;
}
.feature p { font-size: 17px; color: var(--muted); margin: 0 0 18px; text-wrap: pretty; }
.feature ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.feature li { padding-left: 22px; position: relative; font-size: 15.5px; }
.feature li::before {
  content: ""; position: absolute; left: 0; top: 0.65em;
  width: 10px; height: 2px; background: var(--brand);
}
.frame {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: var(--surface);
}
.frame img { display: block; width: 100%; height: auto; }
.frame.dark { background: #1c1d21; border-color: #33353b; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 28px; padding: 44px 0; }
  .feature.flip .feature-text { order: 0; }
}

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

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; display: flex; flex-direction: column;
}
.card .frame { border: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border); }
.card-body { padding: 20px 22px 24px; }
.card h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -0.015em; }
.card h3 kbd { font-size: 14px; vertical-align: 2px; margin-right: 6px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; text-wrap: pretty; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }

/* ---------- keys ---------- */

kbd {
  font-size: 13px; padding: 2px 7px; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; background: var(--bg); color: var(--fg); white-space: nowrap;
}
.keys { display: grid; gap: 14px; }
.keyrow {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
}
.keyrow .label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 600;
}
.keyseq { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.keyseq .arrow { color: var(--muted); }
.statusbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted); font-family: var(--mono);
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); padding: 8px 12px;
}
.statusbar .chip { color: var(--accent); font-weight: 700; letter-spacing: 0.06em; }
.statusbar .dot { opacity: 0.5; }
.statusbar .right { margin-left: auto; }

/* ---------- themes ---------- */

.themes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.theme {
  min-width: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--tb);
  background: var(--tbg); color: var(--tfg); font-size: 12px;
}
.theme .bar {
  background: var(--tchrome); padding: 7px 10px; font-weight: 600; font-size: 11.5px;
  border-bottom: 1px solid var(--tb); display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.theme .bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--tacc); flex: none; }
.theme .body { padding: 10px 10px 12px; font-family: var(--mono); line-height: 1.65; white-space: nowrap; overflow: hidden; }
.theme .h { color: var(--th); font-weight: 700; }
.theme .m { opacity: 0.65; }
.theme .a { color: var(--tacc); }
@media (max-width: 960px) { .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

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

.pricing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.price-card {
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 28px;
}
.price-card .plan-name { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.price-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 20px; }
.price { border: 1px solid var(--border); border-radius: 12px; background: var(--bg); padding: 18px 20px; }
.price .amount { font-size: 38px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.price .per { color: var(--muted); font-size: 14px; }
.price .note { color: var(--muted); font-size: 13px; margin-top: 8px; }
.price.best { border-color: var(--brand); }
.price .tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); margin-bottom: 8px; }
.checks { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 9px; font-size: 15.5px; }
.checks li { padding-left: 26px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.price-card .btn { width: 100%; }
.price-card .fine { text-align: center; margin-top: 12px; }
@media (max-width: 860px) { .pricing { grid-template-columns: 1fr; gap: 32px; } }
@media (max-width: 480px) { .price-options { grid-template-columns: 1fr; } }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.col { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; background: var(--surface); }
.col h3 { margin: 0 0 12px; font-size: 18px; letter-spacing: -0.01em; }
.col ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15.5px; display: grid; gap: 6px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */

.faq details { border-top: 1px solid var(--border); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 17px; list-style: none;
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 10px 0 0; max-width: 70ch; font-size: 15.5px; text-wrap: pretty; }

/* ---------- final CTA ---------- */

.cta-band {
  margin-top: 80px; padding: 72px 0; text-align: center;
  border-top: 1px solid var(--border); background: var(--surface);
}
.cta-band .title { margin-bottom: 10px; }
.cta-band p { color: var(--muted); font-size: 18px; margin: 0 auto 28px; max-width: 56ch; }

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

.footer { border-top: 1px solid var(--border); padding: 40px 0 56px; font-size: 14px; color: var(--muted); }
.footer .container { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.footer .brand { font-size: 16px; margin-bottom: 10px; }
.footer .brand img { width: 22px; height: 22px; border-radius: 5px; }
.footer p { margin: 0 0 6px; max-width: 40ch; }
.footer h4 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--fg); }
@media (max-width: 640px) { .footer .container { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .footer .col-brand { grid-column: 1 / -1; } }

/* ---------- inner pages ---------- */

.page-head { padding: 72px 0 40px; text-align: center; }
.page-head h1 {
  font-size: clamp(36px, 5.5vw, 56px); letter-spacing: -0.035em; line-height: 1.05;
  font-weight: 700; margin: 0 0 16px; text-wrap: balance;
}
.page-head p { color: var(--muted); font-size: 19px; max-width: 56ch; margin: 0 auto; text-wrap: pretty; }

.rec {
  border: 1px solid var(--brand); border-radius: 14px; background: var(--surface);
  padding: 22px 24px; margin-bottom: 20px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px;
}
.rec-body { flex: 1; min-width: 240px; }
.rec-k { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.rec-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.rec-meta { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.rec-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.platform { border: 1px solid var(--border); border-radius: 14px; padding: 22px 22px 20px; background: var(--surface); display: flex; flex-direction: column; }
.platform h3 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.015em; }
.platform .req { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; text-wrap: pretty; }
.files-k { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 8px 0 6px; }
.files { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 8px; }
.files li { min-width: 0; }
.files a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; min-width: 0;
  font-family: var(--mono); font-size: 12.5px; color: var(--fg);
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.files a:hover { border-color: var(--brand); text-decoration: none; }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .size { color: var(--muted); font-size: 11.5px; flex: none; }
@media (max-width: 860px) { .platforms { grid-template-columns: minmax(0, 1fr); } }

.prose { font-size: 16.5px; }
.prose h2 { font-size: 24px; letter-spacing: -0.02em; margin: 40px 0 10px; }
.prose p { color: var(--muted); margin: 0 0 14px; max-width: 70ch; text-wrap: pretty; }
.prose p strong { color: var(--fg); }

/* ---------- article (blog) ---------- */

.article { max-width: 720px; margin: 0 auto; padding: 64px 24px 24px; }
.article .eyebrow { margin-bottom: 14px; }
.article h1 {
  font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.03em;
  font-weight: 700; margin: 0 0 18px; text-wrap: balance;
}
.article .meta { color: var(--muted); font-size: 15px; margin: 0 0 40px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.article p { font-size: 18px; line-height: 1.7; margin: 0 0 24px; text-wrap: pretty; }
.article h2 { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; margin: 44px 0 14px; }
.article h2 .num { color: var(--brand); margin-right: 10px; }
.article code { font-size: 0.88em; background: var(--surface); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; }
.article .frame { margin: 8px 0 32px; }
.article .frame img { width: 100%; }
.article figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.article .end { border-top: 1px solid var(--border); padding-top: 24px; color: var(--muted); font-size: 15px; }

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