/* snare.sh shared styles. No external fonts or assets. */
:root {
  color-scheme: dark light;
  --bg: #0b0d0c;
  --surface: #121514;
  --raise: #191d1b;
  --line: #272c29;
  --text: #edece5;
  --soft: #bdbcb2;
  --muted: #8e9088;
  --accent: #ff6b3d;
  --accent-tint: rgba(255, 107, 61, .1);
  --on-accent: #1a0c06;
  --ok: #7fd4a0;
  /* Code surfaces stay dark in both schemes. */
  --code-bg: #0f1211;
  --code-line: #272c29;
  --code-text: #e6e5dd;
  --code-dim: #8e9088;
  --code-accent: #ff8a63;
  --code-ok: #7fd4a0;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 68rem;
  --r: 10px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3ec;
    --surface: #fbfaf5;
    --raise: #fff;
    --line: #d9d5c7;
    --text: #181a17;
    --soft: #3c3f39;
    --muted: #5f6259;
    --accent: #b3320d;
    --accent-tint: rgba(179, 50, 13, .07);
    --on-accent: #fff;
    --ok: #1c7445;
    --code-bg: #161a18;
    --code-line: #161a18;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1, h2, h3, p, ol, ul, dl, dd, pre, table { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
code, pre, kbd { font-family: var(--mono); font-size: .9em; }
p code, li code, td code, dd code { color: var(--text); background: var(--raise); border: 1px solid var(--line); border-radius: 4px; padding: .05em .3em; overflow-wrap: anywhere; }
strong { font-weight: 650; }
svg { display: block; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; background: var(--accent); color: var(--on-accent); padding: .5rem .9rem; border-radius: 6px; font-weight: 600; text-decoration: none; }
.skip:focus { top: .75rem; color: var(--on-accent); }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 3.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font: 600 1.05rem var(--mono); letter-spacing: -.01em; text-decoration: none; color: var(--text); }
.brand svg { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 1.4rem; margin-left: auto; font-size: .9rem; }
.nav a { color: var(--soft); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--text); }
.nav a.btn { color: var(--on-accent); }
@media (max-width: 760px) { .nav .opt { display: none; } .nav { gap: 1rem; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1rem; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: .92rem; text-decoration: none; line-height: 1.2; }
.btn:hover { color: var(--on-accent); filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); color: var(--text); filter: none; }
.btn.sm { padding: .4rem .75rem; font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* Type */
.eyebrow, .label { font: 500 .78rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow b, .label b { color: var(--accent); font-weight: 500; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.12; letter-spacing: -.028em; font-weight: 680; text-wrap: balance; }
h3 { font-size: 1.05rem; line-height: 1.35; font-weight: 650; letter-spacing: -.01em; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--soft); max-width: 40rem; text-wrap: pretty; }
.note { font-size: .9rem; color: var(--muted); }
.fine { font-size: .9rem; color: var(--muted); max-width: 46rem; }
.fine a, .lead a { color: var(--text); }
.hl { color: var(--accent); }

/* Sections */
.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem); background: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 28px 28px; position: relative; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 35%, transparent), var(--bg) 92%); pointer-events: none; }
.hero > .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-copy > * + * { margin-top: 1.4rem; }
.sec { padding: clamp(3.5rem, 7vw, 6rem) 0; border-top: 1px solid var(--line); }
.sec-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.sec-head > * + * { margin-top: 1rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.stack > * + * { margin-top: 1.1rem; }
@media (max-width: 900px) { .hero-grid, .split { grid-template-columns: minmax(0, 1fr); } }

/* Install command */
.cmd { display: flex; align-items: center; gap: .75rem; max-width: 33rem; background: var(--code-bg); color: var(--code-text); border: 1px solid var(--code-line); border-radius: var(--r); padding: .45rem .45rem .45rem 1rem; font-family: var(--mono); box-shadow: 0 0 0 4px var(--accent-tint); }
.cmd::before { content: "$"; color: var(--code-accent); }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: .5rem 0; font-size: .92rem; scrollbar-width: none; }
.copy { flex: none; font: 600 .78rem var(--sans); color: var(--code-text); background: #232926; border: 1px solid #39413c; border-radius: 6px; padding: .5rem .75rem; cursor: pointer; min-width: 4.2rem; }
.copy:hover { border-color: var(--code-accent); }
.facts { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; font-size: .9rem; color: var(--muted); }
.facts li::before { content: "+ "; font-family: var(--mono); color: var(--accent); }

/* Terminal and code blocks */
.term { background: var(--code-bg); color: var(--code-text); border: 1px solid var(--code-line); border-radius: var(--r); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: .5rem; padding: .55rem .9rem; border-bottom: 1px solid #272c29; font: .75rem var(--mono); color: var(--code-dim); }
.term-bar::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--code-dim); opacity: .6; }
.term pre, pre.code { padding: 1rem 1.1rem; overflow-x: auto; font-size: .82rem; line-height: 1.7; tab-size: 2; }
pre.code { background: var(--code-bg); color: var(--code-text); border: 1px solid var(--code-line); border-radius: var(--r); }
.term .p, pre.code .p { color: var(--code-accent); user-select: none; }
.term .d, pre.code .d { color: var(--code-dim); }
.term .ok, pre.code .ok { color: var(--code-ok); }
pre.code mark { background: rgba(255, 107, 61, .18); color: #ffd9cc; }

/* Hero visual: terminal, wire, alert */
.wire { display: flex; align-items: center; gap: .75rem; padding: .2rem 0 .2rem 1.6rem; font: .75rem var(--mono); color: var(--muted); }
.wire::before { content: ""; width: 1px; height: 2.4rem; background: linear-gradient(var(--line), var(--accent)); }
.alert { background: var(--raise); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .55); }
.alert-head { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); font-weight: 650; font-size: .95rem; }
.dot { flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); }
.alert-head span:last-child { margin-left: auto; white-space: nowrap; font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kv { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: .3rem .9rem; padding: .85rem 1rem; font-size: .8rem; }
.kv.w { grid-template-columns: 6.6rem minmax(0, 1fr); }
.kv dt { color: var(--muted); font-family: var(--mono); }
.kv dd { font-family: var(--mono); overflow-wrap: anywhere; }
.alert-foot { padding: .7rem 1rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--soft); }
.alert-foot b { color: var(--accent); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; counter-reset: step; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.steps > li { counter-increment: step; padding: 1.5rem; border-left: 1px solid var(--line); }
.steps > li:first-child { border-left: 0; }
.steps > li::before { content: "0" counter(step); display: block; font: 500 .78rem var(--mono); color: var(--accent); margin-bottom: .9rem; }
.steps h3 { margin-bottom: .45rem; }
.steps p { color: var(--soft); font-size: .95rem; }
.steps .snip { display: block; margin-top: 1rem; padding: .6rem .75rem; background: var(--code-bg); color: var(--code-text); border: 1px solid var(--code-line); border-radius: 6px; font: .76rem/1.55 var(--mono); overflow-x: auto; white-space: pre; }
.steps.five { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.steps.five > li { grid-column: span 2; }
.steps.five > li:nth-child(n+4) { grid-column: span 3; border-top: 1px solid var(--line); }
.steps.five > li:nth-child(4) { border-left: 0; }
@media (max-width: 800px) {
  .steps, .steps.five { grid-template-columns: minmax(0, 1fr); }
  .steps > li, .steps.five > li, .steps.five > li:nth-child(n+4) { grid-column: auto; border-left: 0; border-top: 1px solid var(--line); }
  .steps > li:first-child { border-top: 0; }
}

/* Timeline */
.tl { border-left: 1px solid var(--line); margin-left: .35rem; }
.tl li { position: relative; display: grid; grid-template-columns: 4.4rem minmax(0, 1fr); gap: .75rem; padding: .55rem .75rem .55rem 1.25rem; font-size: .92rem; color: var(--soft); }
.tl li::before { content: ""; position: absolute; left: -.3rem; top: 1.05rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--bg); border: 1px solid var(--muted); }
.tl .t { font: .8rem/1.9 var(--mono); color: var(--muted); }
.tl .fire { background: var(--accent-tint); border-radius: 0 var(--r) var(--r) 0; color: var(--text); padding-block: .9rem; margin-block: .3rem; }
.tl .fire::before { background: var(--accent); border-color: var(--accent); top: 1.4rem; }
.tl .fire .t { color: var(--accent); }
.tl .fire b { display: block; font: 500 .74rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-top: .25rem; }
.tl .after { color: var(--muted); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem; text-decoration: none; }
.card > * + * { margin-top: .5rem; }
.card p { color: var(--soft); font-size: .93rem; }
a.card:hover { border-color: var(--accent); color: inherit; }
a.card h3::after { content: " \2192"; color: var(--accent); }
.card.on { border-color: var(--accent); }

/* Canary tables */
.ct { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ct caption { text-align: left; padding: .75rem 0; }
.ct th { text-align: left; font: 500 .72rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: .6rem .9rem .6rem 0; border-bottom: 1px solid var(--line); }
.ct td { padding: .8rem .9rem .8rem 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--soft); }
.ct tr:last-child td { border-bottom: 0; }
.ct .type-cell { font: 600 .92rem var(--mono); color: var(--text); white-space: nowrap; }
.ct .path { font: .8rem/1.9 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.tier { display: inline-block; font: 500 .72rem var(--mono); padding: .12rem .45rem; border-radius: 4px; border: 1px solid var(--line); color: var(--soft); white-space: nowrap; }
.tier.p { border-color: var(--accent); color: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .5rem 1.25rem; }
details.panel { padding: 0; margin-top: 1rem; }
details.panel summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 600; border-radius: var(--r); }
details.panel summary span { color: var(--muted); font-weight: 400; }
details.panel > div { padding: 0 1.25rem .5rem; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .ct thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ct, .ct tbody, .ct tr, .ct td { display: block; }
  .ct tr { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .ct tr:last-child { border-bottom: 0; }
  .ct td { padding: .12rem 0; border: 0; }
}
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1.25rem 2rem; margin-top: 2rem; font-size: .9rem; color: var(--soft); }
.tiers dt { margin-bottom: .35rem; }

/* Lists */
.cmds { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .65rem 1.25rem; font-size: .93rem; }
.cmds dt { font: .84rem/1.8 var(--mono); color: var(--text); }
.cmds dd { color: var(--soft); }
@media (max-width: 560px) { .cmds { grid-template-columns: minmax(0, 1fr); gap: .1rem; } .cmds dd { margin-bottom: .7rem; } }
.ticks li { position: relative; padding-left: 1.4rem; color: var(--soft); font-size: .95rem; }
.ticks li + li { margin-top: .6rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .62em; width: .6rem; height: 1px; background: var(--accent); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-size: .9rem; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; }
.foot p { max-width: 22rem; margin-top: .6rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; }
.foot ul li + li { margin-top: .4rem; }
.foot h2 { font: 500 .72rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .7rem; }
.foot a { color: var(--soft); text-decoration: none; }
.foot a:hover { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .alert.live { animation: arrive .6s .5s cubic-bezier(.2, .7, .2, 1) both; }
  .alert.live .dot { animation: ping 2.4s 1.2s ease-out infinite; }
  @keyframes arrive { from { opacity: 0; transform: translateY(10px); } }
  @keyframes ping { 70%, 100% { box-shadow: 0 0 0 .55rem transparent; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.mt { margin-top: 1.5rem; }
pre.wrapc { white-space: pre-wrap; overflow-wrap: anywhere; }
.card .label { font-size: .72rem; }
.ct td:nth-child(5) { white-space: nowrap; }
@media (max-width: 480px) { .cmd code { white-space: normal; overflow-wrap: anywhere; font-size: .85rem; } }
@media (max-width: 720px) { .ct caption { display: block; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
figure { margin: 0; }
figcaption { margin-bottom: .6rem; }
