:root {
  color-scheme: dark;
  --ink: #0b1722;
  --panel: #10212b;
  --panel-deep: #0d1c27;
  --line: rgba(221, 188, 111, .23);
  --gold: #e2bb69;
  --gold-light: #f4d894;
  --white: #f6f1e8;
  --muted: #a6b2b5;
  --green: #8bb7a1;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 12% 7%, #173b37 0, transparent 31rem),
              radial-gradient(ellipse at 88% 17%, #342b21 0, transparent 35rem), var(--ink);
  color: var(--white);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}
a { color: var(--gold-light); overflow-wrap: anywhere; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
[hidden] { display: none !important; }
.site-header, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem max(5vw, calc((100vw - 1200px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 20, 30, .62);
}
.demo-nav { position: sticky; top: 0; z-index: 5; background: #10223a; border-bottom: 1px solid var(--line); }
.demo-tabs { display: flex; max-width: 1200px; margin: auto; padding: 0 5vw; gap: .25rem; overflow-x: auto; scrollbar-width: thin; }
.demo-tab {
  flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent;
  padding: .85rem 1rem; background: none; color: #adbaba;
  font-size: .82rem; font-weight: 650; letter-spacing: .015em;
}
.demo-tab:hover { color: var(--white); }
.demo-tab[aria-selected="true"] { border-color: var(--gold); color: var(--gold-light); }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--white); }
.brand-mark { width: 3rem; height: 3rem; object-fit: cover; flex: none; border: 1px solid var(--gold); border-radius: .65rem; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 1.25rem; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.header-status {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--line); padding: .45rem .8rem; border-radius: 3rem;
  color: var(--muted); font-size: .75rem; letter-spacing: .04em;
}
.status-dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--gold); }
main { max-width: 1200px; margin: auto; padding: 0 5vw 5rem; }
.eyebrow { color: var(--gold); font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow span { margin-right: .55rem; color: var(--green); }
.intro { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); align-items: center; gap: clamp(1.2rem, 3vw, 2.4rem); padding: 1.3rem 0 1.6rem; }
.intro-copy { min-width: 0; }
.intro-art { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; background: #0c1720; box-shadow: 0 16px 45px rgba(0,0,0,.2); }
.intro-art img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.intro-art figcaption { position: absolute; inset: auto 0 0; padding: 1.5rem 1rem .8rem; background: linear-gradient(transparent, rgba(5, 15, 20, .9)); color: var(--white); font-size: .72rem; letter-spacing: .06em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: normal; }
h1 { margin: .45rem 0 .45rem; font-size: clamp(2.35rem, 4vw, 3.3rem); line-height: 1.1; letter-spacing: -.045em; }
h1 em { color: var(--gold); font-style: normal; }
.workflow-name { margin: 0 0 .8rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 2.2vw, 1.95rem); line-height: 1.3; }
.workflow-name strong { color: var(--gold-light); font-weight: normal; }
.intro-text { max-width: 800px; margin-bottom: .65rem; color: #c7d0cf; font-size: 1rem; line-height: 1.55; }
.capability-line { margin: 0; font-size: .78rem; color: var(--muted); }
.capability-line span { color: var(--green); font-weight: 700; margin-right: .6rem; }
.demo-panel { padding-bottom: 2rem; scroll-margin-top: 4rem; }
.demo-panel > .section-heading { margin: .8rem 0 1rem; }
.featured-question {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  margin-bottom: 1rem; padding: 1rem 1.35rem; border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: .8rem; background: #142330;
}
.featured-question h2 { font-size: clamp(1.4rem, 2vw, 1.8rem); line-height: 1.25; margin: .35rem 0; }
.featured-question p { margin: 0; color: var(--muted); font-size: .8rem; }
.featured-question .secondary-button { white-space: nowrap; }
.answer-text { line-height: 1.7; margin-top: .85rem; }
.citations { margin-top: 1rem; }
.capability-grid, .library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.capability-grid > div, .library-card, .conversation, .empty-witness, .future-note {
  border: 1px solid var(--line); border-radius: .85rem; background: #10242d;
}
.capability-grid > div { padding: 1.3rem; }
.capability-grid strong { display: block; margin: .3rem 0; font-family: Georgia, serif; font-size: 1.25rem; }
.capability-grid p { margin: 0; color: var(--muted); font-size: .82rem; }
.ask-heading { max-width: 790px; margin: 1.4rem 0; }
.ask-heading h2 { font-size: clamp(1.9rem, 3vw, 2.8rem); line-height: 1.15; margin-bottom: .55rem; }
.ask-heading p { color: var(--muted); margin: 0; }
.explore-prompts { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.1rem; }
.explore-prompts button { background: #1d3739; border: 1px solid var(--line); color: var(--gold-light); border-radius: 999px; padding: .55rem .85rem; cursor: pointer; font: inherit; font-size: .82rem; }
.explore-prompts button:hover, .explore-prompts button:focus-visible { border-color: var(--gold); }
.ask-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(310px, .8fr); align-items: start; gap: 1.3rem; }
.conversation { min-height: 360px; max-height: 660px; overflow-y: auto; padding: 1rem; }
.message { max-width: 95%; margin-bottom: 1rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: .8rem; background: #172e35; }
.message p { margin: .5rem 0 0; }
.user-message { margin-left: auto; background: #2b332b; }
.error-message { border-color: #bb7b75; }
.input-note { color: var(--muted); font-size: .78rem; }
.library-card { display: flex; flex-direction: column; text-align: left; min-width: 0; gap: .7rem; padding: 1.35rem; color: var(--white); }
.library-card h3 { font-size: 1.25rem; line-height: 1.25; margin: 0; }
.library-answer { color: #e2e9df; font-size: .85rem; margin: 0; }
.library-sources { max-height: 240px; overflow: auto; }
.library-sources .claim { padding: .65rem 0; font-size: .76rem; }
.library-sources .source { margin-left: .5rem; }
.library-card .text-button { align-self: flex-start; margin-top: auto; text-align: left; font-size: .82rem; }
.library-note { color: var(--muted); font-size: .83rem; }
.empty-witness, .future-note { padding: 1.3rem; color: var(--muted); }
.future-note { margin-top: 1.3rem; }
.future-note p { margin: .5rem 0 0; }
.intro-steps {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem;
  margin-top: 2rem; color: #d2dacf; font-size: .8rem; letter-spacing: .03em;
}
.intro-steps span:nth-child(even) { color: var(--gold); }
.hero-link { display: inline-block; margin-top: 1.2rem; color: var(--gold-light); font-size: .84rem; font-weight: 700; text-underline-offset: .3rem; }
.hero-link span { margin-left: .4rem; }
.experience { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .8fr); gap: 1.5rem; align-items: stretch; }
.experience-main, .boundary-card, .result-card, .trail-card, .graph-details, .capture-footer {
  border: 1px solid var(--line); border-radius: 1rem;
  background: linear-gradient(150deg, rgba(22, 44, 48, .95), rgba(12, 27, 39, .95));
  box-shadow: 0 22px 65px rgba(0, 0, 0, .12);
}
.experience-main { padding: clamp(1.4rem, 3vw, 2.6rem); }
.section-heading { display: flex; align-items: center; gap: 1.2rem; }
.section-rule { flex: 1; height: 1px; background: var(--line); }
.experience h2, .witness h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.15; margin: 1.2rem 0 .65rem; }
.supporting { color: var(--muted); max-width: 540px; }
label[for="fragment"] { display: block; margin: 1.6rem 0 .55rem; font-size: .84rem; font-weight: 700; }
textarea {
  display: block; width: 100%; min-height: 135px; resize: vertical;
  padding: 1rem 1.1rem; border: 1px solid rgba(226, 187, 105, .45); border-radius: .65rem;
  color: var(--white); background: #0b1a25; line-height: 1.6;
}
textarea::placeholder { color: #809193; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; margin-top: 1.2rem; }
.primary-button, .secondary-button {
  border-radius: .55rem; padding: .8rem 1.15rem; font-weight: 700;
  transition: background .2s, transform .2s;
}
.primary-button { border: 1px solid var(--gold); background: var(--gold); color: #14212a; }
.primary-button:hover:not(:disabled) { background: var(--gold-light); transform: translateY(-1px); }
.primary-button span { margin-left: .5rem; }
.text-button { border: 0; padding: .5rem 0; color: var(--gold-light); background: transparent; text-decoration: underline; text-underline-offset: .3rem; }
.text-button:hover { color: var(--white); }
.request-state { min-height: 1.2rem; margin: 1rem 0 0; color: var(--muted); font-size: .78rem; }
.boundary-card { padding: clamp(1.4rem, 2.5vw, 2rem); background: linear-gradient(160deg, #253127, #122730); }
.boundary-card h2 { font-size: 1.65rem; margin: 1rem 0 1.5rem; }
.boundary-card ul { list-style: none; padding: 0; margin: 0; }
.boundary-card li { border-top: 1px solid var(--line); padding: .9rem 0; color: #cbd5cf; font-size: .88rem; }
.boundary-card li strong { display: block; color: var(--white); margin-bottom: .2rem; }
.boundary-card p { margin: 1.2rem 0 0; color: var(--muted); font-size: .77rem; line-height: 1.65; }
.witness { margin-top: 1.6rem; }
.witness-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.witness-heading p { margin: 0 0 1.4rem; color: var(--muted); }
.outcome-tag { flex-shrink: 0; padding: .45rem .7rem; border: 1px solid #739d86; border-radius: 2rem; color: #b8ddc7; font-size: .72rem; }
.outcome-tag.no-record { color: var(--gold-light); border-color: var(--gold); }
.outcome-tag.failure { color: #f0aca6; border-color: #d1847b; }
.witness-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.5rem; align-items: start; }
.result-card, .trail-card { padding: clamp(1.3rem, 2.6vw, 2rem); }
.result-card h3, .trail-card h3 { font-size: 1.6rem; margin: .55rem 0 1.2rem; }
#answer { color: #e7ece7; line-height: 1.8; }
.claim { padding: 1rem 0; border-top: 1px solid var(--line); }
.claim p { margin: 0 0 .55rem; }
.claim-label { display: inline-block; color: var(--gold); font-size: .75rem; font-weight: 700; margin-right: .35rem; }
.source { margin: .55rem 0 0 1.5rem; padding: .55rem .7rem; border-left: 2px solid var(--gold); background: rgba(0, 0, 0, .12); font-size: .77rem; }
.source strong, .source a, .source span { display: block; }
.source strong { margin-bottom: .25rem; }
.source span { color: var(--muted); overflow-wrap: anywhere; }
.source a + a { margin-top: .25rem; color: #b5cec2; }
.trail { list-style: none; margin: 0; padding: 0; }
.trail li { display: flex; gap: 1rem; padding: 0 0 1.15rem; }
.trail li:not(:last-child) { border-left: 1px solid var(--line); margin-left: .75rem; padding-left: 0; }
.trail li:not(:last-child) .trail-number { margin-left: -.75rem; }
.trail-number { display: grid; place-items: center; flex: 0 0 1.5rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #314c49; color: var(--gold-light); font-size: .63rem; }
.trail strong { font-size: .84rem; }
.trail p { margin: .25rem 0 0; color: var(--muted); font-size: .78rem; }
.graph-details { margin: 1.5rem 0; padding: 1rem 1.3rem; font-size: .85rem; }
.graph-details summary { cursor: pointer; color: var(--gold-light); font-weight: 700; }
.graph-details summary span { color: var(--muted); font-weight: normal; }
.graph-details ul { padding-left: 1.4rem; margin-bottom: 0; }
.graph-details li { margin: .45rem 0; }
.capture-footer { padding: 1.3rem 1.6rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
.capture-footer strong { font-family: Georgia, serif; font-size: 1.2rem; }
.capture-footer p { margin: .3rem 0 0; color: var(--muted); font-size: .78rem; }
.secondary-button { flex-shrink: 0; background: transparent; border: 1px solid var(--gold); color: var(--gold-light); }
.secondary-button:hover:not(:disabled) { background: rgba(226, 187, 105, .12); }
.site-footer { border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); font-size: .75rem; }
@media (max-width: 760px) {
  .site-header, .site-footer { padding-left: 5vw; padding-right: 5vw; }
  .header-status { font-size: .64rem; }
  .experience, .witness-grid, .ask-layout { grid-template-columns: 1fr; }
  .ask-layout .experience-main { order: -1; }
  .capability-grid, .library-grid { grid-template-columns: 1fr; }
  .intro { grid-template-columns: 1fr; padding-top: 1.3rem; }
  .intro-art { max-width: 440px; }
  .featured-question { align-items: stretch; flex-direction: column; }
  .witness { margin-top: 1.2rem; }
  .capture-footer, .witness-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 430px) {
  .brand small { display: none; }
  .header-status { padding: .35rem .5rem; letter-spacing: 0; }
  .intro-steps { gap: .3rem .5rem; }
  .form-actions, .primary-button, .secondary-button { width: 100%; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .primary-button { transition: none; }
}