/* ============================================================
   PromptSathi — Shared Design System
   Pure CSS. Themes scoped via [data-theme] on <html>.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --accent1: #6C5CE7;
  --accent2: #A855F7;
  --accent-gradient: linear-gradient(135deg, #6C5CE7, #A855F7);
  --radius: 16px;
  --radius-sm: 10px;
  --danger: #E5484D;
  --success: #2FA84F;
  --warning: #B45309;
  --warning-bg: #FEF3C7;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #0B0E17;
  --bg-elev: #121626;
  --bg-soft: #171C33;
  --text: #EDF0FA;
  --muted: #9AA3C0;
  --border: #1E2440;
  --header-bg: rgba(11, 14, 23, .85);
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --code-bg: #0A0D18;
  --thumb-text: #EDF0FA;
}

[data-theme="light"] {
  --bg: #FAFBFF;
  --bg-elev: #FFFFFF;
  --bg-soft: #F1F3FB;
  --text: #14172B;
  --muted: #5B6178;
  --border: #E6E8F2;
  --header-bg: rgba(250, 251, 255, .85);
  --shadow: 0 8px 24px rgba(20, 23, 43, .08);
  --code-bg: #10142A;
  --thumb-text: #FFFFFF;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 .6em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent1); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--accent1);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

.section { padding: 4.5rem 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-head { max-width: 680px; margin: 0 auto 2.5rem; text-align: center; }
.section-head.left { text-align: left; margin-left: 0; margin-right: 0; }
.section-title { margin-bottom: .5rem; }
.section-sub { color: var(--muted); margin-bottom: 0; font-size: 1.05rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  flex: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-left: 1rem;
}
.nav-links a {
  color: var(--muted);
  font-size: .925rem;
  font-weight: 500;
  padding: .5rem .75rem;
  border-radius: 8px;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.theme-toggle {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.theme-toggle:hover { background: var(--bg-soft); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 600;
  font-size: .95rem;
  padding: .7rem 1.4rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 6px 18px rgba(108, 92, 231, .35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(108, 92, 231, .45); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-soft); }

.btn-sm { padding: .45rem .95rem; font-size: .85rem; border-radius: 9px; }
.btn-lg { padding: .95rem 2rem; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5.5rem 0 4.5rem;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.hero-bg .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .45;
}
.hero-bg .blob-1 {
  width: 480px; height: 480px;
  background: var(--accent1);
  top: -160px; left: -120px;
  animation: drift 18s ease-in-out infinite alternate;
}
.hero-bg .blob-2 {
  width: 420px; height: 420px;
  background: var(--accent2);
  bottom: -180px; right: -100px;
  animation: drift 22s ease-in-out infinite alternate-reverse;
}
.hero-bg .blob-3 {
  width: 260px; height: 260px;
  background: #38BDF8;
  top: 40%; left: 55%;
  opacity: .25;
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg .blob { animation: none; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

.hero-content { max-width: 760px; margin: 0 auto; position: relative; }
.hero-title { margin-bottom: 1rem; }
.hero-title .grad {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--muted); font-size: 1.15rem; margin-bottom: 2rem; }
.hero-ctas { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 3rem;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat-num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-stats .stat-label { color: var(--muted); font-size: .875rem; }

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); }
.card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1.15rem; margin-bottom: .5rem; }
.card-desc { color: var(--muted); font-size: .95rem; flex: 1; }
.card-actions { margin-top: 1.25rem; display: flex; gap: .6rem; flex-wrap: wrap; }

.prompt-card { cursor: default; }
.prompt-card:hover { transform: translateY(-6px); }

.thumb {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, var(--g1, #6C5CE7), var(--g2, #A855F7));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.25), transparent 60%);
}
.thumb-label {
  position: relative;
  z-index: 1;
  color: var(--thumb-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  text-align: center;
  padding: 0 1.25rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-model { color: var(--accent1); border-color: rgba(108, 92, 231, .35); }
.badge-cat { color: var(--accent2); border-color: rgba(168, 85, 247, .35); }
.badge-duration { color: var(--muted); }

.tool-card { text-align: left; }
.tool-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--accent-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}
.tool-icon svg { width: 26px; height: 26px; }

.model-card, .cat-card {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  color: var(--text);
  transition: transform .2s ease, border-color .2s ease;
}
.model-card:hover, .cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent1);
  text-decoration: none;
}
.model-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--g1, #6C5CE7), var(--g2, #A855F7));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  flex: none;
}
.model-card h3, .cat-card h3 { margin: 0; font-size: 1.05rem; }
.model-card p, .cat-card p { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; }

/* ---------- Forms / filters ---------- */
.form-control {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent1);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, .18);
}
.form-control::placeholder { color: var(--muted); }

.search-bar { display: flex; gap: .6rem; max-width: 640px; margin: 0 auto 1.5rem; }

.filters { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2rem; }
.filter-group { display: inline-flex; align-items: center; gap: .5rem; }
.filter-group label { font-size: .875rem; font-weight: 600; color: var(--muted); }
.filter-group select.form-control, .filter-group .form-control { width: auto; }

label.field-label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .4rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.empty-state svg { width: 44px; height: 44px; margin-bottom: 1rem; opacity: .6; }
.empty-state h3 { color: var(--text); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-size: .875rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb li + li::before { content: "/"; margin-right: .5rem; opacity: .6; }

/* ---------- Prompt box ---------- */
.prompt-box {
  background: var(--code-bg);
  color: #E8ECF8;
  border-radius: var(--radius);
  padding: 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  border: 1px solid rgba(255, 255, 255, .06);
}
.prompt-field {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
}

/* ---------- Demo badge ---------- */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #FCD34D;
  border-radius: 999px;
  padding: .3rem .8rem;
}
[data-theme="dark"] .demo-badge {
  background: rgba(180, 83, 9, .18);
  border-color: rgba(252, 211, 77, .4);
  color: #FCD34D;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  max-width: 460px;
  z-index: 200;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  transform: translateY(140%);
  transition: transform .4s ease;
}
.cookie-banner.show { transform: none; }
.cookie-banner p { font-size: .875rem; color: var(--muted); margin: 0 0 1rem; }
.cookie-banner .cookie-actions { display: flex; gap: .6rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translate(-50%, 140%);
  z-index: 300;
  background: var(--text);
  color: var(--bg);
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform .35s ease;
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 0;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2.5rem;
}
.footer .brand { margin-bottom: .8rem; }
.footer-desc { color: var(--muted); font-size: .9rem; max-width: 300px; }
.footer h4 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer ul li { margin-bottom: .55rem; }
.footer ul a { color: var(--text); font-size: .92rem; }
.footer ul a:hover { color: var(--accent1); }
.footer-social { display: flex; gap: .6rem; margin-top: 1.1rem; }
.footer-social a {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
}
.footer-social a:hover { color: var(--text); border-color: var(--accent1); }
.footer-social svg { width: 17px; height: 17px; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .85rem;
}

/* ---------- Blog ---------- */
.post { max-width: 720px; margin: 0 auto; }
.post-meta {
  display: flex;
  gap: .75rem;
  align-items: center;
  color: var(--muted);
  font-size: .875rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.prose { font-size: 1.05rem; line-height: 1.8; }
.prose h2, .prose h3 { margin-top: 2em; }
.prose p { margin-bottom: 1.2em; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose blockquote {
  border-left: 4px solid var(--accent1);
  margin: 1.5em 0;
  padding: .5em 1.2em;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--bg-soft);
  padding: .15em .45em;
  border-radius: 6px;
}
.prose pre code { background: none; padding: 0; }
.prose pre {
  background: var(--code-bg);
  color: #E8ECF8;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: .9rem;
}

/* ---------- Dropzone / tools ---------- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  background: var(--bg-elev);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent1);
  background: var(--bg-soft);
}
.dropzone svg { width: 44px; height: 44px; color: var(--accent1); margin-bottom: .8rem; }
.dropzone p { color: var(--muted); margin: 0; font-size: .95rem; }

.progress {
  height: 10px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 999px;
  width: 0;
  transition: width .4s ease;
}

/* Before / after compare slider */
.compare-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  user-select: none;
  touch-action: none;
}
.compare-wrap img { width: 100%; display: block; pointer-events: none; }
.compare-after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
  overflow: hidden;
}
.compare-after img { height: 100%; object-fit: cover; }
.compare-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 12px rgba(0,0,0,.4);
  transform: translateX(-50%);
}
.compare-handle::after {
  content: "↔";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #14172B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.tab-btn {
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  background: none;
  border: none;
  color: var(--muted);
  padding: .8rem 1.1rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn[aria-selected="true"] { color: var(--accent1); border-bottom-color: var(--accent1); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Table ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  background: var(--bg-elev);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th, .table td {
  text-align: left;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-family: var(--font-display);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--bg-soft);
}
.table tr:last-child td { border-bottom: none; }

/* ---------- Mobile filter drawer ---------- */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(340px, 88vw);
  z-index: 250;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform .35s ease;
  padding: 1.5rem;
  overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.drawer-header h3 { margin: 0; }
.drawer-close {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.pagination a, .pagination button {
  min-width: 42px; height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 .9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
}
.pagination a:hover, .pagination button:hover { border-color: var(--accent1); text-decoration: none; }
.pagination [aria-current="page"] {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

/* ---------- Newsletter / misc ---------- */
.newsletter { text-align: center; max-width: 560px; margin: 0 auto; }
.newsletter-form { display: flex; gap: .6rem; margin-top: 1.5rem; }
.newsletter-note { color: var(--muted); font-size: .85rem; margin-top: .9rem; }
.newsletter-success {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: rgba(47, 168, 79, .12);
  border: 1px solid var(--success);
  color: var(--success);
  font-weight: 600;
}

.page-hero { padding: 3.5rem 0 2.5rem; text-align: center; }
.page-hero h1 { margin-bottom: .6rem; }
.page-hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }

.cta-band {
  background: var(--accent-gradient);
  border-radius: calc(var(--radius) * 1.5);
  color: #fff;
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.18), transparent 50%),
              radial-gradient(circle at 85% 80%, rgba(255,255,255,.12), transparent 50%);
}
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 520px; margin: 0 auto 1.8rem; }
.cta-band .btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,.12); }
.cta-band .btn-primary { background: #fff; color: var(--accent1); box-shadow: 0 8px 22px rgba(0,0,0,.2); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: .75rem 1.25rem 1.25rem;
    margin: 0;
    gap: 0;
    display: none;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .nav-links a { padding: .8rem .6rem; font-size: 1rem; }
  .site-header.nav-open .nav-links { display: flex; }
  .nav-toggle { display: inline-flex; }
  .header-actions .btn { display: none; }

  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 3rem 0; }
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .newsletter-form { flex-direction: column; }
  .search-bar { flex-direction: column; }
}

@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
  .hero-ctas .btn { width: 100%; }
  .cookie-banner { left: .75rem; right: .75rem; bottom: .75rem; }
  .footer-bottom { justify-content: center; text-align: center; }
}

/* ---------- Ad slots (placeholders filled from /api/settings/public) ---------- */
.ad-slot { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-slot:empty { display: none; }
/* Article sidebar slot is desktop-only; hidden on mobile. */
@media (max-width: 768px) {
  .ad-slot-sidebar { display: none; }
}
