:root {
  color-scheme: light;
  --ink: #1b1a1f;
  --ink-soft: #4a4753;
  --muted: #767180;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --border: rgba(27, 26, 31, 0.08);
  --border-strong: rgba(27, 26, 31, 0.14);
  --accent: #6a5af9;
  --accent-soft: #efeaff;
  --lime: #d8ff62;
  --shadow-sm: 0 1px 2px rgba(27, 26, 31, 0.04), 0 2px 8px rgba(27, 26, 31, 0.04);
  --shadow-md: 0 8px 24px rgba(27, 26, 31, 0.08);
  --shadow-lg: 0 24px 60px rgba(27, 26, 31, 0.12);
  --radius: 16px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.home-page {
  background:
    radial-gradient(900px 480px at 100% -10%, rgba(106, 90, 249, 0.10), transparent 60%),
    radial-gradient(700px 420px at -10% 30%, rgba(255, 138, 107, 0.08), transparent 60%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img, svg { display: block; max-width: 100%; }

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 80px;
}

/* Header */
.site-header {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand img { width: 28px; height: 28px; border-radius: 8px; }

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.top-nav a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color .15s ease, background .15s ease;
}
.top-nav a:hover { color: var(--ink); background: rgba(27, 26, 31, 0.05); }
.top-nav a[aria-current="page"] { color: #fff; background: var(--ink); }
.top-nav a[aria-current="page"]:hover { color: #fff; background: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: #fff; background: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface); transform: translateY(-1px); color: var(--ink); }

/* Typography */
h1, h2, h3 { margin: 0; color: var(--ink); letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 4.6vw, 3.8rem); line-height: 1.04; font-weight: 700; }
h2 { font-size: clamp(1.55rem, 2.5vw, 2rem); line-height: 1.18; font-weight: 700; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lede { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.6; max-width: 56ch; margin: 0; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  padding: 56px 0 64px;
}
.hero-text > .lede { margin: 16px 0 28px; }
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--border);
}
.hero-stats > div { margin: 0; }
.hero-stats dt {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero-stats dd {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Hero preview stack */
.hero-preview { position: relative; min-height: 360px; }
.preview-stack { position: relative; width: 100%; min-height: 360px; }
.preview-card {
  position: absolute;
  display: grid;
  gap: 8px;
  padding: 22px;
  width: 78%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.preview-card::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent-tile, var(--accent-soft));
  margin-bottom: 6px;
}
.preview-card-1 { top: 0; right: 0; transform: rotate(3deg); z-index: 3; }
.preview-card-2 { top: 96px; right: 56px; transform: rotate(-2.5deg); z-index: 2; }
.preview-card-3 { top: 200px; right: 16px; transform: rotate(1.5deg); z-index: 1; opacity: 0.94; }
.preview-meta { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.preview-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); line-height: 1.25; }
.preview-domain { font-size: 0.8rem; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Sections */
.band { padding: 56px 0; }
.band-soft {
  margin: 24px 0 0;
  padding: 48px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.band-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.band-link { color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; }
.band-link:hover { color: var(--accent); }

/* Latest grid */
.latest-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.latest-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  gap: 10px;
  padding: 26px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.latest-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent-tile, var(--accent));
}
.latest-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  color: var(--ink);
}
.latest-card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.latest-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.latest-card-desc {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}
.latest-card-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 500;
  border-top: 1px dashed var(--border);
}
.latest-card-domain {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

/* Categories */
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.category-tile {
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 22px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 160px;
  color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.category-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  color: var(--ink);
}
.category-count {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-tile, var(--accent-soft));
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}
.category-name { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.category-latest { color: var(--muted); font-size: 0.82rem; line-height: 1.45; }

/* Callout */
.callout {
  margin-top: 32px;
  padding: 36px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.callout h2 { color: #fff; }
.callout .eyebrow { color: var(--lime); }
.callout .lede { color: rgba(255, 255, 255, 0.72); margin-top: 8px; }
.callout .btn-primary { background: #fff; color: var(--ink); box-shadow: none; }
.callout .btn-primary:hover { color: var(--ink); background: #fff; }

/* Directory page */
.directory-hero {
  padding: 48px 0 24px;
  display: grid;
  gap: 14px;
}
.directory-hero h1 { max-width: 760px; }
.directory-console { padding: 8px 0 56px; }
.directory-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) minmax(150px, 200px) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 24px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.directory-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.directory-controls input,
.directory-controls select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.directory-controls input:focus,
.directory-controls select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(106, 90, 249, 0.15);
}
.result-count {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.project-card[hidden] { display: none; }
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.project-card-link {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  padding: 20px;
  align-items: start;
  color: var(--ink);
}
.project-card-link:hover { color: var(--ink); }
.project-visual {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-tile, var(--accent-soft));
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.project-copy { display: grid; gap: 6px; min-width: 0; }
.project-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.project-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); line-height: 1.25; letter-spacing: -0.01em; }
.project-description { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; }
.project-domain {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.empty-state {
  margin-top: 12px;
  padding: 28px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 600;
  background: var(--surface);
}

/* Accent palette (soft pastel tiles) */
.accent-calculators { --accent-tile: #d6f3ed; }
.accent-planners    { --accent-tile: #fde8c2; }
.accent-guides      { --accent-tile: #d9eedf; }
.accent-generators  { --accent-tile: #ffd9cf; }
.accent-tools       { --accent-tile: #e4dcff; }

/* Footer */
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 60px auto 40px;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); font-weight: 500; }
.site-footer a:hover { color: var(--accent); }

/* Legal */
.legal-shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 64px; }
.legal-card {
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.legal-card h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 6px; }
.legal-card h2 { margin-top: 24px; font-size: 1.05rem; }
.legal-card p { color: var(--ink-soft); line-height: 1.7; }
.legal-card a { color: var(--accent); font-weight: 600; }
.legal-card a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 1040px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-preview { min-height: 280px; max-width: 460px; }
  .latest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-controls { grid-template-columns: 1fr 1fr; }
  .result-count { justify-self: start; }
}

@media (max-width: 720px) {
  .top-nav { padding: 3px; }
  .top-nav a { padding: 0 10px; height: 32px; font-size: 0.82rem; }
  .latest-grid, .category-grid, .directory-grid { grid-template-columns: 1fr; }
  .directory-controls { grid-template-columns: 1fr; }
  .hero { padding: 32px 0 48px; }
  .hero-stats { gap: 16px; }
  .hero-stats dt { font-size: 1.4rem; }
  .callout { flex-direction: column; align-items: flex-start; padding: 28px; }
  .band { padding: 40px 0; }
  .band-soft { padding: 32px 20px; border-radius: var(--radius); }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .legal-card { padding: 24px; }
  .preview-card { width: 92%; }
  .preview-card-2 { right: 24px; }
  .preview-card-3 { right: 0; }
}
