/* AniFlow product page.
   Palette is the app's own (frontend/src/styles.css), so the page and the
   screenshots read as one thing. No external requests: system fonts only. */

:root {
  --bg: #1c2027;
  --bg-deep: #161a20;
  --surface: #232932;
  --surface-2: #2c333e;
  --line: #333b48;
  --line-soft: #2a313c;
  --text: #dbe3ee;
  --text-dim: #a9b4c2;
  --text-mute: #7f8a9a;
  --accent: #44a3ff;
  --accent-strong: #7bbcff;
  --accent-ink: #04111f;
  --violet: #8a6cf0;
  --ok: #10c469;
  --warn: #f9c851;
  --bad: #ff6c6c;

  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;

  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: #44a3ff44; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 4px; }

/* ---- header ---------------------------------------------------------- */

.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.top .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 600 18px/1 var(--display); letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.top nav { margin-left: auto; display: flex; gap: 26px; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--text-dim); }
.top nav a:hover { color: var(--text); }
.top .btn { margin-left: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px; border-radius: 8px;
  font: 600 15px/1 var(--sans); text-decoration: none;
  border: 1px solid var(--line); color: var(--text);
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: #4a5566; background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.small { padding: 9px 15px; font-size: 14px; }
.btn svg { width: 17px; height: 17px; fill: currentColor; }

/* ---- hero ------------------------------------------------------------ */

.hero { padding: clamp(56px, 9vw, 112px) 0 0; }
.eyebrow { font: 600 13px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 22px; }
h1 {
  margin: 0; font: 600 clamp(44px, 7.4vw, 96px)/1.0 var(--display);
  letter-spacing: -0.035em; max-width: 12ch;
}
h1 em { font-style: normal; color: var(--accent); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 6vw, 80px); align-items: end; }
.lede { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--text-dim); margin: 0 0 30px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { margin: 18px 0 0; font-size: 14px; color: var(--text-mute); }

.shot {
  margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--bg-deep);
  box-shadow: 0 30px 60px -30px #000a, 0 2px 0 #ffffff08 inset;
}
.shot .bar { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px; border-bottom: 1px solid var(--line-soft); background: var(--surface); font: 12.5px/1 var(--mono); color: var(--text-mute); }
.shot .bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.shot img { width: 100%; }
.hero .shot { margin-top: clamp(48px, 7vw, 88px); }

/* ---- generic sections ------------------------------------------------ */

section { padding: clamp(72px, 10vw, 128px) 0 0; }
.sec-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 6vw, 80px); align-items: start; margin-bottom: clamp(36px, 5vw, 64px); }
.sec-head .num { font: 500 14px/1 var(--mono); color: var(--text-mute); margin: 0 0 18px; }
h2 { margin: 0; font: 600 clamp(30px, 4vw, 50px)/1.08 var(--display); letter-spacing: -0.028em; }
.sec-head p { margin: 0; color: var(--text-dim); font-size: 18px; max-width: 36em; }
.sec-head p + p { margin-top: 1em; }

h3 { margin: 0 0 12px; font: 600 22px/1.25 var(--display); letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
.dim { color: var(--text-dim); }
code, .mono { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { background: var(--surface); border: 1px solid var(--line-soft); padding: .1em .4em; border-radius: 5px; color: var(--accent-strong); }

/* ---- the idea: verdict ledger ---------------------------------------- */

.ledger { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-deep); overflow: hidden; }
.ledger-head { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); background: var(--surface); font: 13px/1.4 var(--mono); color: var(--text-mute); }
.ledger-head b { color: var(--text-dim); font-weight: 500; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 8px 24px; padding: 16px 20px; border-top: 1px solid var(--line-soft); align-items: baseline; }
.row:first-of-type { border-top: 0; }
.row .name { font: 14.5px/1.5 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.row .why { grid-column: 1; font-size: 14.5px; color: var(--text-mute); }
.tag { justify-self: end; grid-row: 1; grid-column: 2; font: 600 12px/1 var(--mono); letter-spacing: .08em; padding: 6px 9px; border-radius: 5px; border: 1px solid; }
.t-ok { color: var(--ok); border-color: #0e9b5466; background: #10c46914; }
.t-no { color: var(--bad); border-color: #b34b4b66; background: #ff6c6c12; }
.t-ig { color: var(--text-mute); border-color: var(--line); }
.t-am { color: var(--warn); border-color: #b8912f66; background: #f9c85112; }

.ledger-foot { padding: 16px 20px; border-top: 1px solid var(--line-soft); font-size: 14.5px; color: var(--text-mute); }

/* ---- feature chapters ------------------------------------------------ */

.chapter { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 84px); align-items: center; padding-top: clamp(64px, 8vw, 104px); }
.chapter.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.chapter.flip .copy { order: 2; }
.chapter .kicker { font: 500 13px/1 var(--mono); color: var(--accent); margin: 0 0 16px; letter-spacing: .02em; }
.chapter .copy > p { color: var(--text-dim); }

.facts { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.facts li { padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 15.5px; line-height: 1.5; color: var(--text-dim); }
.facts li b { color: var(--text); font-weight: 600; }

/* ---- episode states -------------------------------------------------- */

.states { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-deep); }
.states > div { padding: 22px 20px 24px; border-left: 1px solid var(--line-soft); }
.states > div:first-child { border-left: 0; }
.states .s { font: 600 12px/1 var(--mono); letter-spacing: .09em; color: var(--accent-strong); margin: 0 0 12px; }
.states p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-dim); }
.states-extra { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 12px; border: 1px solid var(--line-soft); border-radius: 12px; }
.states-extra > div { padding: 18px 20px; border-left: 1px solid var(--line-soft); }
.states-extra > div:first-child { border-left: 0; }
.states-extra .s { color: var(--text-dim); }

/* ---- dense list ------------------------------------------------------ */

.ruled { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(28px, 6vw, 84px); border-top: 1px solid var(--line); }
.ruled > div { display: grid; grid-template-columns: minmax(0, 1fr); padding: 22px 0 24px; border-bottom: 1px solid var(--line-soft); }
.ruled h3 { font-size: 18px; margin-bottom: 6px; }
.ruled p { margin: 0; color: var(--text-dim); font-size: 16px; line-height: 1.55; }

/* ---- integrations ---------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th, .table td { text-align: left; padding: 16px 20px 16px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table thead th { font: 500 13px/1 var(--mono); color: var(--text-mute); letter-spacing: .04em; border-bottom-color: var(--line); padding-top: 0; }
.table td:first-child { font-weight: 600; white-space: nowrap; color: var(--text); width: 25%; }
.table td { color: var(--text-dim); }
.table td:nth-child(2) { white-space: nowrap; font-family: var(--mono); font-size: 13.5px; color: var(--text-mute); width: 17%; }

/* ---- self-hosting ---------------------------------------------------- */

.host { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 84px); align-items: start; }
pre {
  margin: 0; padding: 22px 24px; overflow-x: auto;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: 12px;
  font: 14px/1.7 var(--mono); color: var(--text-dim);
}
pre .c { color: var(--text-mute); }
pre .k { color: var(--accent-strong); }

.needs { list-style: none; padding: 0; margin: 22px 0 0; border-top: 1px solid var(--line-soft); }
.needs li { padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 15.5px; color: var(--text-dim); }
.needs li b { color: var(--text); font-weight: 600; }

/* ---- closing --------------------------------------------------------- */

.closing { text-align: left; }
.closing .box { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 6vw, 80px); align-items: end; padding: clamp(36px, 6vw, 72px); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.closing h2 { font-size: clamp(32px, 4.6vw, 58px); max-width: 14ch; }
.closing p { color: var(--text-dim); }
.closing .cta { justify-content: flex-start; }
.closing .meta { font: 13.5px/1.7 var(--mono); color: var(--text-mute); margin-top: 16px; }

footer { margin-top: clamp(72px, 10vw, 120px); border-top: 1px solid var(--line-soft); padding: 32px 0 48px; color: var(--text-mute); font-size: 14.5px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 32px; align-items: center; }
footer .brand { font-size: 16px; color: var(--text-dim); }
footer .brand img { width: 24px; height: 24px; border-radius: 6px; }
footer p { margin: 0; max-width: 56ch; }
footer a { color: var(--text-dim); }

.doc-link { margin: 28px 0 0; font-size: 16px; }
.sec-head + .chapter { padding-top: 0; align-items: start; }
.codes { display: grid; gap: 16px; min-width: 0; }
/* hidden until site-config.js sets the GitHub address */
html:not(.has-gh) [data-gh] { display: none; }
.ruled-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(56px, 7vw, 88px); }
.ruled a, .sec-head p a, .chapter + p a { color: var(--accent); }

/* ---- small screens --------------------------------------------------- */

@media (max-width: 920px) {
  .top nav a:not(.btn):not(.keep) { display: none; }
  .hero-grid, .sec-head, .chapter, .chapter.flip, .host, .closing .box { grid-template-columns: minmax(0, 1fr); }
  .chapter.flip .copy { order: 0; }
  .states { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .states > div { border-left: 0; border-top: 1px solid var(--line-soft); }
  .states > div:nth-child(-n+2) { border-top: 0; }
  .states > div:nth-child(even) { border-left: 1px solid var(--line-soft); }
  .states-extra { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .states-extra > div:nth-child(3) { border-left: 0; }
  .states-extra > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .ruled, .ruled-3 { grid-template-columns: minmax(0, 1fr); }
  .table td:nth-child(2) { display: none; }
  .table thead th:nth-child(2) { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .tag { grid-column: 1; grid-row: auto; justify-self: start; }
  .states { grid-template-columns: minmax(0, 1fr); }
  .states > div, .states > div:nth-child(even) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .states > div:first-child { border-top: 0; }
  .table td:first-child { white-space: normal; }
  .top nav a:not(.keep) { display: none; }
  .top nav { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
