/*
  Coding Koala family components, v1 (27 Oct 2026). Reads only the names in tokens.css.
  Load order: tokens.css, then components.css, then any page-specific CSS (keep that small).
*/

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: var(--weight-body) var(--text-md)/var(--leading-body) var(--font-sans);
  -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-sm); }
::selection { background: var(--accent-soft); color: var(--ink); }
p { margin: 0 0 var(--space-4); max-width: var(--measure); }
strong { font-weight: var(--weight-strong); }
code, kbd, pre, .mono { font-family: var(--font-mono); font-size: .92em; font-variant-ligatures: none; }
:not(pre) > code { padding: .08em .35em; border-radius: var(--radius-sm); background: var(--sunken); }
.skip { position: absolute; left: -999px; top: var(--space-2); }
.skip:focus { left: var(--space-2); z-index: 10; padding: var(--space-2) var(--space-3); background: var(--surface); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--gutter); }
.read { max-width: var(--read-max); }
.section { padding-block: var(--space-8); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: var(--space-6); max-width: 44rem; }
.split { display: grid; gap: var(--space-6); }
@media (min-width: 60rem) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-8); align-items: start; } }

/* ---------- Type ---------- */
h1, h2, h3, h4 { margin: 0; color: var(--ink); text-wrap: balance; }
.display {
  font-size: var(--text-3xl); line-height: var(--leading-tight); font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display); max-width: 16ch;
}
h2, .h2 { font-size: var(--text-2xl); line-height: 1.12; font-weight: 750; letter-spacing: var(--tracking-heading); margin-bottom: var(--space-4); }
h3, .h3 { font-size: var(--text-xl); line-height: var(--leading-snug); font-weight: 700; letter-spacing: -.01em; margin-bottom: var(--space-2); }
h4, .h4 { font-size: var(--text-md); font-weight: var(--weight-strong); margin-bottom: var(--space-2); }
.lead { font-size: var(--text-lg); line-height: 1.55; color: var(--muted); max-width: 40rem; }
.small { font-size: var(--text-sm); color: var(--muted); }
/* One named kicker per page at most (the hero). Not a label over every section. Its dot is ink, so the orange mark stays single. */
.kicker { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-4); color: var(--ink); font-size: var(--text-sm); font-weight: 700; letter-spacing: .01em; }
.kicker::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--ink); flex: none; }
.accent-text { color: var(--accent-ink); }
/* The orange underline: one phrase per headline, never more. */
.mark { background: linear-gradient(transparent 72%, color-mix(in oklab, var(--brand-navy) 16%, transparent) 72%); padding-inline: .04em; } /* navy tint: keeps orange for the one mark per view */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark { background: linear-gradient(transparent 72%, color-mix(in oklab, var(--brand-navy-light) 28%, transparent) 72%); } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in oklab, var(--canvas) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-4); min-height: 4rem; }
.lockup { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--ink); text-decoration: none; margin-right: auto; }
.lockup-mark { width: 2.1rem; height: auto; filter: var(--logo-filter); }
.lockup-name { display: flex; flex-direction: column; line-height: 1.05; }
.lockup-name b { font-size: 1.2rem; font-weight: 780; letter-spacing: -.02em; }
.lockup-name span { font-size: var(--text-xs); color: var(--muted); font-weight: 500; }
.nav { display: none; gap: var(--space-5); font-size: var(--text-sm); font-weight: 600; }
.nav a { color: var(--ink); text-decoration: none; padding-block: var(--space-2); }
.nav a:hover { color: var(--link); text-decoration: underline; }
@media (min-width: 48rem) { .nav { display: flex; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 2.875rem; padding: .7rem 1.25rem; border-radius: var(--radius-md); border: 1px solid var(--action);
  background: var(--action); color: var(--on-action); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--action-hover); border-color: var(--action-hover); box-shadow: var(--shadow-panel); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-lg { min-height: 3.25rem; padding-inline: 1.6rem; font-size: 1.0625rem; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--surface); border-color: var(--ink); color: var(--ink); }
.btn .arrow { width: 1rem; height: 1rem; flex: none; transition: transform var(--dur-fast) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }
.actions .small { flex-basis: 100%; margin: 0; }

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-7) var(--space-8); }
.hero-grid { display: grid; gap: var(--space-7); align-items: center; }
.hero-grid > *, .split > *, .aq > *, .demo-grid > * { min-width: 0; }
@media (min-width: 64rem) { .hero { padding-block: var(--space-8) var(--space-9); } .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: var(--space-8); } }
.hero .lead { margin-top: var(--space-5); }

/* ---------- Panels (only around real content: a report, a code block, a question) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); }
.panel-pad { padding: var(--space-5); }

/* ---------- Steps: a numbered sequence where order matters ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 var(--space-6) 3.25rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -.15rem; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); border: 2px solid var(--ink); color: var(--ink); font-weight: 750; font-size: var(--text-sm); font-variant-numeric: tabular-nums;
}
.steps > li::after { content: ""; position: absolute; left: 1.08rem; top: 2.25rem; bottom: .25rem; width: 2px; background: var(--line); }
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps > li.is-ours::before { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps h3 { font-size: 1.125rem; margin-bottom: var(--space-1); }
.steps p { color: var(--muted); margin: 0; }
@media (min-width: 60rem) {
  .steps.across { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: var(--space-5); }
  .steps.across > li { padding: 3.25rem 0 0 0; }
  .steps.across > li::after { left: 2.6rem; right: -1rem; top: 1.05rem; bottom: auto; width: auto; height: 2px; }
}

/* ---------- Plain list with ticks (what you get) ---------- */
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.ticks li { position: relative; padding-left: 1.9rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .3rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--ok-soft) no-repeat center / .7rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5 4.8 9 10 3' fill='none' stroke='%231d6b45' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ticks.not li::before { background-color: var(--sunken); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6h6' stroke='%23545a6b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* ---------- Two-column definition list (facts, scope) ---------- */
.facts { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; gap: var(--space-1) var(--space-6); padding-block: var(--space-4); border-bottom: 1px solid var(--line); }
@media (min-width: 48rem) { .facts > div { grid-template-columns: 14rem minmax(0, 1fr); } }
.facts dt { font-weight: var(--weight-strong); }
.facts dd { margin: 0; color: var(--muted); }

/* ---------- Statement band: one per page, navy ---------- */
.band { background: var(--band); color: var(--on-band); padding-block: var(--space-8); }
.band h2 { color: var(--on-band); max-width: 22ch; }
.band p { color: var(--on-band-muted); }
.band .btn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.band .btn:hover { background: color-mix(in oklab, var(--accent) 88%, var(--white)); }
.band a:not(.btn) { color: var(--on-band); }
/* Quiet band: a navy section with no orange fill (Guided Selection's reference-version mention). */
.band.quiet .btn { background: transparent; color: var(--on-band); border-color: color-mix(in oklab, var(--on-band) 45%, transparent); }
.band.quiet .btn:hover { background: color-mix(in oklab, var(--on-band) 10%, transparent); }

/* ---------- Tags ---------- */
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: var(--radius-pill); background: var(--sunken); color: var(--ink); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag-optional { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); }

/* ---------- Notes ---------- */
.note { padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); background: var(--sunken); color: var(--ink); font-size: var(--text-sm); }
.note p:last-child { margin: 0; }
.sample-label { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--muted); font-weight: 600; }
.sample-label::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; border: 1.5px solid var(--muted); }

/* ---------- Price note (public pages carry no dollar amounts) ---------- */
.price-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.price-note b { font-size: var(--text-xl); letter-spacing: -.01em; }
.price-note span { color: var(--muted); }

/* ---------- Questions (FAQ) ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) 0; font-weight: var(--weight-strong); font-size: 1.0625rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 1rem; height: 1rem; margin-top: .25rem; background: var(--muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2v12M2 8h12' stroke='black' stroke-width='1.75' stroke-linecap='round'/%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 16 16'%3E%3Cpath d='M8 2v12M2 8h12' stroke='black' stroke-width='1.75' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform var(--dur-base) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 var(--space-5); color: var(--muted); max-width: var(--measure); }

/* ---------- Footer ---------- */
.site-footer { padding-block: var(--space-7) var(--space-6); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-sm); }
.site-footer .wrap { display: grid; gap: var(--space-4); }
.site-footer p { margin: 0; }
.site-footer .independence { color: var(--ink); }

/* =====================================================================
   RepoKoala signature: the pull request card (report + checks + diff)
   ===================================================================== */
.pr { overflow: hidden; }
.pr-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.pr-state { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: var(--radius-pill); background: var(--ok); color: var(--on-ok); font-size: var(--text-xs); font-weight: 700; }
.pr-title { font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; }
.pr-branch { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); flex-basis: 100%; }
.pr-checks { list-style: none; margin: 0; padding: var(--space-3) var(--space-5); display: grid; gap: var(--space-2); border-bottom: 1px solid var(--line); }
.pr-checks li { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.pr-checks li::before { content: ""; flex: none; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--ok-soft) no-repeat center / .65rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5 4.8 9 10 3' fill='none' stroke='%231d6b45' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.pr-checks li.is-review::before { background: var(--accent); background-image: none; box-shadow: inset 0 0 0 3px var(--accent-soft); } /* the one orange mark in the RepoKoala hero */
.pr-checks li.is-review { font-weight: 650; }
.pr-checks .who { margin-left: auto; color: var(--muted); font-size: var(--text-xs); }
.diff { margin: 0; padding: var(--space-3) 0; background: var(--sunken); font-family: var(--font-mono); font-size: .8125rem; line-height: 1.75; overflow-x: auto; }
.diff div { padding-inline: var(--space-5); white-space: pre; }
.diff .add { background: var(--diff-add-soft, var(--ok-soft)); color: var(--diff-add, var(--ok)); }
.diff .del { background: var(--diff-del-soft, var(--error-soft)); color: var(--diff-del, var(--error)); }
.diff .ctx { color: var(--muted); }
.pr-foot { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; padding: var(--space-3) var(--space-5); font-size: var(--text-xs); color: var(--muted); }
.pr-file { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink); font-weight: 600; }
.pr-file::before { content: ""; width: .8rem; height: 1rem; border-radius: 2px; border: 1.5px solid currentColor; }

/* =====================================================================
   Guided Selection signature: the annotated question
   ===================================================================== */
.aq-wrap { container-type: inline-size; }
.aq { display: grid; gap: var(--space-4); }
@container (min-width: 40rem) { .aq { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: var(--space-5); } }
@container (min-width: 26rem) and (max-width: 39.99rem) { .aq-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.aq-card { padding: var(--space-5); }
.aq-step { font-size: var(--text-xs); color: var(--muted); font-weight: 600; margin: 0 0 var(--space-2); }
.aq-q { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; margin: 0 0 var(--space-4); }
.aq-options { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.aq-options li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: .7rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-md); font-weight: 550; }
.aq-options li.is-picked { border-color: var(--product); box-shadow: inset 0 0 0 1px var(--product); background: var(--product-soft); }
.aq-options li.is-unsure { border-style: dashed; color: var(--muted); }
.aq-by { font-size: var(--text-xs); color: var(--muted); font-weight: 600; }
.aq-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); counter-reset: note; }
.aq-notes li { counter-increment: note; position: relative; padding: var(--space-3) var(--space-4) var(--space-3) 2.6rem; border-radius: var(--radius-md); background: var(--annotation-soft, var(--sunken)); font-size: var(--text-sm); }
.aq-notes li::before { content: counter(note); position: absolute; left: .8rem; top: .75rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center; background: var(--annotation, var(--ink)); color: var(--surface); font-size: .72rem; font-weight: 750; }
.aq-notes b { display: block; color: var(--annotation, var(--ink)); font-size: var(--text-xs); letter-spacing: .01em; margin-bottom: .1rem; }
.aq-notes code { background: transparent; padding: 0; }
.aq-pin { display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--annotation, var(--ink)); color: var(--surface); font-size: .68rem; font-weight: 750; flex: none; }

/* Spec status line on the format site */
.status { display: inline-flex; align-items: center; gap: var(--space-2); padding: .3rem .75rem; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); font-size: var(--text-sm); font-weight: 600; }
.status::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); }

/* ---------- Motion: one authored moment per page (the signature piece settles in) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .settle > * { animation: settle var(--dur-slow) var(--ease-out) both; }
  .settle > *:nth-child(2) { animation-delay: 90ms; }
  .settle > *:nth-child(3) { animation-delay: 180ms; }
  .settle > *:nth-child(4) { animation-delay: 270ms; }
  @keyframes settle { from { transform: translateY(10px); filter: blur(2px); } to { transform: none; filter: none; } } /* content stays visible: no opacity fade */
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Phone refinements ---------- */
.btn { white-space: nowrap; }
.aq-options li > span:first-child { white-space: nowrap; }
@media (max-width: 47.99rem) {
  .site-header .btn { min-height: 2.5rem; padding: .45rem .85rem; font-size: var(--text-sm); }
  .lockup-name span { max-width: 11rem; }
  .pr-checks .who { display: none; }
}
