:root {
  --bg: #0b0d12;
  --bg-elev: #12151c;
  --bg-elev-2: #181c26;
  --border: #262b38;
  --text: #e7e9ee;
  --text-dim: #9099ab;
  --text-faint: #626a7d;
  --accent: #5b9dff;
  --accent-dim: #2a4d8a;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --radius: 12px;
}

:root[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-elev: #ffffff;
  --bg-elev-2: #eef0f4;
  --border: #dde1e8;
  --text: #1a1d24;
  --text-dim: #565f70;
  --text-faint: #8993a6;
  --accent: #2563eb;
  --accent-dim: #dbe6ff;
  --shadow: 0 4px 24px rgba(20,20,30,0.08);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6f8;
    --bg-elev: #ffffff;
    --bg-elev-2: #eef0f4;
    --border: #dde1e8;
    --text: #1a1d24;
    --text-dim: #565f70;
    --text-faint: #8993a6;
    --accent: #2563eb;
    --accent-dim: #dbe6ff;
    --shadow: 0 4px 24px rgba(20,20,30,0.08);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.brand-mark { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand-mark .accent { color: var(--accent); }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-elev-2); color: var(--text); }

.main {
  max-width: 880px;
  margin: 0 auto;
  padding: 60px 24px 40px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tool-icon { font-size: 26px; line-height: 1; }
.tool-body h2 { margin: 0 0 6px; font-size: 17px; }
.tool-body p { margin: 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.45; }
.tool-link-hint {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}
.tool-card:hover .tool-link-hint { color: var(--accent); }

.footnote {
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
  margin: 56px 0 0;
}
.footnote a { color: var(--text-faint); text-decoration: underline; }
.footnote a:hover { color: var(--accent); }
