/* Corral site. 8px spacing scale; one accent; light by default, dark via tokens. */
:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --ink: #16140f;
  --ink-2: #5a564d;
  --ink-3: #8a857a;
  --line: #e2dccf;
  --accent: #c24a1c;
  --accent-ink: #fff8f1;
  --shadow-lg: 0 1px 2px rgba(22, 20, 15, .06), 0 24px 48px -16px rgba(22, 20, 15, .22), 0 48px 96px -32px rgba(22, 20, 15, .18);
  --shadow-md: 0 1px 2px rgba(22, 20, 15, .06), 0 16px 32px -16px rgba(22, 20, 15, .2);
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s8: 96px; --s10: 128px; --s12: 160px;
  --font: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max: 1200px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12110e; --surface: #1a1915; --ink: #efebe2; --ink-2: #aaa498; --ink-3: #7d786d; --line: #2e2c26;
    --accent: #e36a3a; --accent-ink: #1a0b04;
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 48px -16px rgba(0, 0, 0, .6), 0 48px 96px -32px rgba(0, 0, 0, .5);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 32px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.035em; line-height: 1.02; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: var(--s2); z-index: 10; background: var(--ink); color: var(--bg); padding: var(--s1) var(--s2); border-radius: 8px; }
.skip:focus { left: var(--s2); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--s3); }
.narrow { max-width: 760px; }

/* ------------------------------------------------------------ nav */
.nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid transparent; backdrop-filter: saturate(1.4) blur(10px); }
.nav-in { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -.03em; text-decoration: none; }
.mark {
  width: 20px; height: 20px; border-radius: 5px; background-color: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 2v16M10 2v16M16 2v16M1 7h18M1 13h18' stroke='black' stroke-width='2.6' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 2v16M10 2v16M16 2v16M1 7h18M1 13h18' stroke='black' stroke-width='2.6' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
}
.nav nav { display: flex; align-items: center; gap: var(--s3); font-size: 16px; font-weight: 500; }
.nav nav a:not(.btn) { text-decoration: none; color: var(--ink-2); }
.nav nav a:not(.btn):hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 var(--s3); border-radius: 10px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 16px; text-decoration: none; border: 1px solid var(--ink);
  transition: transform .12s ease, background-color .12s ease;
}
.btn:hover { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink-3); }
.btn-small { height: 40px; padding: 0 var(--s2); font-size: 15px; }

/* ------------------------------------------------------------ hero */
.hero { padding: var(--s10) 0 var(--s8); }
.hero h1 { font-size: clamp(44px, 7.2vw, 84px); max-width: 16ch; }
.lede { margin-top: var(--s3); font-size: clamp(19px, 2vw, 22px); color: var(--ink-2); max-width: 36ch; line-height: 1.45; }
.ctas { margin-top: var(--s5); display: flex; gap: var(--s2); flex-wrap: wrap; }

.composite { position: relative; margin-top: var(--s8); padding-bottom: var(--s6); }
.browser {
  margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow-lg); width: 92%;
}
.browser-bar { height: 40px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); background: var(--surface); }
.url { font-size: 13px; color: var(--ink-3); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 48px; }
.browser img { width: 100%; }
.phone {
  position: absolute; right: 0; bottom: 0; width: 25%; min-width: 150px; margin: 0; padding: 8px; border-radius: 40px;
  background: #0f0e0c; border: 1px solid #2a2823; box-shadow: var(--shadow-lg);
}
.phone img { border-radius: 32px; width: 100%; }

/* ------------------------------------------------------------ features */
.feature { padding: var(--s10) 0; border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s8); align-items: center; }
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.flip .copy { order: 2; }
.copy h2 { font-size: clamp(32px, 4.2vw, 52px); }
.copy p { margin-top: var(--s3); font-size: 19px; color: var(--ink-2); max-width: 40ch; }
.visual { min-width: 0; }
.caption { margin-top: var(--s2); font-size: 14px; line-height: 1.5; color: var(--ink-3); max-width: 64ch; }
.shot { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-md); background: var(--surface); }

/* dedup strip */
.frames { list-style: none; margin: 0; padding: var(--s2); display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s1);
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); }
.frames li { position: relative; }
.frames img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; outline: 2px solid transparent; }
.frames li.kept img { outline-color: var(--accent); outline-offset: 1px; }
.frames li.dup img { opacity: .28; filter: grayscale(1); }
.frames span { position: absolute; left: 6px; bottom: 4px; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.frames li.dup span { color: var(--ink-3); text-shadow: none; }

/* queue */
.queue { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; }
.queue li { display: grid; grid-template-columns: 128px minmax(0, 1fr) 112px; gap: var(--s2); align-items: center; padding: var(--s2); }
.queue li + li { border-top: 1px solid var(--line); }
.queue img { width: 128px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.queue .why { font-weight: 600; font-size: 16px; line-height: 1.3; }
.queue .parts { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.score { display: flex; align-items: center; gap: var(--s1); justify-self: end; }
.score .bar { width: 64px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.score .bar i { display: block; height: 100%; background: var(--accent); }
.score b { font-size: 15px; font-variant-numeric: tabular-nums; width: 3ch; text-align: right; }

/* dataset card */
.card-doc { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); padding: var(--s4); font-size: 15px; }
.card-doc header { border-bottom: 1px solid var(--line); padding-bottom: var(--s2); margin-bottom: var(--s2); }
.card-doc .file { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.card-doc h3 { font-size: 24px; margin-top: 4px; }
.card-doc .meta { margin-top: var(--s1); color: var(--ink-2); font-size: 14px; }
.card-doc h4 { margin: var(--s3) 0 var(--s1); font-size: 15px; font-weight: 650; }
.card-doc table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.card-doc th, .card-doc td { text-align: right; padding: 6px var(--s1); border-bottom: 1px solid var(--line); }
.card-doc th:first-child, .card-doc td:first-child { text-align: left; padding-left: 0; }
.card-doc th { font-weight: 600; color: var(--ink-2); font-size: 13px; }
.card-doc p { margin-top: var(--s2); color: var(--ink-2); }
.card-doc ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.card-doc li { margin: 4px 0; }

/* results */
.results { padding: var(--s10) 0; border-top: 1px solid var(--line); }
.numbers { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.numbers div { padding: var(--s5) var(--s4); display: flex; flex-direction: column-reverse; gap: var(--s1); }
.numbers div + div { border-left: 1px solid var(--line); }
.numbers dd { margin: 0; font-size: clamp(48px, 6vw, 72px); font-weight: 650; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.numbers dd span { font-size: .38em; letter-spacing: -.01em; color: var(--ink-3); font-weight: 500; }
.numbers dt { font-size: 16px; color: var(--ink-2); }
.results .caption { margin-top: var(--s3); }

/* quickstart */
.quick { padding: var(--s10) 0 var(--s12); border-top: 1px solid var(--line); }
.quick h2 { font-size: clamp(32px, 4.2vw, 52px); }
.quick p { margin-top: var(--s2); color: var(--ink-2); font-size: 19px; }
pre { margin: var(--s4) 0 0; padding: var(--s3); background: #16140f; color: #efe9dc; border-radius: 12px; overflow-x: auto; font: 15px/1.7 var(--code); border: 1px solid #16140f; }
@media (prefers-color-scheme: dark) { pre { background: #0b0a08; border-color: var(--line); } }
.small { font-size: 16px !important; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: var(--s5) 0; font-size: 15px; color: var(--ink-2); }
.foot-in { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); align-items: center; }
.logo.small { font-size: 16px; color: var(--ink); }
.logo.small .mark { width: 16px; height: 16px; }
.credits { flex-basis: 100%; font-size: 13px; color: var(--ink-3); margin-top: var(--s1); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .split, .split.flip { grid-template-columns: 1fr; gap: var(--s5); }
  .split.flip .copy { order: 0; }
  .feature, .results, .quick { padding: var(--s8) 0; }
  .hero { padding: var(--s8) 0 var(--s6); }
  .numbers { grid-template-columns: 1fr; }
  .numbers div + div { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap { padding: 0 var(--s2); }
  .nav nav { gap: var(--s2); }
  .nav nav a[href="docs/demo.html"] { display: none; }
  .composite { margin-top: var(--s6); padding-bottom: var(--s8); }
  .browser { width: 100%; border-radius: 10px; }
  .browser-bar { height: 28px; }
  .url { font-size: 11px; padding: 0 16px; }
  .phone { width: 38%; min-width: 0; right: 0; bottom: -8px; padding: 5px; border-radius: 26px; }
  .phone img { border-radius: 21px; }
  .queue li { grid-template-columns: 88px minmax(0, 1fr); }
  .queue img { width: 88px; }
  .queue .score { grid-column: 2; justify-self: start; }
  .card-doc { padding: var(--s2); }
  .numbers div { padding: var(--s4) var(--s3); }
  pre { font-size: 13px; padding: var(--s2); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }
