:root {
  --bg: #f7f5f1;
  --bg-alt: #efebe4;
  --card: #ffffff;
  --ink: #142233;
  --ink-2: #4a5868;
  --line: #ddd6cb;
  --teal: #1b7f93;
  --teal-2: #0f4c6e;
  --sand: #d9822b;
  --sand-2: #a8551b;
  --hero-ink: #f4f1ea;
  --shadow: 0 10px 30px rgba(20, 34, 51, .08);
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d141c; --bg-alt: #111b25; --card: #16222e; --ink: #e9eef3; --ink-2: #9fb0c0;
    --line: #243443; --teal: #3bb3c6; --teal-2: #7fd0dc; --sand: #eb9a4a; --sand-2: #f2b479;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d141c; --bg-alt: #111b25; --card: #16222e; --ink: #e9eef3; --ink-2: #9fb0c0;
  --line: #243443; --teal: #3bb3c6; --teal-2: #7fd0dc; --sand: #eb9a4a; --sand-2: #f2b479;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--teal); }
h1, h2, h3 { font-family: "Space Grotesk", Inter, sans-serif; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.15rem; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.small { font-size: .88rem; color: var(--ink-2); }
.sub { color: var(--ink-2); max-width: 760px; margin: 0 0 2rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; color: var(--sand); margin: 0 0 .8rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .78em 1.3em; border-radius: 999px; font: 600 .95rem Inter, sans-serif; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff; box-shadow: 0 6px 18px rgba(27, 127, 147, .3); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-sm { padding: .45em 1em; font-size: .88rem; background: var(--sand); color: #fff !important; }
.btn.disabled { opacity: .45; pointer-events: none; }

/* nav */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; transition: background .25s, box-shadow .25s; }
.nav.solid { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--hero-ink); font: 700 1.3rem "Space Grotesk", sans-serif; }
.nav.solid .brand { color: var(--ink); }
.mark { width: 32px; height: 32px; }
.m1 { fill: var(--teal); } .m2 { fill: var(--sand); } .m3 { fill: #2b5f86; }
.links { display: flex; gap: 1.4rem; align-items: center; }
.links a { color: var(--hero-ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav.solid .links a { color: var(--ink); }
.menu { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; }
.menu span { display: block; height: 2px; margin: 6px 8px; background: var(--hero-ink); border-radius: 2px; }
.nav.solid .menu span { background: var(--ink); }

/* hero */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; color: var(--hero-ink); background: #0b1620; overflow: hidden; }
#dem { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 17, 26, .92) 0%, rgba(8, 17, 26, .7) 42%, rgba(8, 17, 26, .05) 75%); pointer-events: none; }
.hero-in { position: relative; padding: 110px 0 70px; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); max-width: 12em; }
.grad { background: linear-gradient(90deg, #5fd0e0, #f0a65a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.2rem); max-width: 34em; color: #c9d4de; }
.cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero .btn-ghost { color: var(--hero-ink); }
.stage-tag { margin-top: 2.6rem; font: 500 .82rem "JetBrains Mono", monospace; color: #8fb6c6; letter-spacing: .02em; }
.stage-tag::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sand); margin-right: .6em; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* stats */
.stats { background: var(--card); border-bottom: 1px solid var(--line); }
.stats-in { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); }
.stat { background: var(--card); padding: 1.6rem 1.2rem; }
.stat b { display: block; font: 700 clamp(1.5rem, 3vw, 2.2rem) "Space Grotesk", sans-serif; color: var(--teal-2); }
.stat span { font-size: .9rem; color: var(--ink-2); }

/* sections */
.sec { padding: clamp(64px, 9vw, 110px) 0; }
.sec.alt { background: var(--bg-alt); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; box-shadow: var(--shadow); transition: transform .2s; }
.card:hover { transform: translateY(-3px); }
.card p { color: var(--ink-2); margin: 0; font-size: .95rem; }
.ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--teal) 14%, transparent); margin-bottom: 1rem; }
.ic svg { width: 24px; height: 24px; fill: none; stroke: var(--teal); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.ticks { list-style: none; padding: 0; margin: 1.2rem 0; }
.ticks li { padding-left: 1.7em; position: relative; margin: .45em 0; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .5em; width: .75em; height: .75em; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--sand) 0 45%, var(--sand-2) 46%); }
.cca { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow); }
#cca { width: 100%; aspect-ratio: 16 / 10; display: block; }
.cca figcaption { font-size: .85rem; color: var(--ink-2); margin-top: .6rem; }

/* agents */
.agents { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%); }
.ag-head { max-width: 860px; }
code { font: .9em "JetBrains Mono", monospace; background: color-mix(in srgb, var(--teal) 12%, transparent); padding: .1em .35em; border-radius: 5px; }
.badges { display: flex; flex-wrap: wrap; gap: .6rem; margin: -0.6rem 0 2.2rem; }
.badges span { display: inline-flex; align-items: center; gap: .4em; padding: .45em .9em; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); }
.badges svg { width: 16px; height: 16px; fill: none; stroke: var(--sand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ag-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 1.6rem; align-items: start; }
.ag-connect { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; box-shadow: var(--shadow); min-width: 0; }
.small-tabs button { font-size: .85rem; padding: .4em .9em; }
.code { position: relative; background: #0e1822; border-radius: 10px; margin: .4rem 0 .8rem; }
.code pre { margin: 0; padding: 1.1rem 1rem; overflow-x: auto; color: #d9e6ef; font: .85rem/1.6 "JetBrains Mono", monospace; }
.code code { background: none; padding: 0; font-size: inherit; }
.code .c { color: #6f8ba0; }
.copy { position: absolute; top: 8px; right: 8px; border: 1px solid #2c4254; background: #16283a; color: #bcd2e0; border-radius: 6px; padding: .25em .7em; font: 500 .75rem Inter, sans-serif; cursor: pointer; }
.mt { margin-top: 1.6rem; }
.tools { display: flex; flex-wrap: wrap; gap: .4rem; }
.tools .grp { width: 100%; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-top: .5rem; }
.tools code { font-size: .78rem; padding: .25em .55em; border-radius: 6px; transition: background .3s, color .3s; }
.tools code.hot { background: var(--sand); color: #fff; }
.term { border-radius: 12px; overflow: hidden; background: #0b141c; border: 1px solid #1d2f3d; box-shadow: 0 30px 70px rgba(10, 20, 30, .25); min-width: 0; }
.term-body { height: 470px; overflow: hidden; padding: 1rem 1.1rem; font: .82rem/1.55 "JetBrains Mono", monospace; color: #cfe0ea; display: flex; flex-direction: column; justify-content: flex-end; }
.term-body .ln { white-space: pre-wrap; word-break: break-word; margin: .15rem 0; animation: lnIn .25s ease; }
.term-body .user { color: #fff; background: #17324a; border-radius: 8px; padding: .55rem .7rem; margin: .4rem 0 .6rem; font-family: Inter, sans-serif; font-size: .9rem; }
.term-body .call { color: #7fd0dc; }
.term-body .call b { color: #f0a65a; font-weight: 500; }
.term-body .res { color: #8aa4b6; padding-left: 1.2em; }
.term-body .reply { color: #eef4f8; font-family: Inter, sans-serif; font-size: .9rem; background: #142430; border-left: 3px solid var(--sand); padding: .55rem .75rem; border-radius: 6px; margin-top: .5rem; }
.term-body .cur::after { content: "▋"; color: #f0a65a; animation: pulse 1s infinite; }
.term-note { margin: 0; padding: .7rem 1.1rem .9rem; font-size: .78rem; color: #7f97a8; border-top: 1px solid #1d2f3d; }
@keyframes lnIn { from { opacity: 0; transform: translateY(6px); } }

/* paper */
.paper-link { margin: 1.1rem 0 0; font-size: .92rem; }
.paper-link a { color: #8fd3df; font-weight: 600; text-decoration: none; }
.paper-link a:hover { text-decoration: underline; }
.paper-link span { color: #7f97a8; font: .8rem "JetBrains Mono", monospace; margin-left: .5rem; }
.paper { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.4rem, 3vw, 2.4rem); box-shadow: var(--shadow); }
.paper h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.paper .btn-ghost { color: var(--teal); }
.doi { font: 500 .85rem "JetBrains Mono", monospace; }
.cite { background: #0e1822; border-radius: 12px; overflow: hidden; min-width: 0; }
.cite-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; color: #cfe0ea; border-bottom: 1px solid #1d2f3d; font-size: .9rem; }
.cite .copy { position: static; }
.cite pre { margin: 0; padding: 1rem; color: #d9e6ef; font: .8rem/1.6 "JetBrains Mono", monospace; overflow-x: auto; }

/* figures */
.bench-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.fig { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); cursor: zoom-in; }
.fig img { background: #fff; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; padding: .5rem; }
.fig figcaption { padding: .9rem 1rem 1.1rem; font-size: .9rem; color: var(--ink-2); }
.fig figcaption b { color: var(--ink); }
.apps { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.apps .wide { grid-column: 1 / -1; }
.apps .wide img { aspect-ratio: 21 / 10; }
.appnote { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; box-shadow: var(--shadow); }
.appnote p { color: var(--ink-2); font-size: .95rem; }

/* perf bars */
.perf { margin-top: 3rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.6rem; box-shadow: var(--shadow); }
.bars { display: grid; gap: .55rem; }
.bar { display: grid; grid-template-columns: minmax(150px, 290px) 1fr 84px; gap: .8rem; align-items: center; font-size: .88rem; }
.bar .lbl { color: var(--ink-2); }
.bar .lbl b { color: var(--ink); font-weight: 600; }
.bar .track { display: block; height: 12px; background: var(--bg-alt); border-radius: 99px; overflow: hidden; }
.bar .fill { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--sand)); transition: width 1.4s cubic-bezier(.2, .8, .2, 1); }
.bar .val { font: 500 .85rem "JetBrains Mono", monospace; text-align: right; }

/* gallery */
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs button { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .5em 1.1em; border-radius: 99px; font: 500 .92rem Inter, sans-serif; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.window { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(10, 20, 30, .25); background: #1d232b; }
.wbar { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 12px; background: #2a313a; }
.wbar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.wbar i:nth-child(2) { background: #febc2e; } .wbar i:nth-child(3) { background: #28c840; }
.wbar span { margin-left: 10px; color: #aeb7c2; font: .78rem "JetBrains Mono", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#shot { width: 100%; transition: opacity .25s; }

/* editions */
.editions { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.ed { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.ed.pro { background: linear-gradient(160deg, #10283a, #0c1a26); color: #eef3f7; border-color: #1f3b50; }
.ed.pro .tag { color: #f0a65a; }
.ed.pro .fine { color: #a9bccb; }
.tag { color: var(--teal); font-weight: 600; font-size: .85rem; margin: 0; }
.ed h3 { font-size: 1.8rem; margin: .3rem 0 0; }
.price { font: 700 1.25rem "Space Grotesk", sans-serif; color: var(--sand); margin: .3rem 0 0; }
.fine { font-size: .85rem; color: var(--ink-2); margin-top: auto; }
.limits { display: grid; gap: .25rem; margin: .2rem 0 1rem; padding: .8rem 1rem; border-radius: 10px; background: color-mix(in srgb, var(--sand) 10%, transparent); border: 1px dashed color-mix(in srgb, var(--sand) 55%, transparent); font-size: .88rem; }
.limits b { color: var(--sand-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.dlg-meta { margin-top: .9rem; }
.dl { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* contact */
.addr { line-height: 1.8; }
.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.6rem; box-shadow: var(--shadow); display: grid; gap: .9rem; }
.form label { display: grid; gap: .3rem; font-size: .88rem; font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
input, select, textarea { font: 400 .95rem Inter, sans-serif; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .7em .8em; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.form-note { margin: 0; font-size: .88rem; color: var(--teal); min-height: 1.2em; }

.foot { background: #0b1620; color: #b9c6d2; padding: 2rem 0; }
.foot-in { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.foot b { color: #fff; }
.foot a { color: #8fd3df; }
.foot .small { color: #8297a8; }

/* dialogs */
dialog { border: 0; border-radius: 16px; padding: 0; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); max-width: min(480px, 100% - 32px); }
dialog::backdrop { background: rgba(5, 12, 18, .6); backdrop-filter: blur(3px); }
.dlg-in { padding: 1.6rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; margin: 1rem 0; }
.check input { width: auto; margin-top: .3em; }
.dlg-act { display: flex; gap: .6rem; justify-content: flex-end; }
#lb { max-width: min(1300px, 100% - 24px); background: #fff; }
#lb img { max-height: 86vh; width: auto; margin: auto; }
.lb-x { position: absolute; top: 6px; right: 10px; border: 0; background: rgba(0, 0, 0, .55); color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; }

/* reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .grid3, .bench-grid { grid-template-columns: 1fr 1fr; }
  .split, .editions, .apps, .ag-grid, .paper { grid-template-columns: 1fr; }
  .stats-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .links { position: fixed; inset: 64px 0 auto; flex-direction: column; align-items: flex-start; gap: 0; padding: .5rem 16px 1rem; background: var(--bg); box-shadow: 0 10px 20px rgba(0, 0, 0, .15); transform: translateY(-130%); transition: transform .3s; }
  .links.open { transform: none; }
  .links a { color: var(--ink) !important; padding: .7rem 0; width: 100%; }
  .links .btn-sm { width: auto; margin-top: .4rem; padding: .5em 1.2em; color: #fff !important; }
  .menu { display: block; }
  .grid3, .bench-grid, .row2 { grid-template-columns: 1fr; }
  .hero-shade { background: linear-gradient(180deg, rgba(8, 17, 26, .9) 0%, rgba(8, 17, 26, .75) 55%, rgba(8, 17, 26, .35) 100%); }
  .bar { grid-template-columns: 1fr 64px; }
  .bar .track { grid-column: 1 / -1; grid-row: 2; }
  .term-body { height: 430px; font-size: .76rem; }
  .apps .wide img { aspect-ratio: 16 / 11; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bar .fill { transition: none; }
  .stage-tag::before { animation: none; }
}

/* dynamic granular flow */
.fig.vid { cursor: default; }
.fig.vid video { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #fff; padding: .5rem; }
.badge-ed { display: inline-block; margin: 0 0 .6rem; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; letter-spacing: .02em; color: var(--ink); background: var(--card); border: 1px solid var(--line); }
