/* -- app shell ---------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--color-navy);
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  box-sizing: border-box;
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(76, 141, 255, 0.35), transparent);
}
.topbar.is-elevated {
  background: rgba(10, 25, 48, 0.85);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 8px 24px rgba(var(--shadow-color), 0.28);
}

.topbar__divider {
  width: 1px;
  height: 22px;
  background: var(--color-navy-border);
  flex-shrink: 0;
}

.topbar__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-navy-border);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  color: var(--color-navy-text);
  cursor: pointer;
  transition: background 0.15s ease;
}
.topbar__menu-toggle:hover { background: var(--color-navy-surface); }
.topbar__menu-toggle .icon-x { display: none; }

.topbar__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.topbar__nav a {
  position: relative;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-navy-text-muted);
  padding-bottom: 3px;
}
.topbar__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1.5px;
  background: var(--color-accent-bright);
  transition: right 0.2s var(--ease-out);
}
.topbar__nav a:hover { color: var(--color-navy-text); text-decoration: none; }
.topbar__nav a:hover::after { right: 0; }

/* -- language switch ------------------------------------------------------- */
.lang-switch { position: relative; }
.lang-switch__toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-navy-border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-navy-text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-switch__toggle:hover,
.lang-switch.is-open .lang-switch__toggle { background: var(--color-navy-surface); color: var(--color-navy-text); }
.lang-switch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--color-navy-surface);
  border: 1px solid var(--color-navy-border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 32px rgba(var(--shadow-color), 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s var(--ease-out), visibility 0.15s;
  z-index: 60;
}
.lang-switch.is-open .lang-switch__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-switch__menu li { margin: 0; }
.lang-switch__menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-navy-text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.lang-switch__menu a:hover { background: var(--color-navy-border); color: var(--color-navy-text); }
.lang-switch__menu a.is-active { color: var(--color-navy-text); font-weight: 600; }
.lang-switch__tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--color-navy-text-muted);
  background: rgba(255, 255, 255, 0.08);
}
.lang-switch__menu a.is-active .lang-switch__tag { color: var(--color-accent-bright); background: rgba(76, 141, 255, 0.16); }
@media (max-width: 720px) {
  .lang-switch__current { display: none; }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-navy-border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-navy-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { background: var(--color-navy-surface); color: var(--color-navy-text); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: inline-flex; }

/* -- brand mark (three ripple rings — an original mark, not a trademark) --- */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  color: var(--color-navy-text);
}
.brand__mark { flex-shrink: 0; overflow: visible; }
.brand__word { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.01em; }
.brand__word span { font-weight: 600; color: var(--color-accent-bright); margin-left: 0.2em; }
.footer__brand .brand__word { font-size: 1.4rem; }

/* -- sidebar -------------------------------------------------------------- */
.sidebar {
  background: var(--color-sidebar-bg);
  border-right: 1px solid var(--color-border);
  padding: var(--space-3);
  overflow-y: auto;
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 8px; border: 2px solid var(--color-sidebar-bg); }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }
.sidebar__sections { flex: 1 0 auto; }

/* -- sidebar footer: pinned below the section list, fills the leftover -- */
/* vertical space on tall viewports with a few quick, useful shortcuts.  -- */
.sidebar__footer {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.sidebar__footer-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-2);
}
.sidebar__footer-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.sidebar__footer-links a:hover { background: var(--color-surface); color: var(--color-text); text-decoration: none; }
.sidebar__footer-meta {
  margin: 0;
  padding: 0 var(--space-2);
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
/* -- sidebar category clusters -------------------------------------------- */
.sidebar__category + .sidebar__category { margin-top: 10px; }
.sidebar__category-title {
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.75;
  padding: 0 var(--space-2) 4px;
  margin-bottom: 2px;
}

.sidebar__section { margin-bottom: 2px; }
.sidebar__section-count {
  flex-shrink: 0;
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  padding: 1px 5px;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.sidebar__section summary:hover .sidebar__section-count,
.sidebar__section[open] .sidebar__section-count { opacity: 1; }
.sidebar__section summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px var(--space-2);
  border-radius: var(--radius-sm);
  list-style: none;
  transition: background 0.15s ease;
}
.sidebar__section summary::-webkit-details-marker { display: none; }
.sidebar__section summary:hover { background: var(--color-accent-soft); }
.sidebar__section-chevron {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.2s var(--ease-out), color 0.15s ease;
}
.sidebar__section[open] .sidebar__section-chevron { transform: rotate(90deg); color: var(--color-accent); }
.sidebar__section-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar__section[open] .sidebar__section-icon,
.sidebar__section summary:hover .sidebar__section-icon {
  background: var(--sidebar-icon-tint, var(--color-accent-soft));
  color: var(--sidebar-icon-ink, var(--color-accent));
}
.sidebar__section-title {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--color-text);
}

@media (prefers-reduced-motion: no-preference) {
  .sidebar__links { animation: sidebar-links-in 0.18s var(--ease-out) both; }
}
@keyframes sidebar-links-in {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.sidebar__links { list-style: none; margin: 2px 0 0; padding: 0 0 var(--space-2) 26px; border-left: 1px solid var(--color-border); margin-left: 15px; }
.sidebar__links li { position: relative; }
.sidebar__links a {
  display: block;
  padding: 4px var(--space-2) 4px calc(var(--space-2) + 3px);
  margin-left: -1px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sidebar__links a:hover { background: var(--color-surface); color: var(--color-text); text-decoration: none; }
.sidebar__links a[aria-current="page"] {
  background: var(--color-accent-soft);
  border-left-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}

/* -- search --------------------------------------------------------------- */
.search-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-navy-border);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  color: var(--color-navy-text);
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}
.search-mobile-toggle:hover { background: var(--color-navy-surface); }
.search { position: relative; flex: 1; max-width: 300px; transition: max-width 0.2s var(--ease-out); }
.search:focus-within { max-width: 400px; }
.search__close { display: none; }
.search__icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-navy-text-muted);
  pointer-events: none;
}
.search__input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 30px 7px 32px;
  border: 1px solid var(--color-navy-border);
  border-radius: var(--radius-sm);
  background: var(--color-navy-surface);
  color: var(--color-navy-text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search__input:focus { outline: none; border-color: var(--color-accent-bright); box-shadow: 0 0 0 3px rgba(76, 141, 255, 0.18); }
.search__input::placeholder { color: var(--color-navy-text-muted); }
.search__kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 6px;
  border: 1px solid var(--color-navy-border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-navy-text-muted);
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.search:focus-within .search__kbd { opacity: 0; }
.search__results {
  display: block;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(var(--shadow-color), 0.18);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 30;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top;
  pointer-events: none;
  transition: opacity 0.14s var(--ease-out), transform 0.14s var(--ease-out);
}
.search__results.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.search__result {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.search__result:last-child { border-bottom: none; }
.search__result:hover { background: var(--color-surface); }
.search__result-title { font-weight: 600; font-size: 0.9rem; color: var(--color-text); }
.search__result-section { font-size: 0.75rem; color: var(--color-text-muted); }
.search__empty { padding: var(--space-3); color: var(--color-text-muted); font-size: 0.9rem; }

/* -- content ------------------------------------------------------------- */
.content {
  padding: var(--space-5) var(--space-4);
  min-width: 0;
}
.content__inner { max-width: 1080px; margin: 0 auto; }

/* -- article layout (main column + "on this page" toc) --------------------- */
.article-layout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
}
.article-main { flex: 1; min-width: 0; max-width: var(--content-max-width); }
.article-toc {
  flex: 0 0 200px;
  position: sticky;
  top: calc(56px + var(--space-4));
  font-size: 0.85rem;
}
.article-toc__title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.article-toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--color-border); }
.article-toc li { margin-bottom: 2px; line-height: 1.35; }
.article-toc a {
  display: block;
  padding: 4px 0 4px 12px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--color-text-muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.article-toc a:hover { color: var(--color-accent); text-decoration: none; }
.article-toc a.is-active { color: var(--color-accent); border-left-color: var(--color-accent); font-weight: 600; }
.article-toc__level-3 { padding-left: var(--space-3); }

/* -- reading progress bar --------------------------------------------------- */
/* position: fixed (not sticky) so it never participates in .app's grid flow */
.progress-bar {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 19;
  height: 2px;
  background: transparent;
  pointer-events: none;
}
.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transition: width 0.1s linear;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.eyebrow__sep { color: var(--color-border); }
.eyebrow__section { color: var(--color-text-muted); }
.eyebrow a { color: inherit; }
.eyebrow a:hover { color: var(--color-accent); }

.article__description {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* -- callouts -------------------------------------------------------------- */
.callout {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin: 0 0 var(--space-3);
}
.callout {
  position: relative;
  padding-left: calc(var(--space-3) + 26px);
}
.callout::before {
  content: "";
  position: absolute;
  left: var(--space-3);
  top: 15px;
  width: 16px;
  height: 16px;
  background: var(--color-callout-info-border);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.callout-warn::before {
  background: var(--color-callout-warn-border);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}
.callout p:last-child { margin-bottom: 0; }
.callout-info { background: var(--color-callout-info-bg); }
.callout-warn { background: var(--color-callout-warn-bg); }

/* -- prev/next -------------------------------------------------------------- */
.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.prev-next__link {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.prev-next__link:hover { background: var(--color-accent-soft); border-color: var(--color-accent); text-decoration: none; }
.prev-next__link--next { text-align: right; }
.prev-next__label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.prev-next__link--next .prev-next__label { justify-content: flex-end; }
.prev-next__title { font-weight: 600; color: var(--color-text); }

/* -- back to top ------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-sidebar-bg);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(var(--shadow-color), 0.16);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out), border-color 0.15s ease;
  z-index: 15;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { border-color: var(--color-accent); }

/* -- home: hero ------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-5) 0 var(--space-4);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
}
.hero__mark {
  position: absolute;
  right: -20px;
  top: -30px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.92;
  filter: drop-shadow(0 12px 28px rgba(27, 87, 214, 0.22));
}
.hero__eyebrow {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}
.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 10px 0 0;
  font-size: 2.6rem;
}
.hero__subtitle {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: var(--space-2) 0 0;
  font-size: 1.1rem;
  color: var(--color-text-muted);
}
.hero__stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
@media (prefers-reduced-motion: no-preference) {
  .hero__eyebrow, .hero h1, .hero__subtitle, .hero__stats {
    animation: rise-in 0.5s var(--ease-out) both;
  }
  .hero h1 { animation-delay: 0.05s; }
  .hero__subtitle { animation-delay: 0.1s; }
  .hero__stats { animation-delay: 0.15s; }
}
@keyframes rise-in {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-sidebar-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 7px var(--space-3);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.stat-pill strong { font-family: var(--font-display); color: var(--color-text); font-size: 0.95rem; }
.stat-pill--live { background: var(--color-accent-soft); border-color: #c9dafb; color: var(--color-accent); font-weight: 600; }
.stat-pill__dot { width: 6px; height: 6px; border-radius: 50%; background: #2e9e5b; flex-shrink: 0; }

/* -- home: spotlight + section grid ------------------------------------------ */
.eyebrow-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
}

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.spotlight-card {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-sidebar-bg);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.spotlight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(var(--shadow-color), 0.14);
  border-color: #b9cdf7;
  text-decoration: none;
}
@media (prefers-reduced-motion: no-preference) {
  .spotlight-card { animation: rise-in 0.4s var(--ease-out) both; }
  .spotlight-card:nth-child(1) { animation-delay: 0.05s; }
  .spotlight-card:nth-child(2) { animation-delay: 0.1s; }
  .spotlight-card:nth-child(3) { animation-delay: 0.15s; }
  .spotlight-card:nth-child(4) { animation-delay: 0.2s; }
}
.spotlight-card__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}
.spotlight-card__title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--color-text); margin-bottom: 4px; }
.spotlight-card__desc { font-size: 0.85rem; line-height: 1.5; color: var(--color-text-muted); }

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}
.section-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-sidebar-bg);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.section-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(var(--shadow-color), 0.1); border-color: #b9cdf7; }
@media (prefers-reduced-motion: no-preference) {
  .section-card { animation: rise-in 0.4s var(--ease-out) both; }
  .section-card:nth-child(1) { animation-delay: 0.02s; } .section-card:nth-child(2) { animation-delay: 0.05s; }
  .section-card:nth-child(3) { animation-delay: 0.08s; } .section-card:nth-child(4) { animation-delay: 0.11s; }
  .section-card:nth-child(5) { animation-delay: 0.14s; } .section-card:nth-child(6) { animation-delay: 0.17s; }
  .section-card:nth-child(7) { animation-delay: 0.2s; }  .section-card:nth-child(8) { animation-delay: 0.23s; }
  .section-card:nth-child(9) { animation-delay: 0.26s; } .section-card:nth-child(10) { animation-delay: 0.29s; }
  .section-card:nth-child(11) { animation-delay: 0.32s; } .section-card:nth-child(12) { animation-delay: 0.35s; }
  .section-card:nth-child(13) { animation-delay: 0.38s; }
}
.section-card__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.section-card__badge {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.68rem;
  flex-shrink: 0;
}
.section-card__title { font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; color: var(--color-text); }
.section-card__list { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.section-card__list li { margin-bottom: 3px; }
.section-card__list a { color: var(--color-text-muted); }
.section-card__list a:hover { color: var(--color-accent); }
.section-card__more { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }

/* -- footer -------------------------------------------------------------- */
.footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-4);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.footer__brand .brand { color: var(--color-text); margin-bottom: var(--space-2); }
.footer__brand .brand__word span { color: var(--color-accent); }
.footer__tagline { margin: 0; max-width: 320px; line-height: 1.55; }
.footer__col-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.footer__col { display: flex; flex-direction: column; gap: 6px; }
.footer__col a { color: var(--color-text-muted); font-size: 0.85rem; }
.footer__col a:hover { color: var(--color-accent); }
.footer__meta { margin: 0; font-size: 0.82rem; }
.footer__bottom {
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: 0.78rem;
  line-height: 1.6;
}
.footer__bottom p { margin: 0 0 4px; }
.footer__bottom p:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* -- mobile sidebar backdrop -------------------------------------------------- */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 24, 0.45);
  z-index: 24;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* -- responsive -------------------------------------------------------------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .topbar__menu-toggle { display: inline-flex; }
  .topbar__nav { display: none; }
  .search-mobile-toggle { display: inline-flex; }
  .search { display: none; }
  .search.is-active {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    max-width: none;
    padding: 0 var(--space-4);
    background: var(--color-navy);
    z-index: 31;
  }
  .search.is-active .search__input { flex: 1; width: auto; padding-right: 12px; }
  .search.is-active .search__kbd { display: none; }
  .search.is-active .search__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    color: var(--color-navy-text-muted);
    cursor: pointer;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    width: min(85vw, 320px);
    max-height: none;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease-out);
    z-index: 25;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .app.sidebar-open .sidebar-backdrop { display: block; opacity: 1; }
  .footer { grid-column: 1; }
  .prev-next { grid-template-columns: 1fr; }
  .prev-next__link--next { text-align: left; }
  .article-toc { display: none; }
  .hero h1 { font-size: 2rem; }
  .hero__mark { display: none; }
  .back-to-top { right: var(--space-3); bottom: var(--space-3); }
  .pricing-grid { grid-template-columns: 1fr; }
}

/* -- pricing cards (advertise page) ------------------------------------------ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-4);
}
.pricing-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-sidebar-bg);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.pricing-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(var(--shadow-color), 0.1); border-color: #b9cdf7; }
.pricing-card--featured { border-color: var(--color-accent); }
.pricing-card__title { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--color-text); }
.pricing-card__price { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: var(--color-text); margin: 6px 0 2px; }
.pricing-card__price span { font-family: var(--font-sans); font-weight: 400; font-size: 0.8rem; color: var(--color-text-muted); }
.pricing-card__desc { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.pricing-card__list { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; display: flex; flex-direction: column; gap: 6px; }
.pricing-card__list li { display: flex; align-items: flex-start; gap: 6px; color: var(--color-text); }
.pricing-card__list li svg { flex-shrink: 0; margin-top: 2px; color: #1e7a46; }
