/* One stylesheet, no framework, no external font, no build step — the same constraint site/ holds
   itself to. The palette is defined once as custom properties and inverted for dark mode, so the
   page follows the visitor's system setting without a toggle or a flash of the wrong theme. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-card: #ffffff;
  --fg: #14171f;
  --fg-dim: #5b6472;
  --line: #e3e6ec;
  --accent: #1f6feb;
  --accent-fg: #ffffff;
  --ok: #1a7f4b;
  --warn: #8a5a00;
  --danger: #b42318;
  --code-bg: #0f1420;
  --code-fg: #e6edf3;
  --radius: 10px;
  --wrap: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-soft: #131a24;
    --bg-card: #161d27;
    --fg: #e6edf3;
    --fg-dim: #9aa7b5;
    --line: #262e3a;
    --accent: #4d8dfa;
    --accent-fg: #06101f;
    --ok: #46c07f;
    --warn: #d8a13a;
    --danger: #f0736a;
    --code-bg: #0a0f18;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

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

h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 1rem; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 0 0 1rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  padding: .1em .35em;
  border-radius: 4px;
}

/* ── header / footer ─────────────────────────────────────────────── */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4rem; }
.brand { font-weight: 700; font-size: 1.05rem; color: var(--fg); letter-spacing: -0.01em; }
.brand::before { content: "▲"; color: var(--accent); margin-right: .45rem; }
.nav-links { display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap; }
.nav-links a { color: var(--fg-dim); font-size: .94rem; }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
/* .nav-links a is more specific than .btn, so without this the header's call-to-action renders as
   dim grey text on a blue fill — caught in a screenshot, not by reading the stylesheet. */
.nav-links a.btn { color: var(--accent-fg); }
.nav-links a.btn:hover { color: var(--accent-fg); }

.site-footer { border-top: 1px solid var(--line); margin-top: 5rem; padding: 2rem 0 3rem; color: var(--fg-dim); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.footer-links a { margin-left: 1rem; color: var(--fg-dim); }
.footer-note { margin-top: 1rem; font-size: .85rem; opacity: .85; }
.footer-note p { margin: 0; }

/* ── buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-fg);
  padding: .7rem 1.25rem; border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; font-family: inherit;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-small { padding: .45rem .8rem; font-size: .88rem; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: .94rem; padding: 0; }
.linklike.danger { color: var(--danger); }
.inline { display: inline; }

/* ── hero ────────────────────────────────────────────────────────── */
.hero { padding: 5rem 0 3rem; background: linear-gradient(180deg, var(--bg-soft), var(--bg)); border-bottom: 1px solid var(--line); }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .74rem; font-weight: 700; color: var(--accent); margin: 0 0 .9rem; }
.lede { font-size: 1.15rem; color: var(--fg-dim); max-width: 42rem; }
.lede p { margin: 0 0 .6rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.75rem 0 2.5rem; }

.terminal {
  background: var(--code-bg); color: var(--code-fg); padding: 1.1rem 1.25rem; border-radius: var(--radius);
  overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem; line-height: 1.7; max-width: 44rem; margin: 0;
}
.terminal .prompt { color: #6ee7a8; user-select: none; }
.terminal .dim { color: #7d8896; }
.terminal .ok { color: #6ee7a8; font-weight: 600; }

/* ── features ────────────────────────────────────────────────────── */
.features { padding: 4rem 0 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; }
.grid article { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.grid p { color: var(--fg-dim); margin: 0; font-size: .95rem; }

/* ── pricing ─────────────────────────────────────────────────────── */
.pricing { padding: 3.5rem 0; }
.pricing .sub { color: var(--fg-dim); margin-bottom: 2rem; }
/* minmax(14rem) rather than 17rem so FOUR plan cards fit one row inside .wrap (68rem): four at
   17rem plus gaps overflows and drops the last plan onto a row of its own, which reads as an
   afterthought rather than the top tier. */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; align-items: start; }
.plan .price { font-size: 1.9rem; }
.plan { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.plan-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan .price { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; margin: .25rem 0; }
.plan .per { font-size: .95rem; font-weight: 400; color: var(--fg-dim); }
.plan .tagline { color: var(--fg-dim); font-size: .95rem; }
.plan ul { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.plan li { padding-left: 1.5rem; position: relative; margin-bottom: .45rem; font-size: .95rem; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan .current { color: var(--ok); font-weight: 600; font-size: .95rem; margin: 0; }
.plan .unavailable { color: var(--fg-dim); font-size: .9rem; margin: 0; }

.faq { padding: 2rem 0 4rem; }
.faq dt { font-weight: 650; margin-top: 1.4rem; }
.faq dd { margin: .4rem 0 0; color: var(--fg-dim); }
.faq dd p { margin: 0; }

/* ── forms and cards ─────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.form label, label.stacked { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .92rem; }
label small { display: block; font-weight: 400; color: var(--fg-dim); margin-top: .35rem; font-size: .85rem; }
label .key { display: inline-block; font-weight: 400; color: var(--fg-dim); font-family: ui-monospace, monospace; font-size: .78rem; margin-left: .4rem; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  display: block; width: 100%; margin-top: .35rem; padding: .6rem .7rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  color: var(--fg); font: inherit; font-size: .95rem;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
label.check input { width: auto; margin: 0; }
.inline-form { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; }
.inline-form input { margin: 0; }

/* ── flashes ─────────────────────────────────────────────────────── */
.flash { padding: .8rem 1rem; border-radius: 8px; font-size: .93rem; margin: 1.25rem 0; border: 1px solid; }
.flash-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: var(--ok); color: var(--fg); }
.flash-err { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); color: var(--fg); }
.flash-warn { background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: var(--warn); color: var(--fg); }

/* ── dashboard ───────────────────────────────────────────────────── */
.dash { padding: 2.5rem 0 4rem; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.dash-head h1 { font-size: 2rem; margin-bottom: .35rem; }
.plan-badge { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.25rem; text-align: right; }
.plan-badge .label { text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; color: var(--fg-dim); margin: 0; }
.plan-badge .value { font-size: 1.25rem; font-weight: 700; margin: 0; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); gap: 1.5rem; align-items: start; }
.dash-grid .wide { grid-column: 1 / -1; }
.subnav { display: flex; gap: 1rem; font-size: .95rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; }
.stat .value { font-size: 1.75rem; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.stat .label { color: var(--fg-dim); font-size: .82rem; margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-dim); padding: 0 .6rem .5rem 0; font-weight: 700; }
td { padding: .55rem .6rem .55rem 0; border-top: 1px solid var(--line); vertical-align: middle; }

.token-reveal { border-color: var(--ok); }
pre.token { background: var(--code-bg); color: var(--code-fg); padding: 1rem; border-radius: 8px; overflow-x: auto; font-size: .85rem; user-select: all; margin: 0 0 1rem; }

.checks { list-style: none; padding: 0; margin: 0 0 1rem; }
.checks li { padding-left: 1.5rem; position: relative; margin-bottom: .4rem; font-size: .93rem; }
.checks li::before { position: absolute; left: 0; font-weight: 700; }
.checks li.ok::before { content: "✓"; color: var(--ok); }
.checks li.bad::before { content: "✗"; color: var(--danger); }

.small { font-size: .87rem; color: var(--fg-dim); }
.small.warn { color: var(--warn); }
.ok { color: var(--ok); }
.badge { background: var(--accent); color: var(--accent-fg); border-radius: 4px; padding: .05rem .35rem; font-size: .7rem; font-weight: 700; }
.page-head { padding: 3.5rem 0 1rem; }
.prose { padding: 3rem 0 2rem; max-width: 42rem; }
.prose h2 { margin-top: 2rem; }
.prose .meta { color: var(--fg-dim); font-size: .85rem; margin-top: 2.5rem; }
.status-past_due { color: var(--warn); }
.status-canceled { color: var(--danger); }

/* ── federated sign-in ───────────────────────────────────────────── */
.sso { margin-bottom: 1.25rem; }
.sso-btn { display: block; text-align: center; margin-bottom: .6rem; font-weight: 600; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--fg-dim); font-size: .85rem; margin: 1.25rem 0 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.identity { display: inline-block; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; margin-right: .4rem; }

/* ── pricing comparison ──────────────────────────────────────────── */
.billing-toggle { display: inline-flex; gap: .25rem; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: .25rem; margin-top: 1rem; }
.billing-toggle a { padding: .4rem 1rem; border-radius: 999px; color: var(--fg-dim); font-size: .9rem; }
.billing-toggle a.on { background: var(--bg-card); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.billing-toggle a:hover { text-decoration: none; color: var(--fg); }
.ribbon { position: absolute; top: -.75rem; left: 1.5rem; background: var(--accent); color: var(--accent-fg); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .2rem .6rem; border-radius: 999px; margin: 0; }
.plan { position: relative; }
.centered { text-align: center; }
.compare { padding: 1rem 0 3rem; }
.table-scroll { overflow-x: auto; }
.matrix { min-width: 40rem; }
.matrix th { text-align: center; font-size: .85rem; text-transform: none; letter-spacing: 0; color: var(--fg); padding-bottom: .75rem; }
.matrix th:first-child { text-align: left; }
.matrix td { text-align: center; padding: .6rem .5rem; }
.matrix td:first-child { text-align: left; color: var(--fg-dim); }
.matrix .hint { display: block; font-size: .78rem; opacity: .75; }
.matrix .yes { color: var(--ok); font-weight: 700; }
.matrix .no { color: var(--fg-dim); }
.matrix strong { font-size: 1.05rem; }

/* ── admin billing ───────────────────────────────────────────────── */
.drift { margin: .35rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--fg-dim); }
.danger-text { color: var(--danger); }
td .hint { display: block; font-size: .78rem; color: var(--fg-dim); }
.status-active { color: var(--ok); font-weight: 600; }
.status-trialing { color: var(--accent); font-weight: 600; }

/* ── The language picker ─────────────────────────────────────────────────────────────────────
   <details>/<summary>, so it opens and closes with no JavaScript. The list is absolutely
   positioned so opening it does not reflow the header. */
.langmenu { position: relative; }
.langmenu > summary {
  cursor: pointer; list-style: none; color: var(--fg-dim); font-size: .94rem;
  padding: .15rem .4rem; border-radius: 6px; user-select: none; white-space: nowrap;
}
.langmenu > summary::-webkit-details-marker { display: none; }
.langmenu > summary:hover { color: var(--fg); background: var(--bg-soft); }
.langmenu[open] > summary { color: var(--fg); background: var(--bg-soft); }
.langmenu__cur { font-size: .9rem; }
.langmenu__list {
  position: absolute; z-index: 30; inset-inline-end: 0; top: calc(100% + .4rem);
  min-width: 11rem; max-height: 60vh; overflow-y: auto;
  margin: 0; padding: .35rem; list-style: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
}
.langmenu__list li { margin: 0; }
.langmenu__list a {
  display: block; padding: .4rem .6rem; border-radius: 6px;
  color: var(--fg); font-size: .95rem; text-decoration: none;
}
.langmenu__list a:hover { background: var(--bg-soft); text-decoration: none; }
.langmenu__list a.on { font-weight: 600; }
/* The check marks the current language for anyone who cannot rely on weight alone. */
.langmenu__list a.on::after { content: " ✓"; color: var(--accent); }

/* Keyboard users must be able to see where they are; the picker is the one control someone reaches
   for precisely when they cannot read the page. */
.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 100;
  padding: .6rem .9rem; background: var(--bg); border: 1px solid var(--line); border-radius: 0 0 8px 0;
}
.skip-link:focus { inset-inline-start: 0; }

/* ── Right-to-left ───────────────────────────────────────────────────────────────────────────
   Arabic is the only RTL locale here. Almost nothing needs flipping, because the layout is built
   from flex/grid and logical properties — these are the handful of places that hard-coded a side.

   Note what is NOT flipped: anything marked dir="ltr" in the markup — commands, tokens, slugs,
   URLs, email addresses and Stripe ids. Those are LTR strings inside an RTL sentence, and the
   bidirectional algorithm reorders them into something that cannot be retyped unless they say so. */
[dir="rtl"] .terminal,
[dir="rtl"] .token,
[dir="rtl"] code { text-align: left; }
[dir="rtl"] .langmenu__list { inset-inline-end: 0; }
[dir="rtl"] .plan .ribbon { left: auto; right: 1.5rem; }
/* The arrow in "Compare every plan →" points the wrong way in an RTL sentence; the Arabic string
   carries ← instead, so nothing is transformed here — this comment exists so the next person does
   not add a CSS flip that would double-reverse it. */
