:root {
  color-scheme: dark;
  --bg: #070a08;
  --surface: #101511;
  --surface-2: #171d18;
  --surface-3: #202822;
  --line: #2b362d;
  --text: #f3f7f1;
  --muted: #98a49b;
  --lime: #c8ff3f;
  --mint: #58ffc0;
  --danger: #ff8f7d;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 2%, rgba(88, 255, 192, .09), transparent 29rem),
    radial-gradient(circle at 6% 38%, rgba(200, 255, 63, .04), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 68px;
  padding: 10px max(22px, 4vw);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 8, .86);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 700 12px/1 var(--mono); letter-spacing: .13em; }
.mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--lime); color: #090c09; letter-spacing: -.08em; }
.local, .eyebrow { font: 650 10px/1.45 var(--mono); letter-spacing: .14em; color: var(--mint); }
.local { justify-self: end; }
.view-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.view-button { padding: 9px 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font: 700 10px var(--mono); letter-spacing: .08em; }
.view-button.active { background: var(--lime); color: #0b0d0b; }

main { width: min(1380px, 92vw); margin: auto; }
.hero { padding: clamp(72px, 9vw, 140px) 0 72px; border-bottom: 1px solid var(--line); }
h1 { max-width: 1120px; margin: 22px 0 28px; font-size: clamp(52px, 8.5vw, 126px); line-height: .87; letter-spacing: -.075em; }
h1 em { color: var(--lime); font-style: normal; }
.lede { max-width: 790px; margin: 0; color: var(--muted); font-size: clamp(16px, 1.8vw, 22px); line-height: 1.55; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 42px; }
.stat { min-width: 160px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: rgba(16, 21, 17, .82); }
.stat b { display: block; font-size: 30px; letter-spacing: -.04em; }
.stat span { color: var(--muted); font: 600 10px var(--mono); letter-spacing: .11em; }

.view-panel { padding: 64px 0 20px; }
.view-panel[hidden] { display: none; }
.section-intro { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); align-items: end; gap: 40px; margin-bottom: 34px; }
.section-intro h2, .agent-guide h2, .source-section > h2 { margin: 13px 0 0; font-size: clamp(36px, 5vw, 72px); line-height: .96; letter-spacing: -.055em; }
.section-intro > p { margin: 0; color: var(--muted); line-height: 1.65; }

.control-panel { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 1px; margin: 0 0 38px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.visual-controls { grid-template-columns: 1.7fr repeat(4, 1fr); }
.control-panel label { display: flex; min-width: 0; flex-direction: column; gap: 9px; padding: 15px; background: var(--surface); }
.control-panel label span { color: var(--muted); font: 650 9px var(--mono); letter-spacing: .13em; }
.control-panel input, .control-panel select { min-width: 0; width: 100%; border: 0; background: transparent; color: var(--text); outline: 0; }
.control-panel option { background: var(--surface); }

.catalog-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 0 25px; }
.catalog-head h2 { margin: 7px 0 0; font-size: clamp(28px, 3vw, 46px); letter-spacing: -.045em; }
.catalog-head > button, #reset { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; font: 700 10px var(--mono); letter-spacing: .08em; }
.catalog-head > button:hover { border-color: var(--lime); color: var(--lime); }

.visual-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.visual-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); transition: transform .25s ease, border-color .25s ease; }
.visual-card:hover { transform: translateY(-4px); border-color: #526153; }
.preview-button { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border: 0; border-bottom: 1px solid var(--line); background: #f2f2ef; cursor: pointer; }
.preview-button img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .45s ease; }
.visual-card:hover .preview-button img { transform: scale(1.025); }
.capture-label { position: absolute; left: 12px; bottom: 12px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(5, 8, 6, .78); color: #fff; font: 700 8px var(--mono); letter-spacing: .1em; backdrop-filter: blur(10px); }
.preview-arrow { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--lime); color: #0a0c0a; font-size: 19px; }
.visual-card-body { padding: 20px; }
.meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--mint); font: 650 9px var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.badge { padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.visual-card h3 { margin: 17px 0 9px; font-size: 28px; letter-spacing: -.04em; }
.visual-card-body > p { min-height: 48px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.pill { padding: 6px 8px; border-radius: 7px; background: var(--surface-3); color: #c2cbc4; font: 600 9px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.card-guidance { display: grid; grid-template-columns: 1fr auto; gap: 16px; margin: 18px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.card-guidance span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.card-guidance b, .spec-grid b { display: block; margin-bottom: 5px; color: var(--mint); font: 650 8px var(--mono); letter-spacing: .1em; }
.inspect-button { width: 100%; padding: 12px; border: 1px solid #3b493d; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; font: 700 10px var(--mono); letter-spacing: .08em; }
.inspect-button:hover { border-color: var(--lime); background: var(--lime); color: #080b09; }
.empty { grid-column: 1 / -1; padding: 50px; border: 1px dashed var(--line); border-radius: 18px; text-align: center; color: var(--muted); }

.results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.component-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.component-card h3 { margin: 16px 0 9px; font-size: 18px; }
.path { overflow: hidden; color: var(--muted); font: 10px/1.45 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 30px 0; }
.pagination button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); cursor: pointer; }
.pagination button.active { border-color: var(--lime); background: var(--lime); color: #090c09; }

.agent-guide { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(40px, 8vw, 120px); margin: 90px 0; padding: clamp(35px, 6vw, 76px); border: 1px solid var(--line); border-radius: 25px; background: linear-gradient(145deg, rgba(200,255,63,.06), rgba(88,255,192,.02)), var(--surface); }
.guide-copy > p:last-child { color: var(--muted); line-height: 1.65; }
.guide-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.guide-steps li { display: grid; grid-template-columns: 48px 1fr; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.guide-steps li:last-child { border-bottom: 0; }
.guide-steps b { color: var(--lime); font: 700 12px var(--mono); }
.guide-steps span { color: var(--muted); line-height: 1.5; }
.guide-steps strong { display: block; margin-bottom: 5px; color: var(--text); }

.source-section { padding: 85px 0; border-top: 1px solid var(--line); }
.source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 34px; }
.source-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.source-card header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.source-card h3 { margin: 0; }
.source-card p { margin: 13px 0 0; color: var(--muted); font: 10px var(--mono); }
.mode { padding: 6px 8px; border-radius: 999px; background: rgba(88,255,192,.1); color: var(--mint); font: 650 8px var(--mono); letter-spacing: .08em; }

.component-dialog { width: min(1080px, 94vw); max-height: 92vh; padding: 0; overflow: auto; border: 1px solid #3b493d; border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: 0 35px 120px rgba(0,0,0,.7); }
.component-dialog::backdrop { background: rgba(0, 0, 0, .78); backdrop-filter: blur(8px); }
.dialog-close { position: sticky; top: 16px; z-index: 3; float: right; display: grid; place-items: center; width: 38px; height: 38px; margin: 16px 16px -54px 0; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; font-size: 24px; }
.dialog-preview { aspect-ratio: 16 / 7; overflow: hidden; background: #f3f3f0; }
.dialog-preview img { width: 100%; height: 100%; object-fit: cover; }
.dialog-body { padding: clamp(24px, 5vw, 54px); }
.dialog-body h2 { margin: 18px 0 8px; font-size: clamp(38px, 6vw, 72px); letter-spacing: -.055em; }
.dialog-description { max-width: 760px; color: var(--muted); line-height: 1.65; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 30px 0; }
.detail-grid section { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.detail-grid h3 { margin: 0 0 12px; color: var(--mint); font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.detail-grid ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }
.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.spec-grid span { padding: 16px; background: var(--surface-2); color: var(--text); font-size: 12px; }
.source-path { margin-top: 24px; padding: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #090d0a; }
.source-path span { display: block; margin-bottom: 8px; color: var(--mint); font: 650 8px var(--mono); letter-spacing: .1em; }
.source-path code { display: block; overflow-x: auto; color: #cad2cc; font-size: 11px; white-space: nowrap; }
.curation-note { color: var(--muted); font-size: 11px; line-height: 1.5; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dialog-actions button, .dialog-actions a { padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; text-decoration: none; font: 700 10px var(--mono); letter-spacing: .07em; }
.dialog-actions a { border-color: var(--lime); background: var(--lime); color: #080b09; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px max(22px, 4vw); border-top: 1px solid var(--line); color: var(--muted); font: 600 9px var(--mono); letter-spacing: .1em; }
.fatal { padding: 10vw; }

@media (max-width: 1100px) {
  .visual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .visual-controls { grid-template-columns: 2fr repeat(2, 1fr); }
  .visual-controls label:nth-child(4), .visual-controls label:nth-child(5) { grid-column: span 1; }
  .agent-guide { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; gap: 10px; }
  .local { display: none; }
  .brand > span:last-child { display: none; }
  .view-switch { justify-self: end; }
  .view-button { padding: 8px 9px; font-size: 8px; }
  main { width: min(100% - 28px, 1380px); }
  .hero { padding: 62px 0 52px; }
  h1 { font-size: clamp(48px, 15vw, 76px); }
  .stat { min-width: calc(50% - 6px); flex: 1; }
  .section-intro { grid-template-columns: 1fr; gap: 18px; }
  .visual-controls, .control-panel { grid-template-columns: 1fr 1fr; }
  .visual-controls label:first-child, .control-panel label:first-child { grid-column: 1 / -1; }
  .visual-grid { grid-template-columns: 1fr; }
  .preview-button { aspect-ratio: 16 / 10; }
  .results { grid-template-columns: 1fr 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .agent-guide { margin: 60px 0; padding: 28px 20px; }
  .detail-grid, .spec-grid { grid-template-columns: 1fr; }
  .dialog-preview { aspect-ratio: 16 / 10; }
  footer { flex-direction: column; }
}

@media (max-width: 480px) {
  .view-button { max-width: 104px; white-space: normal; line-height: 1.25; }
  .visual-controls, .control-panel { grid-template-columns: 1fr; }
  .visual-controls label:first-child, .control-panel label:first-child { grid-column: auto; }
  .catalog-head { align-items: flex-start; flex-direction: column; }
  .results { grid-template-columns: 1fr; }
  .visual-card h3 { font-size: 25px; }
  .card-guidance { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
