:root {
  --bg: #0a0b0d;
  --bg-alt: #0e1013;
  --panel: #13161b;
  --panel-2: #181c22;
  --line: #242932;
  --line-2: #313844;
  --text: #e9ecf0;
  --muted: #9ba3ae;
  --faint: #6b7380;
  --red: #ff4d4d;
  --red-soft: rgba(255, 77, 77, 0.14);
  --green: #3ddc84;
  --blue: #7cc4ff;
  --amber: #ffc66d;
  --radius: 14px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.88em; }
p code, li code, td code, th code, span code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.08em 0.38em;
  white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--red); color: #000; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Announcement */
.announce { background: linear-gradient(90deg, rgba(255,77,77,0.12), rgba(255,77,77,0.03)); border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.announce .wrap { display: flex; gap: 10px; align-items: center; padding-top: 9px; padding-bottom: 9px; flex-wrap: wrap; }
.announce .short { display: none; }
@media (max-width: 600px) { .announce .long { display: none; } .announce .short { display: inline; } }
.announce a { color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; }
.announce a:hover { color: var(--red); }

.chip { display: inline-flex; align-items: center; font: 700 11px/1 var(--mono); letter-spacing: 0.04em; padding: 4px 7px; border-radius: 6px; vertical-align: middle; }
.chip-red { color: var(--red); background: var(--red-soft); border: 1px solid rgba(255,77,77,0.35); }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(10, 11, 13, 0.78); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.01em; text-decoration: none; font-size: 17px; }
.brand-mark { width: 28px; height: 28px; }
.nav nav { margin-left: auto; }
.nav-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 760px) { .nav-links { display: none; } .nav-inner .btn { margin-left: auto; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 15px; padding: 12px 20px; border-radius: 10px; border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-primary { background: var(--red); color: #140404; }
.btn-primary:hover { background: #ff6767; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { border-color: #4a5260; background: rgba(255,255,255,0.05); }

/* Hero */
.hero { position: relative; padding: 72px 0 56px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; opacity: 0.35; mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 30%, transparent 75%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.eyebrow { font: 600 13px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--red); margin: 0 0 18px; display: flex; gap: 10px; align-items: center; }
.section-head:not(.left) .eyebrow { justify-content: center; }
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(36px, 5.2vw, 62px); font-weight: 800; }
h1 em { font-style: normal; background: linear-gradient(180deg, transparent 62%, rgba(255,77,77,0.38) 62%); padding: 0 2px; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); margin: 22px 0 28px; max-width: 34em; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.hero-ctas.center { justify-content: center; }
.works-with { margin: 28px 0 0; color: var(--faint); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.works-with span { color: var(--muted); font-weight: 500; }
.works-with span + span::before { content: "·"; color: var(--faint); margin-right: 14px; }
.hero-art { position: relative; }
.hero-art img { position: relative; width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgba(0,0,0,0.6)); animation: hover 7s ease-in-out infinite; }
.glow { position: absolute; inset: 8% 6% 14%; background: radial-gradient(closest-side, rgba(255,77,77,0.30), rgba(255,77,77,0.06) 60%, transparent); filter: blur(10px); }
@keyframes hover { 0%, 100% { transform: translateY(0) rotate(-0.6deg); } 50% { transform: translateY(-12px) rotate(0.4deg); } }
@media (max-width: 900px) {
  .hero { padding: 40px 0 32px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hero-art { order: -1; max-width: 520px; margin: 0 auto; }
}

/* Install line */
.install-line { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 10px 10px 16px; max-width: 520px; min-width: 0; }
.install-line .prompt { color: var(--red); font-family: var(--mono); font-weight: 700; flex: none; }
.install-line code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 14.5px; scrollbar-width: none; }
.install-line code::-webkit-scrollbar { display: none; }
.copy { flex: none; font: 600 13px var(--sans); color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 12px; cursor: pointer; transition: background .15s, color .15s; }
.copy:hover { background: #222831; }
.copy.done { color: var(--green); border-color: rgba(61,220,132,0.5); }

/* Stats */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 28px 24px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat strong { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat strong small { font-size: 0.5em; color: var(--red); margin-left: 3px; font-weight: 700; }
.stat span { color: var(--muted); font-size: 14px; line-height: 1.45; }
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 22px 16px; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Sections */
.section { padding: 104px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head.left { margin: 0 0 32px; text-align: left; }
h2 { font-size: clamp(30px, 3.8vw, 44px); font-weight: 800; }
.section-head p:not(.eyebrow) { color: var(--muted); font-size: 18px; margin: 18px 0 0; }
@media (max-width: 600px) { .section { padding: 72px 0; } .section-head { margin-bottom: 32px; } }
.footnote { color: var(--faint); font-size: 14px; text-align: center; max-width: 640px; margin: 24px auto 0; }

/* Loop */
.loop { max-width: 880px; margin: 0 auto; }
.loop-tabs, .os-tabs { display: flex; gap: 6px; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.loop-tabs::-webkit-scrollbar, .os-tabs::-webkit-scrollbar { display: none; }
.loop-tabs button, .os-tabs button { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 10px; white-space: nowrap; font: 600 14.5px var(--sans); color: var(--muted); background: transparent; border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer; }
.loop-tabs button:hover, .os-tabs button:hover { color: var(--text); }
.loop-tabs button[aria-selected="true"], .os-tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.loop-tabs .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 700 12px var(--mono); background: var(--line); color: var(--muted); }
.loop-tabs button[aria-selected="true"] .n { background: var(--red); color: #140404; }
.panel-note { color: var(--muted); margin: 0 0 14px; text-align: center; }
@media (max-width: 600px) { .loop-tabs button { white-space: normal; font-size: 13px; padding: 8px 6px; line-height: 1.25; } .loop-tabs .n { display: none; } }

/* Terminal */
.term { background: #07080a; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.45); min-width: 0; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2c323b; }
.term-bar span { margin-left: 8px; font: 500 12px var(--mono); color: var(--faint); }
.term pre { margin: 0; padding: 18px 20px 22px; overflow-x: auto; font: 13.5px/1.7 var(--mono); }
.term pre code { font-size: inherit; }
.term .cmd::before { content: "$ "; color: var(--red); font-weight: 700; }
.term .cmd { color: var(--text); font-weight: 500; }
.term .json { color: #c9ced6; }
.term .k { color: var(--blue); }
.term .s { color: #a8e6b8; }
.term .num { color: var(--amber); }
.term .b { color: var(--green); font-weight: 700; }
.term .c { color: var(--faint); }
.term .p { color: var(--red); font-weight: 700; }
@media (max-width: 600px) { .term pre { font-size: 12px; padding: 14px 14px 16px; } }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card .chip { position: absolute; top: 18px; right: 18px; }
.card-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--red-soft); margin-bottom: 18px; }
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }
@media (max-width: 1060px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

/* Compare */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.compare th, .compare td { text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); background: var(--panel-2); }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare tbody th { font-weight: 600; white-space: nowrap; }
.compare td { color: var(--muted); }
.compare td:last-child { color: var(--text); }
.compare td:last-child::before { content: "✓"; color: var(--green); font-weight: 700; margin-right: 8px; }

/* How */
.how-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--muted); }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 14px; height: 8px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
.diagram { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.diagram svg { width: 100%; height: auto; }
.d-box > rect { fill: var(--panel-2); stroke: var(--line-2); stroke-width: 1.2; }
.d-accent > rect { stroke: rgba(255,77,77,0.6); fill: rgba(255,77,77,0.05); }
.d-pill > rect { fill: #0c0e11; stroke: var(--line-2); }
.d-app > rect { fill: rgba(61,220,132,0.05); stroke: rgba(61,220,132,0.45); }
.d-inner > rect { fill: rgba(255,77,77,0.08); stroke: rgba(255,77,77,0.5); }
.diagram text { fill: var(--text); font: 600 13px var(--sans); text-anchor: middle; }
.diagram .d-t { font-size: 15px; font-weight: 700; }
.diagram .d-s { fill: var(--muted); font-size: 11.5px; font-weight: 500; }
.diagram .d-l { fill: var(--faint); font: 500 11px var(--mono); text-anchor: start; }
.diagram .d-l.mid { text-anchor: middle; }
.d-line { stroke: var(--red); stroke-width: 1.6; fill: none; stroke-dasharray: 5 4; }
@media (max-width: 900px) { .how-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } .diagram { padding: 12px; } }

/* News */
.news { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.news-item { padding: 26px 22px; border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,77,77,0.05), transparent 60%); }
.news-item:first-child { border-left: 0; }
.news-item h3 { font-size: 17px; margin-bottom: 10px; }
.news-item p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 1000px) { .news { grid-template-columns: 1fr 1fr; } .news-item:nth-child(3) { border-left: 0; } .news-item:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 600px) { .news { grid-template-columns: 1fr; } .news-item { border-left: 0; } .news-item + .news-item { border-top: 1px solid var(--line); } }

/* Install */
.install-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.os-tabs { max-width: 520px; }
.os-panel .install-line { max-width: 520px; }
.quick pre { line-height: 1.85; }
@media (max-width: 900px) { .install-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* CTA */
.cta { padding: 112px 0; text-align: center; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; left: 50%; top: 50%; width: 900px; height: 420px; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(255,77,77,0.16), transparent); pointer-events: none; }
.cta-inner { position: relative; }
.cta p { color: var(--muted); font-size: 18px; margin: 16px 0 26px; }
@media (max-width: 600px) { .cta { padding: 80px 0; } }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 36px 0 44px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; }
.brand.small { font-size: 15px; }
.brand.small .brand-mark { width: 22px; height: 22px; }
.footer ul { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 0; }
.footer ul a { color: var(--muted); text-decoration: none; font-size: 14px; }
.footer ul a:hover { color: var(--text); }
.fine { margin: 0 0 0 auto; color: var(--faint); font-size: 13px; }
@media (max-width: 760px) { .fine { margin-left: 0; width: 100%; } }

/* 404 */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 48px 16px; }
.notfound img { width: min(420px, 80vw); margin: 0 auto 24px; opacity: 0.9; }
.notfound p { color: var(--muted); }
