/* yakfind.com. Colours come from the logo: wordmark navy and blue, the yak's tweed, and the
   logo's paper, which the page background matches so the mascot sits on it without a box.
   Fonts are served from this site (assets/fonts, SIL OFL), so pages make no third-party requests. */
@font-face { font-family: "Rubik"; src: url(/assets/fonts/rubik-var.woff2) format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(/assets/fonts/source-sans-3-var.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(/assets/fonts/source-sans-3-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/assets/fonts/plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/assets/fonts/plex-mono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #f9f7f1;
  --paper-2: #f0ebdf;
  --card: #ffffff;
  --ink: #16212b;
  --ink-2: #46525e;
  --blue: #1a6cba;
  --blue-dark: #12528f;
  --tweed: #6e5536;
  --line: #dcd4c4;
  --mark: #f6d776;
  --focus: #a2541c;
  --display: "Rubik", "Segoe UI", system-ui, sans-serif;
  --text: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --wrap: min(1200px, 100% - 2 * var(--gutter));
  color-scheme: light;
}
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 400 1rem/1.6 var(--text); font-size: clamp(1rem, .95rem + .25vw, 1.125rem); color: var(--ink); background: var(--paper); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 1.4rem + 4vw, 4.4rem); font-weight: 700; line-height: 1.02; letter-spacing: -.025em; margin: 0 0 1.25rem; }
h2 { font-size: clamp(1.85rem, 1.25rem + 2.3vw, 2.9rem); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; margin: 0 0 1rem; }
h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); font-weight: 600; line-height: 1.25; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }
a { color: var(--blue-dark); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.small { font-size: .9em; color: var(--ink-2); }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: var(--gutter); }
.wrap, .site-header .bar, .site-footer .bar, main:not(.home) { width: var(--wrap); margin-inline: auto; }

/* Buttons and forms */
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; padding: .6rem 1.2rem;
  font: 600 1.05rem/1.2 var(--text); color: #fff; background: var(--blue); border: 2px solid var(--blue); border-radius: .5rem; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.ghost { background: transparent; color: var(--blue-dark); }
.button.ghost:hover { background: var(--card); }
.button.small { min-height: 2.25rem; padding: .35rem .9rem; font-size: .95rem; }
button:disabled { opacity: .55; cursor: default; }
button.link { background: none; border: 0; min-height: 0; padding: 0; color: var(--blue-dark); font-weight: 600; text-decoration: underline; text-underline-offset: .2em; }
button.link:hover { background: none; text-decoration-thickness: 2px; }
form { margin: 1.2rem 0; }
label { display: block; margin-bottom: .7rem; font-weight: 600; }
input, select, textarea { display: block; width: 100%; padding: .6rem .7rem; border: 1px solid #8a948f; background: var(--card); border-radius: .4rem; font: inherit; color: var(--ink); }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; flex-wrap: wrap; padding-block: .6rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand-head { width: auto; height: 3rem; }
.brand-word { width: auto; height: 1.65rem; }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem 1.4rem; margin-left: auto; }
.site-header nav a:not(.button) { color: var(--ink); text-decoration: none; font-weight: 600; }
.site-header nav a:not(.button):hover { color: var(--blue-dark); text-decoration: underline; }
.site-footer { border-top: 1px solid var(--line); margin-top: 0; }
.site-footer .bar { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding-block: 1.5rem 2.5rem; color: var(--ink-2); }
.site-footer .brand-name { font-family: var(--display); font-weight: 600; color: var(--ink); margin-right: auto; }
.site-footer a { color: var(--ink-2); }

/* Home page sections */
.home > section { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.home > .band { background: var(--paper-2); border-block: 1px solid var(--line); }
.section-lede { max-width: 44rem; font-size: 1.1em; color: var(--ink-2); margin-bottom: 2rem; }

/* Hero: the yak examines a real result from the sample matter. */
.home > .hero { padding-block: clamp(2rem, 1rem + 4vw, 4.5rem) clamp(3rem, 2rem + 4vw, 5.5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.lede { font-size: 1.2em; color: var(--ink-2); max-width: 36rem; margin-bottom: 1.75rem; }
.hero-search { margin: 0 0 1.75rem; max-width: 40rem; }
.hero-search label { font-weight: 600; color: var(--tweed); margin-bottom: .45rem; }
.hero-field { display: flex; gap: .5rem; padding: .4rem; background: var(--card); border: 2px solid var(--ink); border-radius: .7rem; box-shadow: 0 .35rem 0 var(--paper-2); }
.hero-field:focus-within { border-color: var(--blue); }
.hero-field textarea { flex: 1; min-width: 0; border: 0; padding: .45rem .6rem; font: 500 1rem/1.45 var(--mono); background: transparent; resize: none; }
.hero-field textarea:focus-visible { outline: none; }
.hero-field button { align-self: center; }
.hero-field button { flex: none; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; max-width: 38rem; }
.facts li { position: relative; padding-left: 1.6rem; color: var(--ink-2); }
.facts li::before { content: ""; position: absolute; left: .1rem; top: .5em; width: .75rem; height: .45rem; border: solid var(--tweed); border-width: 0 0 3px 3px; transform: rotate(-45deg); }
.facts strong { color: var(--ink); }
.hero-scene { position: relative; margin: 0; padding-bottom: 11rem; }
.mascot { display: block; width: min(100%, 31rem); height: auto; margin-left: auto; }
.evidence { position: absolute; left: 0; right: 6%; bottom: 0; background: var(--card); border: 1px solid var(--line); border-radius: .8rem;
  padding: 1rem 1.15rem .85rem; box-shadow: 0 1.25rem 2.5rem -1rem rgba(70, 52, 30, .35); }
.evidence-file { margin: 0; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.kind { font: 500 .72rem/1 var(--mono); padding: .25rem .35rem; border: 1px solid var(--ink-2); border-radius: .25rem; color: var(--ink-2); }
.evidence-meta { margin: .1rem 0 .6rem; font-size: .9em; color: var(--ink-2); }
.evidence blockquote { margin: 0; border-left: 3px solid var(--tweed); padding-left: .8rem; }
.evidence blockquote p { margin: 0 0 .45rem; font-size: .95em; line-height: 1.5; }
.evidence figcaption { font-size: .85em; color: var(--ink-2); margin-top: .55rem; }
mark { background: var(--mark); color: var(--ink); padding: 0 .1em; border-radius: .15em; }

/* Demo */
.home > .demo-section { margin: 0; }
.demo-section .demo-intro p:not(.small) { font-size: 1.05em; }
.demo-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

/* Keyword search compared with an exact query, on the sample matter. */
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.ladder li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "q n" "bar bar" "why run"; gap: .55rem 1.5rem; align-items: center;
  padding: 1.15rem 1.3rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--paper); }
.ladder li.best { background: var(--card); border: 2px solid var(--blue); }
.ladder code { grid-area: q; font-size: clamp(.95rem, .9rem + .3vw, 1.15rem); font-weight: 500; overflow-wrap: anywhere; }
.ladder .count { grid-area: n; color: var(--ink-2); white-space: nowrap; }
.ladder .count b { font: 700 1.9rem/1 var(--display); color: var(--ink); margin-right: .3rem; }
.ladder .meter { grid-area: bar; height: .5rem; border-radius: 1rem; background: linear-gradient(90deg, var(--tweed) calc(var(--n) / 60 * 100%), var(--line) 0); }
.ladder li.best .meter { background: linear-gradient(90deg, var(--blue) calc(var(--n) / 60 * 100%), var(--line) 0); }
.ladder p { grid-area: why; margin: 0; color: var(--ink-2); }
.ladder .link { grid-area: run; justify-self: end; }

/* A real sequence, so the steps are numbered. */
.steps { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; counter-reset: step; }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: .8rem; padding: 1.35rem; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2.2rem; height: 2.2rem; margin-bottom: .8rem; border-radius: 50%;
  font: 700 1.05rem/1 var(--display); color: #fff; background: var(--ink); }
.steps p { margin: 0; color: var(--ink-2); }

/* Privacy */
.private-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 5vw, 4.5rem); align-items: start; }
.private-grid > div > p { color: var(--ink-2); max-width: 36rem; }
.ledger { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: .8rem; padding: .4rem 1.25rem; }
.ledger div { display: flex; justify-content: space-between; gap: .5rem 1.5rem; flex-wrap: wrap; padding: .8rem 0; border-bottom: 1px dashed var(--line); }
.ledger div:last-child { border-bottom: 0; }
.ledger dt { color: var(--ink-2); }
.ledger dd { margin: 0; font-weight: 700; text-align: right; }
.formats { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.private-grid .formats p { margin: 0; max-width: 62rem; color: var(--ink-2); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: .9rem; padding: 1.5rem 1.4rem 1.25rem; }
.plan.featured { border: 2px solid var(--blue); box-shadow: 0 1.5rem 2.5rem -1.5rem rgba(18, 82, 143, .45); }
.plan .tag { position: absolute; top: -.85rem; left: 1.2rem; margin: 0; padding: .2rem .7rem; font-size: .85rem; font-weight: 700; color: #fff; background: var(--blue-dark); border-radius: 1rem; }
.plan h3 { font-size: 1.45rem; margin-bottom: .2rem; }
.plan .who { color: var(--ink-2); margin-bottom: .8rem; }
.plan .price { margin-bottom: .8rem; color: var(--ink-2); }
.plan .price b { font: 700 2.6rem/1 var(--display); color: var(--ink); letter-spacing: -.02em; margin-right: .25rem; }
.plan ul { margin: 0 0 1.25rem; padding-left: 1.2rem; flex: 1; }
.plan li { margin-bottom: .35rem; }
.plan .button { width: 100%; }
.plan .renew { margin: .6rem 0 0; font-size: .88em; color: var(--ink-2); text-align: center; }
.more-plans { margin-top: 2rem; }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; background: var(--card); border-radius: .6rem; }
caption { text-align: left; font: 600 1.15rem/1.3 var(--display); padding-bottom: .6rem; }
th, td { padding: .75rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .9em; color: var(--ink-2); font-weight: 600; background: var(--paper); }
td:nth-child(n+3) { white-space: nowrap; }
.terms-line { margin: 1.25rem 0 0; color: var(--ink-2); font-size: .95em; }
.download { margin-top: 2.5rem; padding: 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: .9rem; }
.download p { color: var(--ink-2); }
.download p:has(.button) { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; color: var(--ink); }
.download form { max-width: 36rem; }

/* Questions */
.faq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 1rem clamp(2rem, 5vw, 4rem); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0;
  font: 600 clamp(1.05rem, 1rem + .3vw, 1.2rem)/1.35 var(--display); }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; flex: none; font-size: 1.4em; line-height: .9; color: var(--blue); }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { margin: 0 0 1.2rem; color: var(--ink-2); max-width: 46rem; }

/* Closing call to action and the firm pilot */
.closing-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 5vw, 4.5rem); align-items: start; }
.closing p { color: var(--ink-2); max-width: 36rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.pilot { background: var(--card); border: 1px solid var(--line); border-radius: .9rem; padding: 1.4rem; }
.pilot form { margin: 1rem 0 .5rem; }

@media (max-width: 960px) {
  .hero-grid, .private-grid, .faq-grid, .closing-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-scene { max-width: 34rem; margin-inline: auto; width: 100%; }
  .plans, .steps { grid-template-columns: minmax(0, 1fr); }
  .plan.featured { order: -1; }
}
@media (max-width: 600px) {
  .brand-head { height: 2.4rem; }
  .brand-word { height: 1.35rem; }
  .site-header .bar { display: grid; grid-template-columns: 1fr auto; }
  .site-header nav { grid-column: 1 / -1; grid-row: 2; margin-left: 0; gap: .25rem 1.1rem; font-size: .95rem; }
  .hero-field { flex-direction: column; }
  .hero-field button { align-self: stretch; }
  .hero-field button { width: 100%; }
  .hero-scene { padding-bottom: 0; }
  .mascot { width: 75%; margin-inline: auto; }
  .evidence { position: relative; right: auto; margin-top: -3.5rem; }
  .ladder li { grid-template-areas: "q q" "n n" "bar bar" "why why" "run run"; }
  .ladder .link { justify-self: start; }
  .ledger dd { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Legal, support and tutorial pages */
.legal { max-width: 780px; padding-block: 3rem; }
.legal h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.4rem); }
.legal h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.8rem); margin-top: 2.5rem; }
.legal ol li { padding: .35rem 0 .6rem .35rem; }
.legal code { background: #ebe6da; padding: .08em .3em; border-radius: .2em; overflow-wrap: anywhere; }
.intro { padding-block: clamp(2.5rem, 6vw, 5rem); max-width: 46rem; }
.intro p { font-size: 1.1em; color: var(--ink-2); }
.tutorial-index ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; padding: 0; list-style: none; }
.tutorial-index li a { display: block; height: 100%; padding: 1rem; background: var(--card); color: var(--blue-dark); border: 1px solid var(--line); border-radius: .65rem; font-weight: 600; }
.tutorial-index li a:hover { background: #eef3f9; }
@media (max-width: 700px) { .tutorial-index ul { grid-template-columns: 1fr; } }

/* The tutorials' small search form (lesson-form.html, lesson.js) */
.search-example { display: block; background: #192c3d; color: #f8f6ef; border-radius: .8rem; margin: 0 0 1.5rem; padding: 1.2rem clamp(1rem, 4vw, 2.2rem); }
.search-example h2 { font: 600 1.5rem/1.3 var(--display); color: #f8f6ef; letter-spacing: 0; margin: 0 0 .55rem; }
.search-example p { margin: .65rem 0; }
.search-example a { color: #cfe3f7; }
.search-example code { color: #f2dbad; }
.demo-input { display: flex; gap: .65rem; }
.demo-input input { min-width: 0; font-family: var(--mono); }
#demo-results details { padding: .6rem .85rem; margin: .5rem 0; background: var(--paper); color: var(--ink); border-radius: .5rem; }
#demo-results summary { cursor: pointer; font-weight: 600; }
.demo-editor { flex: 1; min-width: 0; position: relative; }
#demo-backdrop, #demo-query { font: 1rem/1.4 var(--mono); padding: .6rem; white-space: pre; }
#demo-backdrop { position: absolute; inset: 1px; padding: .55rem; overflow: hidden; pointer-events: none; color: var(--ink); }
#demo-query { width: 100%; resize: vertical; }
#demo-query.demo-decorated { color: transparent; caret-color: var(--ink); background: transparent; position: relative; }
.demo-editor:has(.demo-decorated) { background: #fff; border-radius: .4rem; }
.query-operator, .query-function { color: var(--blue); font-weight: bold; }
.query-phrase, .query-regex, .query-wildcard { color: #6b4b16; }
.query-error { color: #9c2117; text-decoration: underline wavy; }
.query-help { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.query-help select { width: auto; max-width: 100%; }
.query-suggestions { position: absolute; z-index: 10; top: 100%; left: 0; display: grid; gap: .25rem; padding: .35rem; background: #192c3d; border: 1px solid #dde4e9; border-radius: .4rem; }
.query-suggestions[hidden] { display: none; }
.query-suggestions [aria-current="true"] { outline: 2px solid #ffe08a; }
