/* quibble.fyi — tokens come from the mark (docs/brand.md, "Visual identity"). */
:root {
  --teal: #14b8a6;
  --teal-ink: #0f766e;
  --emerald: #10b981;
  --coral: #f43f5e;
  --paper: #fffdf9;
  --ink: #1f2a2e;
  --muted: #56666b;
  --line: #e6e0d6;
  --card: #ffffff;
  --tint: #eaf7f5;
  --shadow: 0 1px 0 rgba(31, 42, 46, 0.04), 0 12px 32px -18px rgba(15, 118, 110, 0.35);
  --radius-bubble: 22px;
  --measure: 38rem;
  --gutter: clamp(16px, 5vw, 56px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --teal-ink: #5eead4;
    --paper: #13201f;
    --ink: #edf4f2;
    --muted: #a3b5b2;
    --line: #2a3a39;
    --card: #1a2a29;
    --tint: #16302d;
    --shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --teal-ink: #5eead4;
  --paper: #13201f;
  --ink: #edf4f2;
  --muted: #a3b5b2;
  --line: #2a3a39;
  --card: #1a2a29;
  --tint: #16302d;
  --shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---- A/B: hide every variant that wasn't chosen ------------------------
   Hiding, never showing, so each element keeps its own display. Without JS
   the defaults (nitpicks / section / quiet) remain. */
html[data-h]:not([data-h="nitpicks"]) [data-v-h="nitpicks"],
html:not([data-h="gripes"]) [data-v-h="gripes"],
html:not([data-h="petty"]) [data-v-h="petty"],
html:not([data-h="bugs"]) [data-v-h="bugs"],
html:not([data-h="ugh"]) [data-v-h="ugh"],
html[data-a]:not([data-a="section"]) [data-v-a="section"],
html:not([data-a="story"]) [data-v-a="story"],
html:not([data-s="signature"]) [data-v-s="signature"],
html[data-s]:not([data-s="quiet"]) [data-v-s="quiet"] { display: none !important; }

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* an author display rule must never un-hide */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Recursive", ui-sans-serif, system-ui, sans-serif;
  font-variation-settings: "CASL" 0.25, "MONO" 0;
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: var(--teal-ink); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
code {
  font-family: "Recursive", ui-monospace, monospace;
  font-variation-settings: "MONO" 1, "CASL" 0;
  font-size: 0.88em;
  background: var(--tint);
  padding: 0.08em 0.35em;
  border-radius: 6px;
}
h1, h2, h3 { font-variation-settings: "CASL" 1, "MONO" 0; line-height: 1.12; margin: 0; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 780; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
.fine { font-size: 0.92rem; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 16px; background: var(--card); padding: 8px 12px; z-index: 10; }

main > section { padding: clamp(56px, 9vw, 112px) var(--gutter) 0; max-width: 76rem; margin: 0 auto; }

/* ---- Header ------------------------------------------------------------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter); max-width: 76rem; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-weight: 800; font-size: 1.3rem; font-variation-settings: "CASL" 1;
}
.brand .tld { color: var(--teal-ink); }
.top nav { display: flex; gap: clamp(14px, 3vw, 28px); font-size: 1rem; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.top nav a:hover { color: var(--teal-ink); }

/* ---- Buttons ------------------------------------------------------------ */
.button {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--teal-ink); color: #fff;
  font: inherit; font-weight: 700; font-variation-settings: "CASL" 0.6;
  padding: 0.8em 1.35em; border-radius: 999px; text-decoration: none;
  box-shadow: 0 2px 0 rgba(15, 118, 110, 0.35);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .button { color: #062421; } }
:root[data-theme="dark"] .button { color: #062421; }
.button:hover { filter: brightness(1.06); }
.button:active { transform: translateY(1px); }
.button[disabled] { opacity: 0.6; cursor: progress; }
.quiet-link { font-weight: 600; }

/* ---- Hero --------------------------------------------------------------- */
.hero {
  display: grid; gap: clamp(40px, 6vw, 72px); align-items: center;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
}
main > .hero { padding-top: clamp(32px, 6vw, 80px); }
.headline {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  font-weight: 860;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin-bottom: 0.45em;
  text-wrap: balance;
}
.headline .line { display: inline-block; }
.lede { font-size: clamp(1.15rem, 1.9vw, 1.35rem); max-width: var(--measure); }
.actions { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin-top: 1.6em; }

.remark {
  margin: 2.2em 0 0; max-width: 26rem;
}
.remark blockquote {
  position: relative; margin: 0 0 0.6em; display: inline-block;
  background: var(--tint); padding: 0.55em 1em; border-radius: 18px 18px 18px 4px;
  font-variation-settings: "CASL" 1; font-weight: 600;
}
.remark figcaption { font-size: 0.9rem; color: var(--muted); }
.remark button {
  font: inherit; font-weight: 700; color: var(--teal-ink); background: none; border: 0;
  padding: 0 0 0 0.4em; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em;
}

/* The one orchestrated moment: the complaint is said, then it becomes an issue. */
.hero-art { position: relative; display: grid; gap: 26px; justify-items: start; }
.said {
  position: relative; margin: 0 0 0 4%;
  max-width: 21rem;
  border: 3px solid var(--teal); border-radius: var(--radius-bubble);
  background: var(--card);
  padding: 0.8em 1.1em;
  font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 650;
  font-variation-settings: "CASL" 1;
}
.said .tail { /* drawn like the mark's tail */
  position: absolute; right: 40px; bottom: -28px; width: 34px; height: 30px; overflow: visible;
}
.said .tail path { fill: var(--card); stroke: var(--teal); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; transform: translateY(-2.5px); }
.issue {
  width: 100%; max-width: 30rem; justify-self: end;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 1.1em 1.25em; box-shadow: var(--shadow);
  font-family: "Recursive", ui-monospace, monospace;
  font-variation-settings: "MONO" 1, "CASL" 0; font-size: 0.86rem; line-height: 1.55;
}
.issue-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5em; font-variation-settings: "MONO" 0, "CASL" 0; }
.issue-title .num { color: var(--muted); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0.8em; }
.chip {
  font-size: 0.78rem; font-weight: 700; padding: 0.1em 0.65em; border-radius: 999px;
  background: var(--tint); color: var(--teal-ink); font-variation-settings: "MONO" 0, "CASL" 0.5;
}
.chip-marker { background: var(--teal); color: #fff; }
.chip-dropped { background: none; color: var(--coral); text-decoration: line-through; border: 1.5px dashed var(--coral); }
.issue-body { list-style: none; margin: 0 0 0.7em; padding: 0; color: var(--muted); }
.issue-body li { overflow-wrap: anywhere; }
.issue-body li::before { content: "- "; }
.diag { margin: 0; color: var(--ink); font-weight: 600; }
.diag span { display: block; font-weight: 400; color: var(--coral); overflow-wrap: anywhere; margin-top: 0.25em; }

@media (prefers-reduced-motion: no-preference) {
  .said { animation: say 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.15s both; }
  .issue { animation: file 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.9s both; }
  @keyframes say { from { opacity: 0; transform: scale(0.85) translateY(8px); } }
  @keyframes file { from { opacity: 0; transform: translateY(18px); } }
}

/* ---- Agentic story (variant "story") ------------------------------------ */
.agentic-story {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px 48px; align-items: baseline;
}
.agentic-story p { max-width: var(--measure); }

/* ---- Captures ----------------------------------------------------------- */
.captures h2 { margin-bottom: 1.2em; }
.capture-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 28px 32px;
}
.capture-grid > div { border-top: 3px solid var(--teal); padding-top: 0.9em; }
.capture-grid > div:nth-child(3) { border-top-color: var(--coral); } /* when something broke */
.capture-grid h3 { margin-bottom: 0.4em; }
.capture-grid p { color: var(--muted); font-size: 1rem; }

/* ---- FYI sections ------------------------------------------------------- */
.fyi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px 56px; align-items: start; }
.fyi h2 { grid-column: 1; grid-row: 1; }
.fyi-body { grid-column: 2; grid-row: 1 / span 3; max-width: var(--measure); }
.fyi-tag {
  position: relative; display: inline-block; vertical-align: 0.12em;
  font-size: 0.55em; font-weight: 800; letter-spacing: 0.02em;
  color: #fff; background: var(--teal-ink);
  padding: 0.12em 0.55em 0.16em; margin-right: 0.3em;
  border-radius: 10px 10px 10px 2px;
  font-variation-settings: "CASL" 1;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fyi-tag { color: #062421; } }
:root[data-theme="dark"] .fyi-tag { color: #062421; }

.paths { grid-column: 1; grid-row: 2; margin: 0.8em 0 0; display: grid; gap: 22px; align-content: start; }
.path figcaption { font-size: 0.9rem; font-weight: 700; color: var(--muted); margin-bottom: 0.4em; }
.path ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; }
.path li {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0.3em 0.9em; font-size: 0.95rem; font-weight: 600;
}
.path li + li::before { content: ""; display: inline-block; width: 18px; height: 2px; background: var(--line); margin: 0 10px 0 -26px; vertical-align: middle; }
.path li + li { margin-left: 18px; }
.hop-them { border-color: var(--coral) !important; border-style: dashed !important; color: var(--coral); }
.hop-you { border-color: var(--teal) !important; background: var(--tint) !important; color: var(--teal-ink); }

/* ---- Bands and FYI art: break the rhythm ------------------------------- */
/* Full-bleed colour behind a width-constrained section, with no extra markup. */
.band-tint, .band-ink {
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(0 -100vmax);
  background: var(--band);
  padding-bottom: clamp(56px, 9vw, 112px) !important;
  margin-top: clamp(56px, 9vw, 112px) !important;
}
.band-tint { --band: var(--tint); }
.band-ink { --band: #0f2927; color: #e8f3f1; }
.band-ink .fyi-tag { background: var(--teal); color: #062421; }
.band-ink .path li { background: #163a37; border-color: #2c5451; color: #e8f3f1; }
.band-ink .path figcaption { color: #9fc1bc; }
.band-ink .hop-them { color: #fda4af; border-color: #fb7185 !important; }
.band-ink .hop-you { background: #115e56 !important; color: #ccfbf1; border-color: var(--teal) !important; }
.band-ink .path li { font-size: 1.05rem; padding: 0.45em 1.1em; }

.fyi-art { grid-column: 1; grid-row: 2; margin: 0.8em 0 0; }
.art-label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-bottom: 0.35em; }
.chips-art .art-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 1.1em; }
.chips-art .art-label { flex-basis: 100%; margin: 0; }
.chips-art .chip { font-size: 0.95rem; padding: 0.2em 0.85em; }
.reported-art p { margin: 0 0 1em; }
.reported-art code { display: block; font-size: 0.8rem; padding: 0.6em 0.9em; border-radius: 10px; overflow-wrap: anywhere; background: var(--card); border: 1.5px solid var(--line); }
.reported-art p:last-child code { border-style: dashed; }
.fyi-mark { position: relative; }
.big-mark { grid-column: 1; width: clamp(120px, 18vw, 220px); height: auto; margin-top: 1.5em; transform: rotate(-6deg); }

/* ---- Also in the box --------------------------------------------------- */
.box h2 { margin-bottom: 1.2em; }
.box-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 26px 40px; }
.box-grid h3 { margin-bottom: 0.35em; }
.box-grid h3 code { font-size: 0.95em; }
.box-grid p { color: var(--muted); font-size: 1rem; margin: 0; }

/* ---- Demo --------------------------------------------------------------- */
.demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px 56px; }
.demo-intro p { max-width: var(--measure); }
.demo-intro h2 { margin-bottom: 0.6em; }
.demo .try { font-weight: 600; }
.demo-stage { grid-column: 2; display: grid; gap: 20px; align-content: start; }
.stage-guide[hidden] { display: none; }
.stage-guide { font-size: 1rem; }
.status { font-weight: 700; }
.status.ok { color: var(--emerald); }
.status.bad { color: var(--coral); }
.counter strong { font-size: 1.4em; color: var(--emerald); font-variation-settings: "MONO" 1; }
.counter.leaked strong { color: var(--coral); }
.counter-why { font-size: 0.9rem; color: var(--muted); margin-top: -0.4em; }
.leaks { font-size: 0.85rem; color: var(--coral); overflow-wrap: anywhere; }
.filed { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 20px; align-content: start; }
.filed .empty {
  border: 2px dashed var(--line); border-radius: 14px; padding: 2em 1.5em; color: var(--muted); margin: 0;
}
.filed .issue { max-width: none; justify-self: stretch; }
.watch { margin: 0; }
.watch video { width: 100%; height: auto; display: block; border-radius: 14px; border: 1.5px solid var(--line); box-shadow: var(--shadow); background: var(--card); }
.watch figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.6em; }
.filed .tracker-name { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 0.4em; font-variation-settings: "MONO" 0; }
.filed .rendered { font-family: "Recursive", ui-sans-serif, sans-serif; font-variation-settings: "MONO" 0, "CASL" 0; font-size: 0.95rem; }
.filed .rendered ul { padding-left: 1.2em; margin: 0.4em 0; }
.filed .rendered img { max-width: 100%; }
.filed pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: inherit; }
.filed .view-toggle { font: inherit; font-size: 0.8rem; margin-top: 0.8em; background: none; border: 0; padding: 0; color: var(--teal-ink); text-decoration: underline; cursor: pointer; }
.dropped-note { font-size: 0.85rem; color: var(--coral); margin: 0 0 0.6em; font-variation-settings: "MONO" 0; }

/* ---- Proof, trackers, early access -------------------------------------- */
.trackers table { border-collapse: collapse; margin: 1.2em 0 1em; min-width: min(100%, 26rem); }
.trackers th, .trackers td { text-align: left; padding: 0.55em 1.6em 0.55em 0; border-bottom: 1.5px solid var(--line); }
.trackers th { font-size: 0.9rem; color: var(--muted); font-weight: 700; }
.trackers td:last-child { color: var(--emerald); font-weight: 700; }
.trackers td.untested { color: var(--muted); font-weight: 600; }
.early {
  margin-top: clamp(56px, 9vw, 112px) !important;
  background: var(--tint); border-radius: 28px 28px 28px 6px;
  padding: clamp(32px, 5vw, 56px) !important;
  max-width: calc(76rem - 2 * var(--gutter)) !important;
  margin-left: max(var(--gutter), calc((100% - 76rem) / 2 + var(--gutter))) !important;
  margin-right: max(var(--gutter), calc((100% - 76rem) / 2 + var(--gutter))) !important;
}
.early p { max-width: var(--measure); }
.early h2 { margin-bottom: 0.5em; }
.trackers .fine { max-width: 44rem; }

/* ---- Footer ------------------------------------------------------------- */
.foot { max-width: 76rem; margin: 0 auto; padding: 56px var(--gutter) 72px; }
.foot .fine { max-width: 44rem; }

/* ---- Review dialog ------------------------------------------------------ */
.review { width: min(960px, 94vw); height: min(80vh, 760px); padding: 0; border: 0; border-radius: 16px; background: var(--card); color: var(--ink); }
.review::backdrop { background: rgba(19, 32, 31, 0.55); }
.review-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1.5px solid var(--line); font-size: 0.95rem; font-weight: 700; }
.review-bar button { font: inherit; font-weight: 700; border: 0; background: var(--tint); color: var(--teal-ink); padding: 0.3em 0.9em; border-radius: 999px; cursor: pointer; }
.review iframe { width: 100%; height: calc(100% - 50px); border: 0; background: #fff; }

/* ---- Narrow screens ----------------------------------------------------- */
@media (max-width: 820px) {
  .hero, .fyi, .demo, .agentic-story { grid-template-columns: minmax(0, 1fr); }
  .demo-stage { grid-column: 1; }
  .fyi h2, .fyi-body, .paths, .fyi-art { grid-column: 1; grid-row: auto; }
  .big-mark { width: 110px; }
  .issue { justify-self: stretch; }
  .said { margin-left: 0; }
}
@media (max-width: 420px) {
  .top nav a[href="#demo"] { display: none; }
}
