/* ==========================================================
   Pop3Fetch — Shared marketing theme
   Dark premium palette, blue gradients of #2d5be3 (logo blue).
   Loaded on every marketing page. Page-specific styles live
   inline in each page's <style> block.
   ========================================================== */

:root {
  --bg: #0b1020;
  --bg-soft: #11182d;
  --bg-elev: #151c34;
  --card: rgba(255,255,255,0.045);
  --card-strong: rgba(255,255,255,0.07);
  --card-border: rgba(255,255,255,0.08);
  --card-border-strong: rgba(255,255,255,0.14);
  --text: #f7f8fb;
  --muted: #a7b0c3;
  --muted-2: #7d869c;
  --accent: #2d5be3;
  --accent-2: #4a90ff;
  --accent-soft: #9ab8ff;
  --green: #37d39a;
  --rose: #ff6b8b;
  --amber: #f5b86b;
  --glow: rgba(45,91,227,0.35);
  --glow-2: rgba(74,144,255,0.32);
  --grad: linear-gradient(135deg, #2d5be3 0%, #4a90ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(45,91,227,0.2), rgba(74,144,255,0.2));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(45,91,227,0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(74,144,255,0.12), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Inter Tight', sans-serif;
  letter-spacing: -0.02em;
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgba(45,91,227,0.45); color: white; }

/* ====== NAV ====== */
.nav-wrap {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(11,16,32,0.65);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
nav {
  max-width: 1200px; margin: 0 auto;
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Inter Tight', sans-serif; font-weight: 700; font-size: 19px;
  letter-spacing: -0.02em; color: var(--text);
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  box-shadow: 0 6px 18px var(--glow);
  display: block; overflow: hidden;
}
.logo-mark svg { display: block; width: 100%; height: 100%; }
.logo .wordmark { display: inline-block; line-height: 1; }
.logo .wordmark span {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a:not(.btn) {
  font-size: 14px; color: var(--muted);
  padding: 8px 14px; border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav-links a:not(.btn):hover { color: var(--text); background: rgba(255,255,255,0.04); }

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: 'Inter', sans-serif; border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad); color: white;
  box-shadow: 0 10px 30px var(--glow), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 36px var(--glow), inset 0 1px 0 rgba(255,255,255,0.22); }
.btn-ghost {
  background: rgba(255,255,255,0.04); color: var(--text);
  border-color: var(--card-border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: var(--card-border-strong); }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 12px; }

/* ====== HAMBURGER (mobile) ====== */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ====== SECTION PRIMITIVES ====== */
.section { max-width: 1200px; margin: 0 auto; padding: 90px 28px; position: relative; }
.section-narrow { max-width: 820px; }
.section-soft { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.02) 30%, rgba(255,255,255,0.02) 70%, transparent); }
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-soft);
  padding: 6px 12px; border-radius: 100px;
  background: rgba(45,91,227,0.1); border: 1px solid rgba(45,91,227,0.22);
  margin-bottom: 18px;
}
h1.page-title {
  font-size: clamp(34px, 4.8vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}
h2.section-title {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.section-lead {
  font-size: 18px; color: var(--muted); max-width: 620px; line-height: 1.6;
  margin-bottom: 16px;
}

/* ====== PROSE (article content) ====== */
.prose { color: var(--muted); font-size: 16px; line-height: 1.75; }
.prose h2 { font-size: 26px; color: var(--text); margin: 56px 0 16px; font-weight: 700; letter-spacing: -0.02em; }
.prose h3 { font-size: 19px; color: var(--text); margin: 36px 0 10px; font-weight: 600; letter-spacing: -0.01em; }
.prose p { margin-bottom: 18px; }
.prose a { color: var(--accent-soft); text-decoration: underline; text-decoration-color: rgba(154,184,255,0.4); transition: color .2s; }
.prose a:hover { color: white; text-decoration-color: var(--accent-soft); }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 20px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.92em;
  font-family: 'JetBrains Mono', 'Menlo', Monaco, monospace;
  color: var(--accent-soft);
}
.prose pre {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 22px 0;
  font-size: 13.5px;
  line-height: 1.55;
}
.prose pre code {
  background: none; border: none; padding: 0; color: var(--text);
}
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  margin: 22px 0;
  color: var(--text);
  font-size: 17px;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 40px 0;
}
.prose table {
  width: 100%; border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  margin: 28px 0;
  font-size: 14px;
}
.prose th, .prose td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
}
.prose th { color: var(--text); font-weight: 600; background: rgba(255,255,255,0.025); }
.prose td { color: var(--muted); }
.prose tr:last-child td { border-bottom: none; }

/* ====== CARDS / CALLOUTS ====== */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 24px;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--card-border-strong); }
.callout {
  background: var(--grad-soft);
  border: 1px solid rgba(45,91,227,0.3);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 24px 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
.callout strong { color: white; }
.callout a { color: var(--accent-soft); }

/* ====== BREADCRUMB ====== */
.breadcrumb {
  font-size: 13px;
  color: var(--muted-2);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--muted); transition: color .2s; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { margin: 0 8px; opacity: 0.6; }

/* ====== FOOTER ====== */
footer.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 50px 28px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 40px;
}
footer.site-footer .footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 24px;
  align-items: center; justify-content: space-between;
}
footer.site-footer a { color: var(--muted); transition: color .2s; }
footer.site-footer a:hover { color: var(--text); }
footer.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
footer.site-footer .footer-cert { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
footer.site-footer .footer-cert .ck { color: var(--green); }

/* ====== REVEAL (scroll fade) ======
   Defaults to fully visible — only the JS controller (marketing.js
   initReveal) sets `html.js-reveal` and then hides .reveal until the
   IntersectionObserver fires. This way, if JS fails to load (e.g.
   the file is opened directly via file:// and asset paths break),
   content still renders normally instead of disappearing. */
.reveal { transition: opacity .7s ease, transform .7s ease; }
html.js-reveal .reveal { opacity: 0; transform: translateY(20px); }
html.js-reveal .reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 720px) {
  .section { padding: 64px 22px; }
  nav { padding: 14px 22px; position: relative; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(11,16,32,0.97); backdrop-filter: blur(16px);
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px 18px 20px;
    border-bottom: 1px solid var(--card-border);
  }
  .nav-links.open { display: flex; }
  .nav-links a:not(.btn) { padding: 12px 14px; }
  .nav-links .btn { margin-top: 6px; }
  .hamburger { display: flex; }
  footer.site-footer .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}
