:root {
  --ink: #f7f4ff;
  --muted: #a8a5bd;
  --dim: #77748b;
  --page: #090b18;
  --page-deep: #060712;
  --panel: rgba(20, 21, 42, 0.86);
  --panel-solid: #14152a;
  --panel-soft: #101225;
  --line: rgba(203, 193, 255, 0.14);
  --line-strong: rgba(177, 154, 255, 0.28);
  --violet: #9f7aea;
  --violet-bright: #bd9cff;
  --magenta: #ed7ed5;
  --cyan: #72dbe2;
  --green: #75e6b5;
  --amber: #ffc875;
  --red: #ff8d9d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 4%, rgba(124, 82, 201, 0.19), transparent 31rem),
    radial-gradient(circle at 4% 37%, rgba(44, 144, 170, 0.09), transparent 27rem),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
  content: "";
  pointer-events: none;
}

a { color: inherit; }
button, textarea { font: inherit; }

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  color: #0b0d18;
  background: var(--cyan);
  font-weight: 800;
}

.skip-link:focus { top: 20px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 24, 0.82);
  backdrop-filter: blur(18px);
}

.brand, .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 13px;
  color: white;
  background: linear-gradient(145deg, #a976ef, #5b43b6 55%, #2e91aa);
  box-shadow: 0 8px 28px rgba(132, 87, 217, 0.28);
  font-weight: 900;
}

.brand strong, .brand small, .footer-brand strong, .footer-brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: 0.04em; }
.brand small { color: var(--muted); font-size: 11px; }

nav { display: flex; align-items: center; gap: 28px; }
nav a { color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
nav a:hover, nav a:focus-visible { color: var(--ink); }
.nav-github { padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 99px; }

main > section, footer {
  width: min(calc(100% - 40px), var(--max-width));
  margin-right: auto;
  margin-left: auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: 72px;
  align-items: center;
  min-height: 680px;
  padding: 92px 0 80px;
}

.eyebrow-row { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 34px; }
.status-pill, .quiet-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: #d9d4e7;
  background: rgba(255,255,255,0.035);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill { border-color: rgba(117,230,181,0.28); color: #b5f5d8; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(117,230,181,0.10); }
.kicker { margin: 0 0 12px; color: var(--violet-bright); font-size: 12px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }

h1, h2, h3, p { margin-top: 0; }
h1, h2 { letter-spacing: -0.045em; line-height: 1.03; }
h1 { max-width: 760px; margin-bottom: 24px; font-size: clamp(3.5rem, 7vw, 6.7rem); }
h1 span { color: transparent; background: linear-gradient(100deg, var(--violet-bright), var(--magenta), var(--cyan)); background-clip: text; -webkit-background-clip: text; }
h2 { margin-bottom: 18px; font-size: clamp(2.25rem, 4vw, 4rem); }
h3 { line-height: 1.25; }

.hero-lede { max-width: 670px; margin-bottom: 34px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover { transform: translateY(-2px); }
.button:focus-visible, button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 3px solid rgba(114,219,226,0.55); outline-offset: 3px; }
.button.primary { color: #0a0b16; background: linear-gradient(100deg, #c3a5ff, #e4a0db); box-shadow: 0 13px 34px rgba(157,108,215,0.23); }
.button.secondary { border-color: var(--line-strong); color: var(--ink); background: rgba(255,255,255,0.035); }

.system-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(34,35,67,0.93), rgba(15,17,36,0.94));
  box-shadow: var(--shadow);
}

.system-card::before { position: absolute; top: -80px; right: -80px; width: 220px; height: 220px; border-radius: 50%; background: rgba(155,107,228,0.18); filter: blur(28px); content: ""; }
.system-card-head { position: relative; display: flex; justify-content: space-between; margin-bottom: 22px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.live-dot { color: var(--cyan); }
.flow-list { position: relative; margin: 0; padding: 0; list-style: none; }
.flow-list li { display: flex; gap: 15px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); }
.flow-list li > span { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--violet-bright); font-size: 10px; font-weight: 900; }
.flow-list strong, .flow-list small { display: block; }
.flow-list strong { font-size: 14px; }
.flow-list small { color: var(--muted); font-size: 12px; }
.system-note { position: relative; margin: 16px 0 0; padding: 15px; border-left: 2px solid var(--cyan); color: var(--muted); background: rgba(114,219,226,0.055); font-size: 12px; }
.system-note strong { color: var(--ink); }

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 120px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metrics-strip div { padding: 24px 28px; border-left: 1px solid var(--line); }
.metrics-strip div:first-child { border-left: 0; }
.metrics-strip strong, .metrics-strip span { display: block; }
.metrics-strip strong { color: var(--violet-bright); font-size: 30px; line-height: 1.2; }
.metrics-strip span { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: 0.04em; }

.section-intro { max-width: 710px; margin-bottom: 38px; }
.section-intro > p:last-child { color: var(--muted); }
.section-intro.centered { margin-right: auto; margin-left: auto; text-align: center; }

.demo-section { padding: 40px 0 120px; }
.demo-grid { display: grid; grid-template-columns: 0.82fr 1.35fr; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow); }
.query-panel { padding: 32px; border-right: 1px solid var(--line); background: rgba(10,12,27,0.78); }
.query-panel label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 850; }
.input-shell { position: relative; }
textarea { width: 100%; resize: vertical; min-height: 132px; padding: 16px 16px 34px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); background: #0d0f20; line-height: 1.5; }
textarea::placeholder { color: #69677a; }
#character-count { position: absolute; right: 12px; bottom: 9px; color: var(--dim); font-size: 10px; }
.submit-button { width: 100%; margin-top: 12px; }
.submit-button span:last-child { margin-left: auto; font-size: 18px; }

.example-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.example-list p { flex: 0 0 100%; margin-bottom: 2px; color: var(--dim); font-size: 10px; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.example-list button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.example-list button:hover { border-color: var(--line-strong); color: var(--ink); background: rgba(255,255,255,0.04); }
.example-list .example-link { flex: 0 0 100%; margin-top: 4px; color: var(--violet-bright); font-size: 11px; font-weight: 800; text-decoration: none; }
.example-list .example-link:hover { color: var(--cyan); }
.data-note { display: flex; gap: 12px; margin-top: 30px; padding: 14px; border: 1px solid rgba(114,219,226,0.14); border-radius: 12px; color: var(--muted); background: rgba(114,219,226,0.035); font-size: 11px; }
.data-note span { color: var(--cyan); }
.data-note p { margin: 0; }
.data-note strong { color: #dceff0; }

.result-panel { min-height: 560px; padding: 34px; background: radial-gradient(circle at 100% 0, rgba(157,122,234,0.09), transparent 24rem); }
.result-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; max-width: 420px; margin: 0 auto; text-align: center; }
.result-empty h3 { margin: 25px 0 8px; font-size: 22px; }
.result-empty p { color: var(--muted); font-size: 13px; }
.empty-orbit { position: relative; display: grid; width: 78px; height: 78px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; }
.empty-orbit::before, .empty-orbit::after { position: absolute; inset: -10px; border: 1px solid rgba(159,122,234,0.12); border-radius: 50%; content: ""; }
.empty-orbit::after { inset: 14px; background: radial-gradient(circle, var(--violet-bright), transparent 65%); filter: blur(6px); }
.empty-orbit i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 22px var(--cyan); }

.result-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.disposition { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.disposition.answer { color: var(--green); }
.disposition.handoff { color: var(--amber); }
.disposition::before { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 12%, transparent); content: ""; }
.result-head h3 { max-width: 560px; margin-bottom: 0; font-size: 25px; }
.retrieval-badge { flex: none; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.handoff-reasons { display: flex; flex-wrap: wrap; gap: 7px; margin: -7px 0 22px; }
.reason-chip { padding: 6px 9px; border: 1px solid rgba(255,200,117,0.2); border-radius: 99px; color: #ffdba4; background: rgba(255,200,117,0.055); font-size: 10px; font-weight: 750; }
.guidance { margin-bottom: 24px; color: #dfdcea; font-size: 14px; }
.steps { margin: 0 0 26px; padding: 0; list-style: none; counter-reset: steps; }
.steps li { position: relative; margin: 10px 0; padding: 3px 0 3px 36px; color: var(--muted); font-size: 12px; counter-increment: steps; }
.steps li::before { position: absolute; left: 0; display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--violet-bright); content: counter(steps); font-size: 9px; font-weight: 900; }
.citation-card { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(255,255,255,0.025); }
.citation-id { flex: none; padding: 7px 9px; border-radius: 8px; color: #0a0b16; background: var(--cyan); font-size: 10px; font-weight: 950; }
.citation-card p { margin: 0; }
.citation-card strong, .citation-card small { display: block; }
.citation-card strong { font-size: 12px; }
.citation-card small { color: var(--muted); font-size: 10px; }
.citation-card a { margin-left: auto; color: var(--violet-bright); font-size: 11px; font-weight: 800; text-decoration: none; }

.evidence-panel { display: grid; grid-template-columns: 0.75fr 1fr; gap: 18px; margin-top: 18px; }
.confidence-card, .match-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,9,20,0.36); }
.evidence-label { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.evidence-label strong { color: var(--ink); }
.confidence-track { overflow: hidden; height: 5px; border-radius: 99px; background: rgba(255,255,255,0.08); }
.confidence-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--cyan)); }
.confidence-note { margin: 9px 0 0; color: var(--dim); font-size: 9px; }
.matched-terms { display: flex; flex-wrap: wrap; gap: 5px; }
.matched-terms span { padding: 4px 7px; border-radius: 6px; color: #cbc6db; background: rgba(255,255,255,0.055); font-size: 9px; }

.approach-section { padding: 100px 0 130px; }
.approach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.approach-grid article { min-height: 270px; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius-md); background: linear-gradient(155deg, rgba(27,29,54,0.8), rgba(14,16,33,0.82)); }
.approach-grid article > span { display: inline-block; margin-bottom: 58px; color: var(--violet-bright); font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.approach-grid h3 { margin-bottom: 12px; font-size: 17px; }
.approach-grid p { margin: 0; color: var(--muted); font-size: 12px; }

.review-section { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; padding: 76px; border: 1px solid rgba(255,200,117,0.14); border-radius: var(--radius-lg); background: radial-gradient(circle at 0 100%, rgba(179,101,160,0.13), transparent 33rem), var(--panel-soft); }
.review-section > div:first-child > p:not(.kicker) { color: var(--muted); }
.text-link { color: var(--violet-bright); font-size: 13px; font-weight: 850; text-decoration: none; }
.text-link span { margin-left: 7px; }
.review-rules { border-top: 1px solid var(--line); }
.review-rules > div { display: flex; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.rule-icon { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(255,200,117,0.25); border-radius: 10px; color: var(--amber); background: rgba(255,200,117,0.04); font-weight: 900; }
.review-rules p { margin: 0; }
.review-rules strong, .review-rules small { display: block; }
.review-rules strong { font-size: 13px; }
.review-rules small { color: var(--muted); font-size: 10px; }

.boundaries-section { padding: 130px 0; }
.boundary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.boundary-card { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); }
.boundary-card h3 { margin-bottom: 24px; font-size: 20px; }
.boundary-card ul { margin: 0; padding: 0; list-style: none; }
.boundary-card li { position: relative; padding: 10px 0 10px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.boundary-card li::before { position: absolute; left: 2px; color: var(--green); content: "✓"; font-weight: 900; }
.not-card li::before { color: var(--dim); content: "○"; }
.evaluation-caveat { max-width: 780px; margin: 22px auto 0; color: var(--dim); font-size: 10px; text-align: center; }

.source-library { padding: 40px 0 140px; }
.library-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.library-item { scroll-margin-top: 100px; border: 1px solid var(--line); border-radius: 14px; background: rgba(15,17,36,0.68); }
.library-item summary { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 18px; cursor: pointer; list-style: none; }
.library-item summary::-webkit-details-marker { display: none; }
.library-item summary > span:first-child { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--violet-bright); font-size: 9px; font-weight: 900; }
.library-item summary strong { font-size: 12px; }
.library-item summary small { color: var(--muted); font-size: 10px; }
.library-item summary::after { color: var(--dim); content: "+"; font-size: 18px; }
.library-item[open] summary::after { content: "−"; }
.library-content { padding: 0 18px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.library-content p { margin: 15px 0 8px; }
.library-content ol { margin: 0; padding-left: 20px; }

footer { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 40px 0 44px; border-top: 1px solid var(--line); }
.footer-brand p { margin: 0; }
.footer-brand strong, .footer-brand small { display: block; }
.footer-brand strong { font-size: 12px; }
.footer-brand small { color: var(--muted); font-size: 10px; }
.footer-links { display: flex; gap: 20px; margin: 0; }
.footer-links a { color: var(--muted); font-size: 10px; font-weight: 800; text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-note { grid-column: 1 / -1; margin: 0; color: var(--dim); font-size: 9px; }

@media (max-width: 920px) {
  nav a:not(.nav-github) { display: none; }
  .hero { grid-template-columns: 1fr; gap: 42px; min-height: auto; }
  .system-card { max-width: 620px; }
  .demo-grid { grid-template-columns: 1fr; }
  .query-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .approach-grid { grid-template-columns: repeat(2, 1fr); }
  .review-section { grid-template-columns: 1fr; gap: 36px; padding: 50px; }
}

@media (max-width: 620px) {
  .site-header, main > section, footer { width: min(calc(100% - 28px), var(--max-width)); }
  .site-header { padding: 12px 0; }
  .brand small { display: none; }
  .nav-github { padding: 7px 10px; }
  .hero { padding: 70px 0 55px; }
  h1 { font-size: clamp(3rem, 15vw, 4.4rem); }
  .metrics-strip { grid-template-columns: repeat(2, 1fr); margin-bottom: 85px; }
  .metrics-strip div { border-top: 1px solid var(--line); }
  .metrics-strip div:nth-child(odd) { border-left: 0; }
  .query-panel, .result-panel { padding: 23px; }
  .result-panel { min-height: 500px; }
  .result-head { display: block; }
  .retrieval-badge { display: inline-block; margin-top: 12px; }
  .evidence-panel, .boundary-grid, .library-grid { grid-template-columns: 1fr; }
  .approach-grid { grid-template-columns: 1fr; }
  .approach-grid article { min-height: 220px; }
  .approach-grid article > span { margin-bottom: 34px; }
  .review-section { padding: 30px; }
  footer { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; }
}

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