/* Persona — shared styles
   Light theme with dark hero/footer. Zero external deps, system fonts. */

:root {
  --bg: #ffffff;
  --bg-subtle: #f6f8fb;
  --bg-dark: #0c1222;
  --bg-dark-2: #111a30;
  --text: #1a2233;
  --text-dark: #e8edf6;
  --muted: #5b6573;
  --muted-dark: #94a0b8;
  --border: #e6e9ef;
  --border-dark: #21304d;
  --brand: #5b5bd6;
  --brand-hover: #4a4ac4;
  --brand-soft: #ececfb;
  --accent: #12b6a3;
  --ok: #1faa5a;
  --warn: #d98a00;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.10);
  --maxw: 1120px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .7em 1.25em; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-subtle); }
.btn-on-dark { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); }
.btn-on-dark:hover { background: rgba(255,255,255,.16); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; color: var(--text); font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.brand-light { color: #fff; }
.nav-links { display: flex; gap: 22px; margin-left: 8px; }
.nav-links a { color: var(--muted); font-weight: 550; font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-toggle button {
  border: 0; background: transparent; padding: .35em .6em; cursor: pointer;
  font-size: .8rem; font-weight: 600; color: var(--muted); font-family: inherit;
}
.lang-toggle button.active { background: var(--brand-soft); color: var(--brand); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 500px at 70% -10%, #1c2c52 0%, var(--bg-dark) 55%);
  color: var(--text-dark);
  padding: 84px 0 96px;
  position: relative; overflow: hidden;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  color: var(--muted-dark); background: rgba(255,255,255,.05);
  border: 1px solid var(--border-dark); padding: .35em .8em; border-radius: 999px;
  margin-bottom: 22px;
}
.hero .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(18,182,163,.18); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lede { color: var(--muted-dark); font-size: 1.2rem; max-width: 54ch; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } }

.stat-strip { display: flex; gap: 40px; margin-top: 52px; flex-wrap: wrap; }
.stat .num { font-size: 1.7rem; font-weight: 800; color: #fff; }
.stat .lbl { font-size: .85rem; color: var(--muted-dark); }

/* ---------- Code blocks ---------- */
.code {
  background: #0a1020; border: 1px solid var(--border-dark); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.code-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border-dark); }
.code-head .dots { display: flex; gap: 6px; }
.code-head .dots i { width: 11px; height: 11px; border-radius: 50%; background: #2a3550; }
.code-head .fname { font-family: var(--mono); font-size: .78rem; color: var(--muted-dark); margin-left: 6px; }
pre {
  margin: 0; padding: 18px; overflow-x: auto;
  font-family: var(--mono); font-size: .82rem; line-height: 1.65; color: #d7e0f0;
}
pre code { font-family: inherit; }
.tok-key { color: #7aa2ff; }
.tok-str { color: #7fd6a6; }
.tok-fn { color: #c4a6ff; }
.tok-num { color: #f0b072; }
.tok-com { color: #5a6b8c; }
.tok-punc { color: #95a3c0; }

code.inline {
  font-family: var(--mono); font-size: .85em;
  background: var(--bg-subtle); border: 1px solid var(--border);
  padding: .1em .4em; border-radius: 6px; color: #324;
}

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-subtle { background: var(--bg-subtle); }
.section-head { max-width: 640px; margin: 0 0 48px; }
.section-head .kicker { color: var(--brand); font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

/* Steps / how it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow); }
.step .n { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 700; margin-bottom: 14px; }
.step h3 { margin-bottom: .3em; }
.step p { color: var(--muted); margin: 0; font-size: .96rem; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 820px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg); }
.feature .ico { width: 38px; height: 38px; border-radius: 9px; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; color: var(--brand); }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); margin: 0; font-size: .94rem; }

/* Pipeline diagram */
.diagram-wrap { display: flex; justify-content: center; padding: 16px 0; }
.diagram-wrap svg { max-width: 100%; height: auto; }

/* Split / code showcase */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.split ul { list-style: none; padding: 0; margin: 18px 0 0; }
.split ul li { padding: 8px 0 8px 30px; position: relative; color: var(--muted); }
.split ul li::before { content: ""; position: absolute; left: 0; top: 15px; width: 16px; height: 16px; border-radius: 50%; background: var(--brand-soft); box-shadow: inset 0 0 0 4px var(--brand); }

/* CTA band */
.cta-band { background: linear-gradient(120deg, #14224a, var(--bg-dark)); color: #fff; border-radius: var(--radius-lg); padding: 54px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--muted-dark); max-width: 50ch; margin: 0 auto 26px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-dark); color: var(--muted-dark); padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.footer-grid h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 14px; }
.footer-grid a { display: block; color: var(--muted-dark); padding: 5px 0; font-size: .92rem; }
.footer-grid a:hover { color: #fff; text-decoration: none; }
.footer-brand p { font-size: .92rem; max-width: 36ch; margin-top: 14px; }
.footer-bottom { border-top: 1px solid var(--border-dark); margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .85rem; }

/* ---------- Docs ---------- */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 48px; padding: 48px 0 80px; }
@media (max-width: 880px) { .docs { grid-template-columns: 1fr; } .docs-nav { position: static; } }
.docs-nav { position: sticky; top: 88px; align-self: start; font-size: .92rem; }
.docs-nav .grp { margin-bottom: 22px; }
.docs-nav .grp-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.docs-nav a { display: block; color: var(--muted); padding: 5px 0; }
.docs-nav a:hover { color: var(--text); text-decoration: none; }
.docs-body { min-width: 0; }
.docs-body h2 { margin-top: 8px; padding-top: 8px; }
.docs-body h3 { margin-top: 36px; }
.docs-body p { color: #313a4a; }
.docs-body > section { scroll-margin-top: 84px; }

.endpoint { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 16px 0 8px; }
.endpoint .ep-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: .9rem; }
.method { font-weight: 700; font-size: .72rem; padding: .25em .6em; border-radius: 6px; letter-spacing: .03em; }
.method.post { background: #e6f6ee; color: #137a45; }
.method.get { background: #e7eefc; color: #2657c4; }
.ep-path { color: var(--text); }

table.params { width: 100%; border-collapse: collapse; margin: 12px 0 4px; font-size: .9rem; }
table.params th, table.params td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.params th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
table.params td code { font-family: var(--mono); font-size: .86em; color: var(--brand); }
.req { color: var(--warn); font-size: .78rem; font-weight: 600; }

.callout { border: 1px solid var(--border); border-left: 3px solid var(--brand); background: var(--bg-subtle); border-radius: 8px; padding: 14px 18px; margin: 18px 0; font-size: .92rem; color: #313a4a; }

/* ---------- Status ---------- */
.status-hero { padding: 48px 0 28px; }
.overall { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-radius: var(--radius-lg); background: #eafaf0; border: 1px solid #bfe9cf; font-weight: 650; color: #137a45; }
.overall .pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(31,170,90,.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31,170,90,.45); } 70% { box-shadow: 0 0 0 10px rgba(31,170,90,0); } 100% { box-shadow: 0 0 0 0 rgba(31,170,90,0); } }

.components { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin: 28px 0; }
.component { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.component:last-child { border-bottom: 0; }
.component .name { font-weight: 600; }
.component .name small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
.badge-ok { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-size: .9rem; font-weight: 600; }
.badge-ok .d { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 28px 0; }
@media (max-width: 700px) { .metrics { grid-template-columns: 1fr; } }
.metric { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.metric .v { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.metric .k { color: var(--muted); font-size: .88rem; }
.metric .spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 14px; }
.metric .spark i { flex: 1; background: var(--brand-soft); border-radius: 2px 2px 0 0; min-height: 3px; }

.uptime-row { display: flex; gap: 2px; margin: 10px 0 2px; }
.uptime-row i { flex: 1; height: 30px; border-radius: 2px; background: var(--ok); opacity: .85; }
.uptime-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; }

.incidents { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; text-align: center; color: var(--muted); }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }

/* Mobile nav */
@media (max-width: 760px) {
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); flex-direction: column; gap: 0; padding: 8px 0; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 24px; }
  .nav-toggle { display: block; }
}
