:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --ink: #16202c;
  --ink-soft: #4a5a6a;
  --muted: #7b8a99;
  --line: #e3e9f1;
  --brand: #0e9bd6;
  --brand-ink: #0a7bab;
  --brand-deep: #062a3d;
  --accent: #f5a623;
  --ok: #19a974;
  --err: #e5484d;
  --radius: 14px;
  --shadow: 0 10px 40px -12px rgba(8, 38, 61, .28);
  --shadow-sm: 0 4px 18px -8px rgba(8, 38, 61, .25);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .9em; background: rgba(14,155,214,.1); color: var(--brand-ink); padding: .1em .4em; border-radius: 5px; }
kbd { font-family: var(--mono); font-size: .82em; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: .05em .4em; color: var(--ink-soft); }
em { font-style: normal; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-weight: 600; font-size: 1rem;
  padding: .7em 1.4em; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn--sm { padding: .45em .95em; font-size: .9rem; background: var(--brand); color: #fff; border-radius: 8px; }
.btn--sm:hover { background: var(--brand-ink); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .7rem clamp(1rem, 4vw, 3rem);
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.nav__brand:hover { text-decoration: none; }
.nav__brand em { font-weight: 500; }
.nav__logo { width: 26px; height: 26px; }
.nav__links { display: flex; gap: 1.4rem; margin-left: auto; }
.nav__links a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.nav__links a:hover { color: var(--brand-ink); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(14,155,214,.14), transparent 60%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--brand-ink); margin: 0 0 1rem; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-soft); max-width: 34ch; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; margin: 1.6rem 0 1rem; }
.hero__sub { font-size: .92rem; color: var(--muted); max-width: 46ch; }

/* ---------- editor mock ---------- */
.editor {
  background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; font-family: var(--mono);
}
.editor--flat { box-shadow: var(--shadow-sm); }
.editor__bar { display: flex; align-items: center; gap: .4rem; padding: .6rem .9rem; background: #f3f5f9; border-bottom: 1px solid var(--line); }
.editor__bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #d6dde6; }
.editor__bar .dot:nth-child(1) { background: #ff6058; }
.editor__bar .dot:nth-child(2) { background: #ffbd2e; }
.editor__bar .dot:nth-child(3) { background: #29c93f; }
.editor__file { margin-left: .6rem; font-size: .82rem; color: var(--muted); }
.editor__code {
  margin: 0; padding: 1.1rem 1.1rem 1.3rem; font-size: .92rem; line-height: 1.85;
  white-space: pre; overflow-x: auto; counter-reset: line; position: relative;
}
.editor__code .ln { counter-increment: line; }
.editor__code .ln::before {
  content: counter(line); display: inline-block; width: 2.1em; margin-right: 1em;
  color: #c2cbd6; text-align: right; user-select: none; font-size: .85em;
}
/* tokens */
.k { color: #0a59c4; }
.s { color: #1a7f37; }
.p { color: #6a7686; }
.c { color: #9aa6b2; font-style: italic; }
.err { color: var(--err); text-decoration: wavy underline rgba(229,72,77,.6); text-underline-offset: 3px; }
.caret { display: inline-block; width: 2px; height: 1.05em; background: var(--brand); vertical-align: -.18em; margin-left: 1px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.squiggle { color: var(--err); font-size: .82em; padding-left: 3.1em; }

/* completion popup */
.popup {
  display: block; width: max-content; min-width: 260px; white-space: normal;
  margin: .35rem 0 .35rem 3.1em;
  background: #fff; border: 1px solid #d4dbe5; border-radius: 9px;
  box-shadow: 0 16px 40px -12px rgba(8,38,61,.35); overflow: hidden; font-size: .9rem;
}
.popup .row { display: flex; align-items: center; gap: .6rem; padding: .32rem .8rem; color: var(--ink); }
.popup .row .ico { width: 1.4em; height: 1.4em; display: grid; place-items: center; border-radius: 4px; background: #eaf4fb; color: var(--brand-ink); font-size: .72em; font-weight: 700; }
.popup .row.sel { background: #e4eefc; }
.popup .row .ty { margin-left: auto; color: var(--muted); font-size: .85em; }
.popup .hint { display: block; padding: .3rem .8rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }

/* docs popup */
.docpop {
  display: block; width: max-content; max-width: 360px; white-space: normal;
  margin: .4rem 0 .2rem 3.1em; padding: .7rem .9rem;
  background: #fffef6; border: 1px solid #ece2bf; border-radius: 9px;
  box-shadow: var(--shadow-sm); font-family: var(--sans); font-size: .9rem; line-height: 1.5; color: var(--ink-soft);
}
.docpop b { color: var(--ink); }
.docpop .ty { color: var(--brand-ink); font-family: var(--mono); font-size: .82em; }
.docpop .muted { color: var(--muted); }
.docpop .link { display: block; margin-top: .4rem; color: var(--brand-ink); }

/* ---------- logos strip ---------- */
.logos {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.4rem;
  padding: 1.6rem clamp(1rem, 4vw, 3rem); border-block: 1px solid var(--line);
  color: var(--muted); font-size: .85rem;
}
.logos strong { color: var(--ink-soft); font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }

/* ---------- sections ---------- */
section { scroll-margin-top: 70px; }
.section__title { text-align: center; font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-top: 0; }
.section__sub { text-align: center; color: var(--ink-soft); max-width: 60ch; margin: 0 auto 2.6rem; }

.features { padding: clamp(3.5rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.2rem; max-width: 1100px; margin: 0 auto; }
.card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.card__ico { font-size: 1.8rem; margin-bottom: .5rem; }
.card h3 { font-size: 1.18rem; }
.card p { color: var(--ink-soft); margin: 0; font-size: .96rem; }

/* showcase rows */
.showcase { background: var(--bg-soft); border-block: 1px solid var(--line); padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem); display: flex; flex-direction: column; gap: clamp(3rem, 6vw, 5rem); }
.show { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; max-width: 1100px; margin: 0 auto; width: 100%; }
.show--rev .show__text { order: 2; }
.show h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
.show__text p { color: var(--ink-soft); }
.ticks { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.ticks li { position: relative; padding-left: 1.7rem; margin-bottom: .55rem; color: var(--ink); }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 800; }

.shot { margin: 0; }
.shot img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; }
.shot figcaption { text-align: center; color: var(--muted); font-size: .85rem; margin-top: .7rem; }
.shot--wide { max-width: 540px; margin: 0 auto 2.5rem; }

/* live device window highlight */
.device { padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem); background: var(--bg-soft); border-block: 1px solid var(--line); }
.device__eyebrow { text-align: center; }
.shot--device { max-width: 1040px; margin: 1.5rem auto 0; }

/* ---------- run section ---------- */
.run { padding: clamp(3.5rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem); }
.run__grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(2rem, 4vw, 3.5rem); max-width: 1080px; margin: 0 auto; }
.run h3 { font-size: 1.05rem; margin-top: 1.6rem; }
.run h3:first-child { margin-top: 0; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 .5rem; }
.pills li { font-family: var(--mono); font-size: .85rem; background: var(--brand-deep); color: #d7f1ff; padding: .3em .8em; border-radius: 7px; }
.backend { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.backend:last-child { margin-bottom: 0; }
.backend h4 { font-size: 1.05rem; margin-bottom: .3rem; }
.backend p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.warn { color: var(--err); font-weight: 600; }

/* ---------- get started ---------- */
.start { background: var(--bg-soft); border-top: 1px solid var(--line); padding: clamp(3.5rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem); }
.steps { counter-reset: step; list-style: none; padding: 0; max-width: 820px; margin: 0 auto 3rem; display: grid; gap: 1.1rem; }
.steps li { counter-increment: step; position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem 1.4rem 4.4rem; box-shadow: var(--shadow-sm); }
.steps li::before { content: counter(step); position: absolute; left: 1.3rem; top: 1.35rem; width: 2rem; height: 2rem; display: grid; place-items: center; background: var(--brand); color: #fff; border-radius: 50%; font-weight: 700; }
.steps h3 { font-size: 1.15rem; margin-bottom: .25rem; }
.steps p { margin: 0; color: var(--ink-soft); }
.muted { color: var(--muted); }

.cta-band { text-align: center; max-width: 760px; margin: 0 auto; background: linear-gradient(135deg, var(--brand-deep), #0a4a6b); color: #fff; border-radius: 20px; padding: clamp(2.2rem, 5vw, 3.5rem); box-shadow: var(--shadow); }
.cta-band h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cta-band__btns { display: flex; flex-wrap: wrap; gap: .9rem; justify-content: center; margin-top: 1.2rem; }
.cta-band .btn--ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.cta-band .btn--ghost:hover { border-color: #fff; color: #fff; }

/* ---------- footer ---------- */
.footer { padding: clamp(2.5rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem) 2rem; }
.footer__cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; max-width: 1000px; margin: 0 auto 1.5rem; }
.footer__cols strong { display: block; margin-bottom: .4rem; }
.footer__cols p { color: var(--muted); font-size: .9rem; max-width: 44ch; }
.footer__cols nav { display: grid; gap: .5rem; align-content: start; }
.footer__legal { text-align: center; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); padding-top: 1.5rem; max-width: 1000px; margin: 0 auto; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .nav__links { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .show, .show--rev .show__text { grid-template-columns: 1fr; order: 0; }
  .run__grid, .footer__cols { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hero__cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}
