/* CiteSieve by Braivex. Base identity: Braivex tokens (public/brand/braivex.css), Assistant, black and cyan.
   CiteSieve's own device is the mesh: a band of perforations that answers pass through.
   Motion: transform and opacity only; 100/150/200/300 ms; ease-out in, ease-in out; nothing loops for decoration. */
@font-face { font-family: 'Assistant'; src: url('/brand/Assistant-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Assistant'; src: url('/brand/Assistant-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #000000; --panel: #0a0a0a; --panel-2: #0a0d12;
  --ink: #ffffff; --ink-70: #b0b0b0; --ink-55: #999999;
  --accent: #00f0ff; --accent-2: #0055ff; --on-accent: #04070a;
  --line: rgba(255, 255, 255, .1); --line-strong: rgba(255, 255, 255, .22);
  --good: #6ee7a8; --warn: #ffd27a; --bad: #ff8f8f;
  --radius: 4px; --max: 1200px;
  --motion-100: 100ms; --motion-150: 150ms; --motion-200: 200ms; --motion-300: 300ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-in: cubic-bezier(.7, 0, .84, 0);
  --mesh: radial-gradient(circle, var(--accent) 1.1px, transparent 1.7px);
  --mesh-dim: radial-gradient(circle, rgba(255, 255, 255, .34) 1px, transparent 1.6px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Assistant', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #7ff7ff; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-55); } .soft { color: var(--ink-70); } .small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.noscript, .plain-page { max-width: 560px; margin: 15vh auto; padding: 0 24px; display: grid; gap: 16px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.stack { display: grid; gap: 16px; } .stack-lg { display: grid; gap: 32px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }

/* the mesh: CiteSieve's device */
.mesh { height: 14px; background: var(--mesh) 0 0 / 10px 7px; opacity: .9; }
.mesh-rule { height: 7px; background: var(--mesh-dim) 0 0 / 10px 7px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font-weight: 700; font-size: 16px; text-decoration: none; transition: opacity var(--motion-150) var(--ease-out), transform var(--motion-100) var(--ease-out); }
.btn:hover { color: var(--ink); border-color: var(--ink-70); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { color: var(--on-accent); opacity: .88; border-color: var(--accent); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-quiet { border-color: transparent; color: var(--ink-70); padding: 0 10px; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-align: left; justify-self: start; }

/* forms */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; color: var(--ink-70); }
.input { width: 100%; min-height: 44px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); }
.input::placeholder { color: #7d7d7d; }
.input:focus-visible { outline-offset: 0; border-color: var(--accent); }
textarea.input { min-height: 72px; resize: vertical; }
.hint { font-size: 14px; color: var(--ink-55); }
.msg { padding: 12px 14px; border: 1px solid var(--line-strong); border-left: 3px solid var(--warn); border-radius: var(--radius); background: var(--panel); font-size: 15px; }
.msg-bad { border-left-color: var(--bad); } .msg-good { border-left-color: var(--good); } .msg-info { border-left-color: var(--accent); }

/* brand lockup */
.lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.lockup:hover { color: var(--ink); }
.lockup b { font-size: 20px; letter-spacing: -.01em; line-height: 1; }
.lockup small { display: block; font-size: 12px; color: var(--ink-55); line-height: 1.2; margin-top: 2px; }
.mark { width: 30px; height: 30px; flex: none; }

/* ---------- landing ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 0; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.topbar nav a:not(.btn) { color: var(--ink-70); text-decoration: none; font-size: 16px; }
.topbar nav a:not(.btn):hover { color: var(--ink); }
.hero { display: grid; gap: 40px; padding: 40px 0 72px; align-items: start; }
.hero h1 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.04; letter-spacing: -.028em; font-weight: 700; text-wrap: balance; }
.hero .lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-70); max-width: 34em; text-wrap: pretty; }
.report-form { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); }
.report-form .wide { grid-column: 1 / -1; }
.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.12; letter-spacing: -.02em; max-width: 22em; text-wrap: balance; }
.section .lede { color: var(--ink-70); max-width: 40em; margin-top: 12px; }
.facts { display: grid; gap: 0; margin-top: 36px; border-top: 1px solid var(--line); }
.facts > div { display: grid; gap: 4px 32px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 700; font-size: 19px; }
.facts dd { color: var(--ink-70); max-width: 44em; }
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 20px; }
.plan { display: grid; gap: 12px; align-content: start; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.plan.is-current { border-color: var(--accent); }
.plan h3 { font-size: 20px; }
.plan .price { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.plan .price small { font-size: 15px; font-weight: 400; color: var(--ink-55); letter-spacing: 0; }
.plan li { padding: 5px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-70); }
.seg { display: inline-flex; justify-self: start; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; }
.seg button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-70); font-size: 15px; }
.seg button[aria-pressed='true'] { background: var(--ink); color: #000; font-weight: 700; }
.footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--ink-55); font-size: 15px; }
.footer .cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer a { color: var(--ink-70); }
.footer li { padding: 3px 0; }

/* ---------- the sieve stage (the one orchestrated motion moment) ---------- */
.sieve { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); min-width: 0; }
.sieve-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-55); }
.sieve-q { padding: 16px 18px 0; font-weight: 700; }
.sieve-answer { padding: 10px 18px 18px; color: var(--ink-70); font-size: 16px; max-height: 15.5em; overflow: hidden; position: relative; white-space: pre-wrap; }
.sieve-answer.is-long::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3.2em; background: linear-gradient(transparent, var(--panel)); }
.hit { position: relative; color: var(--ink); font-weight: 700; white-space: nowrap; }
.hit::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink-55); transform-origin: left; }
.hit.is-you::after { background: var(--accent); }
.sieve-out { display: grid; gap: 18px; padding: 18px; }
.sieve-out h3 { font-size: 14px; font-weight: 400; color: var(--ink-55); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 3px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 15px; background: var(--bg); max-width: 100%; }
.chip .pos { color: var(--ink-55); font-variant-numeric: tabular-nums; }
.chip.is-you { border-color: var(--accent); color: var(--accent); }
.chip.is-you .pos { color: var(--accent); }
.chip.is-tracked { border-style: dashed; }
.sieve.is-playing .sieve-answer { animation: cs-fade var(--motion-300) var(--ease-out) both; }
.sieve.is-playing .hit::after { animation: cs-underline var(--motion-300) var(--ease-out) both; animation-delay: 350ms; }
.sieve.is-playing .mesh { animation: cs-fade var(--motion-200) var(--ease-out) both; animation-delay: 500ms; }
.sieve.is-playing .chip { animation: cs-drop var(--motion-300) var(--ease-out) both; animation-delay: calc(700ms + var(--i, 0) * 90ms); }
.chip:nth-child(1) { --i: 0; } .chip:nth-child(2) { --i: 1; } .chip:nth-child(3) { --i: 2; } .chip:nth-child(4) { --i: 3; } .chip:nth-child(5) { --i: 4; } .chip:nth-child(6) { --i: 5; } .chip:nth-child(7) { --i: 6; } .chip:nth-child(n+8) { --i: 7; }
.sieve-out > div:nth-child(2) .chip { animation-delay: calc(1100ms + var(--i, 0) * 90ms); }
@keyframes cs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cs-underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cs-drop { from { opacity: 0; transform: translateY(-22px); } to { opacity: 1; transform: translateY(0); } }

/* progress (functional: shows ongoing work) */
.progress { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); }
.progress li { display: flex; gap: 10px; align-items: baseline; color: var(--ink-55); font-size: 15px; }
.progress li.is-on { color: var(--ink); }
.progress li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink-55); flex: none; transform: translateY(-1px); }
.progress li.is-on::before { background: var(--accent); border-color: var(--accent); animation: cs-pulse 1200ms ease-in-out infinite; }
.progress li.is-done::before { background: var(--ink-55); }
@keyframes cs-pulse { 50% { opacity: .35; } }

/* ---------- results, tables, metrics ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 20px; min-width: 0; }
.panel > h2, .panel > h3 { font-size: 18px; margin-bottom: 4px; }
.grid-2 { display: grid; gap: 16px; } .grid-3 { display: grid; gap: 16px; }
.figure { font-size: clamp(44px, 7vw, 72px); font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.figure-2 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.ival { position: relative; height: 22px; margin: 10px 0 4px; }
.ival::before { content: ''; position: absolute; left: 0; right: 0; top: 7px; height: 7px; background: var(--mesh-dim) 0 0 / 10px 7px; }
.ival-band { position: absolute; top: 5px; height: 11px; background: rgba(0, 240, 255, .22); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.ival-point { position: absolute; top: 0; width: 3px; height: 22px; margin-left: -1.5px; background: var(--ink); }
.ival-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-55); }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; color: var(--ink-70); white-space: nowrap; }
.tag-you { border-color: var(--accent); color: var(--accent); }
.tag-good { border-color: var(--good); color: var(--good); } .tag-bad { border-color: var(--bad); color: var(--bad); } .tag-warn { border-color: var(--warn); color: var(--warn); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 400; color: var(--ink-55); font-size: 13px; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td:last-child, .table th:last-child { padding-right: 0; }
.table .r { text-align: right; }
.table-scroll { overflow-x: auto; }
.bar { height: 8px; background: rgba(255, 255, 255, .08); border-radius: 2px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--ink-55); transform-origin: left; }
.bar.is-you > i { background: var(--accent); }
.split { display: flex; height: 10px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.split i { display: block; height: 100%; } .split .pos-s { background: var(--good); } .split .neu-s { background: var(--ink-55); } .split .neg-s { background: var(--bad); }
.dots { display: flex; flex-wrap: wrap; gap: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink-55); }
.dot.is-hit { background: var(--accent); border-color: var(--accent); }
.chart { width: 100%; min-width: 560px; height: auto; display: block; }
.chart text { fill: var(--ink-55); font-size: 11px; font-family: inherit; }
.empty { display: grid; gap: 12px; justify-items: start; padding: 36px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty h2, .empty h3 { font-size: 22px; }
.empty p { color: var(--ink-70); max-width: 34em; }
.answer-text { white-space: pre-wrap; color: var(--ink-70); font-size: 16px; max-width: 46em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--ink-55); } .kv dd { min-width: 0; overflow-wrap: anywhere; }
details.acc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
details.acc > summary { cursor: pointer; padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; list-style: none; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > .acc-body { padding: 0 18px 18px; display: grid; gap: 16px; }
.check { display: grid; grid-template-columns: 72px 1fr; gap: 4px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .fix { color: var(--ink); } .check p { font-size: 15px; color: var(--ink-70); }

/* ---------- app shell ---------- */
.shell { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1fr); }
.side { padding: 16px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.side nav { display: flex; flex-wrap: wrap; gap: 4px; }
.side nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius); color: var(--ink-70); text-decoration: none; font-size: 15px; }
.side nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.side nav a[aria-current='page'] { color: var(--ink); font-weight: 700; background: rgba(0, 240, 255, .1); box-shadow: inset 2px 0 0 var(--accent); }
.side-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; color: var(--ink-55); }
.main { padding: 24px 20px 64px; min-width: 0; display: grid; gap: 24px; align-content: start; }
.page-head { display: grid; gap: 10px; }
.page-head h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.02em; line-height: 1.1; }
.page-head p { color: var(--ink-70); max-width: 44em; }
.view { animation: cs-fade var(--motion-200) var(--ease-out) both; display: grid; gap: 24px; min-width: 0; }
.prompt-row { display: grid; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.prompt-row:first-child { border-top: 1px solid var(--line); }
.loading { color: var(--ink-55); padding: 24px 0; }

@media (min-width: 720px) {
  .facts > div { grid-template-columns: 260px 1fr; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sieve-out { grid-template-columns: 1fr 1fr; }
  .prompt-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 56px; padding-top: 56px; }
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
  .main { border-left: 1px solid var(--line); }
  .side { border-bottom: 0; align-content: start; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px; gap: 22px; }
  .side nav { display: grid; gap: 2px; }
  .side-foot { display: grid; margin-top: auto; }
  .main { padding: 36px 40px 80px; }
  .main > * { max-width: 1020px; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .report-form { grid-template-columns: 1fr; padding: 16px; }
  .panel { padding: 16px; }
  .check { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 56px; }
  .side { padding: 14px 16px; }
}

/* Reduced motion: no translate or scale, no stagger, no pulsing; state is always also in text. */
@media (prefers-reduced-motion: reduce) {
  .sieve.is-playing .chip, .sieve.is-playing .hit::after, .sieve.is-playing .mesh, .sieve.is-playing .sieve-answer, .view { animation: cs-fade var(--motion-100) linear both; animation-delay: 0ms; transform: none; }
  .progress li.is-on::before { animation: none; }
  .btn { transition: none; } .btn:active { transform: none; }
}
