/* getfaro.dev (§5): faro-dark / faro-light colours and JetBrains Mono (§5.1, §5.2). */

@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/JetBrainsMono-Regular.bab39fa6be.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/JetBrainsMono-Bold.33917edd7e.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/JetBrainsMono-Italic.f37cb91be6.woff2") format("woff2"); }

:root {
  color-scheme: dark light;
  --bg: light-dark(#f7f4ee, #101216);
  --panel: light-dark(#efebe3, #1a1d23);
  --fg: light-dark(#24272e, #e6e6e6);
  --muted: light-dark(#656a73, #7c838f);
  --accent: light-dark(#9a5c06, #f5b94a);
  --border: light-dark(#c9c3b6, #3a3f4a);
  --logo-red: light-dark(#b8352a, #e86b6b);
  --logo-lamp: light-dark(#9c4f08, #f5a742);
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-theme="dark"] { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--sans);
}
@media (min-width: 640px) { body { font-size: 18px; } }

p { margin: 0 0 1rem; max-width: 70ch; }
a { color: var(--accent); }
strong { font-weight: 700; }
em { font-style: italic; }
code, pre, kbd, .wordmark, h1, h2, h3, .tab, .btn, .facts, .hints { font-family: var(--mono); }
code { background: var(--panel); padding: .1em .35em; border-radius: 4px; font-size: .92em; }
pre { margin: 0; font-size: .9rem; line-height: 1.55; overflow-x: auto; }
kbd {
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px;
  padding: 0 .35em; font-size: .85em; background: var(--panel);
}

h1 { font-size: clamp(2.5rem, 7vw, 3.5rem); line-height: 1.1; margin: 0 0 1rem; }
h2 { font-size: 1.5rem; margin: 0 0 1rem; }
h3 { font-size: 1.05rem; margin: 0 0 .3rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute; left: -100%;
  background: var(--panel); color: var(--fg); padding: .5rem 1rem; z-index: 10;
}
.skip:focus { left: .5rem; top: .5rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* these need html.js (site.js) */
.js-only { display: none; }
html.js .js-only { display: inline-flex; align-items: center; gap: .3em; }

.site-head nav {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  max-width: 75rem; margin: 0 auto; padding: .6rem 1.25rem;
}

@media (min-width: 641px) {
  .site-head {
    position: sticky; top: 0; z-index: 5;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .site-head nav { padding: .35rem 1.25rem; }
}
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--fg); }
.logo { display: block; }
.wordmark { font-weight: 700; font-size: 1.15rem; }
.head-links { display: flex; gap: 1rem; list-style: none; margin: 0 0 0 auto; padding: 0; flex-wrap: wrap; }
.head-links a { color: var(--fg); text-decoration: none; }
.head-links a:hover { color: var(--accent); text-decoration: underline; }
/* page theme: system / light / dark (§5.1); site.js marks the choice */
.scheme { border: 1px solid var(--border); border-radius: 6px; padding: 1px; gap: 1px; }
.scheme button {
  display: grid; place-items: center; background: none; border: 0; border-radius: 4px;
  color: var(--muted); padding: .25rem .4rem; cursor: pointer;
}
.scheme button:hover { color: var(--accent); }
.scheme button[aria-checked="true"] { color: var(--fg); background: var(--panel); }
.scheme svg { display: block; }
/* Narrow: the switch sits beside the logo, the links take the next row. */
@media (max-width: 640px) {
  .scheme { margin-left: auto; }
  .head-links { order: 3; width: 100%; margin-left: 0; }
}

main { max-width: 75rem; margin: 0 auto; padding: 0 1.25rem; container-type: inline-size; }
section { margin: 3rem 0; }
main > section:not(.panel-section) { max-width: 46rem; margin-left: auto; margin-right: auto; }

.hero { margin-top: 3.5rem; }
/* One line wherever 25 monospace characters fit the column (15em, plus a
   margin); below 2rem it wraps, balanced. */
.hero h1 { font-size: clamp(2rem, calc((100vw - 2.5rem) / 15.5), 3rem); text-wrap: balance; }
.subline { font-size: 1.2rem; max-width: 60ch; }
.cta { display: flex; align-items: stretch; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: .4em; text-decoration: none;
  background: var(--accent); color: var(--bg); font-weight: 700;
  border: 1px solid var(--accent); border-radius: 6px; padding: .5rem .9rem;
}
.btn:hover { filter: brightness(1.08); }
.hero-install { flex: 1 1 22rem; min-width: 0; }
.facts { color: var(--muted); font-size: .85rem; max-width: none; }

.panel-section { max-width: 75rem; }
.panel { margin: 0; }
.panel .frame {
  position: relative;
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
/* demo.js sets .focused (§4.3) */
.panel .frame.focused { border-color: var(--accent); }

.panel .frame svg { display: block; width: 100%; height: auto; }
.poster-dark { display: block; }
.poster-light { display: none; }
@media (prefers-color-scheme: light) {
  .poster-dark { display: none; }
  .poster-light { display: block; }
}
[data-theme="dark"] .poster-dark { display: block; }
[data-theme="dark"] .poster-light { display: none; }
[data-theme="light"] .poster-dark { display: none; }
[data-theme="light"] .poster-light { display: block; }

/* §4.7 phone gallery (4.5b): below the readable floor (120 cols need
   962 px at 13 px, D122) and on touch-only devices, three 44-column stills
   swipe past; the first is the mobile poster; demo.js reads display back.
   A touch device with a trackpad too (iPad + keyboard) counts as a laptop. */
.panel-section { --g: none; --h: none; --f: block; }
@media (pointer: coarse) { .panel-section { --g: flex; --h: block; --f: none; } }
@media (pointer: coarse) and (any-pointer: fine) { .panel-section { --g: none; --h: none; --f: block; } }
@container (max-width: 961px) { .panel-section { --g: flex; --h: block; --f: none; } }
.phone-gallery {
  display: var(--g); gap: .75rem; overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.phone-hint { display: var(--h); font-size: .85rem; color: var(--muted); margin: .4rem 0 0; }
.panel .frame { display: var(--f); }
.panel:fullscreen { --g: none; --h: none; --f: block; }
.phone-gallery figure {
  flex: 0 0 clamp(358px, 100%, 440px); margin: 0; scroll-snap-align: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel) top left / 0 0 no-repeat; /* the ::before shows it */
  background-image: var(--shot-d);
}
.phone-gallery figure::before {
  content: ""; display: block; aspect-ratio: 440 / 456;
  background: inherit; background-size: 100% 100%;
  border-radius: 5px 5px 0 0;
}
.phone-gallery figcaption {
  padding: .1rem .5rem;
  font-family: var(--mono); font-size: .75rem; color: var(--fg);
  background: var(--panel); border-top: 1px solid var(--border);
  border-bottom-left-radius: 5px; border-bottom-right-radius: 5px;
}
.phone-conversation { --shot-d: url("phone/conversation-dark.b1cbe31586.svg"); --shot-l: url("phone/conversation-light.67a7f4567b.svg"); }
.phone-palette { --shot-d: url("phone/palette-dark.e3a15fe985.svg"); --shot-l: url("phone/palette-light.5401881e83.svg"); }
.phone-themes { --shot-d: url("phone/themes-dark.0761cd02e6.svg"); --shot-l: url("phone/themes-light.1124b9aee0.svg"); }
@media (prefers-color-scheme: light) { .phone-gallery figure { background-image: var(--shot-l); } }
[data-theme="light"] .phone-gallery figure { background-image: var(--shot-l); }
[data-theme="dark"] .phone-gallery figure { background-image: var(--shot-d); }
.demo-status {
  position: absolute; left: 0; right: 0; bottom: 0;
  margin: 0; max-width: none; padding: .15rem .6rem;
  font-family: var(--mono); font-size: .8rem; line-height: 1.5;
  color: var(--muted); background: var(--panel);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.demo-status[hidden] { display: none; }
.demo-start { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.demo-start[hidden] { display: none; }
.demo-exited {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
}
.demo-exited[hidden] { display: none; }
.demo-exited button {
  font-family: var(--mono); font-size: .9rem; color: var(--fg);
  background: var(--panel); border: 1px solid var(--accent); border-radius: 6px;
  padding: .5rem .9rem; cursor: pointer;
}
.demo-exited button:hover { color: var(--accent); }

.demo-canvas { display: none; }
.frame.live .demo-canvas { display: block; position: relative; animation: demo-in .18s ease-out; }
@keyframes demo-in { from { opacity: 0; } }
/* Live, the poster stays under the canvas while it fades in, then goes. */
.frame.live .poster-dark, .frame.live .poster-light { position: absolute; top: 0; left: 0; }
.frame.live.settled .poster-dark, .frame.live.settled .poster-light { display: none !important; }
/* demo.js sizes the poster to the live canvas (.fitted), so the swap moves nothing. */
.frame.live, .frame.fitted { width: fit-content; margin-left: auto; margin-right: auto; }

.panel figcaption { padding-top: .6rem; }
.panel figcaption > p { max-width: none; }
/* Live, the canvas can be narrower than the panel (it's centred): the caption
   keeps to its width. The panel itself stays full width, because demo.js
   measures it to refit the font. */
.panel:not(:fullscreen):has(.frame.live, .frame.fitted) { display: grid; justify-content: center; }
.panel:not(:fullscreen):has(.frame.live, .frame.fitted) > figcaption { width: 0; min-width: 100%; }
/* Caption rows the live demo fills, held empty until then. */
.reserved { visibility: hidden; }
.hints, .safety { font-size: .9rem; margin: 0 0 .4rem; }
.hints { display: var(--f); }

.demo-focus {
  font-family: var(--mono); font-size: .85rem; color: var(--muted);
  margin: 0 0 .4rem;
}
.demo-focus[hidden] { display: none; }
.panel-tools { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 .4rem; }
.panel-tools[hidden] { display: none; }
.panel-tools { align-items: center; }
.theme-pick { font-family: var(--mono); font-size: .8rem; display: inline-flex; align-items: center; gap: .4rem; }
.theme-pick select {
  font: inherit; color: var(--fg); background: var(--panel);
  border: 1px solid var(--border); border-radius: 999px; padding: .2rem .6rem; cursor: pointer;
}
.theme-pick select:hover { border-color: var(--accent); }
.theme-pick select[disabled] { opacity: .5; cursor: default; }
.tool-note { font-size: .8rem; color: var(--muted); margin-right: auto; }
.panel-tools > button {
  font-family: var(--mono); font-size: .8rem; color: var(--fg);
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: .2rem .7rem; cursor: pointer;
}
.panel-tools > button:hover { border-color: var(--accent); color: var(--accent); }
.panel-tools > button[aria-pressed="true"] {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}
.panel-tools > button[disabled] { opacity: .5; cursor: default; }
.panel-tools > button[disabled]:hover { border-color: var(--border); color: var(--fg); }

.demo-controls-status { font-family: var(--mono); font-size: .85rem; margin: 0 0 .4rem; }
.phone-note { display: var(--h); font-size: .9rem; margin: .4rem 0 0; }
/* The tour (D143): a link (the file itself without JS); site.js opens it in
   the dialog and only then gives the video its src. */
.tour-open { font-family: var(--mono); font-size: .9rem; margin: .4rem 0 0; }
.tour {
  padding: 0; width: min(1020px, 96vw); max-width: none;
  color: var(--fg); background: var(--panel);
  border: 1px solid var(--border); border-radius: 6px;
}
.tour::backdrop { background: color-mix(in srgb, var(--bg) 80%, transparent); }
.tour video { display: block; width: 100%; height: auto; background: #101216; }
.tour-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  max-width: none; margin: 0; padding: .4rem .6rem;
  font-family: var(--mono); font-size: .8rem; color: var(--muted);
}
.tour-close {
  font: inherit; color: var(--fg); background: var(--panel); cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; padding: .2rem .7rem;
}
.tour-close:hover { border-color: var(--accent); color: var(--accent); }

/* ⛶ fullscreen (§4.5). */
.panel:fullscreen {
  display: flex; flex-direction: column; height: 100%; padding: 1.25rem;
  background: var(--bg); overflow: auto;
}
.panel:fullscreen .frame { flex: none; }
.panel:fullscreen figcaption { flex: none; }

.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 2rem; }
.why-grid > div > p { margin: 0; }
@media (max-width: 640px) { .why-grid { grid-template-columns: 1fr; } }

.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.tab {
  background: none; border: 1px solid var(--border); border-radius: 6px 6px 0 0;
  color: var(--fg); padding: .35rem .8rem; cursor: pointer; font-size: .9rem;
}
.tab[aria-selected="true"] { border-color: var(--accent); color: var(--accent); }

.codeblock {
  display: flex; align-items: center; gap: .75rem;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; padding: .8rem 1rem; margin: 0 0 1rem;
}
.codeblock > pre, .codeblock > code { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.codeblock > code { white-space: pre; }

.codeblock .cmt { color: var(--fg); }
/* The hero's install box: as tall as the button beside it (.cta stretches
   both), no bottom margin to push it up, and the command a touch smaller so
   it fits beside the button without scrolling. */
.codeblock.hero-install { margin: 0; padding-top: .45rem; padding-bottom: .45rem; }
.codeblock.hero-install > code { font-size: .85em; }
.copy {
  flex: none;
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  color: var(--fg); font-family: var(--mono); font-size: .75rem;
  padding: .2rem .5rem; cursor: pointer;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }
.install h3 { margin-top: 1.4rem; }
.install .note { font-size: .9rem; }
.prereq { border-collapse: collapse; margin: 0 0 1rem; }
.prereq th, .prereq td { border: 1px solid var(--border); padding: .35rem .7rem; text-align: left; }
.prereq th { font-family: var(--mono); font-size: .85rem; }

.diagram { margin: 0 0 1.5rem; }
.diagram svg { width: 100%; height: auto; max-width: 42rem; }
.diagram .box rect { fill: var(--panel); stroke: var(--border); }
.diagram text { font-family: var(--mono); font-size: 14px; fill: var(--fg); }
.diagram .sub { font-size: 12px; fill: var(--muted); }
.diagram .wire { stroke: var(--border); fill: none; stroke-width: 1.5; }
.statements { list-style: none; margin: 0; padding: 0; }
.statements li { margin: 0 0 1rem; max-width: 70ch; }

.limits ul { margin: 0; padding-left: 1.2rem; }
.limits li { margin: 0 0 .5rem; max-width: 70ch; }

.keytable { border-collapse: collapse; margin: 0 0 1rem; width: 100%; }
.keytable th, .keytable td { border: 1px solid var(--border); padding: .35rem .7rem; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.keytable thead th { font-family: var(--mono); font-size: .85rem; }
.keytable th[scope="row"] { white-space: nowrap; font-weight: 400; }

.faq details { border-bottom: 1px solid var(--border); padding: .5rem 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq summary:hover { color: var(--accent); }
.faq details p { margin: .6rem 0 .4rem; }

.site-foot {
  width: min(46rem, 100% - 2.5rem); margin: 3rem auto 0; padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--border); font-size: .9rem;
}
.foot-links { display: flex; gap: 1rem; flex-wrap: wrap; list-style: none; margin: 0 0 1rem; padding: 0; }
.site-foot p { max-width: none; margin: 0 0 .5rem; }
.site-foot a { color: var(--accent); }
.opt-out-note { font-size: .9rem; }

main.legal { max-width: calc(46rem + 2.5rem); }
.legal h1 { font-size: 2rem; margin-top: 2.5rem; }
.legal h2 { font-size: 1.15rem; margin-top: 2rem; }
.updated { color: var(--muted); font-size: .9rem; }

a, button, select, .tab, .copy, .panel .frame { transition: color .12s, border-color .12s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
