/* Sweep website */

:root {
  --bg: #0d1311;
  --bg-alt: #111a17;
  --panel: #16211d;
  --line: #24332d;
  --text: #e4ece7;
  --muted: #95a89f;
  --emerald: #34d399;
  --emerald-ink: #06281c;
  --amber: #f0b445;
  --coral: #f27a69;

  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1160px;
  --radius-lg: 20px;
  --radius: 12px;
  --radius-sm: 7px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f7f5;
    --bg-alt: #e9efec;
    --panel: #ffffff;
    --line: #d3ddd8;
    --text: #0f1f19;
    --muted: #51655c;
    --emerald: #0c8f62;
    --emerald-ink: #ffffff;
    --amber: #9a6200;
    --coral: #bf3b28;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.005em; }
p { margin: 0; }
a { color: inherit; }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: color-mix(in srgb, var(--emerald) 10%, transparent);
  border-radius: 5px;
  padding: 0.08em 0.35em;
}
img { display: block; }

:focus-visible { outline: 2px solid var(--emerald); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--emerald); color: var(--emerald-ink); padding: 8px 14px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--text); }
.gh-link {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 0.9rem;
}
.gh-link:hover { border-color: var(--muted); }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .gh-link { margin-left: auto; }
  .gh-link span { display: none; }
  .menu-btn {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 40px; height: 40px; background: none; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; padding: 0 10px;
  }
  .menu-btn span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s; }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--body); font-weight: 600; font-size: 1rem; text-decoration: none;
  border-radius: 999px; padding: 14px 24px; border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn-primary { background: var(--emerald); color: var(--emerald-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--emerald) 86%, var(--text)); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { padding: 10px 18px; font-size: 0.95rem; margin-top: 14px; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.9rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  max-width: 11ch;
}
.lede { margin-top: 24px; font-size: 1.14rem; color: var(--muted); max-width: 54ch; }
.lede code { color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; font-size: 0.9rem; color: var(--muted); }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); opacity: .7; }
.hero-meta .ver { color: var(--text); font-weight: 600; }

@media (max-width: 960px) {
  .hero { padding-top: 48px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
}

/* Readout: the hero's scan result */
.readout {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px -40px color-mix(in srgb, var(--emerald) 40%, transparent);
}
.readout-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dots { display: inline-flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.readout-title { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.readout-list { list-style: none; margin: 0; padding: 6px 0; }
.readout-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "name tag size" "path tag size";
  column-gap: 14px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.readout-list li:last-child { border-bottom: 0; }
.r-name { grid-area: name; font-weight: 600; font-size: 0.97rem; }
.r-path { grid-area: path; font-family: var(--mono); font-size: 0.74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.readout-list .tag { grid-area: tag; }
.r-size { grid-area: size; font-family: var(--display); font-weight: 700; font-size: 1.05rem; min-width: 4.6em; text-align: right; font-variant-numeric: tabular-nums; }
.readout-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 18px; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--emerald) 7%, var(--panel));
}
.readout-foot span { color: var(--muted); font-weight: 500; }
.readout-foot strong { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 4vw, 2.6rem); letter-spacing: -0.03em; color: var(--emerald); font-variant-numeric: tabular-nums; }

/* One load moment: rows arrive, total counts up */
.js .readout-list li { opacity: 0; transform: translateY(6px); }
.js .readout-list li.in { opacity: 1; transform: none; transition: opacity .35s ease, transform .35s ease; }
@media (prefers-reduced-motion: reduce) {
  .js .readout-list li { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
  .readout-list li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name size" "path tag"; row-gap: 4px; }
  .readout-list .tag { justify-self: end; }
}

/* Safety tags */
.tag {
  display: inline-block; font-size: 0.74rem; font-weight: 600; line-height: 1;
  padding: 5px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap;
}
.tag.safe { color: var(--emerald); background: color-mix(in srgb, var(--emerald) 10%, transparent); }
.tag.review { color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.tag.danger { color: var(--coral); background: color-mix(in srgb, var(--coral) 10%, transparent); }

/* Story */
.story { padding: 56px 24px 72px; border-top: 1px solid var(--line); }
.story-quote {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.45rem, 2.8vw, 2.05rem); line-height: 1.3; letter-spacing: -0.015em;
  max-width: 30ch;
}
.story-quote code { font-size: 0.8em; }
.story-body { margin-top: 18px; color: var(--muted); max-width: 60ch; font-size: 1.08rem; }

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 56px; align-items: end; margin-bottom: 40px; }
.section-head p { color: var(--muted); max-width: 52ch; }
@media (max-width: 800px) { .section-head { grid-template-columns: 1fr; } .section { padding: 64px 0; } }

/* Steps (a real sequence) */
.steps { list-style: none; counter-reset: step; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.steps li { counter-increment: step; padding: 0 32px 0 0; position: relative; }
.steps li + li { padding-left: 32px; border-left: 1px solid var(--line); }
.steps li::before {
  content: counter(step);
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--emerald); color: var(--emerald);
  font-family: var(--display); font-weight: 700; margin-bottom: 18px;
}
.steps h3 { font-size: 1.5rem; margin-bottom: 10px; }
.steps p { color: var(--muted); }
@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .steps li, .steps li + li { padding: 0 0 0 0; border-left: 0; }
}

/* Catalog */
.catalog-tools { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 28px; }
.search {
  display: flex; align-items: center; gap: 10px; flex: 1 1 260px; max-width: 360px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; color: var(--muted);
}
.search:focus-within { border-color: var(--emerald); }
.search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text);
  font: inherit; font-size: 0.96rem; padding: 11px 0;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .n { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }

.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; align-items: start; }
.tool {
  margin: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 8px;
}
.tool-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.tool-head h3 { font-size: 1.08rem; }
.tool-head span { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.tool ul { list-style: none; margin: 0; padding: 0; }
.tool li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.tool li:first-child { border-top: 0; }
.t-what { min-width: 0; }
.t-what b { display: block; font-weight: 500; font-size: 0.94rem; }
.t-what small { display: block; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.catalog-empty { color: var(--muted); padding: 32px 0; }

/* Safety */
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 56px; }
.level { border-top: 3px solid var(--line); padding-top: 18px; }
.level:nth-child(1) { border-top-color: var(--emerald); }
.level:nth-child(2) { border-top-color: var(--amber); }
.level:nth-child(3) { border-top-color: var(--coral); }
.level .tag { font-size: 0.9rem; padding: 6px 12px; }
.level p { margin-top: 14px; color: var(--muted); }
@media (max-width: 800px) { .levels { grid-template-columns: 1fr; gap: 28px; } }

.guards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.guards li { padding: 26px 28px 26px 0; border-bottom: 1px solid var(--line); }
.guards li:not(:nth-child(3n+1)) { padding-left: 28px; border-left: 1px solid var(--line); }
.guards h3 { margin-bottom: 8px; }
.guards p { color: var(--muted); font-size: 0.97rem; }
@media (max-width: 900px) {
  .guards { grid-template-columns: 1fr 1fr; }
  .guards li, .guards li:not(:nth-child(3n+1)) { padding: 22px 20px 22px 0; border-left: 0; }
  .guards li:nth-child(2n) { padding-left: 20px; border-left: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .guards { grid-template-columns: 1fr; }
  .guards li, .guards li:nth-child(2n) { padding: 20px 0; border-left: 0; }
}

/* Install */
.install-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.install-steps { list-style: none; counter-reset: s; margin: 32px 0 0; padding: 0; }
.install-steps li { counter-increment: s; position: relative; padding: 0 0 30px 56px; }
.install-steps li::before {
  content: counter(s); position: absolute; left: 0; top: -4px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--emerald); color: var(--emerald-ink); font-family: var(--display); font-weight: 700;
}
.install-steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 16px; top: 36px; bottom: 4px; width: 2px; background: var(--line);
}
.install-steps h3 { margin-bottom: 6px; font-size: 1.2rem; }
.install-steps p { color: var(--muted); max-width: 58ch; }
.install-steps strong { color: var(--text); font-weight: 600; }

.side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.side-block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.side-block h3 { margin-bottom: 8px; }
.side-block p { color: var(--muted); font-size: 0.96rem; }
.side-block .small { font-size: 0.88rem; margin-top: 12px; }
pre {
  margin: 14px 0 0; padding: 14px 16px; overflow-x: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.7;
}
pre code { background: none; padding: 0; font-size: inherit; }
@media (max-width: 900px) { .install-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* FAQ */
.faq-wrap { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 56px; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; align-items: center;
  padding: 20px 0; font-weight: 600; font-size: 1.06rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details p { color: var(--muted); padding: 0 0 22px; max-width: 64ch; }
@media (max-width: 800px) { .faq-wrap { grid-template-columns: 1fr; gap: 24px; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand p { color: var(--muted); margin-top: 12px; max-width: 30ch; }
.site-footer h3 { font-family: var(--body); font-size: 0.92rem; font-weight: 600; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); font-size: 0.94rem; }
.site-footer a { text-decoration: none; }
.site-footer ul a:hover { color: var(--text); text-decoration: underline; }
.footer-bottom { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.86rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
