/* The Ask page (how-ask-works.html). Loaded after chrome.css, which holds the fonts, the colour tokens, the header
   and the footer; the names below map this page's own roles onto those tokens, so it follows the light and the dark
   theme with the rest of the site. Cobalt is what Ask itself returns, and links and controls. A pale highlighter
   marks the words that matched; grey and dashed is the keyword search Ask is compared with.
   No framework, every chart drawn in HTML and CSS or inline SVG. */
:root {
  --page: var(--paper);      /* the paper */
  --surface: var(--panel);   /* cards and quoted text */
  --band: var(--sunk);       /* the live comparison's band */
  --tint: var(--sunk);       /* tracks, code, quiet fills */
  --line: var(--rule);       /* hairlines */
  --line-2: var(--rule-2);   /* stronger rules, dashed outlines */
  --accent: var(--link);     /* cobalt: Ask's own results, links, controls */
  --accent-2: color-mix(in srgb, var(--link) 80%, var(--ink));   /* hover and pressed */
  --accent-soft: var(--data-soft);
  --accent-ink: var(--link-ink);                                  /* text on the accent */
  --accent-edge: color-mix(in srgb, var(--link) 34%, var(--panel));
  --mark: var(--signal-soft);  /* highlighter: matched words */
  --max: 1180px;
  --gutter: max(18px, env(safe-area-inset-left, 0px));
  --radius: 6px;
  --shadow: 3px 3px 0 var(--rule);
}
@media (min-width: 1240px) { :root { --gutter: 34px; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 16.5px/1.62 var(--sans); font-kerning: normal; overflow-x: hidden; }
@media (min-width: 720px) { body { font-size: 17px; } }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, table, pre, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, pre { font-family: var(--mono); font-size: 0.85em; }
code { background: var(--tint); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; font-size: 1em; }
strong, b { font-weight: 650; }
em { font-style: italic; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 40; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; color: var(--paper); }


/* shared pieces */
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); }
.sec { margin-top: clamp(64px, 9vw, 112px); scroll-margin-top: 16px; }
.sec-h { display: grid; gap: 10px; max-width: 760px; }
.sec-h h2 { font-size: clamp(28px, 1.2rem + 1.9vw, 40px); line-height: 1.12; font-weight: 750; letter-spacing: -0.03em; text-wrap: balance; }
.sec-lede { font-size: 1.06em; color: var(--ink-2); max-width: 66ch; }
.prose { max-width: 70ch; }
.prose > * + * { margin-top: 14px; }
.sec-h + .prose { margin-top: 20px; }
.prose h3 { margin-top: 34px; font-size: 21px; line-height: 1.3; font-weight: 700; letter-spacing: -0.015em; scroll-margin-top: 16px; }
.prose ul.dots { list-style: disc; padding-left: 1.2em; display: grid; gap: 6px; }
.small { font-size: 14px; color: var(--ink-3); }
.caption { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--ink-3); max-width: 70ch; }
.aside { font-size: 14px; color: var(--ink-3); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.method { display: inline-flex; justify-self: start; max-width: 100%; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--tint); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.method::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.method.hand::before { background: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; border-radius: var(--r); font-weight: 650; font-size: 15.5px; text-decoration: none; border: 1px solid var(--line-2); color: var(--ink); background: var(--surface); }
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--signal); border-color: var(--ink); color: var(--signal-ink); }
.btn.primary:hover { background: var(--signal); border-color: var(--ink); color: var(--signal-ink); box-shadow: 3px 3px 0 var(--ink); }

/* hero */
.hero { display: grid; gap: 22px 56px; align-items: end; padding-top: clamp(28px, 6vw, 72px); }
@media (min-width: 980px) { .hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.hero-head { display: grid; gap: 14px; }
.hero-text { display: grid; gap: 18px; }
.hero h1 { font-size: clamp(36px, 1.4rem + 4.2vw, 62px); line-height: 1.03; font-weight: 780; letter-spacing: -0.04em; text-wrap: balance; }
.hero h1 span { color: var(--ink-3); }
.lede { font-size: clamp(17.5px, 1rem + 0.45vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 60ch; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--ink-2); }
.facts b { color: var(--ink); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* the benchmarks: the centre of the page. A bar is drawn from zero to its value (--v, per cent of the track); the
   whisker over it is the 95 % interval (--lo to --hi). */
.bench-sec .sec-h { max-width: 860px; }
.stamp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; font-size: 14px; color: var(--ink-2); }
#measured-on { font-weight: 600; }
.bench-grid { display: grid; gap: 20px; margin-top: 28px; }
@media (min-width: 760px) { .bench-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bench { padding: clamp(20px, 3vw, 30px); display: grid; gap: 14px; align-content: start; min-width: 0; box-shadow: inset 0 4px 0 var(--accent), var(--shadow); }
.bench-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.bench-h h3 { font-size: clamp(22px, 1rem + 1vw, 28px); font-weight: 760; letter-spacing: -0.025em; line-height: 1.15; }
.nq { font-size: 13px; font-weight: 650; color: var(--ink-2); background: var(--tint); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.what { font-size: 14.5px; color: var(--ink-2); }
.what a { white-space: nowrap; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.stat { display: grid; gap: 8px; align-content: start; min-width: 0; }
.stat-k { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.stat-v { font-size: clamp(36px, 1.5rem + 3.2vw, 60px); font-weight: 760; letter-spacing: -0.045em; line-height: 1; color: var(--ink); white-space: nowrap; }
.stat-s { font-size: 13.5px; color: var(--ink-3); line-height: 1.45; }
.stat-s span:first-child { color: var(--ink); font-weight: 650; }
.track { position: relative; height: 10px; border-radius: 4px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v) * 1%); border-radius: 0 4px 4px 0; background: var(--accent); }
.ci { position: absolute; top: -4px; bottom: -4px; left: calc(var(--lo) * 1%); width: calc((var(--hi) - var(--lo)) * 1%); border-inline: 1.5px solid var(--ink); }
.ci::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid var(--ink); }
.method-note { margin-top: 20px; display: grid; gap: 8px; max-width: 82ch; padding: 16px 20px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
#method-line { color: var(--ink); font-weight: 600; }

/* speed */
.speed-sec { margin-top: clamp(48px, 7vw, 80px); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; max-width: 760px; }
.tile { padding: 18px 20px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.tile-v { font-size: clamp(34px, 1.4rem + 2.4vw, 48px); font-weight: 760; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
.tile-k { font-size: 14px; color: var(--ink-3); }

/* the live comparison, on a band of its own */
.try { margin-top: clamp(56px, 8vw, 96px); background: var(--band); border-block: 1px solid var(--line); padding-block: clamp(36px, 6vw, 64px); scroll-margin-top: 0; }
.askbox { display: flex; gap: 8px; margin-top: 22px; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: var(--shadow); max-width: 820px; }
.askbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.askbox input { flex: 1 1 auto; min-width: 0; min-height: 50px; border: 0; background: transparent; font: inherit; font-size: 17.5px; color: var(--ink); padding: 8px 10px 8px 12px; outline: none; }
.askbox input::placeholder { color: var(--ink-3); }
.askbox input::-webkit-search-cancel-button { cursor: pointer; }
.go { flex: none; min-height: 50px; padding: 0 22px; border: 0; border-radius: 4px; background: var(--ink); color: var(--paper); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.go:hover { background: var(--accent-2); }
@media (max-width: 479px) { .askbox input { font-size: 16px; padding-inline: 8px; } .go { padding: 0 16px; } }
.go:disabled { opacity: 0.65; cursor: progress; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; color: var(--ink-3); }
.chips button { min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer; }
.chips button:hover { border-color: var(--accent); color: var(--accent); }
.status { margin-top: 16px; min-height: 1.6em; font-size: 14.5px; color: var(--ink-2); max-width: 90ch; }
.status.error { color: var(--warn); font-weight: 600; }
.status b { color: var(--ink); }
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 18px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; position: sticky; top: 8px; z-index: 3; box-shadow: var(--shadow); }
.ways button { display: grid; gap: 1px; align-content: center; text-align: left; min-height: 54px; padding: 6px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; line-height: 1.25; }
.ways b { font-size: 14px; font-weight: 700; }
.ways span { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.ways button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ways button[aria-pressed="true"] span { color: color-mix(in srgb, var(--paper) 82%, var(--ink)); }
.panes { display: grid; gap: 20px; align-items: start; margin-top: 16px; }
.pane { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; align-content: start; }
.pane.off { display: none; }
.pane.lead { border-color: var(--accent-edge); box-shadow: 0 0 0 1px var(--accent-edge), var(--shadow); }
.pane.base { background: transparent; border-style: dashed; border-color: var(--line-2); box-shadow: none; }
@media (min-width: 1040px) {
  .ways { display: none; }
  .panes { grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.92fr) minmax(0, 0.92fr); gap: 18px; margin-top: 26px; }
  .pane.off { display: grid; }
  .pane.lead { transform: translateY(-6px); }
}
.pane-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pane-h h3 { font-size: 17px; font-weight: 750; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.pane-h .live-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border-radius: 2px; padding: 2px 8px; }
.pane-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.took { flex: none; font-size: 13px; font-weight: 650; color: var(--ink-2); background: var(--tint); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pane[data-state="done"] .took { color: var(--accent-2); background: var(--accent-soft); }
.pane[data-state="failed"] .took, .pane[data-state="limited"] .took { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, var(--panel)); }
.empty { display: grid; gap: 8px; }
.empty i { display: block; height: 12px; border-radius: 6px; background: var(--tint); }
.empty i:nth-child(2) { width: 82%; } .empty i:nth-child(3) { width: 64%; }
ol.slips { display: grid; gap: 10px; counter-reset: n; }
ol.slips > li { counter-increment: n; position: relative; padding: 12px 12px 12px 44px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
ol.slips > li::before { content: counter(n); position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 6px; background: var(--tint); color: var(--ink-2); font: 700 12.5px/22px var(--sans); text-align: center; }
ol.slips.ours > li:first-child { border-color: var(--accent-edge); background: linear-gradient(0deg, var(--surface), var(--surface)), var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
ol.slips.ours > li:first-child::before { background: var(--accent); color: var(--accent-ink); }
ol.slips.theirs > li { background: var(--page); border-style: dashed; border-color: var(--line-2); }
.quote { font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; color: var(--ink); }
ol.slips.theirs .quote { font-size: 14.5px; color: var(--ink-2); }
.quote mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }
.cite { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 8px; font-size: 13px; color: var(--ink-3); }
.cite a { font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.cite a:hover { text-decoration: underline; }
.cite a.rev { font: 400 12px/1.6 var(--mono); color: var(--ink-3); }
.cite .kind { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); background: var(--tint); border-radius: 4px; padding: 1px 6px; }
.more { font-size: 14px; }
.more .aside { margin: 0; }
.ghost { display: grid; gap: 10px; padding: 0 !important; border: 0 !important; background: none !important; }
.ghost::before { content: none !important; }
.ghost i { display: block; height: 64px; border-radius: 4px; background: var(--tint); animation: breathe 1.3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .ghost i { animation: none; } }
.problem { color: var(--warn); }
details.notes { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
details.notes summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
details.notes ul { list-style: disc; padding-left: 1.2em; margin-top: 4px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.try-foot { margin-top: 22px; display: grid; gap: 8px; max-width: 90ch; }

/* what it does not do */
dl.wrong { display: grid; gap: 14px; margin-top: 28px; }
@media (min-width: 820px) { dl.wrong { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
dl.wrong > div { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
dl.wrong dt { font-weight: 720; font-size: 16.5px; letter-spacing: -0.01em; }
dl.wrong dd { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
dl.wrong dd b { color: var(--ink); }

/* use it */
.use { display: grid; gap: 14px; margin-top: 24px; max-width: 860px; }

.earlier { margin-top: clamp(48px, 7vw, 88px); padding-bottom: 40px; font-size: 14px; color: var(--ink-3); }
#marks { font-size: 13px; color: var(--ink-3); margin-top: 40px; max-width: 80ch; }

@media print {
  .try, .ways, .skip, .cta { display: none !important; }
  body { background: #fff; }
  .card, dl.wrong > div { box-shadow: none; }
  .bench { box-shadow: inset 0 4px 0 var(--accent); }
}
@media (forced-colors: active) {
  .fill { forced-color-adjust: none; background: CanvasText; }
}
