/* =============================================================
   q1tum.cloud — Main Stylesheet
   Themes: Azure Cloud · AI · App Modernisation · Azure Quantum
   ============================================================= */

/* --- Google Fonts (loaded via <head>) ----------------------- */

/* --- Custom Properties -------------------------------------- */
:root {
  /* Base palette */
  --bg:           #07090f;
  --bg-alt:       #0a0f1c;
  --bg-card:      #0e1525;
  --bg-card-h:    #131d32;
  --bg-glass:     rgba(10, 15, 28, 0.85);
  --border:       rgba(255,255,255,0.06);
  --border-h:     rgba(255,255,255,0.12);

  /* Typography */
  --text:         #e2e8f0;
  --text-muted:   #8892a4;
  --text-subtle:  #4a5a6e;

  /* Technology accent colours */
  --azure:        #0078d4;
  --azure-l:      #3fa9f5;
  --quantum:      #00c8ff;
  --quantum-d:    #0090be;
  --ai:           #9b59e8;
  --ai-l:         #bb86fc;
  --modern:       #00c896;
  --modern-d:     #009c72;
  --tech:         #f5a623;

  /* Gradients */
  --grad-brand:    linear-gradient(135deg, var(--azure) 0%, var(--ai) 50%, var(--quantum) 100%);
  --grad-hero:     radial-gradient(ellipse at 60% 40%, rgba(0,120,212,.20) 0%, transparent 55%),
                   radial-gradient(ellipse at 30% 70%, rgba(155,89,232,.16) 0%, transparent 50%),
                   radial-gradient(ellipse at 80% 80%, rgba(0,200,255,.12) 0%, transparent 45%),
                   var(--bg-alt);

  /* Shadows */
  --shadow-sm:    0 1px 4px rgba(0,0,0,.5);
  --shadow-md:    0 4px 24px rgba(0,0,0,.55);
  --shadow-lg:    0 12px 48px rgba(0,0,0,.65);
  --shadow-azure: 0 0 24px rgba(0,120,212,.35);
  --shadow-ai:    0 0 24px rgba(155,89,232,.35);
  --shadow-q:     0 0 24px rgba(0,200,255,.35);

  /* Layout */
  --max-w:        1180px;
  --nav-h:        68px;
  --radius:       10px;
  --radius-lg:    16px;

  /* Fonts */
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Sora', 'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --ease:         cubic-bezier(.25,.46,.45,.94);
}

/* --- Reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
ul, ol { list-style: none; }

/* --- Base --------------------------------------------------- */
body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Subtle tech-grid background */
  background-image:
    linear-gradient(rgba(0,120,212,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,120,212,.035) 1px, transparent 1px);
  background-size: 52px 52px;
}
main { flex: 1; }

/* --- Layout ------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--nav-h);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s var(--ease);
}
.site-header.scrolled { box-shadow: 0 2px 32px rgba(0,0,0,.6); }

.nav { max-width: var(--max-w); margin: 0 auto; height: 100%; padding: 0 24px; }
.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-logo { width: 36px; height: 36px; flex-shrink: 0; }
.nav-brand-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.nav-brand-dot { color: var(--azure); }

/* Menu */
.nav-menu { display: flex; align-items: center; flex: 1; margin-left: 24px; }
.nav-list  { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: block;
  padding: 6px 12px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,.06);
}
.nav-link.active { color: var(--azure-l); }

/* Actions */
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
  font-size: .875rem;
}
.nav-search-btn:hover { background: rgba(255,255,255,.09); border-color: var(--border-h); color: var(--text); }
.nav-search-btn svg { flex-shrink: 0; }
.nav-search-hint {
  font-size: .75rem;
  background: rgba(255,255,255,.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--grad-hero);
  padding: 100px 0 80px;
}

/* Animated gradient border at bottom */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--grad-brand);
  opacity: .4;
}

/* SVG artwork */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-art {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 620px;
  max-width: 60%;
  opacity: .85;
}

/* Electron animation */
@keyframes orbit1 {
  from { transform: rotate(0deg)   translateX(155px) rotate(0deg);   }
  to   { transform: rotate(360deg) translateX(155px) rotate(-360deg); }
}
@keyframes orbit2 {
  from { transform: rotate(180deg) translateX(155px) rotate(-180deg); }
  to   { transform: rotate(540deg) translateX(155px) rotate(-540deg); }
}
.hero-electron { transform-origin: 590px 290px; }
.e1 { animation: orbit1 6s linear infinite; }
.e2 { animation: orbit2 9s linear infinite; }

/* Content */
.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.hero-text { max-width: 600px; }

.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.hero-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, var(--azure-l) 40%, var(--ai-l) 70%, var(--quantum) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.75;
  margin-bottom: 36px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.hero-scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-scroll-indicator span {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--azure));
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: .3; transform: scaleY(.6) translateY(-8px); }
  50%       { opacity: .8; transform: scaleY(1)  translateY(0); }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--azure);
  color: #fff;
  border-color: var(--azure);
  box-shadow: 0 4px 20px rgba(0,120,212,.4);
}
.btn-primary:hover {
  background: var(--azure-l);
  border-color: var(--azure-l);
  box-shadow: 0 6px 28px rgba(0,120,212,.55);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-h);
}
.btn-outline:hover {
  border-color: var(--azure);
  color: var(--azure-l);
  background: rgba(0,120,212,.06);
  transform: translateY(-1px);
}
.btn-outline-hero {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-color: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
}
.btn-outline-hero:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--azure);
  color: var(--azure-l);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 80px 0; }
.section-dark {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--azure-l);
  transition: gap .2s;
}
.section-link:hover { gap: 10px; }

/* ============================================================
   POST CARDS
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.posts-grid-full { margin-top: 32px; }

.post-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-h);
}
/* Coloured top-border per category */
.post-card::before {
  content: '';
  display: block;
  height: 3px;
  width: 100%;
  background: var(--border);
  transition: background .3s;
}
.post-card:hover::before { background: var(--grad-brand); }

/* Category-specific top borders */
.cat-border-azure-cloud::before  { background: var(--azure);   }
.cat-border-ai::before            { background: var(--ai);      }
.cat-border-azure-quantum::before { background: var(--quantum); }
.cat-border-app-modernisation::before { background: var(--modern); }

/* Invisible full-card link */
.post-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.post-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8125rem;
  color: var(--text-subtle);
}
.post-card-date, .post-card-read { font-variant-numeric: tabular-nums; }

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
}
.post-card-title-link {
  position: relative;
  z-index: 2;
  color: var(--text);
  transition: color .2s;
}
.post-card:hover .post-card-title-link { color: var(--azure-l); }

.post-card-summary {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.post-card-cats { display: flex; flex-wrap: wrap; gap: 6px; }

.post-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .825rem;
  font-weight: 600;
  color: var(--text-subtle);
  position: relative;
  z-index: 2;
  transition: color .2s, gap .2s;
  flex-shrink: 0;
}
.post-card:hover .post-card-cta { color: var(--azure-l); gap: 8px; }

/* ============================================================
   TAGS / CATEGORY PILLS
   ============================================================ */
.post-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  border: 1px solid;
  position: relative;
  z-index: 2;
  transition: opacity .2s;
}
.post-tag:hover { opacity: .85; }
.post-tag-plain {
  display: inline-block;
  padding: 2px 8px;
  font-size: .8125rem;
  color: var(--text-muted);
  background: rgba(255,255,255,.05);
  border-radius: 4px;
  transition: color .2s;
}
.post-tag-plain:hover { color: var(--text); }

/* Category colour assignments */
.cat-azure-cloud,   .hero-tag.cat-azure   { color: var(--azure);   border-color: rgba(0,120,212,.4);   background: rgba(0,120,212,.1);   }
.cat-ai,            .hero-tag.cat-ai      { color: var(--ai-l);    border-color: rgba(155,89,232,.4);  background: rgba(155,89,232,.1);  }
.cat-azure-quantum, .hero-tag.cat-quantum { color: var(--quantum);  border-color: rgba(0,200,255,.4);   background: rgba(0,200,255,.1);   }
.cat-app-modernisation, .hero-tag.cat-modern { color: var(--modern); border-color: rgba(0,200,150,.4); background: rgba(0,200,150,.1);  }

/* Coloured dot for list headers */
.cat-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; vertical-align: middle; }
.cat-dot.cat-azure-cloud       { background: var(--azure);   box-shadow: 0 0 8px var(--azure);   }
.cat-dot.cat-ai                { background: var(--ai);      box-shadow: 0 0 8px var(--ai);      }
.cat-dot.cat-azure-quantum     { background: var(--quantum); box-shadow: 0 0 8px var(--quantum); }
.cat-dot.cat-app-modernisation { background: var(--modern);  box-shadow: 0 0 8px var(--modern);  }

/* Footer links */
.cat-azure  { color: var(--azure-l)  !important; }
.cat-ai     { color: var(--ai-l)     !important; }
.cat-modern { color: var(--modern)   !important; }
.cat-quantum{ color: var(--quantum)  !important; }

/* ============================================================
   TOPICS CARDS (home page)
   ============================================================ */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.topic-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
  position: relative;
  overflow: hidden;
}
.topic-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .3s;
}
.topic-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.topic-azure   { --tc: var(--azure);   --tc-b: rgba(0,120,212,.35); }
.topic-ai      { --tc: var(--ai);      --tc-b: rgba(155,89,232,.35); }
.topic-modern  { --tc: var(--modern);  --tc-b: rgba(0,200,150,.35); }
.topic-quantum { --tc: var(--quantum); --tc-b: rgba(0,200,255,.35); }

.topic-card { border-top: 2px solid var(--tc, var(--border)); }
.topic-card:hover { border-color: var(--tc); box-shadow: 0 8px 32px var(--tc-b); }

.topic-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  color: var(--tc);
  padding: 10px;
}
.topic-icon svg { width: 100%; height: 100%; }
.topic-body { flex: 1; }
.topic-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.topic-desc { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }
.topic-count {
  font-size: .75rem;
  font-weight: 600;
  color: var(--tc);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ============================================================
   LIST PAGES (section / taxonomy term)
   ============================================================ */
.page-wrapper { padding-bottom: 80px; }

.list-header {
  padding: 60px 0 40px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.list-header-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.breadcrumb-link { color: var(--azure-l); }
.breadcrumb-link:hover { text-decoration: underline; }

.list-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}
.list-description { font-size: 1.05rem; color: var(--text-muted); max-width: 620px; margin-bottom: 8px; }
.list-count { font-size: .875rem; color: var(--text-subtle); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 56px;
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color .2s, background .2s, color .2s;
}
.pagination-btn:hover { border-color: var(--azure); color: var(--azure-l); background: rgba(0,120,212,.07); }
.pagination-info { font-size: .875rem; color: var(--text-muted); }

.empty-state { text-align: center; padding: 80px 0; color: var(--text-muted); font-size: 1.1rem; }

/* ============================================================
   TERMS (categories / tags index)
   ============================================================ */
.terms-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.term-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .2s, transform .2s;
}
.term-card:hover { transform: translateY(-2px); border-color: var(--border-h); }
.term-name { font-weight: 600; }
.term-count { font-size: .8125rem; color: var(--text-muted); }
.cat-border-azure-cloud  { border-left: 3px solid var(--azure);   }
.cat-border-ai            { border-left: 3px solid var(--ai);      }
.cat-border-azure-quantum { border-left: 3px solid var(--quantum); }
.cat-border-app-modernisation { border-left: 3px solid var(--modern); }

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-header {
  padding: 60px 0 40px;
  background: var(--bg-alt);
  border-bottom: 3px solid var(--border);
  margin-bottom: 0;
}
.cat-top-azure-cloud       { border-bottom-color: var(--azure);   }
.cat-top-ai                { border-bottom-color: var(--ai);      }
.cat-top-azure-quantum     { border-bottom-color: var(--quantum); }
.cat-top-app-modernisation { border-bottom-color: var(--modern);  }

.post-header-inner { max-width: 780px; }
.post-meta-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.03em;
  margin-bottom: 16px;
}
.post-description { font-size: 1.1rem; color: var(--text-muted); max-width: 680px; margin-bottom: 20px; line-height: 1.7; }
.post-cats { display: flex; flex-wrap: wrap; gap: 8px; }

/* Post layout: sidebar ToC + content */
.post-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: flex-start;
  padding-top: 48px;
  padding-bottom: 0;
}

.post-toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.post-toc-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.post-toc-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-subtle);
  margin-bottom: 12px;
}
.post-toc nav { font-size: .875rem; }
.post-toc nav ul { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 1px solid var(--border); }
.post-toc nav > nav > ul { padding-left: 0; border-left: none; }
.post-toc a { color: var(--text-muted); line-height: 1.6; display: block; padding: 2px 0; transition: color .2s; }
.post-toc a:hover { color: var(--azure-l); }

/* Markdown content */
.post-content {
  min-width: 0;
  padding-bottom: 64px;
}
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.3;
  margin: 2em 0 .75em;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.5rem; padding-bottom: .4em; border-bottom: 1px solid var(--border); }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1rem; }

.post-content p  { margin-bottom: 1.5em; color: var(--text); }
.post-content a  { color: var(--azure-l); text-decoration: underline; text-decoration-color: rgba(63,169,245,.3); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.post-content a:hover { text-decoration-color: var(--azure-l); }

.post-content ul, .post-content ol { margin: 0 0 1.5em 1.5em; }
.post-content li { margin-bottom: .4em; }
.post-content ul li { list-style: disc; }
.post-content ol li { list-style: decimal; }

.post-content blockquote {
  margin: 1.5em 0;
  padding: 16px 20px 16px 24px;
  border-left: 3px solid var(--azure);
  background: rgba(0,120,212,.07);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-style: italic;
}
.post-content code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: rgba(255,255,255,.07);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ai-l);
}
.post-content pre {
  background: #0d1117 !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5em 0;
  padding: 20px 24px;
}
.post-content pre code {
  background: none;
  padding: 0;
  font-size: .875rem;
  color: inherit;
}
.post-content img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5em 0;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: .9rem;
}
.post-content th, .post-content td {
  padding: 10px 16px;
  border: 1px solid var(--border);
  text-align: left;
}
.post-content th { background: var(--bg-card); font-weight: 700; }
.post-content tr:nth-child(even) { background: rgba(255,255,255,.02); }

.post-content hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* Post footer */
.post-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg-alt);
}
.post-footer-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  font-size: .875rem;
  color: var(--text-muted);
}
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.post-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, background .2s;
}
.post-nav-btn:hover { border-color: var(--azure); background: rgba(0,120,212,.06); }
.post-nav-next { text-align: right; }
.post-nav-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-subtle); }
.post-nav-title { font-size: .9rem; font-weight: 600; color: var(--text); }

/* ============================================================
   SEARCH MODAL
   ============================================================ */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 24px;
}
.search-modal[hidden] { display: none; }

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: searchIn .18s var(--ease);
}
@keyframes searchIn {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.search-icon { flex-shrink: 0; color: var(--text-subtle); }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1.05rem;
  color: var(--text);
  caret-color: var(--azure);
}
.search-input::placeholder { color: var(--text-subtle); }
.search-clear {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color .2s;
}
.search-clear:hover { color: var(--text); }

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}
.search-result-item {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.search-result-item:hover,
.search-result-item.active,
.search-result-item[aria-selected="true"] { background: rgba(255,255,255,.05); }
.search-result-title { font-weight: 600; font-size: .9375rem; color: var(--text); margin-bottom: 2px; }
.search-result-meta  { font-size: .8125rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.search-no-results   { padding: 32px 20px; text-align: center; color: var(--text-muted); font-size: .925rem; }

.search-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}
.search-hint { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--text-subtle); }
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border: 1px solid var(--border-h);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: .7rem;
  background: rgba(255,255,255,.04);
  min-width: 24px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 64px 24px 48px;
}
.footer-brand .footer-brand-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 12px;
}
.footer-brand-dot { color: var(--azure); }
.footer-tagline { font-size: .875rem; color: var(--text-muted); line-height: 1.7; max-width: 280px; }
.footer-heading { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-subtle); margin-bottom: 16px; }
.footer-list { display: flex; flex-direction: column; gap: 8px; }
.footer-link { font-size: .875rem; color: var(--text-muted); transition: color .2s; }
.footer-link:hover { color: var(--text); }
.footer-social { display: inline-flex; align-items: center; gap: 8px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
}
.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px;
}
.footer-bottom p { font-size: .8125rem; color: var(--text-subtle); }
.footer-bottom a { color: var(--text-muted); transition: color .2s; }
.footer-bottom a:hover { color: var(--azure-l); }
.footer-built { margin-left: auto; }

/* ============================================================
   404
   ============================================================ */
.error-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 80px 24px;
}
.error-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.error-title { font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.error-text  { color: var(--text-muted); max-width: 480px; line-height: 1.7; }
.error-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-toc { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }

  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 4px;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform .3s var(--ease), opacity .3s;
    pointer-events: none;
    z-index: 800;
    margin-left: 0;
  }
  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  .nav-list { flex-direction: column; align-items: flex-start; width: 100%; }
  .nav-link { padding: 10px 12px; width: 100%; }
  .nav-toggle { display: flex; }
  .nav-search-hint { display: none; }

  .hero { min-height: auto; padding: 80px 0 60px; }
  .hero-art { display: none; }

  .posts-grid { grid-template-columns: 1fr; }
  .topics-grid { grid-template-columns: 1fr 1fr; }

  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom .container { flex-direction: column; align-items: flex-start; }
  .footer-built { margin-left: 0; }
}

@media (max-width: 480px) {
  .topics-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .search-modal { padding: 60px 12px 12px; }
}

/* ============================================================
   UTILITY / MISC
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* Selection */
::selection { background: rgba(0,120,212,.35); color: var(--text); }

/* Code copy button */
.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 4px 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.code-copy-btn:hover { background: rgba(255,255,255,.14); color: var(--text); }

.highlight { position: relative; }

/* Smooth fade-in for main content */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-text { animation: fadeUp .6s .1s var(--ease) both; }
.posts-grid { animation: fadeUp .5s .15s var(--ease) both; }
