@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap");

:root {
  --color-bg: #0a0e1a;
  --color-surface: rgba(10, 16, 28, 0.74);
  --color-surface-strong: rgba(5, 10, 18, 0.86);
  --color-surface-soft: rgba(10, 18, 32, 0.62);
  --color-primary: #7c6fdc;
  --color-accent: #1d9bf0;
  --color-accent-soft: rgba(29, 155, 240, 0.10);
  --color-warm: #f59e0b;
  --color-warm-soft: rgba(245, 158, 11, 0.11);
  --color-success: #39ff88;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-soft: #dceff3;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-accent: rgba(29, 155, 240, 0.36);
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.34);
  --shadow-hover: 0 20px 48px rgba(0, 0, 0, 0.40), 0 0 20px rgba(29, 155, 240, 0.08);
  --font-body: "Inter", Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", Arial, sans-serif;
  --content-width: 1120px;
  --article-width: 1040px;
  --article-shell-width: 940px;
  --radius-card: 8px;
  --radius-pill: 999px;
  --transition-fast: 0.22s ease;
  --transition-medium: 0.26s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--color-text);
  background:
    linear-gradient(rgba(4, 8, 14, 0.82), rgba(4, 8, 14, 0.90)),
    url("../img/DATA_8.jpg") center / cover fixed;
}

body.has-ambient-glow::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(
      760px circle at var(--ambient-x, 50vw) var(--ambient-y, 36vh),
      rgba(29, 155, 240, 0.07),
      rgba(124, 111, 220, 0.045) 34%,
      transparent 72%
    );
  opacity: 0.78;
  pointer-events: none;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

.web-stat-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* Shared wrappers */

.page {
  position: relative;
  z-index: 1;
  width: min(var(--content-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 42px;
}

.article-page {
  width: min(var(--article-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0 48px;
}

.article-shell {
  max-width: var(--article-shell-width);
  margin: 0 auto;
}

/* Navigation */

.top-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 54px;
}

.top-nav a {
  min-width: 96px;
  padding: 12px 22px;
  border: 1px solid rgba(124, 111, 220, 0.28);
  border-radius: var(--radius-pill);
  background: rgba(124, 111, 220, 0.78);
  color: #ffffff;
  text-decoration: none;
  text-align: center;
  font-weight: 800;
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  transform: translateY(-3px);
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #081018;
}

/* Shared hero */

.hero {
  text-align: center;
  margin-bottom: 38px;
}

.eyebrow {
  color: var(--color-accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.54);
}

.hero h1 span {
  color: var(--color-primary);
}

.hero p {
  max-width: 820px;
  margin: 22px auto 0;
  color: var(--color-text-soft);
  font-size: 1.04rem;
  line-height: 1.72;
}

/* Blog index */

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 34px;
}

.post-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface-strong);
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--transition-medium),
    border-color var(--transition-medium),
    box-shadow var(--transition-medium),
    background-color var(--transition-medium);
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    radial-gradient(
      420px circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%),
      rgba(29, 155, 240, 0.16),
      rgba(124, 111, 220, 0.08) 38%,
      transparent 70%
    );
  opacity: 0;
  transition: opacity var(--transition-medium);
  pointer-events: none;
}

.post-card > * {
  position: relative;
  z-index: 1;
}

.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-border-accent);
  background: rgba(8, 15, 28, 0.88);
  box-shadow: var(--shadow-hover);
}

.post-card:hover::before {
  opacity: 1;
}

.clickable-card {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.status {
  display: inline-flex;
  align-self: flex-end;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-left: auto;
  margin-bottom: 18px;
  padding: 5px 10px;
  border: 1px solid rgba(29, 155, 240, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(29, 155, 240, 0.08);
  color: var(--color-accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.post-card h2 {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1.36rem;
  margin-bottom: 12px;
}

.post-card p {
  color: var(--color-text-soft);
  line-height: 1.68;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tags span {
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  background: rgba(124, 111, 220, 0.20);
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 800;
}

.post-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.post-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid rgba(29, 155, 240, 0.36);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(135deg, rgba(29, 155, 240, 0.1), rgba(124, 111, 220, 0.1)),
    rgba(5, 10, 18, 0.42);
  color: #b7f7ff;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
  box-shadow: 0 0 16px rgba(29, 155, 240, 0.05);
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.post-link:hover,
.clickable-card:hover .post-link {
  transform: translateY(-2px);
  background:
    linear-gradient(135deg, rgba(29, 155, 240, 0.18), rgba(124, 111, 220, 0.18)),
    rgba(5, 10, 18, 0.58);
  border-color: rgba(29, 155, 240, 0.72);
  color: #ffffff;
  box-shadow: 0 0 22px rgba(29, 155, 240, 0.1);
}

.post-link.is-featured {
  border-color: rgba(29, 155, 240, 0.62);
  background:
    linear-gradient(135deg, rgba(29, 155, 240, 0.24), rgba(125, 211, 252, 0.18)),
    rgba(5, 10, 18, 0.46);
  color: #e2f4ff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 0 22px rgba(29, 155, 240, 0.16);
}

.post-link.is-featured:hover,
.clickable-card:hover .post-link.is-featured {
  border-color: rgba(29, 155, 240, 0.84);
  background:
    linear-gradient(135deg, rgba(29, 155, 240, 0.32), rgba(125, 211, 252, 0.24)),
    rgba(5, 10, 18, 0.58);
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 28px rgba(29, 155, 240, 0.22);
}

.post-link.is-disabled {
  position: relative;
  gap: 8px;
  padding-left: 13px;
  border-color: rgba(245, 158, 11, 0.28);
  background:
    linear-gradient(135deg, rgba(29, 155, 240, 0.10), rgba(124, 111, 220, 0.12), rgba(245, 158, 11, 0.10)),
    rgba(5, 10, 18, 0.48);
  color: #f3f8ff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 0 18px rgba(245, 158, 11, 0.06);
  opacity: 1;
  pointer-events: auto;
  cursor: default;
}

.post-link.is-disabled::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-warm), var(--color-primary));
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.34);
}

.post-link.is-disabled:hover {
  transform: translateY(-2px);
  background:
    linear-gradient(135deg, rgba(29, 155, 240, 0.14), rgba(124, 111, 220, 0.15), rgba(245, 158, 11, 0.13)),
    rgba(5, 10, 18, 0.56);
  border-color: rgba(245, 158, 11, 0.44);
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 22px rgba(245, 158, 11, 0.09);
}

/* Footer */

.page-footer,
footer {
  margin-top: 44px;
  text-align: center;
  color: var(--color-text-muted);
}

/* Article hero */

.article-hero {
  text-align: center;
  margin-bottom: 34px;
}

.article-hero h1 {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.6vw, 4.7rem);
  line-height: 1.02;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.54);
}

.article-hero h1 span,
.compact-hero h1 span {
  color: var(--color-primary);
}

.article-subtitle {
  max-width: 820px;
  margin: 20px auto 0;
  color: var(--color-text-soft);
  font-size: 1.04rem;
  line-height: 1.72;
}

.article-meta,
.article-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.article-meta {
  margin-top: 22px;
}

.article-meta span,
.article-badges span {
  padding: 7px 11px;
  border: 1px solid rgba(29, 155, 240, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(29, 155, 240, 0.08);
  color: var(--color-accent);
  font-size: 0.84rem;
  font-weight: 800;
}

.article-badges {
  margin: 22px auto 18px;
}

.hero-summary {
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 22px;
  border: 1px solid rgba(29, 155, 240, 0.28);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.hero-summary p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 1.02rem;
  line-height: 1.72;
  text-align: center;
}

.hero-summary strong {
  color: var(--color-accent);
}

/* Media */

.article-cover,
.article-image {
  margin: 28px 0;
  border: 1px solid rgba(29, 155, 240, 0.28);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.72);
  box-shadow: var(--shadow-soft);
}

.article-cover img,
.article-image img {
  width: 100%;
  cursor: zoom-in;
}

.article-cover figcaption,
.article-image figcaption {
  position: relative;
  margin: 0;
  padding: 13px 18px 14px 44px;
  border-top: 1px solid rgba(245, 158, 11, 0.24);
  background:
    linear-gradient(90deg, var(--color-warm-soft), rgba(124, 111, 220, 0.08), rgba(29, 155, 240, 0.06)),
    rgba(3, 8, 14, 0.76);
  color: var(--color-text-soft);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.55;
  text-align: left;
}

.article-cover figcaption::before,
.article-image figcaption::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 18px;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(245, 158, 11, 0.62);
  border-radius: 3px;
  background: linear-gradient(135deg, var(--color-warm), var(--color-primary));
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.24);
}

.article-cover figcaption code,
.article-image figcaption code {
  padding: 2px 6px;
  border: 1px solid rgba(57, 255, 136, 0.18);
  border-radius: 5px;
  background: rgba(57, 255, 136, 0.08);
  color: var(--color-success);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Article cards */

.article-card {
  margin: 24px 0;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface-strong);
  box-shadow: var(--shadow-soft);
}

.article-card h2 {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin-bottom: 14px;
}

.article-card h3 {
  color: var(--color-accent);
  margin: 22px 0 12px;
  font-size: 1.05rem;
}

.article-card p,
.article-card li {
  color: var(--color-text-soft);
  font-size: 1rem;
  line-height: 1.72;
}

.article-card ul,
.article-card ol {
  margin: 14px 0 0 22px;
}

.article-card li {
  margin-bottom: 8px;
}

.article-card a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 700;
}

.article-card a:hover {
  text-decoration: underline;
}

.article-card blockquote {
  margin: 18px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--color-primary);
  background: rgba(124, 111, 220, 0.12);
  color: #ffffff;
  font-style: italic;
}

.article-card blockquote footer {
  margin-top: 10px;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 700;
}

.key-takeaways {
  border-color: rgba(57, 255, 136, 0.40);
}

/* Callouts and flow */

.note-callout {
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 4px solid var(--color-accent);
  background: rgba(29, 155, 240, 0.08);
  color: var(--color-text-soft);
  font-weight: 700;
}

.path-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.path-flow span {
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  background: rgba(124, 111, 220, 0.22);
  color: #ffffff;
  font-weight: 700;
}

.flow-list {
  padding-left: 22px;
}

.flow-list li {
  margin-bottom: 10px;
}

/* CLI blocks */

.cli-block {
  margin-top: 20px;
  border: 1px solid rgba(29, 155, 240, 0.30);
  border-radius: var(--radius-card);
  background: rgba(3, 8, 14, 0.92);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.cli-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(29, 155, 240, 0.20);
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 800;
}

.copy-command {
  padding: 7px 12px;
  border: 1px solid rgba(29, 155, 240, 0.42);
  border-radius: var(--radius-pill);
  background: rgba(29, 155, 240, 0.12);
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.copy-command:hover,
.copy-command.is-copied {
  background: var(--color-accent);
  color: #081018;
  border-color: var(--color-accent);
}

.cli-block pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
}

.cli-block code,
.command-list code,
.ascii-diagram code {
  color: var(--color-success);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre;
  text-shadow: 0 0 10px rgba(57, 255, 136, 0.14);
}

.command-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.command-list code {
  padding: 8px 10px;
  border-radius: var(--radius-card);
  background: rgba(29, 155, 240, 0.12);
  color: var(--color-accent);
  font-weight: 700;
  text-shadow: none;
}

/* Diagrams and concept helpers */

.ascii-diagram {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(29, 155, 240, 0.28);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, 0.72);
  overflow-x: auto;
}

.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.mental-model-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mental-model-grid .concept-mini-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title code"
    "text code";
  align-items: center;
  gap: 4px 12px;
  min-height: 74px;
  padding: 14px 16px;
  border-color: rgba(29, 155, 240, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(29, 155, 240, 0.12), rgba(124, 111, 220, 0.08)),
    rgba(5, 10, 18, 0.46);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 0 16px rgba(29, 155, 240, 0.05);
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.mental-model-grid .concept-mini-card:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 155, 240, 0.64);
  background:
    linear-gradient(135deg, rgba(29, 155, 240, 0.16), rgba(124, 111, 220, 0.12)),
    rgba(5, 10, 18, 0.58);
  box-shadow:
    inset 3px 0 0 rgba(29, 155, 240, 0.72),
    0 0 20px rgba(29, 155, 240, 0.08);
}

.mental-model-grid .concept-mini-card h3 {
  grid-area: title;
  margin: 0;
  color: #b7f7ff;
  font-size: 0.92rem;
}

.mental-model-grid .concept-mini-card p {
  grid-area: text;
  margin: 0;
  color: var(--color-text-soft);
  font-size: 0.86rem;
  line-height: 1.38;
}

.mental-model-grid .concept-mini-card code {
  grid-area: code;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(57, 255, 136, 0.28);
  border-radius: var(--radius-pill);
  background: rgba(57, 255, 136, 0.08);
  color: var(--color-success);
  font-size: 0.78rem;
  white-space: nowrap;
}

.concept-mini-card {
  padding: 18px;
  border: 1px solid rgba(29, 155, 240, 0.28);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, 0.55);
}

.concept-mini-card h3 {
  color: var(--color-accent);
  margin-bottom: 10px;
}

.concept-mini-card code {
  display: inline-block;
  margin-top: 10px;
  color: var(--color-success);
  font-weight: 700;
}

.comparison-table-wrapper {
  margin: 20px 0;
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.58);
}

.comparison-table th,
.comparison-table td {
  padding: 14px;
  border: 1px solid rgba(29, 155, 240, 0.24);
  text-align: left;
  vertical-align: top;
}

.comparison-table th {
  color: var(--color-accent);
  background: rgba(29, 155, 240, 0.08);
}

/* Mermaid */

.mermaid-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(29, 155, 240, 0.28);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, 0.62);
  overflow-x: auto;
  cursor: zoom-in;
  animation: diagramFadeIn 0.7s ease both;
  transition:
    transform var(--transition-medium),
    box-shadow var(--transition-medium),
    border-color var(--transition-medium);
}

.mermaid-card .mermaid {
  min-width: 680px;
  display: flex;
  justify-content: center;
}

.mermaid-caption {
  margin-top: 14px;
  color: var(--color-text-soft);
  text-align: center;
  font-size: 0.95rem;
}

.mermaid-card:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

@keyframes diagramFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 761px) {
  .mermaid-card:hover {
    transform: scale(1.02);
    z-index: 20;
    border-color: rgba(57, 255, 136, 0.60);
    box-shadow: 0 20px 46px rgba(57, 255, 136, 0.12);
  }

  .mermaid-card:hover .mermaid {
    filter: drop-shadow(0 0 12px rgba(29, 155, 240, 0.22));
  }
}

/* Quotes and comments */

.article-quote {
  margin: 32px 0 0;
  padding: 28px;
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, 0.72);
  color: var(--color-text-soft);
  font-size: 1.18rem;
  line-height: 1.68;
  font-weight: 700;
}

.article-comments {
  margin-top: 36px;
  padding: 28px;
  border: 1px solid rgba(29, 155, 240, 0.28);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, 0.68);
  box-shadow: var(--shadow-soft);
}

.article-comments h2 {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.article-comments p {
  color: var(--color-text-soft);
  line-height: 1.7;
  margin-bottom: 22px;
}

/* Lightboxes */

.image-lightbox,
.diagram-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.88);
}

.image-lightbox {
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.image-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-image {
  max-width: min(96vw, 1200px);
  max-height: 82vh;
  border: 1px solid rgba(29, 155, 240, 0.32);
  border-radius: var(--radius-card);
  background: #000;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  margin-top: 14px;
  color: var(--color-text-soft);
  text-align: center;
  font-weight: 700;
}

.lightbox-close,
.diagram-lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(29, 155, 240, 0.42);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.82);
  color: var(--color-accent);
  font-size: 1.8rem;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.lightbox-close:hover,
.diagram-lightbox-close:hover {
  background: var(--color-accent);
  color: #081018;
  border-color: var(--color-accent);
}

.diagram-lightbox {
  display: none;
  z-index: 9999;
}

.diagram-lightbox.is-open {
  display: flex;
}

.diagram-lightbox-content {
  width: min(1100px, 96vw);
  max-height: 88vh;
  padding: 24px;
  border: 1px solid rgba(29, 155, 240, 0.32);
  border-radius: var(--radius-card);
  background: rgba(2, 8, 14, 0.96);
  box-shadow: 0 24px 70px rgba(29, 155, 240, 0.16);
  overflow: auto;
}

.diagram-lightbox-content svg {
  width: 100%;
  height: auto;
  min-width: 780px;
}

.diagram-lightbox-caption {
  margin-top: 16px;
  color: var(--color-text-soft);
  text-align: center;
  font-weight: 700;
}

body.lightbox-open,
body.diagram-open {
  overflow: hidden;
}

/* Back to top */

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(29, 155, 240, 0.38);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.82);
  color: var(--color-accent);
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-accent);
  color: #081018;
  border-color: var(--color-accent);
}

/* Responsive */

@media (max-width: 900px) {
  .post-grid {
    grid-template-columns: 1fr;
  }

  .concept-grid {
    grid-template-columns: 1fr;
  }

  .mental-model-grid .concept-mini-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "text"
      "code";
    justify-items: flex-start;
    border-radius: 10px;
  }
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll;
  }

  body.has-ambient-glow::before {
    display: none;
  }

  .page,
  .article-page {
    width: 100%;
    padding: 28px 14px 34px;
  }

  .top-nav {
    gap: 8px;
    margin-bottom: 30px;
  }

  .top-nav a {
    min-width: 86px;
    padding: 10px 14px;
    font-size: 0.86rem;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 14vw, 3.35rem);
  }

  .hero p,
  .article-subtitle,
  .hero-summary p {
    font-size: 0.95rem;
    line-height: 1.58;
  }

  .post-card,
  .article-card,
  .article-comments,
  .hero-summary {
    padding: 22px;
  }

  .article-hero h1 {
    font-size: clamp(2rem, 12vw, 3.3rem);
  }

  .article-card h2 {
    font-size: 1.26rem;
  }

  .article-badges {
    justify-content: center;
    gap: 8px;
  }

  .article-badges span,
  .article-meta span {
    font-size: 0.78rem;
    padding: 7px 10px;
  }

  .cli-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .cli-block code,
  .ascii-diagram code {
    font-size: 0.86rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 12px;
    font-size: 0.92rem;
  }

  .mermaid-card {
    padding: 12px;
  }

  .mermaid-card .mermaid {
    min-width: 560px;
  }

  .diagram-lightbox {
    padding: 14px;
  }

  .diagram-lightbox-content {
    padding: 16px;
  }

  .diagram-lightbox-content svg {
    min-width: 620px;
  }

  .image-lightbox {
    padding: 16px;
  }

  .article-quote {
    padding: 22px;
    font-size: 1.04rem;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 46px;
    height: 46px;
    font-size: 0.85rem;
  }

  .page-footer,
  footer {
    margin-top: 30px;
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .top-nav a,
  body.has-ambient-glow::before,
  .post-card,
  .post-card::before,
  .post-link,
  .copy-command,
  .back-to-top,
  .mermaid-card {
    transition: none;
  }

  .top-nav a:hover,
  .post-card:hover,
  .post-link:hover,
  .back-to-top:hover,
  .mermaid-card:hover {
    transform: none;
  }

  .image-lightbox {
    transition: none;
  }
}
