/* ═══════════════════════════════════════════════════════════════
   Web Push Notifications — Main Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ── Custom Properties ─────────────────────────────────────────── */
:root {
  --clr-bg:          #fafbff;
  --clr-surface:     #ffffff;
  --clr-surface-2:   #f1f3fb;
  --clr-border:      #e2e6f3;
  --clr-text:        #1a1d2e;
  --clr-text-muted:  #6270a0;
  --clr-primary:     #6366f1;
  --clr-primary-dk:  #4f46e5;
  --clr-secondary:   #06b6d4;
  --clr-accent:      #8b5cf6;
  --clr-teal:        #14b8a6;
  --clr-link:        #4f46e5;
  --clr-link-hover:  #7c3aed;
  --clr-code-bg:     #f4f6fc;
  --clr-code-border: #dde2f5;

  --header-h: 64px;
  --radius:   10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 4px rgba(99,102,241,.08);
  --shadow-md: 0 4px 20px rgba(99,102,241,.12);
  --shadow-lg: 0 8px 40px rgba(99,102,241,.18);

  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --max-w: 1380px;
  --content-w: 960px;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--clr-text);
  background: var(--clr-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; display: block; }

/* ── Page wrapper (pushes footer to bottom) ─────────────────────── */
.page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Typography ────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}
h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  color: var(--clr-primary-dk);
  margin-top: 2.5rem;
  margin-bottom: .75rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--clr-border);
}
h3 {
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  color: var(--clr-accent);
  margin-top: 2rem;
  margin-bottom: .5rem;
}
h4 { font-size: 1.05rem; color: var(--clr-primary); margin-top: 1.5rem; margin-bottom: .4rem; }
p  { margin-bottom: 1.1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1.1rem; }
li { margin-bottom: .35rem; }
strong { color: var(--clr-primary-dk); font-weight: 600; }

/* In-page anchor offset for sticky header */
h1, h2, h3, h4, h5, h6 {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

/* ── Links ──────────────────────────────────────────────────────── */
a {
  color: var(--clr-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .18s, text-decoration-color .18s;
}
a:hover {
  color: var(--clr-link-hover);
  text-decoration-color: var(--clr-accent);
}

/* ── Sticky Header ──────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.logo-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--clr-text);
  letter-spacing: -0.03em;
}
.logo-accent { color: var(--clr-primary); }
.logo-link:hover .logo-text { color: var(--clr-primary-dk); }

/* ── Main Nav ───────────────────────────────────────────────────── */
.main-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .85rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--clr-text-muted);
  text-decoration: none;
  transition: background .18s, color .18s;
}
.nav-link:hover {
  background: var(--clr-surface-2);
  color: var(--clr-primary);
  text-decoration: none;
}
.nav-link--active {
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.1));
  color: var(--clr-primary);
}
.nav-icon { display: flex; align-items: center; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  border-radius: 6px;
}
.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Breadcrumb ─────────────────────────────────────────────────── */
.breadcrumb {
  margin-bottom: .6rem;
}
.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
  font-size: .8rem;
  color: var(--clr-text-muted);
}
.breadcrumb li { display: flex; align-items: center; gap: .25rem; }
.breadcrumb a { color: var(--clr-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--clr-primary); text-decoration: underline; }
.breadcrumb-sep { color: var(--clr-border); }
.breadcrumb [aria-current="page"] { color: var(--clr-primary); font-weight: 500; }

/* ── Content Area ───────────────────────────────────────────────── */
.content-main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 5rem;
}
/* Single centering point — breadcrumb and article share the same left edge */
.content-inner {
  max-width: 860px;
  margin: 0 auto;
}
.content-article {
  /* no independent max-width; inherits from .content-inner */
}

/* ── Code Blocks ────────────────────────────────────────────────── */
pre[class*="language-"] {
  position: relative;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--clr-code-border);
  background: var(--clr-code-bg) !important;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.65;
  padding: 1.25rem 1.25rem 1rem;
}
code[class*="language-"], pre[class*="language-"] * {
  font-family: var(--font-mono);
}
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--clr-code-bg);
  border: 1px solid var(--clr-code-border);
  border-radius: 4px;
  padding: .15em .4em;
  color: var(--clr-primary-dk);
}
.copy-btn {
  position: absolute;
  top: .6rem;
  right: .6rem;
  padding: .25rem .65rem;
  font-size: .75rem;
  font-family: var(--font-sans);
  font-weight: 500;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 6px;
  color: var(--clr-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity .18s, background .15s, color .15s;
  z-index: 5;
}
pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.copy-btn:hover { background: var(--clr-primary); color: #fff; border-color: var(--clr-primary); }
.copy-btn.copied { background: var(--clr-teal); color: #fff; border-color: var(--clr-teal); opacity: 1; }

/* ── Tables ─────────────────────────────────────────────────────── */
.content-article table,
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin: 1.5rem 0;
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5rem 0; border-radius: var(--radius); border: 1px solid var(--clr-border); }
.table-wrap table { margin: 0; }
th {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  color: #fff;
  font-weight: 600;
  padding: .7rem 1rem;
  text-align: left;
  font-size: .85rem;
  letter-spacing: .02em;
}
td { padding: .65rem 1rem; border-bottom: 1px solid var(--clr-border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: var(--clr-surface-2); }
tr:hover td { background: rgba(99,102,241,.05); }

/* ── Checkboxes (markdown-it-checkbox) ─────────────────────────── */
.content-article input[type="checkbox"],
input[type="checkbox"].task-list-item-checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  border: 2px solid var(--clr-primary);
  border-radius: 4px;
  background: var(--clr-surface);
  cursor: pointer;
  margin-right: .45rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.content-article input[type="checkbox"]:checked {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
}
.content-article input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.content-article input[type="checkbox"]:hover { border-color: var(--clr-accent); }
.task-list { list-style: none; padding-left: .25rem; }
.task-list-item { display: flex; align-items: flex-start; gap: .25rem; }

/* ── FAQ / Details Accordions ───────────────────────────────────── */
details {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  margin: 1rem 0;
  overflow: hidden;
  transition: box-shadow .18s;
}
details:hover { box-shadow: var(--shadow-sm); }
details[open] { box-shadow: var(--shadow-md); border-color: var(--clr-primary); }
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.2rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--clr-primary-dk);
  cursor: pointer;
  user-select: none;
  list-style: none;
  gap: 1rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '';
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
  transition: transform .2s;
}
details[open] summary::after { transform: rotate(180deg); }
details > *:not(summary) {
  padding: 0 1.2rem 1rem;
}
details[open] summary {
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: .5rem;
}

/* ── Blockquotes ────────────────────────────────────────────────── */
blockquote {
  border-left: 4px solid var(--clr-primary);
  background: linear-gradient(135deg, rgba(99,102,241,.05), rgba(139,92,246,.04));
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--clr-text-muted);
  font-style: italic;
}

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  background: var(--clr-text);
  color: rgba(255,255,255,.75);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 2rem;
}
.footer-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-nav-heading {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.5);
  margin-bottom: .75rem;
}
.footer-nav ul { list-style: none; padding: 0; margin: 0; }
.footer-nav li { margin-bottom: .4rem; }
.footer-nav a {
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .875rem;
  transition: color .15s;
}
.footer-nav a:hover { color: var(--clr-secondary); text-decoration: none; }
.footer-copy {
  font-size: .8rem;
  color: rgba(255,255,255,.35);
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1.5rem;
  margin: 0;
}

/* ── Home Page ──────────────────────────────────────────────────── */
.home-main { flex: 1; }
.hero {
  background: linear-gradient(135deg, #eef0ff 0%, #f0e8ff 50%, #e8f8ff 100%);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}
.hero-inner { max-width: 860px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #4338ca, #7c3aed, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--clr-text-muted);
  margin-bottom: 2.25rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s, background .18s;
  cursor: pointer;
  border: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,.35);
}
.btn-primary:hover { box-shadow: 0 6px 25px rgba(99,102,241,.5); color: #fff; }
.btn-secondary {
  background: linear-gradient(135deg, #0e7490, var(--clr-secondary));
  color: #fff;
  box-shadow: 0 4px 15px rgba(6,182,212,.3);
}
.btn-secondary:hover { box-shadow: 0 6px 25px rgba(6,182,212,.45); color: #fff; }
.btn-tertiary {
  background: linear-gradient(135deg, #5b21b6, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 15px rgba(124,58,237,.3);
}
.btn-tertiary:hover { box-shadow: 0 6px 25px rgba(124,58,237,.45); color: #fff; }
.btn-icon { font-size: 1.2rem; }

/* Home Sections Grid */
.home-sections {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.home-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}
.section-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.section-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--clr-primary);
  text-decoration: none;
}
.section-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}
.icon-backend  { background: linear-gradient(135deg,rgba(99,102,241,.15),rgba(139,92,246,.1)); color: var(--clr-primary); }
.icon-protocols{ background: linear-gradient(135deg,rgba(6,182,212,.15),rgba(59,130,246,.1));  color: var(--clr-secondary); }
.icon-frontend { background: linear-gradient(135deg,rgba(124,58,237,.15),rgba(167,139,250,.1)); color: var(--clr-accent); }
.section-card h3 {
  font-size: 1.15rem;
  color: var(--clr-text);
  margin: 0 0 .6rem;
}
.section-card p {
  font-size: .9rem;
  color: var(--clr-text-muted);
  margin: 0 0 1rem;
  line-height: 1.65;
}
.card-links { list-style: none; padding: 0; margin: 0; }
.card-links li { margin-bottom: .3rem; }
.card-links a {
  font-size: .85rem;
  color: var(--clr-link);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.card-links a::before { content: '→'; opacity: .5; }
.card-links a:hover { color: var(--clr-link-hover); text-decoration: underline; }

.home-about {
  background: var(--clr-surface-2);
  border-top: 1px solid var(--clr-border);
  padding: 3rem 1.5rem;
}
.home-about-inner {
  max-width: 800px;
  margin: 0 auto;
}
.home-about h2 {
  border: none;
  margin-top: 0;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    flex-direction: column;
    align-items: stretch;
    padding: .75rem 1rem;
    box-shadow: var(--shadow-md);
    gap: .25rem;
  }
  .main-nav.is-open { display: flex; }
  .nav-link { padding: .75rem 1rem; border-radius: 8px; }
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .content-main { padding: 1.25rem 1rem 3rem; }
}
@media (min-width: 1200px) {
  .content-main { padding: 2rem 2.5rem 5rem; }
}
@media (min-width: 1600px) {
  :root { --max-w: 1560px; }
}

/* ── Print ──────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .breadcrumb, .copy-btn { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  pre { border: 1px solid #ccc; }
}

