/* portal.css — shared shell for Buzz Tools: header, nav, footer + portal home.
   Loaded by the portal home page and by every tool page (via a relative link
   to this file from inside tools/<name>/). */

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1c1e21;
  --ink-soft: #6b7280;
  --rule: #e5e7eb;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --ring: rgba(79, 70, 229, 0.35);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -12px rgba(16, 24, 40, 0.18);
  --header-h: 56px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #1a1d24;
    --ink: #e7e9ee;
    --ink-soft: #9aa1ad;
    --rule: #2a2f3a;
    --accent: #6d65f0;
    --accent-hover: #7d76f5;
    --accent-ink: #ffffff;
    --accent-soft: rgba(109, 101, 240, 0.16);
    --ring: rgba(109, 101, 240, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- shared header (rendered by portal.js into #site-header) ---- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.site-header-inner {
  max-width: 1000px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.site-title:hover { color: var(--accent); }
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 6px 12px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 120ms ease, background 120ms ease;
}
.nav-link:hover { color: var(--ink); background: var(--accent-soft); }
.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* ---- portal home ---- */

.home {
  max-width: 1000px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 48px) 20px 48px;
}
.hero { margin-bottom: 40px; }
.hero h1 {
  margin: 0 0 10px;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.hero .tagline {
  margin: 0;
  max-width: 56ch;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 22px 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(16, 24, 40, 0.06), 0 16px 32px -16px rgba(16, 24, 40, 0.22);
}
.tool-icon { font-size: 1.6rem; line-height: 1; }
.tool-name { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.tool-desc { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--ink-soft); }
.tool-go {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.no-js {
  margin: 0;
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
}

/* ---- shared footer (rendered into #site-footer) ---- */

.site-footer {
  padding: 28px 20px 40px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
  border-top: 1px solid var(--rule);
}

@media (max-width: 520px) {
  .home { padding: calc(var(--header-h) + 32px) 16px 32px; }
  .hero h1 { font-size: 1.7rem; }
  .site-header-inner { padding: 0 14px; }
}
