:root {
  color-scheme: dark;
  --bg: #0b1014;
  --surface: #11191e;
  --surface-raised: #172228;
  --text: #edf4f1;
  --muted: #9aaba9;
  --line: #2a3c40;
  --accent: #b6f36b;
  --accent-ink: #19240d;
  --cyan: #73d9da;
  --grid: rgba(157, 197, 190, .055);
  --shadow: rgba(0, 0, 0, .24);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f0;
  --surface: #ffffff;
  --surface-raised: #eaf0e9;
  --text: #182625;
  --muted: #536865;
  --line: #cbd9d1;
  --accent: #356b24;
  --accent-ink: #ffffff;
  --cyan: #126e76;
  --grid: rgba(37, 94, 81, .075);
  --shadow: rgba(34, 65, 52, .09);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f4f6f0;
    --surface: #ffffff;
    --surface-raised: #eaf0e9;
    --text: #182625;
    --muted: #536865;
    --line: #cbd9d1;
    --accent: #356b24;
    --accent-ink: #ffffff;
    --cyan: #126e76;
    --grid: rgba(37, 94, 81, .075);
    --shadow: rgba(34, 65, 52, .09);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.shell { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.mono, .eyebrow, .brand, .theme-label, .theme-switch, .search-shortcut, .section-kicker, .section-count, .tool-index, .tool-link, .hero-status, .stat-label, .footer-inner, .category-nav { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.1rem; font-weight: 800; letter-spacing: -.055em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--accent); color: var(--accent); font-size: 1rem; letter-spacing: -.16em; padding-right: .16em; }
.brand span:last-child span { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 22px; }
.header-note { color: var(--muted); font-size: .77rem; letter-spacing: .08em; text-transform: uppercase; }
.theme-control { display: flex; align-items: center; gap: 10px; }
.theme-label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.theme-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.theme-switch button { padding: 6px 10px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: .72rem; }
.theme-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.hero { padding-top: clamp(72px, 10vw, 142px); padding-bottom: 76px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .65fr); gap: 48px; align-items: end; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--accent); box-shadow: 0 0 15px var(--accent); }
h1 { margin: 19px 0 22px; max-width: 800px; font-size: clamp(3.35rem, 7.6vw, 7rem); line-height: .99; font-weight: 800; letter-spacing: -.075em; }
h1 em { color: var(--accent); font-style: normal; }
.hero-copy { max-width: 580px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.17rem); line-height: 1.75; }
.hero-panel { border: 1px solid var(--line); background: var(--surface); box-shadow: 12px 12px 0 var(--shadow); }
.panel-top { display: flex; gap: 5px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.panel-top i { width: 7px; height: 7px; border: 1px solid var(--muted); border-radius: 50%; }
.panel-body { padding: 22px; }
.hero-status { margin: 0 0 24px; color: var(--cyan); font-size: .77rem; }
.hero-status::before { content: "> "; color: var(--accent); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { padding-top: 13px; border-top: 1px solid var(--line); }
.stat-number { display: block; font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -.06em; }
.stat-label { color: var(--muted); font-size: .69rem; text-transform: uppercase; letter-spacing: .07em; }
.browse { padding-top: 42px; padding-bottom: 100px; }
.browse-top { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; }
.browse-title { margin: 0; font-size: 1.4rem; letter-spacing: -.04em; }
.browse-subtitle { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.search-wrap { display: flex; align-items: center; gap: 10px; width: min(100%, 370px); padding: 10px 13px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.search-icon { color: var(--accent); font-family: ui-monospace, monospace; font-size: 1.1rem; }
.search-wrap:focus-within { border-color: var(--cyan); }
.search-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .85rem; }
.search-wrap input::placeholder { color: var(--muted); opacity: .9; }
.search-shortcut { padding: 2px 5px; border: 1px solid var(--line); font-size: .7rem; white-space: nowrap; }
.category-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 46px; }
.category-nav a { padding: 8px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); text-decoration: none; font-size: .73rem; }
.category-nav a:hover { border-color: var(--accent); color: var(--text); }
.category-nav a[aria-current="page"] { border-color: var(--accent); color: var(--text); }
.category-nav a::before { content: "# "; color: var(--accent); }
.category-page .hero { padding-top: clamp(54px, 7vw, 96px); padding-bottom: 54px; }
.category-page .hero h1 { font-size: clamp(3rem, 6vw, 5.5rem); }
.category-page .eyebrow a { text-decoration: none; }
.category-page .eyebrow a:hover { text-decoration: underline; }
.category-page .tool-section { margin-top: 0; }
.tool-section { margin-top: 44px; scroll-margin-top: 20px; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 13px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.section-kicker { color: var(--accent); font-size: .71rem; letter-spacing: .1em; text-transform: uppercase; }
.section-header h2 { margin: 4px 0 0; font-size: clamp(1.4rem, 2.5vw, 1.9rem); line-height: 1.2; letter-spacing: -.05em; }
.section-count { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tool-card { position: relative; display: flex; flex-direction: column; min-height: 210px; padding: 22px; border: 1px solid var(--line); background: var(--surface); transition: border-color .18s, transform .18s, background .18s; }
.tool-card:hover, .tool-card:focus-within { border-color: var(--accent); background: var(--surface-raised); transform: translateY(-3px); }
.tool-index { margin-bottom: 21px; color: var(--cyan); font-size: .72rem; }
.tool-card h3 { margin: 0 0 9px; font-size: 1.02rem; line-height: 1.3; letter-spacing: -.025em; }
.tool-card p { margin: 0 0 24px; color: var(--muted); font-size: .83rem; line-height: 1.55; }
.tool-link { display: inline-flex; align-items: center; gap: 8px; width: fit-content; margin-top: auto; color: var(--accent); font-size: .74rem; font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: .045em; }
.tool-link::after { content: "↗"; font-size: 1rem; line-height: 1; }
.tool-link::before { content: ""; position: absolute; inset: 0; }
.tool-card:hover .tool-link { text-decoration: underline; text-underline-offset: 4px; }
.empty-state { padding: 32px; border: 1px dashed var(--line); color: var(--muted); text-align: center; font-family: ui-monospace, monospace; }
.empty-state[hidden], .tool-section[hidden], .tool-card[hidden], .category-nav[hidden] { display: none; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 23px; padding-bottom: 23px; color: var(--muted); font-size: .74rem; }
.footer-inner strong { color: var(--accent); }
@media (max-width: 850px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { max-width: 420px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 32px, 1200px); }
  .header-inner { min-height: 68px; }
  .header-note, .theme-label, .search-shortcut { display: none; }
  .theme-control { gap: 0; }
  .theme-switch button { padding: 6px 8px; font-size: .68rem; }
  .hero { padding-top: 70px; padding-bottom: 54px; }
  .browse-top { align-items: stretch; flex-direction: column; }
  .search-wrap { width: 100%; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 175px; }
  .footer-inner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tool-card { transition: none; }
}
