/* Nyra Documentation — brand-aligned modern UI */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  /* Logo / panther identity — teal on deep charcoal */
  --brand: #3d9a8b;
  --brand-light: #5ec4b4;
  --brand-bright: #7ee8d8;
  --brand-dim: rgba(61, 154, 139, 0.12);
  --brand-glow: rgba(61, 154, 139, 0.35);
  --brand-ring: rgba(94, 196, 180, 0.5);
  --cyan: #22d3ee;
  --warning: #e8b84a;

  --bg: #06090d;
  --bg-elevated: #0c1118;
  --bg-card: #111820;
  --bg-code: #0a0f14;
  --code-block-fg: #c5d4e3;
  --code-inline-fg: var(--brand-bright);
  --code-inline-bg: rgba(61, 154, 139, 0.1);
  --bg-glass: rgba(12, 17, 24, 0.72);

  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(61, 154, 139, 0.22);

  --text: #f0f4f8;
  --text-muted: #8b9cb0;
  --text-faint: #5c6d7e;

  --mesh-1: rgba(61, 154, 139, 0.14);
  --mesh-2: rgba(34, 211, 238, 0.06);
  --hero-bg: linear-gradient(165deg, rgba(61, 154, 139, 0.08) 0%, rgba(12, 17, 24, 0.6) 45%, transparent 100%);
  --hero-panel-bg: linear-gradient(
    145deg,
    rgba(61, 154, 139, 0.1) 0%,
    rgba(12, 17, 24, 0.92) 42%,
    rgba(6, 9, 13, 1) 100%
  );
  --hero-panel-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(61, 154, 139, 0.1);
  --hero-grid-line: rgba(255, 255, 255, 0.03);
  --hero-orb: rgba(61, 154, 139, 0.22);
  --hero-title-from: #ffffff;
  --hero-title-to: var(--brand-light);
  --hero-logo-drop: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 48px rgba(61, 154, 139, 0.28));

  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  --sidebar-w: 280px;
  --content-max: 1280px;
  --header-h: 72px;
  --contrib-banner-h: 0px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 48px var(--brand-glow);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --brand: #2a7a6e;
  --brand-light: #1f6b60;
  --brand-bright: #2d8f80;
  --brand-dim: rgba(42, 122, 110, 0.1);
  --brand-glow: rgba(42, 122, 110, 0.2);
  --brand-ring: rgba(42, 122, 110, 0.35);
  --cyan: #0891b2;

  --bg: #f0f4f8;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-code: #e8eef4;
  --code-block-fg: #1a2433;
  --code-inline-fg: #1a5c52;
  --code-inline-bg: rgba(42, 122, 110, 0.12);
  --bg-glass: rgba(255, 255, 255, 0.88);

  --border: rgba(15, 20, 25, 0.1);
  --border-strong: rgba(42, 122, 110, 0.35);

  --text: #0f1419;
  --text-muted: #4a5d6e;
  --text-faint: #6b7c8d;

  --mesh-1: rgba(42, 122, 110, 0.12);
  --mesh-2: rgba(8, 145, 178, 0.08);
  --hero-bg: linear-gradient(165deg, rgba(42, 122, 110, 0.1) 0%, rgba(255, 255, 255, 0.9) 50%, transparent 100%);
  --hero-panel-bg: linear-gradient(
    145deg,
    rgba(42, 122, 110, 0.14) 0%,
    rgba(255, 255, 255, 0.97) 45%,
    #ffffff 100%
  );
  --hero-panel-shadow: 0 0 0 1px rgba(42, 122, 110, 0.12) inset,
    0 16px 48px rgba(42, 122, 110, 0.12),
    0 4px 24px rgba(15, 20, 25, 0.06);
  --hero-grid-line: rgba(15, 20, 25, 0.06);
  --hero-orb: rgba(42, 122, 110, 0.18);
  --hero-title-from: #0f1419;
  --hero-title-to: var(--brand);
  --hero-logo-drop: drop-shadow(0 16px 36px rgba(42, 122, 110, 0.25))
    drop-shadow(0 6px 20px rgba(15, 20, 25, 0.1));
}

html[dir="rtl"] body {
  font-family: "IBM Plex Sans Arabic", "DM Sans", system-ui, sans-serif;
}

html[dir="rtl"] code,
html[dir="rtl"] pre,
html[dir="rtl"] .file-tree,
html[dir="rtl"] .pipeline {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  direction: ltr;
  text-align: left;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--contrib-banner-h) + 1.5rem);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient brand mesh (panther / teal identity) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, var(--mesh-1), transparent 55%),
    radial-gradient(ellipse 60% 40% at 95% 20%, var(--mesh-2), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, var(--mesh-1), transparent 45%),
    var(--bg);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

::selection {
  background: rgba(61, 154, 139, 0.35);
  color: var(--text);
}

a {
  color: var(--brand-light);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--brand-bright);
  text-decoration: none;
}

/* ——— Contributors banner (site-wide) ——— */
.contrib-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 210;
  min-height: var(--contrib-banner-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.55rem 2.75rem 0.55rem 1rem;
  box-sizing: border-box;
  background: linear-gradient(
    90deg,
    #1a3d38 0%,
    #16353f 45%,
    #1a3d38 100%
  );
  border-bottom: 1px solid #2f6f66;
  color: #f0f4f8;
  font-size: 0.875rem;
  line-height: 1.35;
}

[data-theme="light"] .contrib-banner {
  background: linear-gradient(
    90deg,
    #d7ece8 0%,
    #d5eaf0 45%,
    #d7ece8 100%
  );
  border-bottom: 1px solid #7eb5ab;
  color: #0f1419;
}

[data-theme="light"] .contrib-banner-text {
  color: #0f1419;
}

[data-theme="light"] .contrib-banner-cta {
  color: #ffffff;
  background: #2a7a6e;
}

[data-theme="light"] .contrib-banner-cta:hover {
  color: #ffffff;
  background: #1f6b60;
}

[data-theme="light"] .contrib-banner-dismiss {
  color: #4a5d6e;
  background: #c5ddd8;
}

[data-theme="light"] .contrib-banner-dismiss:hover {
  color: #0f1419;
  background: #b0cfc8;
}

.contrib-banner[hidden] {
  display: none;
}

.contrib-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  max-width: var(--content-max);
  text-align: center;
}

.contrib-banner-text {
  color: #f0f4f8;
  margin: 0;
}

.contrib-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: #06221e;
  background: #7ee8d8;
  text-decoration: none;
  white-space: nowrap;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.contrib-banner-cta:hover {
  color: #06221e;
  background: #a8f0e4;
  text-decoration: none;
}

.contrib-banner-dismiss {
  position: absolute;
  top: 50%;
  inset-inline-end: 0.65rem;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: #244945;
  color: #c5d4e3;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.contrib-banner-dismiss:hover {
  color: #f0f4f8;
  background: #2f5f59;
}

body.has-contrib-banner,
html.contrib-banner-pending {
  --contrib-banner-h: 44px;
}

@media (max-width: 640px) {
  body.has-contrib-banner,
  html.contrib-banner-pending {
    --contrib-banner-h: 64px;
  }

  .contrib-banner {
    padding-inline: 0.75rem 2.5rem;
    font-size: 0.8125rem;
  }
}

/* ——— Header ——— */
.site-header {
  position: fixed;
  top: var(--contrib-banner-h);
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 1.25rem 0 1.5rem;
  gap: 1rem;
}

.site-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--brand-ring) 20%,
    var(--brand-ring) 80%,
    transparent
  );
  opacity: 0.6;
}

.site-header .logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}

.site-header .logo:hover {
  color: var(--text);
  transform: translateY(-1px);
  filter: drop-shadow(0 0 12px var(--brand-glow));
}

.site-header .logo img {
  height: 46px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.site-header .logo span {
  display: none;
}

.site-header .tagline {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: none;
  padding-inline-start: 1rem;
  border-inline-start: 1px solid var(--border);
  margin-inline-start: 0.25rem;
}

@media (min-width: 900px) {
  .site-header .tagline {
    display: inline;
  }
}

/* Toolbar: theme + language */
.site-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
  margin-inline-end: 0.5rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.toolbar-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.toolbar-btn:hover {
  color: var(--text);
  background: var(--brand-dim);
}

.lang-btn.active {
  color: var(--brand-bright);
  background: var(--brand-dim);
}

#theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  padding: 0.4rem;
}

.theme-icon {
  font-size: 1rem;
  line-height: 1;
}

[data-theme="dark"] .theme-icon-sun {
  display: inline;
}
[data-theme="dark"] .theme-icon-moon {
  display: none;
}
[data-theme="light"] .theme-icon-sun {
  display: none;
}
[data-theme="light"] .theme-icon-moon {
  display: inline;
}

html[dir="rtl"] .site-toolbar {
  margin-inline-start: 0.5rem;
  margin-inline-end: auto;
}

html[dir="rtl"] .sidebar li a.active {
  background: linear-gradient(270deg, var(--brand-dim), transparent);
  box-shadow: inset -3px 0 0 var(--brand);
}

html[dir="rtl"] .callout {
  border-left: none;
  border-right: 3px solid var(--brand);
  border-radius: var(--radius) 0 0 var(--radius);
}

html[dir="rtl"] .steps li {
  padding-left: 0;
  padding-right: 2.75rem;
}

html[dir="rtl"] .steps li::before {
  left: auto;
  right: 0;
}

/* Directional arrows should point the reading way in RTL */
html[dir="rtl"] .pipeline-arrow {
  transform: scaleX(-1);
}

/* Keep the animated hero code left-aligned/LTR regardless of page dir */
html[dir="rtl"] .hero-code,
html[dir="rtl"] .hero-code-body,
html[dir="rtl"] .hero-install-cmd {
  direction: ltr;
}

html[dir="rtl"] .hero-code-run {
  direction: ltr;
}

@media (max-width: 768px) {
  html[dir="rtl"] .sidebar {
    transform: translateX(100%);
  }
  #nav-check:checked ~ .layout .sidebar {
    transform: translateX(0);
  }
  .site-header .tagline {
    display: none !important;
  }
}

.nav-check {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--brand-light);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.nav-toggle:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 20px var(--brand-dim);
}

#nav-check:checked ~ .site-header .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#nav-check:checked ~ .site-header .nav-toggle span:nth-child(2) {
  opacity: 0;
}
#nav-check:checked ~ .site-header .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: calc(var(--header-h) + var(--contrib-banner-h));
  background: rgba(0, 0, 0, 0.55);
  z-index: 140;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

#nav-check:checked ~ .sidebar-backdrop {
  display: block;
}

html:has(#nav-check:checked) body {
  overflow: hidden;
}

/* ——— Layout ——— */
.layout {
  padding-top: calc(var(--header-h) + var(--contrib-banner-h));
  min-height: calc(100vh - var(--header-h) - var(--contrib-banner-h));
  box-sizing: border-box;
}

body.has-docs-footer .layout {
  min-height: 0;
}

@media (min-width: 769px) {
  #nav-check:checked ~ .sidebar-backdrop {
    display: none;
  }

  html:has(#nav-check:checked) body {
    overflow: auto;
  }
}

/* Desktop: fixed sidebar column + full-width main */
@media (min-width: 769px) {
  .site-header {
    padding: 0;
    padding-inline-end: 1.5rem;
    gap: 0;
  }

  .site-header .logo {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    max-width: var(--sidebar-w);
    box-sizing: border-box;
    padding-inline: 1rem;
    justify-content: center;
    gap: 0;
  }

  .site-header .logo img {
    height: 52px;
  }

  .site-header .tagline {
    order: 2;
    margin-inline-start: 1.5rem;
    padding-inline-start: 0;
    border-inline-start: none;
  }

  .site-header .site-toolbar {
    order: 3;
    margin-inline-start: auto;
  }

  .site-header .nav-toggle {
    order: 4;
  }

  /* Content + sticky sidebar share one row; footer sits below both at full width */
  .layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    margin-inline-start: 0;
    width: 100%;
    max-width: none;
    padding-inline-start: 0;
    box-sizing: border-box;
  }

  .sidebar {
    position: sticky;
    top: calc(var(--header-h) + var(--contrib-banner-h));
    left: auto;
    right: auto;
    bottom: auto;
    width: var(--sidebar-w);
    height: calc(100vh - var(--header-h) - var(--contrib-banner-h));
    max-height: calc(100vh - var(--header-h) - var(--contrib-banner-h));
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem 0 2rem;
    z-index: 90;
    transition: none;
    align-self: start;
  }

  html[dir="rtl"] .sidebar {
    left: auto;
    right: auto;
    border-right: none;
    border-left: 1px solid var(--border);
  }

  .content {
    width: 100%;
    max-width: none;
    padding: 2.5rem clamp(2rem, 4vw, 3.5rem) 5rem;
    grid-column: 2;
  }

  .overview-page .overview-content {
    max-width: none;
    width: 100%;
  }

  .hero-landing-inner {
    grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.15fr);
    gap: clamp(2rem, 4vw, 4rem);
  }

  .card-grid,
  .bento-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .bento-featured {
    grid-column: span 2;
  }
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--contrib-banner-h));
  width: var(--sidebar-w);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  z-index: 90;
  transition: transform 0.3s var(--ease);
  align-self: start;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.sidebar nav section {
  margin-bottom: 1.5rem;
}

.sidebar .nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding: 0 1.35rem;
  margin-bottom: 0.5rem;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li a {
  display: block;
  padding: 0.5rem 1.35rem;
  margin: 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border-left: none;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sidebar li a:hover {
  color: var(--text);
  background: var(--brand-dim);
  text-decoration: none;
}

.sidebar li a.active {
  color: var(--brand-bright);
  background: linear-gradient(90deg, var(--brand-dim), transparent);
  box-shadow: inset 3px 0 0 var(--brand);
  font-weight: 600;
}

.content {
  display: block;
  width: 100%;
  max-width: var(--content-max);
  min-height: calc(100vh - var(--header-h) - var(--contrib-banner-h));
  margin-inline: auto;
  padding: 2rem 1.25rem 4rem;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .sidebar li a {
    margin-inline: 0.35rem;
    border-radius: var(--radius-sm);
  }
}

@media (max-width: 768px) {
  .site-header {
    padding-inline-start: 0.75rem;
    padding-inline-end: 0.75rem;
    gap: 0.5rem;
  }

  .site-header .nav-toggle {
    display: flex;
    order: -1;
    flex-shrink: 0;
    margin-inline-start: 0;
    margin-inline-end: 0.25rem;
  }

  .site-header .logo {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding-inline: 0;
    justify-content: flex-start;
  }

  .site-header .logo img {
    height: 40px;
  }

  .site-header .site-toolbar {
    order: 2;
    margin-inline-start: auto;
    margin-inline-end: 0;
    flex-shrink: 0;
  }

  .site-header .tagline {
    display: none !important;
  }

  .layout {
    display: block;
    padding-inline-start: 0;
    padding-inline-end: 0;
  }

  .sidebar {
    position: fixed;
    top: calc(var(--header-h) + var(--contrib-banner-h));
    left: 0;
    bottom: 0;
    height: auto;
    max-height: none;
    transform: translateX(-100%);
    box-shadow: var(--shadow);
    z-index: 150;
  }

  html[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    border-right: none;
    border-left: 1px solid var(--border);
  }

  #nav-check:checked ~ .layout .sidebar {
    transform: translateX(0);
  }

  .content {
    max-width: none;
    min-height: 0;
    padding: 1.75rem 1.25rem 3.5rem;
    grid-column: auto;
  }
}

/* ——— Typography ——— */
.content h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text) 0%, var(--brand-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.content h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 3rem 0 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  padding-bottom: 0.5rem;
  border-bottom: none;
  position: relative;
}

.content h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 0.5rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), transparent);
}

.content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.65rem;
  color: var(--brand-light);
}

.content p {
  margin: 0 0 1.1rem;
}

.content .lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 42em;
}

.content ul,
.content ol {
  margin: 0 0 1.1rem;
  padding-inline-start: 1.35rem;
  padding-left: 0;
}

.content li {
  margin-bottom: 0.4rem;
}

.content li::marker {
  color: var(--brand);
}

/* ——— Hero (index & landing blocks) ——— */
.hero {
  text-align: center;
  padding: 2.5rem 1.5rem 3.5rem;
  margin: 0 0 2.5rem;
  border-bottom: none;
  border-radius: var(--radius-lg);
  background: var(--hero-bg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 80%;
  background: radial-gradient(ellipse, var(--brand-glow) 0%, transparent 70%);
  opacity: 0.35;
  pointer-events: none;
}

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

.hero img {
  max-width: min(320px, 85vw);
  height: auto;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 12px 40px rgba(61, 154, 139, 0.25));
  transition: transform 0.4s var(--ease), filter 0.4s var(--ease);
}

.hero:hover img {
  transform: scale(1.02);
  filter: drop-shadow(0 16px 48px rgba(61, 154, 139, 0.35));
}

.hero h1 {
  -webkit-text-fill-color: unset;
  background: none;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.hero .lead {
  margin-left: auto;
  margin-right: auto;
}

.hero .pill,
.hero-copy .pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--brand-dim);
  color: var(--brand-light);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 24px var(--brand-dim);
}

.hero .pill::before,
.hero-copy .pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.75rem 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #2a7a6e 100%);
  color: #fff;
  border-color: var(--brand-light);
  box-shadow: 0 4px 20px var(--brand-glow);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 6px 28px var(--brand-glow);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--brand-bright);
  border-color: var(--border-strong);
  background: var(--brand-dim);
}

/* ——— Cards ——— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.15rem;
  margin: 2rem 0;
}

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 40%,
    var(--brand-ring) 50%,
    transparent 60%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow), 0 0 32px var(--brand-dim);
}

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

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.card a.stretched {
  color: inherit;
  text-decoration: none;
}

.card a.stretched::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card a.stretched:hover {
  text-decoration: none;
}

/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9rem;
}

th,
td {
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  text-align: start;
}

tr:last-child th,
tr:last-child td {
  border-bottom: none;
}

th {
  background: rgba(61, 154, 139, 0.08);
  font-weight: 600;
  color: var(--brand-light);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: var(--brand-dim);
}

/* Legacy: tables not wrapped */
.content > table {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 1.25rem 0 1.75rem;
}

.content > table th {
  background: rgba(61, 154, 139, 0.08);
}

.content > table th,
.content > table td {
  border: none;
  border-bottom: 1px solid var(--border);
}

/* ——— Code ——— */
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-weight: 500;
  background: var(--code-inline-bg);
  color: var(--code-inline-fg);
  padding: 0.12em 0.45em;
  border-radius: 6px;
  border: 1px solid var(--border);
}

pre {
  position: relative;
  background: var(--bg-code);
  color: var(--code-block-fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  margin: 1.15rem 0 1.5rem;
  font-size: 0.84rem;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="light"] pre {
  box-shadow: inset 0 1px 0 rgba(15, 20, 25, 0.04);
}

pre::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--brand), var(--cyan), var(--brand));
  opacity: 0.85;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  font-weight: 400;
}

/* Nyra inline syntax highlighting (client-side tokenizer in js/site.js)
   - These classes are applied only inside <pre><code> blocks. */
pre .tok-comment {
  color: var(--text-faint);
  font-style: italic;
}

pre .tok-keyword {
  color: var(--brand-bright);
  font-weight: 700;
}

pre .tok-fn {
  color: var(--brand-light);
  font-weight: 650;
}

pre .tok-type {
  color: var(--warning);
  font-weight: 650;
}

pre .tok-string {
  color: var(--brand-light);
  font-weight: 600;
}

pre .tok-number {
  color: var(--cyan);
  font-weight: 650;
}

pre .tok-boolean {
  color: var(--warning);
  font-weight: 700;
}

pre .tok-error {
  color: var(--warning);
  font-weight: 800;
}

pre .tok-operator {
  color: var(--code-block-fg);
  opacity: 0.95;
}

/* ——— Callouts ——— */
.callout {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--brand);
  background: linear-gradient(90deg, var(--brand-dim), transparent);
  padding: 1.1rem 1.35rem;
  margin: 1.5rem 0;
  border-radius: var(--radius);
}

.callout.warning {
  border-left-color: var(--warning);
  border-color: rgba(232, 184, 74, 0.25);
  background: linear-gradient(90deg, rgba(232, 184, 74, 0.1), transparent);
}

.callout strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.pipeline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  white-space: pre;
  line-height: 1.65;
  color: var(--text-muted);
  box-shadow: inset 0 0 40px var(--brand-dim);
}

/* ——— Page nav footer (prev/next links at end of article) ——— */
.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.site-footer a {
  font-weight: 500;
}

/* ——— Site-wide docs footer (full bleed under sidebar + content) ——— */
.docs-footer {
  position: relative;
  z-index: 95;
  width: 100%;
  margin: 0;
  border-top: 1px solid var(--border-strong);
  background:
    linear-gradient(180deg, rgba(61, 154, 139, 0.08) 0%, transparent 28%),
    var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.9rem;
}

[data-theme="light"] .docs-footer {
  background:
    linear-gradient(180deg, rgba(42, 122, 110, 0.07) 0%, transparent 28%),
    var(--bg-elevated);
}

.docs-footer-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 2.5rem clamp(1.25rem, 3vw, 3rem) 2rem;
  box-sizing: border-box;
}

.docs-footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(140px, 1fr));
  gap: 2rem clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  max-width: 1200px;
}

.docs-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.docs-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.docs-footer-logo:hover {
  color: var(--brand-bright);
}

.docs-footer-logo img {
  height: 32px;
  width: auto;
}

.docs-footer-tagline {
  margin: 0;
  max-width: 40ch;
  line-height: 1.5;
  color: var(--text-muted);
}

.docs-footer-col h3 {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.docs-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.docs-footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.docs-footer-col a:hover {
  color: var(--brand-bright);
}

.docs-footer-meta {
  margin-top: 2rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  max-width: 1200px;
}

.docs-footer-meta a {
  color: var(--brand-bright);
  text-decoration: none;
  font-weight: 500;
}

.docs-footer-meta a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .docs-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .docs-footer-brand {
    grid-column: 1 / -1;
  }

  .docs-footer-inner {
    padding: 2rem 1.25rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .docs-footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ——— Badges ——— */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-right: 0.4rem;
}

.badge.live {
  border-color: var(--border-strong);
  color: var(--brand-bright);
  background: var(--brand-dim);
  box-shadow: 0 0 16px var(--brand-dim);
}

/* ——— TOC & examples ——— */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.4rem;
  margin: 1.75rem 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.toc-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 0.65rem;
}

.toc ul {
  margin: 0;
  padding-inline-start: 1.2rem;
  padding-left: 0;
}

.toc a {
  font-size: 0.9rem;
  font-weight: 500;
}

.example-block {
  margin: 3rem 0;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.example-block:last-of-type {
  border-bottom: none;
}

.example-block h2 {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.example-block h2::after {
  display: none;
}

.example-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: -0.35rem 0 1.15rem;
}

/* Easy vs typed code example tabs */
.code-tabs {
  margin: 1rem 0 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-code);
}

.code-tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.code-tab {
  flex: 1;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.code-tab:hover {
  color: var(--text);
  background: var(--brand-dim);
}

.code-tab.active {
  color: var(--brand-bright);
  border-bottom-color: var(--brand);
  background: var(--bg-code);
}

.code-tabs .code-panel {
  display: none;
  margin: 0;
}

.code-tabs .code-panel.active {
  display: block;
}

.code-tabs .code-panel pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

.builtin-ex-title {
  margin: 2rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.builtin-ex-title code {
  font-size: 0.88rem;
}

/* Lesson / concept block: شرح → مثال → Output */
.doc-ex {
  margin: 0 0 2rem;
  padding: 0 0 0.25rem;
}

.doc-ex > h2,
.doc-ex > h3 {
  margin-top: 0;
}

.doc-ex-prose {
  margin: 0.35rem 0 0.85rem;
  color: var(--text);
  line-height: 1.65;
  max-width: 42rem;
}

html[dir="rtl"] .doc-ex-prose {
  font-family: "IBM Plex Sans Arabic", var(--font-sans);
}

.doc-ex .code-tabs,
.doc-ex > pre {
  margin-bottom: 0.35rem;
}

.doc-ex .code-tabs,
.doc-ex > pre,
.doc-ex .example-output {
  direction: ltr;
  text-align: left;
}

.example-output-label {
  margin: 0.65rem 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

pre.example-output {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent, #3d8f7a);
  border-radius: var(--radius);
  overflow-x: auto;
}

pre.example-output code {
  white-space: pre;
}

.file-tree {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin: 1.1rem 0;
  line-height: 1.75;
  color: var(--text-muted);
}

.file-tree .hl {
  color: var(--brand-bright);
  font-weight: 500;
}

pre .file-label {
  display: block;
  font-size: 0.7rem;
  color: var(--brand);
  margin-bottom: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1.15rem 0 1.5rem;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.75rem;
  margin-bottom: 0.9rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  width: 1.75rem;
  height: 1.75rem;
  line-height: 1.75rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-dim), transparent);
  color: var(--brand-bright);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
  margin: 1.15rem 0;
}

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

.compare-grid .label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.4rem;
}

/* Utility */
.text-muted {
  color: var(--text-muted);
}

/* Focus accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   Overview page (index) — editorial landing
   ═══════════════════════════════════════════════════════════ */
.overview-page .overview-content {
  max-width: 100%;
  padding-top: 1.5rem;
}

.overview-page .content > h2::after {
  display: none;
}

/* ——— Hero landing ——— */
.hero-landing {
  position: relative;
  margin: 0 0 3.5rem;
  padding: clamp(3rem, 8vw, 5rem) clamp(1.5rem, 5vw, 3rem);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--hero-panel-bg);
  box-shadow: var(--hero-panel-shadow);
  color: var(--text);
  text-align: center;
}

.hero-landing::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(61, 154, 139, 0.14) 0%,
    transparent 38%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

.hero-facet-bg {
  position: absolute;
  inset: 0;
  opacity: 0.65;
  background-image:
    linear-gradient(135deg, transparent 40%, var(--brand-dim) 50%, transparent 60%),
    linear-gradient(30deg, var(--hero-grid-line) 1px, transparent 1px),
    linear-gradient(150deg, var(--hero-grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 25%, black 15%, transparent 72%);
  pointer-events: none;
}

.hero-glow-orb {
  position: absolute;
  top: -35%;
  left: 50%;
  right: auto;
  width: min(70%, 520px);
  height: 75%;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--hero-orb) 0%, transparent 68%);
  filter: blur(48px);
  pointer-events: none;
  animation: orb-drift 12s ease-in-out infinite alternate;
}

@keyframes orb-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-5%, 8%) scale(1.08); }
}

.hero-landing-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  text-align: start;
}

@media (max-width: 860px) {
  .hero-landing-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy {
    align-items: center;
    text-align: center;
    max-width: 40rem;
    margin: 0 auto;
  }

  .hero-copy h1 {
    align-items: center;
  }

  .hero-copy .hero-lead {
    margin-inline: auto;
  }

  .hero-chips,
  .hero-copy .hero-actions {
    justify-content: center;
  }

  .hero-code {
    order: 2;
    max-width: 40rem;
    margin: 0 auto;
    width: 100%;
  }

  .hero-code-body {
    min-height: 0;
  }
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-frame {
  position: relative;
  display: inline-block;
}

.logo-frame img {
  position: relative;
  z-index: 1;
  max-width: min(300px, 72vw);
  height: auto;
  display: block;
  filter: var(--hero-logo-drop);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
  max-width: 40rem;
  margin: 0;
}

.hero-copy .pill {
  margin-bottom: 1.25rem;
}

.hero-copy h1 {
  margin: 0 0 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  -webkit-text-fill-color: unset;
  background: none;
}

.hero-title-brand {
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.02;
  color: var(--hero-title-from);
  background: linear-gradient(180deg, var(--hero-title-from) 0%, var(--hero-title-to) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 40px rgba(61, 154, 139, 0.25));
}

.hero-title-sub {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  -webkit-text-fill-color: unset;
  background: none;
}

.hero-tagline {
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  font-weight: 600;
  color: var(--brand);
  margin: 0.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.hero-lead {
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  max-width: 38em;
}

.hero-chips {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.5rem;
}

.hero-chips li {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.hero-chips li:hover {
  border-color: var(--border-strong);
  color: var(--brand-bright);
  box-shadow: 0 0 16px var(--brand-dim);
}

.hero-copy .hero-actions {
  justify-content: flex-start;
  margin-top: 0;
}

/* ——— Hero: animated code window ——— */
.hero-code {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
}

.hero-code-window {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(10, 15, 20, 0.96), rgba(6, 9, 13, 0.98));
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), 0 0 60px var(--brand-dim),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  animation: hero-code-float 7s ease-in-out infinite alternate;
}

[data-theme="light"] .hero-code-window {
  background: linear-gradient(180deg, #0c1118, #0a0f14);
}

@keyframes hero-code-float {
  from { transform: translateY(4px); }
  to { transform: translateY(-6px); }
}

.hero-code-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.hero-code-dots {
  display: inline-flex;
  gap: 0.4rem;
}

.hero-code-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #46525f;
}

.hero-code-dots i:nth-child(1) { background: #f25d5d; }
.hero-code-dots i:nth-child(2) { background: #f2b84a; }
.hero-code-dots i:nth-child(3) { background: var(--brand-light); }

.hero-code-file {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hero-code-run {
  margin-inline-start: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--brand-bright);
  background: var(--brand-dim);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
}

.hero-code-body {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 1.1rem 1.25rem 1.35rem;
  min-height: 15.5em;
  font-size: 0.82rem;
  line-height: 1.7;
  /* code stays LTR even in RTL layouts */
  direction: ltr;
  text-align: left;
  white-space: pre;
  overflow-x: auto;
  tab-size: 4;
}

.hero-code-body::before {
  display: none;
}

.hero-code-body code {
  font-family: var(--font-mono);
  background: none;
  border: none;
  padding: 0;
  color: var(--code-block-fg);
  white-space: pre;
}

.hero-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-inline-start: 1px;
  vertical-align: text-bottom;
  background: var(--brand-bright);
  box-shadow: 0 0 8px var(--brand-glow);
  animation: hero-caret-blink 1s step-end infinite;
}

@keyframes hero-caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-code-window { animation: none; }
  .hero-caret { animation: none; }
}

.hero-install {
  margin: 2rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 46rem;
  position: relative;
  z-index: 1;
  text-align: start;
}

.hero-install-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero-install-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-bright);
}

.hero-install-cmd {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

[data-theme="light"] .hero-install-cmd {
  background: rgba(15, 20, 25, 0.04);
}

.hero-install-cmd code {
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text);
  background: none;
  padding: 0;
}

.hero-install-hint {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hero-install-hint a {
  color: var(--brand-bright);
}

.btn-icon {
  padding: 0.65rem 0.85rem;
  min-width: 44px;
}

.btn-icon svg {
  display: block;
}

/* ——— Overview sections ——— */
.overview-section {
  margin-bottom: 3.5rem;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.section-head h2::after {
  display: block;
}

.section-desc {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 36em;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

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

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}

.about-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.about-card-accent {
  background: linear-gradient(160deg, var(--brand-dim) 0%, var(--bg-card) 70%);
  border-color: var(--border-strong);
}

.about-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-bright);
  background: var(--brand-dim);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  clip-path: polygon(12% 0, 100% 0, 100% 88%, 88% 100%, 0 100%, 0 12%);
}

.about-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text);
}

.about-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.about-link {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Pillars */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
}

@media (max-width: 960px) {
  .pillar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.pillar-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 24px var(--brand-dim);
  border-color: var(--border-strong);
}

.pillar-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.35rem;
}

.pillar-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  color: var(--text);
}

.pillar-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Pipeline steps */
.pipeline-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.pipeline-step {
  flex: 1 1 140px;
  padding: 1rem 1.1rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pipeline-step-final {
  border-color: var(--border-strong);
  background: linear-gradient(135deg, var(--brand-dim), var(--bg-code));
}

.pipeline-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--brand);
}

.pipeline-step strong {
  font-size: 0.95rem;
  color: var(--text);
}

.pipeline-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  color: var(--brand);
  font-size: 1.25rem;
  opacity: 0.6;
  padding: 0 0.15rem;
}

@media (max-width: 700px) {
  .pipeline-arrow {
    display: none;
  }
  .pipeline-steps {
    flex-direction: column;
  }
}

/* Bento grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.bento-featured {
  grid-column: span 2;
  grid-row: span 1;
  background: linear-gradient(135deg, rgba(61, 154, 139, 0.12) 0%, var(--bg-card) 55%);
  border-color: var(--border-strong);
}

.bento-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.bento-featured h3 {
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-featured {
    grid-column: span 1;
  }
}

.callout-status {
  border-radius: var(--radius-lg);
}

.overview-page .hero-landing .pill {
  margin-bottom: 1rem;
}

.hero-status-banner {
  margin: 1rem 0 1.25rem;
  text-align: start;
  max-width: 36rem;
}

.hero-status-banner p,
.hero-mvp-banner p {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow-orb {
    animation: none;
  }
}

/* Beginner track lessons */
.lesson-meta {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.lesson-track-list {
  margin: 1.5rem 0 2rem;
  padding-inline-start: 1.4rem;
  padding-left: 0;
}

.lesson-track-list li {
  margin: 0.65rem 0;
}

.lesson-goals {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.lesson-goals ul {
  margin: 0.5rem 0 0;
  padding-inline-start: 1.2rem;
  padding-left: 0;
}

.line-table {
  width: 100%;
  margin: 1.25rem 0 2rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.line-table th,
.line-table td {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.line-table th {
  background: var(--bg-card);
  font-weight: 600;
}

.line-table td:first-child {
  width: 3rem;
  text-align: center;
  color: var(--text-muted);
}

.line-table code {
  white-space: pre-wrap;
  word-break: break-word;
}

.lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.lesson-nav-prev,
.lesson-nav-next {
  flex: 1;
}

.lesson-nav-next {
  text-align: end;
}

.lesson-nav-hub {
  flex: 0 0 auto;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.lesson-nav-spacer {
  flex: 1;
}
