/* ada's site: gruvbox dark, like the clips. */

@font-face { font-family: "JetBrains Mono"; src: url(fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(fonts/jetbrains-mono-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #1d2021;
  --surface: #282828;
  --surface-2: #32302f;
  --line: #3c3836;
  --fg: #ebdbb2;
  --strong: #fbf1c7;
  --muted: #a89984;
  --accent: #fabd2f;
  --link: #83a598;
  --ada: #fe8019;
  --other: #665c54;
  --term: #272727;           /* the clips' own background, sampled from a recording */
  --term-bar: #1f1f1f;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --clip: 680px;             /* the clips' recorded width: shown at 1×, two to a row */
  --gap: 32px;
  color-scheme: dark;
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: .2em; }
h1, h2, h3 { font-family: var(--mono); line-height: 1.2; font-weight: 700; }
h2 { font-size: 1.6rem; margin: 0 0 .75rem; }
/* a heading's # link, to share the card or section: shown on hover, always (dimmed) on touch screens */
.anchor { color: var(--muted); font-weight: 400; text-decoration: none; opacity: 0; transition: opacity .15s; }
:is(h2, h3):hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--accent); }
@media (hover: none) { .anchor { opacity: .5; } }
h3 { font-size: 1.15rem; margin: 0 0 .5rem; }
strong { color: var(--strong); font-weight: 600; }
code, kbd, pre { font-family: var(--mono); font-size: .88em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
kbd {
  display: inline-block; min-width: 1.6em; padding: .05em .45em; text-align: center; color: var(--accent);
  background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
}
figure { margin: 0; }
figcaption { margin-top: .5rem; font-size: .88rem; color: var(--muted); }
.wrap { max-width: calc(2 * var(--clip) + var(--gap) + 32px); margin-inline: auto; padding-inline: 16px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.top nav { display: flex; gap: 1.5rem; align-items: center; height: 3.25rem; font-size: .95rem; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--fg); }
.top .wordmark { font: 700 1.2rem var(--mono); color: var(--fg); margin-right: auto; white-space: nowrap; }
.wordmark span { color: var(--accent); }

/* hero: the pitch beside Ada, then the tour */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 2rem 3rem; align-items: center;
  max-width: calc(1000px + 32px); padding-block: 4rem 2rem;
}
.hero h1 { font-size: clamp(3.5rem, 10vw, 6rem); margin: 0; letter-spacing: -.02em; }
.pitch { font-size: 1.4rem; margin: .5rem 0 .25rem; }
.proof { font-size: .95rem; margin: 0 0 .75rem; }
.sub { color: var(--muted); margin: 0 0 1.75rem; }
.download {
  display: inline-block; padding: .6rem 1.4rem; font: 700 1rem var(--mono); color: var(--bg);
  background: var(--accent); border-radius: 8px; text-decoration: none;
}
.download:hover { background: var(--strong); }
.alt { color: var(--muted); font-size: .9rem; margin: .6rem 0 0; }
.hero .ada img { display: block; width: 100%; height: auto; border-radius: 12px; }
.hero .ada figcaption { font-style: italic; text-align: center; }
.term.term-hero { grid-column: 1 / -1; max-width: 1000px; margin-top: 1rem; }
@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .hero .ada { max-width: 420px; margin-inline: auto; }
}

/* a terminal window around a clip: its body is the clip's own background, so the recording has no edge */
.term {
  display: block; width: 100%; max-width: var(--clip); background: var(--term); border-radius: 10px;
  position: relative; overflow: hidden; text-decoration: none; box-shadow: 0 1px 0 var(--line), 0 18px 40px -18px rgb(0 0 0 / .55);
}
.term-wide { max-width: 1000px; }
.term-bar { display: flex; align-items: center; gap: 6px; height: 28px; padding-inline: 12px; background: var(--term-bar); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #504945; }
.term-bar span { margin-inline: auto; padding-right: 51px; font: 12px var(--mono); color: #928374; }
.term img { display: block; width: 100%; height: auto; }

/* features: cards whose clips sit at their native 680 px, two to a row where they fit */
.features { padding-block: 3rem; }
.card, .pair { max-width: calc(2 * var(--clip) + var(--gap) + 32px); margin: 0 auto 5rem; padding-inline: 16px; }
.card .text { max-width: 46rem; margin-bottom: 1.5rem; }
.card .text p { color: var(--muted); margin: 0 0 1rem; }
.card .text + figure, .media-2 + .text { margin-top: 2.5rem; }
.keys { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; font-size: .9rem; }
.media-2, .pair { display: grid; grid-template-columns: repeat(2, minmax(0, var(--clip))); gap: var(--gap); }
.pair .card { padding: 0; margin: 0; display: flex; flex-direction: column; }
.pair .card .text { flex: 1; margin-bottom: 1rem; }
.pair .card .text + figure { margin-top: 0; }
.side { display: grid; grid-template-columns: minmax(0, var(--clip)) 1fr; gap: var(--gap); align-items: center; }
.side .text { margin: 0; }
@media (max-width: 1424px) {
  .media-2, .pair, .side { grid-template-columns: minmax(0, var(--clip)); }
  .card, .pair { max-width: calc(var(--clip) + 32px); }
  .side .text { order: -1; }
  .pair { row-gap: 5rem; }
}

.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.25rem 1rem; }
.gallery a { display: block; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 0 var(--line), 0 10px 24px -14px rgb(0 0 0 / .6); }
.gallery img { display: block; width: 100%; height: auto; }
.gallery code { display: block; margin-top: .4rem; background: none; padding: 0; font-size: .8rem; color: var(--muted); }
@media (max-width: 1424px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

.also-title { margin-top: 1rem; }
.also { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.also li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; }
.also h3 { font-size: 1rem; margin: 0 0 .4rem; }
.also p { margin: 0; color: var(--muted); font-size: .95rem; }

/* performance */
.perf { padding-block: 3rem; }
.perf > p { color: var(--muted); max-width: 46rem; }
.lede { margin-bottom: .75rem; }
/* the two kinds of time: a legend under the intro, and a tag on each chart and tile */
.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: .75rem 2rem; max-width: 60rem; margin: 0 0 2rem; }
.kinds div { display: flex; gap: .75rem; align-items: baseline; }
.kinds dt { flex: none; width: 3rem; }
.kinds dd { margin: 0; color: var(--muted); font-size: .95rem; }
.kinds dd b { color: var(--fg); font-weight: 600; }
.kind { font: 400 .7rem var(--mono); padding: 0 .4rem; border: 1px solid currentColor; border-radius: 999px; margin-left: .35rem; vertical-align: .1em; white-space: nowrap; }
.kinds .kind { margin-left: 0; }
.kind.wall { color: var(--link); }
.kind.cpu { color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; }
.tile b { font: 700 2rem var(--mono); color: var(--ada); }
.tile b span { font-size: 1rem; color: var(--muted); }
.tile p { margin: .1rem 0 .3rem; }
.tile small { color: var(--muted); }

.doc-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.doc-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.doc-tabs label {
  cursor: pointer; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; color: var(--muted);
}
.doc-tabs label b { font-family: var(--mono); color: var(--fg); margin-right: .3rem; }
.doc-tabs input:checked + label { border-color: var(--accent); color: var(--fg); background: var(--surface); }
.doc-tabs input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.perf-panel { display: none; }
.perf:has(#doc-s:checked) [data-doc="s"], .perf:has(#doc-m:checked) [data-doc="m"],
.perf:has(#doc-l:checked) [data-doc="l"], .perf:has(#doc-xl:checked) [data-doc="xl"] { display: block; }
/* the previewer files' tabs (perf.py's tabbed): six; the images': ten */
.perf:has(#prev-0:checked) [data-prev="0"], .perf:has(#prev-1:checked) [data-prev="1"],
.perf:has(#prev-2:checked) [data-prev="2"], .perf:has(#prev-3:checked) [data-prev="3"],
.perf:has(#prev-4:checked) [data-prev="4"], .perf:has(#prev-5:checked) [data-prev="5"],
.perf:has(#img-0:checked) [data-img="0"], .perf:has(#img-1:checked) [data-img="1"],
.perf:has(#img-2:checked) [data-img="2"], .perf:has(#img-3:checked) [data-img="3"],
.perf:has(#img-4:checked) [data-img="4"], .perf:has(#img-5:checked) [data-img="5"],
.perf:has(#img-6:checked) [data-img="6"], .perf:has(#img-7:checked) [data-img="7"],
.perf:has(#img-8:checked) [data-img="8"], .perf:has(#img-9:checked) [data-img="9"] { display: block; }
.perf h3 { font-size: 1rem; color: var(--muted); font-weight: 400; margin: 0 0 1rem; }
.perf h3.perf-sub { font: 700 1.15rem var(--mono); color: var(--fg); margin: 1rem 0 .5rem; }
.perf h3 code { font-size: .95em; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr)); gap: 1.75rem 2rem; margin-bottom: 2.5rem; }
.chart { margin: 0; }
.chart figcaption { font: 700 .95rem var(--mono); margin: 0 0 .5rem; color: var(--fg); }
.chart figcaption span { font-weight: 400; color: var(--muted); }
.chart figcaption small { display: block; font: .8rem var(--sans); color: var(--muted); margin-top: .1rem; }
.chart ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.chart li { --w: 0%; display: grid; grid-template-columns: 6.5rem 1fr; align-items: center; gap: .5rem; font-size: .85rem; }
.chart .bar { grid-column: 2; grid-row: 1; height: 1.15rem; width: calc(var(--w) * .7); min-width: 2px; background: var(--other); border-radius: 0 3px 3px 0; }
.chart .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart .name small { color: var(--muted); font-size: .75rem; display: block; line-height: 1; }
.chart .val { grid-column: 2; grid-row: 1; justify-self: start; margin-left: calc(var(--w) * .7 + .4rem); font: .8rem var(--mono); white-space: nowrap; }
.chart .val small { color: var(--muted); }
.chart .ada .name { color: var(--ada); font-weight: 700; }
.chart .ada .bar { background: var(--ada); }
.chart .missing .why { grid-column: 2; font-size: .8rem; color: var(--muted); font-style: italic; }
.stamp { font-size: .85rem; }
.caveats { font-size: .88rem; color: var(--muted); max-width: 46rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.perf .caveats h3 { font: 700 .9rem var(--mono); color: var(--fg); margin: 0 0 .5rem; }
.caveats ul { margin: 0 0 .75rem; padding-left: 1.1rem; }
.caveats li { margin: .2rem 0; }
.caveats b { color: var(--fg); font-weight: 600; }
.caveats p { margin: 0; }

/* robustness */
.robust { padding-block: 3rem; }
.robust > p { color: var(--muted); max-width: 46rem; }
.robust .tile b { color: var(--accent); }
.fuzz { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; }
.fuzz li { border-left: 3px solid var(--accent); padding: .25rem 0 .25rem 1rem; }
.fuzz h3 { font-size: 1rem; margin: 0 0 .35rem; }
.fuzz p { margin: 0; color: var(--muted); font-size: .95rem; }

/* install */
.install { padding-block: 3rem; }
.install p { color: var(--muted); max-width: 46rem; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; font-size: .95rem; }
pre .c { color: var(--muted); }

footer { padding-block: 2rem 4rem; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }

/* lightbox: the clips are at full size on a wide screen, so only small screens and the theme
   thumbnails open it */
.zoom { display: none; position: fixed; inset: 0; z-index: 30; place-items: center; padding: 16px; background: rgb(0 0 0 / .85); }
.zoom:target { display: grid; }
.zoom a { position: absolute; inset: 0; }
.zoom img { position: relative; max-width: 100%; max-height: 100%; pointer-events: none; border-radius: 6px; }
@media (min-width: 760px) { a.term { pointer-events: none; } }
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top nav { gap: 1rem; }
  .top nav a:nth-child(2) { display: none; }
}
@media (max-width: 440px) {
  .top nav { gap: .6rem; font-size: .88rem; }
  .top .wordmark { font-size: 1.05rem; }
}
