:root {
  color-scheme: dark;
  --bg:#0d0f12; --surface:#15181d; --surface-2:#1b1f25; --surface-3:#22272e;
  --line:#303640; --line-strong:#454d59; --text:#f5f3ee; --muted:#9ca3ad;
  --orange:#ff6a13; --orange-hover:#ff812e; --orange-soft:rgba(255,106,19,.12);
  --green:#36bd79; --green-soft:rgba(54,189,121,.12); --yellow:#e0ad40; --red:#ed6565;
  --shadow:0 18px 55px rgba(0,0,0,.26); --radius:12px; --max:1320px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg:#f3f4f6; --surface:#fff; --surface-2:#f7f8fa; --surface-3:#eceff3;
  --line:#d9dde3; --line-strong:#b7bec8; --text:#1a1d22; --muted:#606975;
  --orange:#df5508; --orange-hover:#c74800; --orange-soft:rgba(223,85,8,.09);
  --green:#178c55; --green-soft:rgba(23,140,85,.09); --yellow:#9c6d05; --red:#c23f3f;
  --shadow:0 18px 55px rgba(23,29,38,.10);
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; min-height:100vh; color:var(--text); background:var(--bg); font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; overflow-x:hidden; transition:background .2s,color .2s; }
body.no-scroll { overflow:hidden; }
button,a { font:inherit; }
button { color:inherit; }
button:focus-visible,a:focus-visible { outline:2px solid var(--orange); outline-offset:2px; }

.topbar { position:sticky; top:0; z-index:30; height:66px; border-bottom:1px solid var(--line); background:color-mix(in srgb,var(--surface) 92%,transparent); backdrop-filter:blur(16px); }
.topbar-inner { width:min(var(--max),calc(100% - 40px)); height:100%; margin:auto; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.brand { color:var(--text); text-decoration:none; display:inline-flex; align-items:center; gap:11px; }
.brand-mark { width:36px; height:36px; display:grid; place-items:center; border:2px solid var(--orange); color:var(--orange); font-weight:950; font-style:italic; transform:skew(-7deg); letter-spacing:-2px; }
.brand strong { display:block; font-size:12px; letter-spacing:.1em; }
.brand small { display:block; color:var(--muted); font-size:10px; margin-top:2px; }
.topnav { display:flex; align-items:center; gap:5px; }
.nav-button,.theme-toggle { border:0; background:transparent; color:var(--muted); min-height:38px; padding:0 12px; border-radius:7px; cursor:pointer; font-size:13px; font-weight:700; }
.nav-button:hover,.theme-toggle:hover { background:var(--surface-3); color:var(--text); }
.nav-button.active { background:var(--surface-3); color:var(--text); }
.count { display:inline-grid; place-items:center; min-width:19px; height:19px; margin-left:4px; padding:0 5px; background:var(--orange); color:#fff; border-radius:20px; font-size:10px; font-weight:900; }
.theme-toggle { border-left:1px solid var(--line); border-radius:0 7px 7px 0; display:flex; align-items:center; gap:7px; margin-left:5px; }
.theme-toggle > span:first-child { width:17px; font-size:16px; }

main { width:min(var(--max),calc(100% - 40px)); margin:0 auto; }
.hero { padding:58px 0 46px; display:grid; grid-template-columns:minmax(0,1.4fr) minmax(330px,.6fr); gap:72px; align-items:end; border-bottom:1px solid var(--line); }
.eyebrow { color:var(--orange); font-size:10px; font-weight:850; letter-spacing:.18em; display:flex; align-items:center; gap:9px; }
.eyebrow span { width:28px; height:2px; background:currentColor; }
h1,h2,h3,p { margin-top:0; }
h1 { margin:18px 0 20px; max-width:780px; font-size:clamp(46px,6vw,78px); line-height:.95; letter-spacing:-.055em; text-transform:uppercase; }
h1 em { color:var(--orange); font-style:normal; }
.hero-controls { border:1px solid var(--line); background:var(--surface); padding:18px; border-radius:var(--radius); box-shadow:var(--shadow); }
.control-label { margin-bottom:9px; color:var(--muted); font-size:9px; font-weight:900; letter-spacing:.16em; }
.platform-picker { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; padding:4px; background:var(--surface-3); border-radius:9px; }
.platform { border:0; border-radius:6px; background:transparent; padding:9px 8px; color:var(--muted); font-size:12px; font-weight:800; cursor:pointer; }
.platform.active { background:var(--orange); color:#fff; box-shadow:0 2px 10px rgba(0,0,0,.12); }
.hero-stats { display:grid; grid-template-columns:1fr 1.6fr; gap:12px; margin-top:17px; padding-top:16px; border-top:1px solid var(--line); }
.hero-stats strong { display:block; font-size:20px; letter-spacing:-.025em; }
.hero-stats span { display:block; color:var(--muted); font-size:10px; margin-top:2px; }

.view { display:none; animation:fade .2s ease; }
.view.active { display:block; }
@keyframes fade { from { opacity:.4; transform:translateY(6px); } }
.section-heading { display:flex; align-items:end; justify-content:space-between; gap:20px; margin:42px 0 21px; }
.section-heading h2 { margin:0; font-size:clamp(30px,4vw,46px); letter-spacing:-.04em; }
.section-heading p { margin:0; color:var(--muted); line-height:1.55; font-size:14px; }
.ghost-button,.primary-button { min-height:40px; border-radius:7px; padding:0 15px; font-weight:800; cursor:pointer; transition:.16s ease; }
.ghost-button { border:1px solid var(--line-strong); background:var(--surface); color:var(--text); }
.ghost-button:hover { border-color:var(--orange); color:var(--orange); }
.primary-button { border:1px solid var(--orange); background:var(--orange); color:#fff; }
.primary-button:hover { background:var(--orange-hover); border-color:var(--orange-hover); }
.full { width:100%; }
.primary-button.full { margin:17px 0 8px; }

.builder-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:22px; align-items:start; }
.builder-main { min-width:0; }
.builder-compatibility { display:flex; align-items:center; gap:10px; min-height:45px; margin-bottom:11px; padding:10px 14px; border:1px solid rgba(54,189,121,.3); border-radius:8px; background:var(--green-soft); color:var(--green); font-size:12px; font-weight:700; }
.builder-compatibility.warning { border-color:rgba(224,173,64,.35); background:rgba(224,173,64,.09); color:var(--yellow); }
.builder-compatibility.danger { border-color:rgba(237,101,101,.35); background:rgba(237,101,101,.09); color:var(--red); }
.parts-table { overflow:hidden; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:0 8px 26px rgba(0,0,0,.05); }
.parts-head,.track-card { display:grid; grid-template-columns:minmax(190px,.9fr) minmax(260px,1.4fr) 150px 106px; gap:16px; align-items:center; }
.parts-head { min-height:42px; padding:0 17px; background:var(--surface-3); color:var(--muted); border-bottom:1px solid var(--line); font-size:9px; font-weight:900; letter-spacing:.13em; text-transform:uppercase; }
.parts-head span:nth-child(3),.parts-head span:nth-child(4) { text-align:right; }
.track-grid { display:block; }
.track-card { width:100%; min-height:86px; padding:13px 17px; border:0; border-bottom:1px solid var(--line); background:var(--surface); color:var(--text); cursor:pointer; text-align:left; transition:.15s ease; }
.track-card:last-child { border-bottom:0; }
.track-card:hover { background:var(--surface-2); }
.track-card.selected { box-shadow:inset 3px 0 var(--orange); }
.part-category { display:grid; grid-template-columns:42px minmax(0,1fr); align-items:center; gap:12px; }
.track-icon { width:42px; height:42px; display:grid; place-items:center; padding:9px; color:var(--track-color,var(--orange)); background:color-mix(in srgb,var(--track-color,var(--orange)) 11%,transparent); border-radius:9px; }
.track-icon svg { width:100%; height:100%; }
.track-index { display:block; color:var(--muted); font-size:8px; letter-spacing:.14em; font-weight:850; margin-bottom:3px; }
.part-category h3 { margin:0; font-size:14px; line-height:1.3; }
.part-selection { min-width:0; }
.part-selection strong { display:block; font-size:13px; line-height:1.35; }
.part-selection p { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:4px 0 0; color:var(--muted); font-size:11px; }
.part-empty { color:var(--muted); font-weight:650!important; }
.track-price { text-align:right; font-size:12px; font-weight:850; white-space:nowrap; }
.part-action { justify-self:end; min-width:92px; min-height:34px; display:grid; place-items:center; border:1px solid var(--line-strong); border-radius:6px; color:var(--text); background:var(--surface-2); font-size:11px; font-weight:850; }
.track-card:hover .part-action,.track-card.selected .part-action { border-color:var(--orange); color:var(--orange); }
.table-note { margin:10px 2px 0; color:var(--muted); font-size:10px; line-height:1.5; }

.summary-card { position:sticky; top:84px; border:1px solid var(--line); border-radius:var(--radius); padding:21px; background:var(--surface); box-shadow:var(--shadow); }
.summary-label { color:var(--orange); font-size:9px; font-weight:900; letter-spacing:.15em; }
.summary-card > strong { display:block; margin:7px 0 2px; font-size:31px; letter-spacing:-.045em; }
.summary-card > p { color:var(--muted); font-size:11px; line-height:1.5; padding-bottom:15px; border-bottom:1px solid var(--line); }
.summary-line { display:flex; justify-content:space-between; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); font-size:11px; }
.summary-line span { color:var(--muted); }
.summary-card small { display:block; color:var(--muted); font-size:9px; line-height:1.5; }

.track-detail { position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:28px; background:rgba(4,6,8,.72); backdrop-filter:blur(5px); }
.track-detail.hidden { display:none; }
.detail-surface { width:min(1180px,100%); max-height:calc(100vh - 56px); overflow:auto; border:1px solid var(--line-strong); border-radius:14px; background:var(--surface); box-shadow:0 30px 90px rgba(0,0,0,.5); }
.detail-head { position:sticky; top:0; z-index:3; display:grid; grid-template-columns:1fr auto; gap:20px; padding:24px 26px 20px; border-bottom:1px solid var(--line); background:var(--surface); }
.detail-head h2 { margin:7px 0 5px; font-size:32px; letter-spacing:-.04em; }
.detail-head p { max-width:790px; margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.detail-close { width:36px; height:36px; border:1px solid var(--line); border-radius:50%; background:var(--surface-2); cursor:pointer; font-size:20px; }
.stages { padding:12px; }
.stage-card { display:grid; grid-template-columns:180px minmax(160px,.8fr) minmax(210px,1fr) minmax(150px,.75fr) 130px; gap:17px; align-items:start; padding:18px; border:1px solid transparent; border-bottom-color:var(--line); background:transparent; transition:.15s ease; }
.stage-card:last-child { border-bottom-color:transparent; }
.stage-card:hover { background:var(--surface-2); }
.stage-card.selected { border-color:rgba(255,106,19,.48); border-radius:9px; background:var(--orange-soft); }
.stage-main .stage-num { display:block; color:var(--orange); font-size:9px; letter-spacing:.14em; font-weight:900; }
.stage-main h3 { margin:7px 0 5px; font-size:15px; line-height:1.3; }
.stage-card .price { color:var(--text); font-size:11px; font-weight:850; }
.stage-copy { color:var(--muted); font-size:11px; line-height:1.5; }
.mini-list { margin:0; padding:0; list-style:none; }
.mini-list li { position:relative; padding:3px 0 3px 11px; color:var(--text); font-size:10px; line-height:1.4; }
.mini-list li::before { content:""; position:absolute; left:0; top:8px; width:4px; height:4px; border-radius:50%; background:var(--orange); }
.stage-select { width:100%; min-height:36px; border:1px solid var(--line-strong); border-radius:6px; background:var(--surface-2); color:var(--text); font-size:10px; font-weight:850; cursor:pointer; }
.stage-card.selected .stage-select { border-color:var(--orange); background:var(--orange); color:#fff; }
.product-links { display:grid; gap:5px; }
.product-links a { display:flex; align-items:center; justify-content:space-between; gap:7px; min-height:31px; padding:6px 7px; border:1px solid var(--line); border-radius:6px; background:var(--surface); color:var(--text); text-decoration:none; font-size:9px; line-height:1.25; }
.product-links a:hover { border-color:var(--orange); }
.product-links a span { font-weight:750; }
.product-links a em { flex:0 0 auto; color:var(--orange); font-size:9px; font-style:normal; font-weight:900; }
.product-links.compact { display:flex; flex-wrap:wrap; margin-top:8px; }
.product-links.compact a { min-height:26px; }
.recommendation { margin:0 24px 24px; padding:15px 17px; border-left:3px solid var(--orange); background:var(--surface-2); color:var(--muted); font-size:11px; line-height:1.55; }
.recommendation strong { color:var(--orange); }
.infra-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:18px; }
.infra-item { display:grid; grid-template-columns:30px minmax(0,1fr) auto; align-items:center; gap:11px; padding:14px; border:1px solid var(--line); border-radius:8px; background:var(--surface-2); cursor:pointer; }
.infra-item.selected { border-color:rgba(255,106,19,.5); background:var(--orange-soft); }
.infra-item input { position:absolute; opacity:0; pointer-events:none; }
.checkmark { width:26px; height:26px; display:grid; place-items:center; border:1px solid var(--line-strong); border-radius:5px; color:transparent; font-size:12px; }
.infra-item.selected .checkmark { color:#fff; border-color:var(--orange); background:var(--orange); }
.infra-item b { display:block; font-size:12px; }
.infra-item b em { color:var(--orange); font-size:7px; letter-spacing:.12em; font-style:normal; margin-left:4px; }
.infra-item small { display:block; color:var(--muted); font-size:9px; line-height:1.45; margin-top:3px; }
.infra-item > strong { font-size:10px; white-space:nowrap; }

.kit-actions { display:flex; gap:8px; }
.kit-layout { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:22px; align-items:start; }
.alerts { display:grid; gap:8px; margin-bottom:11px; }
.alert { display:flex; gap:10px; padding:12px 14px; border:1px solid rgba(224,173,64,.3); border-left:3px solid var(--yellow); border-radius:7px; background:rgba(224,173,64,.08); color:var(--yellow); font-size:11px; line-height:1.45; }
.alert.danger { border-color:rgba(237,101,101,.28); border-left-color:var(--red); background:rgba(237,101,101,.07); color:var(--red); }
.alert.good { border-color:rgba(54,189,121,.28); border-left-color:var(--green); background:var(--green-soft); color:var(--green); }
.kit-list { border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; background:var(--surface); }
.kit-row { display:grid; grid-template-columns:42px minmax(0,1fr) auto; gap:13px; align-items:center; padding:14px 16px; border-bottom:1px solid var(--line); }
.kit-row:last-child { border-bottom:0; }
.kit-row .number { width:31px; height:31px; display:grid; place-items:center; border-radius:6px; background:var(--surface-3); color:var(--orange); font-size:10px; font-weight:900; }
.kit-row h3 { margin:0 0 4px; font-size:13px; }
.kit-row p { margin:0; color:var(--muted); font-size:10px; }
.kit-row .row-price { font-size:11px; font-weight:850; text-align:right; }
.kit-row button { display:block; border:0; padding:5px 0 0; margin-left:auto; color:var(--orange); background:transparent; font-size:10px; cursor:pointer; }
.empty-kit { padding:64px 28px; text-align:center; color:var(--muted); font-size:12px; }
.empty-kit strong { display:block; color:var(--text); font-size:19px; margin-bottom:7px; }

.principles { margin:80px 0 70px; padding-top:30px; border-top:1px solid var(--line); }
.principles > h2 { margin:0; font-size:24px; letter-spacing:-.03em; }
.principle-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:20px; }
.principle-grid article { padding:20px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.principle-grid b { color:var(--orange); font-size:9px; letter-spacing:.14em; }
.principle-grid h3 { margin:18px 0 7px; font-size:15px; }
.principle-grid p { margin:0; color:var(--muted); font-size:11px; line-height:1.55; }
footer { width:min(var(--max),calc(100% - 40px)); margin:0 auto; padding:26px 0 40px; border-top:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; gap:20px; }
footer > p { margin:0; color:var(--muted); font-size:10px; }
.toast { position:fixed; left:50%; bottom:24px; z-index:70; transform:translate(-50%,18px); padding:11px 15px; border:1px solid var(--line-strong); border-radius:7px; background:var(--surface-3); color:var(--text); box-shadow:var(--shadow); opacity:0; pointer-events:none; transition:.2s ease; font-size:11px; }
.toast.show { opacity:1; transform:translate(-50%,0); }

@media (max-width:1050px) {
  .hero { grid-template-columns:1fr; gap:28px; }
  .hero-controls { max-width:520px; }
  .builder-layout,.kit-layout { grid-template-columns:1fr; }
  .summary-card { position:static; }
  .stage-card { grid-template-columns:145px minmax(150px,.8fr) minmax(190px,1fr) minmax(145px,.7fr) 115px; }
}
@media (max-width:760px) {
  main,footer,.topbar-inner { width:min(var(--max),calc(100% - 26px)); }
  .topbar { height:61px; }
  .brand small { display:none; }
  .brand strong { font-size:9px; }
  .nav-button { padding:0 8px; font-size:11px; }
  .theme-toggle { padding:0 8px; }
  #themeText { display:none; }
  .hero { padding:42px 0 34px; }
  h1 { font-size:44px; }
  .parts-head { display:none; }
  .track-card { grid-template-columns:minmax(0,1fr) auto; gap:10px; min-height:112px; }
  .part-category { grid-column:1; }
  .part-selection { grid-column:1 / -1; padding-left:54px; }
  .track-price { grid-column:2; grid-row:1; align-self:center; }
  .part-action { grid-column:2; grid-row:2; }
  .track-detail { padding:10px; }
  .detail-surface { max-height:calc(100vh - 20px); }
  .detail-head { padding:19px; }
  .detail-head h2 { font-size:27px; }
  .stages { padding:8px; }
  .stage-card { grid-template-columns:1fr; gap:11px; padding:16px 12px; }
  .stage-copy { margin-top:-3px; }
  .stage-select { min-height:40px; }
  .infra-list { grid-template-columns:1fr; padding:12px; }
  .section-heading,.kit-heading { align-items:flex-start; flex-direction:column; }
  .kit-actions { width:100%; }
  .kit-actions button { flex:1; }
  .principle-grid { grid-template-columns:1fr; }
  footer { align-items:flex-start; flex-direction:column; }
}
@media (max-width:460px) {
  .brand strong { display:none; }
  .topnav { gap:1px; }
  .nav-button { padding:0 6px; }
  h1 { font-size:37px; }
  .hero-copy { font-size:14px; }
  .track-card { padding:13px; }
  .part-selection { padding-left:0; }
  .infra-item { grid-template-columns:28px minmax(0,1fr); }
  .infra-item > strong { grid-column:2; }
  .kit-row { grid-template-columns:34px minmax(0,1fr); }
  .kit-row .row-price { grid-column:2; text-align:left; }
  .kit-row button { margin-left:0; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; } }
