/* Site-wide chrome shared by the hub homepage and every mounted tool:
   design tokens, header/footer/brand, and generic layout primitives.
   Tool-specific UI (dropzones, form controls, results cards, …) stays in
   each tool's own stylesheet — only true cross-tool concerns live here. */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #1a1d29;
  --text-muted: #5b6172;
  --border: #e2e5ec;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-contrast: #ffffff;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --surface: #171a23;
    --text: #e7e9f0;
    --text-muted: #9aa0b4;
    --border: #2a2e3a;
    --accent: #5b8def;
    --accent-hover: #7ba3f4;
    --accent-contrast: #0f1117;
    --danger: #f87171;
    --danger-bg: #2a1616;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #171a23;
  --text: #e7e9f0;
  --text-muted: #9aa0b4;
  --border: #2a2e3a;
  --accent: #5b8def;
  --accent-hover: #7ba3f4;
  --accent-contrast: #0f1117;
  --danger: #f87171;
  --danger-bg: #2a1616;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

body { overflow-x: hidden; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

.hint { color: var(--text-muted); font-size: 0.9rem; }

.error-text {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 14px;
  font-size: 0.92rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  text-decoration: underline;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}

/* ---------- Header / brand ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-icon { height: 40px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-name-dim { font-weight: 600; color: var(--text-muted); }
.brand-slogan {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.active { color: var(--accent); }

/* ---------- Hero (shared pattern; wording is per-page) ---------- */

.hero { padding: 40px 0 24px; text-align: center; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 10px; text-wrap: balance; }
.hero .sub { color: var(--text-muted); max-width: 640px; margin: 0 auto; }

/* ---------- Generic info/content cards (FAQ, how-it-works, policy pages) ---------- */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.info-card h2 { font-size: 1rem; margin-top: 0; }
.info-card ul, .info-card ol { padding-left: 20px; margin: 0; }
.info-card li { margin-bottom: 6px; }
.info-card p { margin: 0 0 10px; font-size: 0.92rem; }

/* Simple standalone pages (privacy, terms, etc.) */
.doc-page { max-width: 760px; padding-top: 32px; padding-bottom: 40px; }
.doc-page h1 { font-size: 1.8rem; margin-bottom: 4px; }
.doc-page .updated { margin-bottom: 28px; }
.doc-page .info-card { margin-bottom: 20px; }
.doc-page .back-link { margin-top: 28px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Tool hub grid (homepage) ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 8px 0 40px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s, transform 0.15s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-card .tool-icon { font-size: 2rem; margin-bottom: 10px; display: block; }
.tool-card h2 { font-size: 1.1rem; margin: 0 0 6px; }
.tool-card p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.tool-card.coming-soon { opacity: 0.55; cursor: default; }
.tool-card.coming-soon:hover { border-color: var(--border); transform: none; }
