/* ============================================================
   Edge Middleware — Main Stylesheet
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  /* Brand colours */
  --c-blue-50:    #eff6ff;
  --c-blue-100:   #dbeafe;
  --c-blue-200:   #bfdbfe;
  --c-blue-300:   #93c5fd;
  --c-blue-500:   #3b82f6;
  --c-blue-600:   #2563eb;
  --c-blue-700:   #1d4ed8;
  --c-indigo-500: #6366f1;
  --c-indigo-600: #4f46e5;
  --c-sky-400:    #38bdf8;
  --c-sky-500:    #0ea5e9;
  --c-cyan-400:   #22d3ee;
  --c-cyan-500:   #06b6d4;
  --c-violet-500: #8b5cf6;
  --c-violet-600: #7c3aed;
  --c-emerald-500:#10b981;
  --c-emerald-600:#059669;
  --c-orange-500: #f97316;
  --c-orange-600: #ea580c;
  --c-rose-500:   #f43f5e;
  --c-rose-600:   #e11d48;
  --c-amber-500:  #f59e0b;

  /* Neutral/surface */
  --c-slate-50:   #f8fafc;
  --c-slate-100:  #f1f5f9;
  --c-slate-200:  #e2e8f0;
  --c-slate-300:  #cbd5e1;
  --c-slate-400:  #94a3b8;
  --c-slate-500:  #64748b;
  --c-slate-600:  #475569;
  --c-slate-700:  #334155;
  --c-slate-800:  #1e293b;
  --c-slate-900:  #0f172a;

  /* Semantic tokens */
  --color-bg:         var(--c-slate-50);
  --color-surface:    #ffffff;
  --color-border:     var(--c-slate-200);
  --color-border-mid: var(--c-slate-300);
  --color-text:       var(--c-slate-900);
  --color-text-body:  var(--c-slate-700);
  --color-text-muted: var(--c-slate-500);
  --color-text-faint: var(--c-slate-400);
  --color-primary:    var(--c-blue-600);
  --color-primary-hover: var(--c-blue-700);
  --color-accent:     var(--c-sky-500);

  /* Layout */
  --header-height: 64px;
  --container-max: 1400px;
  --content-max:   1080px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);

  /* Code */
  --code-bg:       #f8fafc;
  --code-border:   var(--c-slate-200);
  --code-text:     var(--c-slate-800);
  --code-font:     'Fira Code', 'Cascadia Code', 'Consolas', 'Monaco', monospace;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-body);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Anchor offset for sticky header */
h1, h2, h3, h4, h5, h6, :target {
  scroll-margin-top: calc(var(--header-height) + 24px);
}

/* ---- Typography helpers ---- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}
.logo-link:hover { opacity: .85; text-decoration: none; }

.logo-img { width: 40px; height: 40px; flex-shrink: 0; }

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.logo-text-main {
  font-size: .95rem;
  font-weight: 700;
  color: var(--c-slate-900);
  letter-spacing: -.01em;
}
.logo-text-sub {
  font-size: .7rem;
  color: var(--color-text-muted);
  font-weight: 400;
  letter-spacing: .01em;
}

/* Desktop navigation */
.main-nav { margin-left: auto; }

.nav-list {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .85rem;
  border-radius: var(--radius-md);
  font-size: .875rem;

  font-weight: 500;
  color: var(--c-slate-600);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--color-primary);
  background-color: var(--c-blue-50);
  text-decoration: none;
}
.nav-link--active {
  color: var(--color-primary);
  background-color: var(--c-blue-50);
  font-weight: 600;
}
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-left: auto;
  transition: background var(--transition-fast);
}
.nav-toggle:hover { background: var(--c-slate-100); }
.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--c-slate-600);
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-fast);
}

/* Mobile nav */
.mobile-nav {
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: .75rem 1.5rem 1rem;
  z-index: 99;
}
.mobile-nav[hidden] { display: none; }

.mobile-nav-list { display: flex; flex-direction: column; gap: .25rem; }

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem .85rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 500;
  color: var(--c-slate-700);
  text-decoration: none;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.mobile-nav-link:hover { color: var(--color-primary); background: var(--c-blue-50); text-decoration: none; }
.mobile-nav-link--active { color: var(--color-primary); background: var(--c-blue-50); font-weight: 600; }

/* ============================================================
   SHARED LAYOUT UTILITIES
   ============================================================ */
main { flex: 1; }

.section-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--c-slate-900);
  text-align: center;
  letter-spacing: -.02em;
  margin-bottom: .75rem;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
  line-height: 1.65;
}

/* ============================================================
   HOME — HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 45%, #f0fdff 100%);
  padding: 5rem 1.5rem 5rem;
  border-bottom: 1px solid var(--c-blue-100);
}

.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }
.hero-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .35;
}
.hero-shape-1 {
  width: 500px; height: 500px;
  top: -150px; right: -100px;
  background: radial-gradient(circle, var(--c-blue-200), transparent 70%);
}
.hero-shape-2 {
  width: 400px; height: 400px;
  bottom: -100px; left: 10%;
  background: radial-gradient(circle, var(--c-sky-400), transparent 70%);
  opacity: .2;
}
.hero-shape-3 {
  width: 300px; height: 300px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--c-indigo-500), transparent 70%);
  opacity: .08;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .85rem;
  background: white;
  border: 1px solid var(--c-blue-200);
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-blue-600);
  letter-spacing: .01em;
  margin-bottom: 1.25rem;
}
.hero-badge-icon { width: 13px; height: 13px; }

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 800;
  color: var(--c-slate-900);
  line-height: 1.15;
  letter-spacing: -.025em;
  margin-bottom: 1.25rem;
}
.hero-title-accent {
  background: linear-gradient(135deg, var(--c-blue-600), var(--c-indigo-500) 50%, var(--c-sky-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--c-slate-700);
  margin-bottom: .75rem;
  line-height: 1.7;
}
.hero-sub {
  font-size: .95rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  line-height: 1.65;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--c-blue-600), var(--c-indigo-600));
  color: white;
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(37,99,235,.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--c-blue-700), var(--c-indigo-600));
  color: white;
}
.btn-secondary {
  background: white;
  color: var(--c-slate-700);
  border: 1.5px solid var(--color-border-mid);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { color: var(--color-primary); border-color: var(--c-blue-300); }

/* Hero visual / diagram */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-diagram {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
}
.hd-node {
  padding: .65rem 1rem;
  border-radius: var(--radius-md);
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
  min-width: 64px;
  white-space: nowrap;
}
.hd-node-client { background: var(--c-blue-50); color: var(--c-blue-600); border: 1.5px solid var(--c-blue-200); }
.hd-node-origin { background: var(--c-slate-100); color: var(--c-slate-600); border: 1.5px solid var(--c-slate-200); }

.hd-arrow { color: var(--c-slate-300); flex-shrink: 0; }
.hd-arrow svg { width: 40px; }

.hd-stack {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex: 1;
}
.hd-layer {
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: .02em;
}
.hd-layer-auth    { background: linear-gradient(90deg, #fef3c7, #fde68a); color: #92400e; }
.hd-layer-route   { background: linear-gradient(90deg, var(--c-blue-50), var(--c-blue-100)); color: var(--c-blue-700); }
.hd-layer-cache   { background: linear-gradient(90deg, #d1fae5, #a7f3d0); color: #065f46; }

/* ============================================================
   HOME — PILLARS
   ============================================================ */
.pillars-section {
  padding: 5rem 0;
  background: var(--color-surface);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 2rem;
}

.pillar-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal), transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}
.pillar-card:hover {
  border-color: var(--c-blue-300);
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}
.pillar-card--runtime:hover { border-color: var(--c-blue-300); }
.pillar-card--middleware:hover { border-color: var(--c-indigo-500); }

.pillar-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.pillar-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pillar-icon svg { width: 26px; height: 26px; }
.pillar-icon--blue { background: linear-gradient(135deg, var(--c-blue-500), var(--c-sky-500)); color: white; }
.pillar-icon--indigo { background: linear-gradient(135deg, var(--c-indigo-600), var(--c-violet-500)); color: white; }

.pillar-title { font-size: 1.15rem; font-weight: 700; color: var(--c-slate-900); margin-bottom: .2rem; }
.pillar-subtitle { font-size: .8rem; color: var(--color-text-muted); font-weight: 500; }

.pillar-desc {
  font-size: .9rem;
  color: var(--c-slate-600);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.pillar-topics {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  flex: 1;
  margin-bottom: 1.75rem;
}
.topic-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .5rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--c-slate-700);
  text-decoration: none;
  transition: color var(--transition-fast), background var(--transition-fast), padding-left var(--transition-fast);
}
.topic-link svg { width: 12px; height: 12px; color: var(--color-text-faint); flex-shrink: 0; transition: color var(--transition-fast); }
.topic-link:hover {
  color: var(--color-primary);
  background: var(--c-blue-50);
  padding-left: .75rem;
  text-decoration: none;
}
.topic-link:hover svg { color: var(--color-primary); }

.pillar-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--c-blue-50);
  border: 1.5px solid var(--c-blue-200);
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  align-self: flex-start;
}
.pillar-cta svg { width: 16px; height: 16px; }
.pillar-cta:hover {
  background: var(--c-blue-100);
  border-color: var(--c-blue-300);
  transform: translateX(2px);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   HOME — FEATURES
   ============================================================ */
.features-section {
  padding: 5rem 0 6rem;
  background: var(--c-slate-50);
  border-top: 1px solid var(--color-border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal), border-color var(--transition-normal);
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--c-slate-300);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-icon--orange { background: #fff7ed; color: var(--c-orange-500); }
.feature-icon--blue   { background: var(--c-blue-50); color: var(--c-blue-600); }
.feature-icon--green  { background: #f0fdf4; color: var(--c-emerald-600); }
.feature-icon--purple { background: #faf5ff; color: var(--c-violet-600); }
.feature-icon--cyan   { background: #ecfeff; color: var(--c-cyan-500); }
.feature-icon--rose   { background: #fff1f2; color: var(--c-rose-500); }

.feature-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-slate-900);
  margin-bottom: .4rem;
}
.feature-desc {
  font-size: .875rem;
  color: var(--c-slate-600);
  line-height: 1.6;
}

/* ============================================================
   CONTENT PAGES
   ============================================================ */
.page-main {
  flex: 1;
  padding: 2.5rem 0 5rem;
}

.page-container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: 2rem;
}
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
  font-size: .8rem;
}
.breadcrumb-item { display: flex; align-items: center; gap: .25rem; }
.breadcrumb-link {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.breadcrumb-link:hover { color: var(--color-primary); text-decoration: none; }
.breadcrumb-sep { width: 14px; height: 14px; color: var(--c-slate-300); }
.breadcrumb-current { color: var(--c-slate-500); font-weight: 500; }

/* ---- Article Content ---- */
.content-article {
  /* Vertical rhythm */
}

.content-article h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--c-slate-900);
  letter-spacing: -.025em;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--c-blue-100);
  background: linear-gradient(135deg, var(--c-slate-900) 0%, var(--c-blue-700) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content-article h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--c-slate-900);
  letter-spacing: -.015em;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
.content-article h2::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--c-blue-500), var(--c-sky-500));
  border-radius: 2px;
}

.content-article h3 {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 700;
  color: var(--c-slate-800);
  margin-top: 2.25rem;
  margin-bottom: .75rem;
  letter-spacing: -.01em;
}

.content-article h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-slate-700);
  margin-top: 1.75rem;
  margin-bottom: .5rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .8rem;
}

.content-article p {
  color: var(--c-slate-700);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-size: 1.0125rem;
}

.content-article > p:first-of-type {
  font-size: 1.075rem;
  color: var(--c-slate-800);
}

.content-article strong { color: var(--c-slate-900); font-weight: 700; }
.content-article em { color: var(--c-slate-700); }

/* Links inside content */
.content-article a {
  color: var(--c-blue-600);
  text-decoration: none;
  border-bottom: 1px solid var(--c-blue-200);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.content-article a:hover {
  color: var(--c-blue-700);
  border-color: var(--c-blue-500);
  text-decoration: none;
}

/* Lists */
.content-article ul,
.content-article ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.content-article ul { list-style: disc; }
.content-article ol { list-style: decimal; }
.content-article li {
  color: var(--c-slate-700);
  line-height: 1.75;
  margin-bottom: .35rem;
}
.content-article li::marker { color: var(--c-blue-400); }

/* ---- Anchor heading links ---- */
.content-article .header-anchor {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
  font-weight: inherit;
}
.content-article .header-anchor:hover {
  color: inherit;
  border-bottom: none;
}

/* ---- Blockquotes ---- */
.content-article blockquote {
  border-left: 4px solid linear-gradient(to bottom, var(--c-blue-500), var(--c-sky-500));
  border-left: 4px solid var(--c-blue-400);
  background: var(--c-blue-50);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--c-slate-700);
}
.content-article blockquote p { margin-bottom: 0; }

/* ---- Horizontal rule ---- */
.content-article hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

/* ---- Inline code ---- */
.content-article :not(pre) > code {
  font-family: var(--code-font);
  font-size: .875em;
  background: var(--c-slate-100);
  color: var(--c-blue-700);
  padding: .15em .4em;
  border-radius: 4px;
  border: 1px solid var(--c-slate-200);
  white-space: nowrap;
}

/* ============================================================
   CODE BLOCKS (Prism.js)
   ============================================================ */
.content-article pre[class*="language-"],
pre[class*="language-"] {
  position: relative;
  background: #1e1e2e !important;
  border: 1px solid #313244;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.25rem;
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.65;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.04);
}

pre[class*="language-"] code[class*="language-"] {
  font-family: var(--code-font);
  background: transparent;
  color: #cdd6f4;
  font-size: inherit;
  padding: 0;
  border: none;
  border-radius: 0;
  white-space: pre;
}

/* Language badge */
pre[class*="language-"]::before {
  content: attr(class);
  position: absolute;
  top: .6rem;
  left: 1rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6c7086;
  font-family: var(--code-font);
}
pre.language-typescript::before { content: 'TypeScript'; }
pre.language-ts::before { content: 'TypeScript'; }
pre.language-javascript::before { content: 'JavaScript'; }
pre.language-js::before { content: 'JavaScript'; }
pre.language-bash::before { content: 'Shell'; }
pre.language-json::before { content: 'JSON'; }
pre.language-html::before { content: 'HTML'; }
pre.language-css::before { content: 'CSS'; }

/* Syntax tokens — Catppuccin Mocha inspired */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata          { color: #6c7086; font-style: italic; }
.token.punctuation    { color: #cad3f5; }
.token.namespace      { opacity: .7; }
.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted        { color: #f38ba8; }
.token.boolean,
.token.number         { color: #fab387; }
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted       { color: #a6e3a1; }
.token.operator       { color: #89dceb; }
.token.entity         { color: #cba6f7; cursor: help; }
.token.url            { color: #89dceb; }
.token.atrule,
.token.attr-value,
.token.keyword        { color: #cba6f7; }
.token.function,
.token.class-name     { color: #89b4fa; }
.token.regex,
.token.important,
.token.variable       { color: #f9e2af; }
.token.important      { font-weight: bold; }
.token.italic         { font-style: italic; }

/* Copy button */
.copy-btn {
  position: absolute;
  top: .6rem;
  right: .75rem;
  padding: .3rem .7rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  color: #6c7086;
  font-size: .7rem;
  font-weight: 600;
  font-family: var(--code-font);
  letter-spacing: .04em;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  line-height: 1.4;
}
.copy-btn:hover { background: rgba(255,255,255,.14); color: #cdd6f4; }
.copy-btn.copied { color: #a6e3a1; border-color: rgba(166,227,161,.3); }

/* ============================================================
   TABLES
   ============================================================ */
.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: .9rem;
  line-height: 1.5;
}

/* Wrap in scroll container via JS — but also do it for all tables */
.content-article .table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin: 1.5rem 0 2rem;
  box-shadow: var(--shadow-sm);
}
.content-article .table-scroll-wrapper table {
  margin: 0;
  width: 100%;
  min-width: 540px;
}

.content-article thead tr {
  background: linear-gradient(90deg, var(--c-slate-800), var(--c-slate-700));
  color: white;
}
.content-article thead th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-slate-200);
  white-space: nowrap;
}
.content-article thead th:first-child { border-radius: var(--radius-md) 0 0 0; }
.content-article thead th:last-child  { border-radius: 0 var(--radius-md) 0 0; }

.content-article tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-fast);
}
.content-article tbody tr:last-child { border-bottom: none; }
.content-article tbody tr:hover { background: var(--c-blue-50); }
.content-article tbody tr:nth-child(even) { background: var(--c-slate-50); }
.content-article tbody tr:nth-child(even):hover { background: var(--c-blue-50); }

.content-article td {
  padding: .75rem 1rem;
  color: var(--c-slate-700);
  vertical-align: top;
}
.content-article td:first-child { font-weight: 600; color: var(--c-slate-800); }

/* Apply scroll styles only to direct-child tables (before JS wrapping). */
.content-article > table:not(.no-wrap) {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-width: unset;
}

/* ============================================================
   TASK LIST CHECKBOXES
   ============================================================ */
.content-article .task-list-item {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .35rem 0;
}
.content-article .task-list-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  border: 2px solid var(--c-slate-300);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  flex-shrink: 0;
  margin-top: 3px;
}
.content-article .task-list-item input[type="checkbox"]:checked {
  background: var(--c-blue-600);
  border-color: var(--c-blue-600);
}
.content-article .task-list-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 6px; height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.content-article .task-list-item input[type="checkbox"]:hover {
  border-color: var(--c-blue-400);
}

/* ============================================================
   FAQ SECTIONS
   ============================================================ */
/* Detect FAQ-like sections: first h3 within a section,
   followed by bold Q: paragraph patterns */
.content-article h3 + p,
.content-article h4 + p {
  /* Subtle top accent for answer paragraphs after question headings */
}

/* FAQ-specific: if h3 starts with Q: or ends with ? style it as question */
.content-article h3:is([id*="q-"], [id*="question"], [id*="faq"]),
.content-article h4:is([id*="q-"], [id*="question"], [id*="faq"]) {
  background: linear-gradient(135deg, var(--c-blue-50), var(--c-indigo-50));
  border-left: 3px solid var(--c-blue-500);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: .65rem 1rem;
  color: var(--c-blue-800);
  margin-left: -1rem;
}

/* General FAQ paragraph separation */
.content-article h2 + h3,
.content-article h3 + h4 { margin-top: 1.25rem; }

/* FAQ question heading (class added by JS) */
.content-article .faq-question {
  background: linear-gradient(135deg, var(--c-blue-50), #f5f3ff);
  border-left: 3px solid var(--c-blue-500);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: .65rem 1rem .65rem 1.1rem;
  color: var(--c-blue-800, #1e3a8a);
  margin-left: 0;
}

/* FAQ answer styling — paragraphs immediately after question headings */
.content-article .faq-answer {
  background: var(--c-slate-50);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: .5rem;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--c-slate-200);
}

/* Step-by-step ordered lists (numbered sections) */
.content-article ol > li {
  padding-left: .25rem;
  margin-bottom: .65rem;
}

/* ============================================================
   DEPTH-SPECIFIC CONTENT STYLES
   ============================================================ */
/* Deeper pages get slightly smaller base type for dense technical content */
.content-depth-3 p { font-size: .9875rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--c-slate-900);
  color: var(--c-slate-400);
  padding-top: 3rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}

.footer-logo-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  margin-bottom: .75rem;
}
.footer-logo-link:hover { text-decoration: none; opacity: .85; }
.footer-logo-img { width: 32px; height: 32px; }
.footer-brand-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--c-slate-100);
  letter-spacing: -.01em;
}
.footer-tagline {
  font-size: .825rem;
  line-height: 1.6;
  color: var(--c-slate-500);
}

.footer-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.footer-nav-heading {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--c-slate-300);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .85rem;
}
.footer-nav-icon { width: 14px; height: 14px; color: var(--c-slate-500); }

.footer-nav-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.footer-nav-list a {
  font-size: .825rem;
  color: var(--c-slate-500);
  text-decoration: none;
  transition: color var(--transition-fast);
  line-height: 1.5;
}
.footer-nav-list a:hover { color: var(--c-slate-200); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 1.25rem 1.5rem;
  text-align: center;
  max-width: var(--container-max);
  margin: 0 auto;
}
.footer-copy {
  font-size: .775rem;
  color: var(--c-slate-600);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .pillars-grid { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { display: none; }
  .footer-nav-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --header-height: 60px; }

  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .logo-text-sub { display: none; }

  .hero { padding: 3rem 1.25rem; }
  .hero-title { font-size: 2rem; }

  .pillars-section,
  .features-section { padding: 3rem 0; }
  .features-grid { grid-template-columns: 1fr; }

  .section-container { padding: 0 1.25rem; }
  .page-container { padding: 0 1.25rem; }

  pre[class*="language-"] { font-size: .8rem; padding: 1.25rem 1rem 1rem; }
  .content-article h1 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; }
  .btn { justify-content: center; }
  .breadcrumb-list { font-size: .75rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .site-footer, .breadcrumbs, .copy-btn { display: none; }
  .content-article { max-width: 100%; }
  pre[class*="language-"] { border: 1px solid #ccc; box-shadow: none; }
}

