/* 99trace.com: the 99Ways palette and type, as set in brand/README.md. No external requests. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #F4F3EF;
  --band: #ECEBE5;
  --surface: #FBFAF7;
  --line: #D8D6CF;
  --text: #292B2A;
  --muted: #676B65;
  --blue: #3558B8;
  --green: #147D40;
  --code: #E6E4DD;
  --button-text: #F4F3EF;
  --shadow: 0 1px 0 rgba(41, 43, 42, 0.04), 0 8px 24px -12px rgba(41, 43, 42, 0.18);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #292B2A;
    --band: #242625;
    --surface: #313332;
    --line: #444745;
    --text: #F4F3EF;
    --muted: #B5B8B1;
    --blue: #A6BAFF;
    --green: #6BD98D;
    --code: #3A3D3B;
    --button-text: #292B2A;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip { position: absolute; left: 16px; top: -48px; z-index: 20; padding: 10px 14px; border-radius: 8px; background: var(--text); color: var(--bg); text-decoration: none; }
.skip:focus { top: 12px; }

a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

code {
  font: 400 0.86em/1.4 var(--mono);
  background: var(--code);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  white-space: nowrap;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.6rem); line-height: 1.04; max-width: 15ch; }
h2 { font-size: clamp(1.7rem, 1.2rem + 1.9vw, 2.6rem); line-height: 1.12; max-width: 24ch; }
h3 { font-size: 1.12rem; line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.wrap.narrow { width: min(780px, 100% - 32px); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; color: var(--text); }
.wordmark { display: block; width: 132px; height: 26px; color: var(--text); }
.wordmark .pupil, .pupil { fill: var(--blue); }
.wordmark.small { width: 110px; height: 22px; }
.nav { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; color: var(--text); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { background: var(--band); }
.nav-github { border: 1px solid var(--line); }
.icon { width: 18px; height: 18px; flex: none; }
@media (max-width: 760px) {
  .nav li:not(:last-child) { display: none; }
}
@media (max-width: 380px) {
  .nav-github span { display: none; }
}

/* Hero */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); }
.eyebrow, .kicker { font: 600 0.8rem/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.lede { margin-top: 22px; max-width: 56ch; font-size: clamp(1.08rem, 1rem + 0.45vw, 1.3rem); line-height: 1.55; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}
.button:hover { border-color: var(--muted); transform: translateY(-1px); }
.button.primary { background: var(--text); border-color: var(--text); color: var(--button-text); }
.button.primary:hover { background: color-mix(in srgb, var(--text) 86%, var(--blue)); }
@media (prefers-reduced-motion: reduce) { .button { transition: none; } .button:hover { transform: none; } }
.meta { margin-top: 22px; color: var(--muted); font-size: 0.92rem; }
.pill { display: inline-block; margin-top: 4px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font: 400 0.8rem/1.6 var(--mono); white-space: nowrap; }

/* The trace */
.trace { margin: clamp(40px, 6vw, 72px) 0 0; }
.trace svg { display: block; width: 100%; height: auto; overflow: visible; }
.trace-tall { display: none !important; max-width: 340px; }
@media (max-width: 640px) {
  .trace-wide { display: none !important; }
  .trace-tall { display: block !important; }
}
.trace-line { fill: none; stroke: var(--muted); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 0 17; animation: march 1.1s linear infinite; }
.trace-stop { fill: var(--bg); stroke: var(--blue); stroke-width: 3; }
.trace-end { fill: var(--green); }
.trace-label { font: 400 22px var(--mono); fill: var(--muted); }
.trace-result { font: 600 24px var(--mono); fill: var(--green); }
.trace-note { font: 400 19px var(--mono); fill: var(--muted); }
@keyframes march { to { stroke-dashoffset: -17; } }
@media (prefers-reduced-motion: reduce) { .trace-line { animation: none; } }

/* Sections */
main > section { padding: clamp(56px, 8vw, 104px) 0; }
.band { background: var(--band); }
.intro { margin-top: 18px; max-width: 64ch; color: var(--muted); font-size: 1.06rem; }
.callout { margin-top: 28px; max-width: 64ch; padding-left: 16px; border-left: 3px solid var(--blue); font-weight: 600; }
.fine { margin-top: 24px; max-width: 72ch; color: var(--muted); font-size: 0.92rem; }

.grid { display: grid; gap: 16px; margin-top: 36px; }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
@media (max-width: 400px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }
.extras { margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 24px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); }
.card.quiet { background: transparent; box-shadow: none; }

/* How it works */
.how { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; margin-top: 40px; align-items: start; }
@media (max-width: 900px) { .how { grid-template-columns: 1fr; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.steps li { position: relative; padding: 0 0 26px 64px; }
.steps li::before { content: ""; position: absolute; left: 21px; top: 44px; bottom: 6px; border-left: 2px dotted var(--muted); }
.steps li:last-child::before { display: none; }
.step-no { position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--blue); background: var(--bg); color: var(--blue); font: 600 0.85rem var(--mono); }
.steps li:last-child .step-no { background: var(--green); border-color: var(--green); color: var(--button-text); }
.steps h3 { padding-top: 9px; margin-bottom: 6px; }
.steps p { color: var(--muted); max-width: 58ch; }

.event-card { background: var(--text); color: var(--bg); border-radius: var(--radius); padding: 22px 22px 18px; font-family: var(--mono); box-shadow: var(--shadow); }
.event-card-title { font-weight: 600; font-size: 1.05rem; color: var(--green); margin-bottom: 14px; }
@media (prefers-color-scheme: light) { .event-card-title { color: #6BD98D; } }
@media (prefers-color-scheme: dark) { .event-card { background: var(--surface); color: var(--text); border: 1px solid var(--line); } }
.event-card dl { margin: 0; display: grid; gap: 10px; }
.event-card dl > div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; font-size: 0.86rem; line-height: 1.5; }
.event-card dt { color: color-mix(in srgb, currentColor 60%, transparent); }
.event-card dd { margin: 0; }

/* Events table */
.table-wrap { margin-top: 32px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
th { font: 600 0.78rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
td:nth-child(2) { white-space: nowrap; color: var(--muted); }
td code { white-space: nowrap; }
@media (max-width: 640px) {
  table, thead, tbody, tr, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  td { padding: 2px 0; border: 0; }
  td code { white-space: normal; }
}

/* Privacy */
.checks { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; max-width: 78ch; }
.checks li { position: relative; padding-left: 34px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--blue); }

/* Screenshots */
.shots { display: grid; gap: 22px; margin-top: 36px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.shots figure { margin: 0; }
.shots a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.shots img { display: block; width: 100%; height: auto; }
.shots figcaption { margin-top: 10px; color: var(--muted); font-size: 0.92rem; }

/* Install */
.install { margin: 30px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; max-width: 78ch; }
.install li { counter-increment: step; position: relative; padding-left: 46px; }
.install li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; font: 600 0.9rem/1.9 var(--mono); color: var(--blue); }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 4px 0; }
details:first-of-type { margin-top: 28px; border-top: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; position: relative; font-weight: 600; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 1.4rem var(--mono); color: var(--muted); }
details[open] summary::after { content: "−"; }
details p { padding: 0 0 18px; color: var(--muted); max-width: 70ch; }

/* Open source */
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 36px; } }
.open h2 + p, .open .kicker + p { margin-top: 16px; color: var(--muted); max-width: 60ch; }
.open .split > div:last-child p + p { margin-top: 14px; }
.arrow { font-weight: 600; text-decoration: none; }
.arrow::after { content: " →"; }

/* Footer */
.site-footer { padding: 40px 0 48px; border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.site-footer .fine { margin-top: 18px; }
