:root {
  --nav-h: 4rem;
  --primary: #065f46;
  --primary-light: #059669;
  --secondary: #1e40af;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: var(--nav-h);
}

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

/* ——— Top navigation ——— */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.site-nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  min-width: 0;
}

.site-brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.site-brand-text strong {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-brand-text span {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
}

.site-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.site-menu a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.site-menu a:hover {
  color: var(--primary);
  background: #ecfdf5;
}

.site-menu a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.site-menu a.external {
  color: var(--secondary);
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.site-menu a.external:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.site-nav.open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-nav.open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ——— Page hero ——— */
.page-hero {
  background: linear-gradient(135deg, #064e3b 0%, var(--primary-light) 55%, #34d399 100%);
  color: #fff;
  padding: 2rem 1.25rem 2.25rem;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,0.14) 0%, transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(0,0,0,0.12) 0%, transparent 40%);
  pointer-events: none;
}

.page-hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
}

.page-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-hero p {
  margin: 0;
  max-width: 42rem;
  opacity: 0.92;
  font-size: 0.95rem;
}

.page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.hero-chip {
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

body.page-review .page-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, var(--secondary) 50%, #3b82f6 100%);
}

body.page-questions .page-hero {
  background: linear-gradient(135deg, #7c2d12 0%, #ea580c 55%, #fb923c 100%);
}

/* ——— Site footer ——— */
.site-footer {
  margin-top: 3rem;
  background: #0f172a;
  color: #94a3b8;
  padding: 2.5rem 1.25rem 2rem;
}

.site-footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}

.site-footer h4 {
  color: #f1f5f9;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.site-footer p, .site-footer li {
  font-size: 0.82rem;
  margin: 0 0 0.4rem;
  line-height: 1.55;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer a {
  color: #cbd5e1;
  text-decoration: none;
}

.site-footer a:hover { color: #fff; }

.site-footer-bottom {
  max-width: var(--max);
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid #334155;
  font-size: 0.78rem;
  text-align: center;
  color: #64748b;
}

/* ——— Landing page ——— */
.landing-main { max-width: var(--max); margin: 0 auto; padding: 2rem 1.25rem 3rem; }

.landing-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: -2.5rem auto 2rem;
  max-width: var(--max);
  padding: 0 1.25rem;
  position: relative;
  z-index: 2;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  font-size: 1.65rem;
  color: var(--primary-light);
  line-height: 1.1;
}

.stat-card span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.landing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.landing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  border-color: #bbf7d0;
}

.landing-card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: #ecfdf5;
}

.landing-card:nth-child(2) .landing-card-icon { background: #eff6ff; }
.landing-card:nth-child(3) .landing-card-icon { background: #fff7ed; }

.landing-card h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.landing-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  flex: 1;
}

.landing-card-cta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-light);
}

.landing-info {
  margin-top: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.landing-info h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  color: var(--secondary);
}

.landing-info p {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: #475569;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.btn-secondary {
  background: #eff6ff;
  color: var(--secondary);
  border: 1px solid #bfdbfe;
}

.btn:hover { transform: translateY(-1px); }

/* ——— Overrides for existing pages ——— */
.tabs-nav { top: var(--nav-h) !important; }

body > .header { display: none !important; }

footer:not(.site-footer) { display: none !important; }

body.page-catalog { background: #f1f5f9; }

body.page-review .container { padding-top: 1.5rem; }

body.page-questions .context-box {
  margin-top: 1.25rem;
  padding-top: 0;
}

body.page-questions .context-inner {
  box-shadow: var(--shadow);
}

/* Smooth tab labels on catalog */
.tabs-nav {
  border-top: none;
  padding-top: 0.25rem;
}

.tab-label {
  border-radius: 10px 10px 0 0;
}

/* Review page quick links bar */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.quick-links a {
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--secondary);
  border: 1px solid #bfdbfe;
}

.quick-links a:hover { background: #dbeafe; }

/* Mobile */
@media (max-width: 860px) {
  .landing-stats { grid-template-columns: repeat(2, 1fr); margin-top: -1.5rem; }
  .landing-grid { grid-template-columns: 1fr; }
  .landing-info { grid-template-columns: 1fr; }
  .site-footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }

  .nav-toggle { display: flex; }

  .site-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    gap: 0.35rem;
    box-shadow: var(--shadow);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s, opacity 0.25s;
  }

  .site-nav.open .site-menu {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-menu a {
    padding: 0.75rem 1rem;
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .landing-stats { grid-template-columns: 1fr 1fr; }
  .site-brand-text span { display: none; }
}

@media print {
  .site-nav, .page-hero, .site-footer { display: none !important; }
  body { padding-top: 0; }
  .tabs-nav { top: 0 !important; }
}
