: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;
  --water: #2f8fd6;
  --hero-ink: #f4f1ea;
  --hero-bg: #0b1520;
  --code-bg: #0f1a24;
  --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; --water: #58b0ee;
    --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; --water: #58b0ee;
  --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; height: auto; }
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.6rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.12rem; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.small { font-size: .88rem; color: var(--ink-2); }
.sub { color: var(--ink-2); max-width: 780px; margin: 0 0 2rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; color: var(--sand); margin: 0 0 .8rem; }
.fl { color: var(--water); }
.mt { margin-top: 1.6rem; }

/* 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; }

/* 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; gap: 1rem; }
.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); } .m4 { stroke: var(--water); }
.links { display: flex; gap: 1.3rem; align-items: center; }
.links a { color: var(--hero-ink); text-decoration: none; font-weight: 500; font-size: .94rem; }
.nav.solid .links a { color: var(--ink); }
.links a.btn-sm { color: #fff; }
.theme { background: none; border: 1px solid color-mix(in srgb, var(--hero-ink) 40%, transparent); color: var(--hero-ink); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
.nav.solid .theme { color: var(--ink); border-color: var(--line); }
@media (max-width: 900px) { .links a:not(.btn-sm) { display: none; } }

/* hero */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; background: var(--hero-bg); color: var(--hero-ink); overflow: hidden; }
#sim { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11, 21, 32, .92) 0%, rgba(11, 21, 32, .55) 42%, rgba(11, 21, 32, 0) 70%); pointer-events: none; }
.hero-in { position: relative; z-index: 2; padding: 110px 0 140px; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5.2rem); margin-bottom: .2em; }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.22rem); max-width: 560px; color: #d6dde4; }
.cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.sim-hud { position: absolute; z-index: 3; right: 16px; top: 80px; width: min(330px, calc(100% - 32px)); background: rgba(11, 21, 32, .72); border: 1px solid rgba(244, 241, 234, .15); border-radius: 12px; padding: .7rem .9rem; font: 13px/1.5 "JetBrains Mono", monospace; backdrop-filter: blur(6px); }
.sim-hud > div { display: flex; justify-content: space-between; gap: 1rem; }
.sim-hud .k { color: #8ea3b6; }
.hud-btns { margin-top: .5rem; justify-content: flex-start !important; gap: .4rem !important; }
.hud-btns button { background: rgba(244, 241, 234, .08); color: var(--hero-ink); border: 1px solid rgba(244, 241, 234, .25); border-radius: 999px; padding: .2em .8em; font: 600 12px Inter, sans-serif; cursor: pointer; }
.hud-btns button[aria-pressed="false"] { opacity: .45; }
.hud-note { margin: .5rem 0 0; font: 11.5px/1.45 Inter, sans-serif; color: #9fb0c0; }
@media (max-width: 900px) { .sim-hud { position: relative; right: auto; top: auto; margin: 0 auto 16px; } .hero { flex-direction: column; justify-content: flex-start; } .hero-in { padding: 96px 0 46vh; } .hero-shade { background: linear-gradient(180deg, rgba(11,21,32,.9) 0%, rgba(11,21,32,.6) 45%, rgba(11,21,32,0) 70%); } }

/* stats */
.stats { background: var(--card); border-bottom: 1px solid var(--line); }
.stats-in { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; padding: 1.6rem 0; }
.stats b { display: block; font: 700 1.6rem "Space Grotesk", sans-serif; color: var(--teal); }
.stats span { font-size: .86rem; color: var(--ink-2); }
@media (max-width: 860px) { .stats-in { grid-template-columns: repeat(2, 1fr); } }

/* sections */
.sec { padding: 88px 0; }
.sec.alt { background: var(--bg-alt); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem 1.3rem 1.1rem; box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); font-size: 1.2rem; margin-bottom: .8rem; }
.fig { margin: 0; background: #fff; border-radius: var(--r); padding: 1rem; border: 1px solid var(--line); box-shadow: var(--shadow); }
.fig figcaption, figure figcaption { font-size: .86rem; color: var(--ink-2); margin-top: .5rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4rem; align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .7rem; color: var(--ink-2); }
.steps b { color: var(--ink); }
.shots { display: grid; gap: 1rem; }
.shots figure, .gallery figure, .figs3 figure { margin: 0; }
.shots img, .gallery img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }

/* agents */
.agent-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.6rem; }
@media (max-width: 900px) { .agent-grid { grid-template-columns: 1fr; } }
.agent-grid > *, .two > * { min-width: 0; }
.term { background: var(--code-bg); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); border: 1px solid #1f2d3a; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: .55rem .8rem; background: #15222e; color: #8ea3b6; font: 12px Inter, sans-serif; }
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: #3a4b5a; }
.term-bar em { margin-left: .5rem; font-style: normal; flex: 1; }
.term-bar button { background: none; border: 1px solid #3a4b5a; color: #c9d4de; border-radius: 999px; font: 600 11.5px Inter, sans-serif; padding: .2em .8em; cursor: pointer; }
#agent-log { margin: 0; padding: 1rem 1.1rem; min-height: 430px; max-height: 470px; overflow: auto; color: #d7e0e8; font: 12.5px/1.6 "JetBrains Mono", monospace; white-space: pre-wrap; }
#agent-log .u { color: #eb9a4a; } #agent-log .tc { color: #7fd0dc; } #agent-log .r { color: #8ea3b6; } #agent-log .a { color: #e9eef3; }
.copy { background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; font: 600 12px Inter, sans-serif; padding: .3em .9em; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips span { font: 12px "JetBrains Mono", monospace; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .2em .65em; color: var(--ink-2); }
.tabs { display: flex; gap: .4rem; margin-bottom: .5rem; }
.tabs button { background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: 999px; padding: .3em .9em; font: 600 .85rem Inter, sans-serif; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.code { background: var(--code-bg); color: #d7e0e8; padding: 1rem; border-radius: 10px; font: 12.5px/1.6 "JetBrains Mono", monospace; overflow: auto; margin: 0 0 .5rem; }

/* calibration */
.table-wrap { overflow-x: auto; margin-bottom: 1.6rem; }
table.cal { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); font-size: .92rem; }
.cal th, .cal td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.cal th { background: color-mix(in srgb, var(--teal) 10%, var(--card)); font-weight: 600; }
.cal tr.hl td { background: color-mix(in srgb, var(--sand) 9%, var(--card)); }
.honest { margin: 1.6rem 0; background: var(--card); border-left: 4px solid var(--sand); border-radius: 10px; padding: 1rem 1.3rem; box-shadow: var(--shadow); }
.honest ul { margin: .3rem 0 0; padding-left: 1.2rem; color: var(--ink-2); }
.honest li { margin-bottom: .35rem; }
.figs3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.figs3 img { background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: .5rem; }
@media (max-width: 760px) { .figs3 { grid-template-columns: 1fr; } }

/* performance bars */
.bars { margin: 1.2rem 0; display: grid; gap: .45rem; }
.bar { display: grid; grid-template-columns: 120px 1fr 74px; gap: .6rem; align-items: center; font-size: .84rem; }
.bar .track { height: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; width: 0; transition: width 1.1s ease; }
.bar .fill.gpu { background: linear-gradient(90deg, var(--teal), var(--teal-2)); }
.bar .fill.cpu { background: var(--sand); }
.bar .v { font-family: "JetBrains Mono", monospace; color: var(--ink-2); text-align: right; }

/* gallery */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.gallery .wide { grid-column: 1 / -1; }
.gallery figure:not(.wide) img { background: #fff; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }

/* contact */
.form { display: grid; gap: .8rem; background: var(--card); padding: 1.4rem; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow); }
.form label { display: grid; gap: .3rem; font-weight: 500; font-size: .92rem; }
.form input, .form textarea { font: inherit; padding: .6em .8em; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.foot { padding: 2rem 0; font-size: .84rem; color: var(--ink-2); border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .bar .fill { transition: none; } }

/* editions and the download dialog */
.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; min-width: 0; }
.ed.pro { background: linear-gradient(160deg, #10283a, #0c1a26); color: #eef3f7; border-color: #1f3b50; }
.ed .tag { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: var(--sand-2); }
.ed.pro .tag { color: #f0a65a; }
.ed h3 { font-size: 1.8rem; margin: .3rem 0 0; }
.price { font: 700 1.1rem "Space Grotesk", sans-serif; color: var(--teal); margin: .2rem 0 1rem; }
.ed.pro .price { color: #7fd0dc; }
.ticks { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: .5rem; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.ed.pro .ticks li::before { color: #7fd0dc; }
.limits { display: grid; gap: .3rem; background: color-mix(in srgb, var(--sand) 9%, var(--card)); border-left: 4px solid var(--sand); border-radius: 10px; padding: .9rem 1rem; margin-bottom: 1rem; font-size: .92rem; }
.limits span { color: var(--ink-2); }
.fine { font-size: .88rem; color: var(--ink-2); }
.ed.pro .fine { color: #a9bccb; }
.dl { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: auto; padding-top: .6rem; }
.ed.pro .btn-ghost { color: #eef3f7; }
@media (max-width: 860px) { .editions { grid-template-columns: 1fr; } .ed { padding: 1.4rem; } }
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; }
.dlg-in h3 { font-size: 1.3rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: 1rem 0; }
.check input { margin-top: .3rem; }
.dlg-act { display: flex; gap: .6rem; justify-content: flex-end; }
.btn.disabled { opacity: .4; pointer-events: none; }
.dlg-meta { margin-top: 1rem; }

/* paper and citation */
.paper { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: start; }
.paper > * { min-width: 0; }
.cite { background: var(--code-bg); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.cite-head { display: flex; justify-content: space-between; align-items: center; padding: .6rem .9rem; color: #d7e0e8; border-bottom: 1px solid #22313f; }
.cite pre { margin: 0; padding: 1rem; color: #d7e0e8; font: 12.5px/1.55 "JetBrains Mono", monospace; overflow-x: auto; }
.foot a { color: inherit; }
@media (max-width: 900px) { .paper { grid-template-columns: 1fr; } }
