/* ============================================================
   SameerPedia - main stylesheet
   Colour tokens are injected from the admin panel in <head>.
   ============================================================ */

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

:root {
  --primary:      #0B1B33;
  --primary-dark: #07101F;
  --accent:       #E5A93C;
  --accent-dark:  #C88C25;
  --secondary:    #38BDF8;
  --body-bg:      #F8FAFC;
  --card-bg:      #FFFFFF;
  --text:         #1E293B;
  --muted:        #64748B;
  --border:       #E2E8F0;
  --header-bg:    #FFFFFF;
  --header-text:  #0B1B33;
  --footer-bg:    #07101F;
  --footer-text:  #C3CFE4;
  --radius:       16px;
  --container:    1240px;
  --font-heading: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", "Hind Siliguri", "Segoe UI", system-ui, sans-serif;

  --shadow-sm: 0 1px 2px rgba(16, 30, 60, .06);
  --shadow:    0 4px 16px rgba(16, 30, 60, .08);
  --shadow-lg: 0 18px 48px rgba(16, 30, 60, .14);
  --header-h:  76px;
  --topbar-h:  38px;
}

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

body {
  margin: 0;
  background:
    linear-gradient(110deg, rgba(219, 234, 254, .78), rgba(252, 231, 243, .72)),
    var(--body-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  color: var(--primary);
  line-height: 1.22;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.02em;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
p  { margin: 0 0 1.1em; }

::selection { background: var(--accent); color: var(--primary-dark); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.04); }
::-webkit-scrollbar-thumb { background: #c3cbdd; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------------- layout ---------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section   { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--alt   { background: var(--card-bg); }

.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.sec-head__title { margin: 0; }
.sec-head__eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent-dark); margin-bottom: 6px;
}
.sec-head__sub { color: var(--muted); font-size: .95rem; margin: 6px 0 0; max-width: 62ch; }
.sec-head__link { font-weight: 700; font-size: .9rem; color: var(--primary); white-space: nowrap; }
.sec-head__link:hover { color: var(--accent-dark); }

.grid { display: grid; gap: 26px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border: 1px solid transparent; border-radius: 999px;
  font-weight: 700; font-size: .92rem; line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--primary-dark); box-shadow: 0 8px 22px rgba(240,180,41,.32); }
.btn--primary:hover { background: var(--accent-dark); }
.btn--dark { background: var(--primary); color: #fff; }
.btn--dark:hover { background: var(--primary-dark); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--ghost:hover { background: rgba(255,255,255,.14); border-color: #fff; }
.btn--outline { background: transparent; color: var(--primary); border-color: var(--border); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn--sm { padding: 9px 18px; font-size: .82rem; }
.btn--block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
}
.badge--accent { background: rgba(240,180,41,.16); color: #8a6206; }
.badge--primary { background: rgba(20,38,74,.09); color: var(--primary); }
.badge--live { background: rgba(16,185,129,.14); color: #047857; }

/* ============================================================
   HEADER + NAVIGATION
   ============================================================ */
.topbar {
  background: var(--primary-dark); color: var(--topbar-text, rgba(255,255,255,.72));
  font-size: var(--topbar-font-size, .78rem); letter-spacing: .03em;
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.topbar__tagline { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.topbar__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.topbar__social { display: flex; gap: 14px; }
.topbar__social a:hover { color: var(--accent); }

.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--header-bg); color: var(--header-text);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s ease;
}
.site-header.is-stuck { box-shadow: var(--shadow); }
.header__inner { display: flex; align-items: center; gap: 14px; min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand__mark { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--font-heading); font-size: 1.32rem; font-weight: 800; letter-spacing: -.03em; }
.brand__name span { color: var(--accent-dark); }
.brand__tag { font-size: var(--brand-tag-font-size, .55rem); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-tag-color, var(--muted)); margin-top: 3px; }
.brand__logo-full { max-height: 52px; width: auto; }

/* ---- primary nav ---- */
.nav { display: flex; align-items: center; margin-left: auto; min-width: 0; }
.nav__list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav__item { position: relative; }
.nav__link {
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 10px 11px; border-radius: 10px;
  font-size: .9rem; font-weight: 600; color: var(--header-text);
  transition: color .18s ease, background .18s ease;
}
.nav__link:hover { color: var(--accent-dark); background: rgba(20,38,74,.05); }
.nav__item.is-active > .nav__link { color: var(--accent-dark); }
.nav__item.is-active > .nav__link::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.nav__caret { width: 11px; height: 11px; transition: transform .22s ease; flex: none; }
.nav__item:hover .nav__caret { transform: rotate(180deg); }

/* ---- dropdown ---- */
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 268px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px; list-style: none; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 240;
}
.nav__item:hover > .dropdown,
.nav__item:focus-within > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown__link { display: block; padding: 9px 13px; border-radius: 9px; transition: background .16s ease; }
.dropdown__link:hover { background: rgba(20,38,74,.055); }
.dropdown__title { font-size: .88rem; font-weight: 700; color: var(--primary); }
.dropdown__link:hover .dropdown__title { color: var(--accent-dark); }
.dropdown__desc { font-size: .74rem; color: var(--muted); line-height: 1.45; margin-top: 1px; }

/* ---- mega menu ---- */
.dropdown--mega {
  left: 50%; transform: translate(-50%, 10px);
  width: min(760px, calc(100vw - 40px));
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 16px;
}
.nav__item:hover > .dropdown--mega,
.nav__item:focus-within > .dropdown--mega { transform: translate(-50%, 0); }
.dropdown--mega .dropdown__foot {
  grid-column: 1 / -1; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}

/* ---- header actions ---- */
.header__actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 11px; border: 1px solid var(--border); background: transparent;
  color: var(--header-text); transition: all .18s ease; position: relative;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-dark); background: rgba(240,180,41,.08); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn__count {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #ef4444; color: #fff;
  font-size: .62rem; font-weight: 800; display: grid; place-items: center; line-height: 1;
}
.nav-toggle { display: none; }

/* ---- notification + user dropdown panels ---- */
.panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: min(360px, calc(100vw - 32px));
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 15px;
  box-shadow: var(--shadow-lg); z-index: 260; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  pointer-events: none;
}
.panel.is-open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.panel__head {
  padding: 14px 17px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-heading); font-weight: 700; color: var(--primary); font-size: .95rem;
}
.panel__body { max-height: 380px; overflow-y: auto; }
.panel__item { display: flex; gap: 12px; padding: 13px 17px; border-bottom: 1px solid var(--border); transition: background .16s; }
.panel__item:last-child { border-bottom: 0; }
.panel__item:hover { background: rgba(20,38,74,.04); }
.panel__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(240,180,41,.16); font-size: 1rem; }
.panel__title { font-size: .86rem; font-weight: 700; color: var(--primary); }
.panel__meta { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.panel__foot { padding: 11px 17px; text-align: center; border-top: 1px solid var(--border); font-size: .82rem; font-weight: 700; }
.panel__empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: .86rem; }
.has-panel { position: relative; }

/* ---- search overlay ---- */
.search-overlay {
  position: fixed; inset: 0; z-index: 400; background: rgba(11,23,48,.72);
  backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(60px, 12vh, 140px) 20px 20px;
  opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s;
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-box {
  width: 100%; max-width: 680px; background: var(--card-bg);
  border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden;
  transform: translateY(-14px); transition: transform .25s ease;
}
.search-overlay.is-open .search-box { transform: translateY(0); }
.search-box__top { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.search-box__top svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-box__input { flex: 1; border: 0; outline: 0; font-size: 1rem; font-family: inherit; background: transparent; color: var(--text); }
.search-box__esc { font-size: .7rem; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; background: transparent; }
.search-box__results { max-height: 60vh; overflow-y: auto; }
.search-result { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--border); }
.search-result:hover { background: rgba(20,38,74,.04); }
.search-result__type { font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); }
.search-result__title { font-size: .9rem; font-weight: 700; color: var(--primary); }
.search-box__hint { padding: 34px 20px; text-align: center; color: var(--muted); font-size: .86rem; }

/* ---- mobile drawer ---- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(11,23,48,.6); z-index: 290;
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
}
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 88vw); z-index: 300;
  background: var(--card-bg); box-shadow: -14px 0 44px rgba(11,23,48,.24);
  transform: translateX(102%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer__body { flex: 1; overflow-y: auto; padding: 10px 12px 24px; }
.drawer__foot { padding: 14px 18px; border-top: 1px solid var(--border); display: grid; gap: 9px; }

.m-nav { list-style: none; margin: 0; padding: 0; }
.m-nav__row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.m-nav__link { flex: 1; padding: 13px 8px; font-weight: 600; font-size: .95rem; color: var(--primary); }
.m-nav__toggle {
  width: 46px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; border-left: 1px solid var(--border);
}
.m-nav__toggle svg { width: 14px; height: 14px; transition: transform .22s ease; }
.m-nav__row.is-open .m-nav__toggle svg { transform: rotate(180deg); }
.m-nav__sub { list-style: none; margin: 0; padding: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease; background: rgba(20,38,74,.03); }
.m-nav__sub.is-open { max-height: 720px; }
.m-nav__sub a { display: block; padding: 10px 8px 10px 24px; font-size: .87rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.m-nav__sub a:hover { color: var(--accent-dark); }

/* ============================================================
   HERO SLIDER  (full-screen, auto-playing)
   ============================================================ */
.hero {
  position: relative; overflow: hidden; background: #050505;
  height: 500px;
  min-height: 500px;
  max-height: 500px;
}
.hero--with-header { height: 500px; }

.hero__track { position: absolute; inset: 0; }

.hero__slide {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity .9s ease, visibility .9s;
  z-index: 1;
}
.hero__slide.is-active { opacity: 1; visibility: visible; z-index: 2; }

/* slide effect: slide instead of fade */
.hero[data-effect="slide"] .hero__slide { transform: translateX(40px); transition: opacity .8s ease, transform .8s ease, visibility .8s; }
.hero[data-effect="slide"] .hero__slide.is-active { transform: translateX(0); }

.hero__bg { position: absolute; inset: 0; }
.hero__bg img, .hero__bg video {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  transform: none; transition: opacity .6s ease;
}
.hero__slide.is-active .hero__bg img, .hero__slide.is-active .hero__bg video { transform: none; }

/* Left-to-right dark overlay, matching a left-aligned text block:
   solid dark on the text side, fading to transparent toward the media. */
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(0,0,0, .88) 0%,
    rgba(0,0,0, .68) 36%,
    rgba(0,0,0, .22) 68%,
    rgba(0,0,0, .04) 100%);
}
.hero--right .hero__scrim {
  background: linear-gradient(270deg,
    rgba(0,0,0, .88) 0%,
    rgba(0,0,0, .68) 36%,
    rgba(0,0,0, .22) 68%,
    rgba(0,0,0, .04) 100%);
}
.hero--center .hero__scrim {
  background: linear-gradient(90deg,
    rgba(0,0,0, .68) 0%,
    rgba(0,0,0, .72) 50%,
    rgba(0,0,0, .68) 100%);
}
.hero__inner {
  position: relative; z-index: 3; width: 100%; max-width: none;
  padding-inline: clamp(24px, 5vw, 96px);
}
.hero__content { max-width: 700px; color: #fff; padding-top: 14px; }
.hero--center .hero__content { max-width: 800px; margin-inline: auto; text-align: center; }
.hero--right  .hero__content { margin-left: auto; text-align: right; }

.hero__eyebrow {
  display: none;
  align-items: center; gap: 9px;
  padding: 7px 16px; border-radius: 999px;
  background: rgba(240,180,41,.16); border: 1px solid rgba(240,180,41,.42);
  color: var(--accent); font-size: .74rem; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase; margin-bottom: 22px;
}
.hero__eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.78); } }

.hero__title {
  font-family: "Hind Siliguri", var(--font-heading);
  font-size: clamp(2.15rem, 3.2vw, 3.45rem);
  line-height: 1.08; font-weight: 800; letter-spacing: 0;
  color: var(--slide-title, #fff); margin: 0 0 18px;
  text-shadow: 0 4px 18px rgba(0,0,0,.36);
}
.hero__title em { font-style: normal; color: var(--accent); }
.hero__text {
  font-family: "Hind Siliguri", var(--font-body);
  font-size: clamp(.95rem, 1vw, 1.06rem);
  font-weight: 500;
  color: var(--slide-text, #E5E7EB); line-height: 1.55; margin: 0; max-width: 72ch;
  text-shadow: 0 2px 10px rgba(0,0,0,.42);
}
.hero--center .hero__text { margin-inline: auto; }
.hero--right  .hero__text { margin-left: auto; }
.hero__actions { display: none; flex-wrap: wrap; gap: 13px; }
.hero--center .hero__actions { justify-content: center; }
.hero--right  .hero__actions { justify-content: flex-end; }

.hero__portrait {
  position: absolute; right: 0; bottom: 0; height: 92%; width: auto; z-index: 2;
  object-fit: contain; object-position: bottom right; pointer-events: none;
  filter: drop-shadow(-16px 12px 34px rgba(0,0,0,.4));
}

/* animate content in */
.hero__slide.is-active .hero__eyebrow,
.hero__slide.is-active .hero__title,
.hero__slide.is-active .hero__text,
.hero__slide.is-active .hero__actions { animation: heroUp .8s cubic-bezier(.22,1,.36,1) both; }
.hero__slide.is-active .hero__title   { animation-delay: .1s; }
.hero__slide.is-active .hero__text    { animation-delay: .2s; }
.hero__slide.is-active .hero__actions { animation-delay: .3s; }
@keyframes heroUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ---- controls ---- */
.hero__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.3);
  color: #fff; place-items: center;
  backdrop-filter: blur(8px); transition: all .2s ease;
  display: none;
}
.hero__arrow:hover { background: var(--accent); border-color: var(--accent); color: var(--primary-dark); }
.hero__arrow svg { width: 20px; height: 20px; }
.hero__arrow--prev { left: 22px; }
.hero__arrow--next { right: 22px; }

.hero__dots {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 6;
  display: flex; gap: 8px; align-items: center;
}
.hero__dot {
  width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(255,255,255,.5); transition: background .2s ease, transform .2s ease;
}
.hero__dot:hover { background: rgba(255,255,255,.75); }
.hero__dot.is-active { width: 8px; border-radius: 50%; background: #fff; transform: scale(1.08); }

.hero__progress { display: none; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255,255,255,.14); z-index: 6; }
.hero__progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%); z-index: 6;
  color: rgba(255,255,255,.7); font-size: .68rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  flex-direction: column; align-items: center; gap: 7px;
  display: none;
}
.hero__scroll::after { content: ""; width: 1px; height: 28px; background: linear-gradient(var(--accent), transparent); animation: scrollLine 1.9s infinite; }
@keyframes scrollLine { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ============================================================
   STAT STRIP
   ============================================================ */
.stats { background: var(--card-bg); border-bottom: 1px solid var(--border); }
.stats__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--border); }
.stat { background: var(--card-bg); padding: 26px 18px; text-align: center; transition: background .2s ease; }
.stat:hover { background: rgba(240,180,41,.06); }
.stat__num { font-family: var(--font-heading); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; color: var(--primary); line-height: 1; }
.stat__num span { color: var(--accent-dark); }
.stat__label { font-size: .72rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.stat--cta { background: var(--primary); color: #fff; display: grid; place-content: center; gap: 4px; }
.stat--cta:hover { background: var(--primary-dark); }
.stat--cta .stat__num { color: var(--accent); font-size: 1rem; }
.stat--cta .stat__label { color: rgba(255,255,255,.72); }

/* ============================================================
   POST CARD
   ============================================================ */
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; height: 100%;
  transition: transform .26s ease, box-shadow .26s ease, border-color .26s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(240,180,41,.55); }

.card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--primary); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__media img { transform: scale(1.06); }
.card__cat {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.94);
  color: var(--primary); font-size: .68rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; backdrop-filter: blur(6px);
}
.card__flag {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  padding: 5px 11px; border-radius: 999px; background: var(--accent);
  color: var(--primary-dark); font-size: .63rem; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase;
}
.card__body { padding: 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card__title { font-size: 1.06rem; font-weight: 700; line-height: 1.35; margin: 0; }
.card__title a { transition: color .18s ease; }
.card:hover .card__title a { color: var(--accent-dark); }
.card__excerpt { font-size: .87rem; color: var(--muted); line-height: 1.62; margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.card__avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.card__author { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); line-height: 1.3; }
.card__date { font-size: .73rem; color: var(--muted); }
.card__metrics { margin-left: auto; display: flex; gap: 12px; font-size: .76rem; color: var(--muted); }
.card__metric { display: inline-flex; align-items: center; gap: 4px; }
.card__metric svg { width: 14px; height: 14px; }

/* ---- wide / featured card ---- */
.card--wide { flex-direction: row; }
.card--wide .card__media { aspect-ratio: auto; width: 44%; flex: none; }
.card--wide .card__body { padding: 24px; }
.card--feature .card__media { aspect-ratio: 16 / 9; }
.card--feature .card__title { font-size: clamp(1.25rem, 2.4vw, 1.75rem); }
.card--feature .card__excerpt { -webkit-line-clamp: 4; line-clamp: 4; font-size: .93rem; }

/* ---- compact list item ---- */
.mini { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.mini:last-child { border-bottom: 0; }
.mini__thumb { width: 76px; height: 60px; border-radius: 10px; object-fit: cover; flex: none; background: var(--primary); }
.mini__title { font-size: .87rem; font-weight: 700; line-height: 1.4; color: var(--primary); margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini:hover .mini__title { color: var(--accent-dark); }
.mini__meta { font-size: .72rem; color: var(--muted); }
.mini__rank { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 800; color: var(--border); flex: none; width: 30px; line-height: 1; }

/* ---- filter pills ---- */
.pills { display: flex; gap: 9px; flex-wrap: wrap; }
.pill {
  padding: 8px 17px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card-bg); font-size: .83rem; font-weight: 600; color: var(--muted);
  transition: all .18s ease; white-space: nowrap;
}
.pill:hover { border-color: var(--accent); color: var(--accent-dark); }
.pill.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty__icon { font-size: 2.6rem; margin-bottom: 12px; opacity: .5; }

/* ============================================================
   PAGE BANNER  (inner pages)
   ============================================================ */
.page-banner {
  position: relative; background: var(--primary-dark); color: #fff;
  padding: clamp(48px, 8vw, 84px) 0; overflow: hidden;
}
.page-banner::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 78% 28%, rgba(240,180,41,.24), transparent 56%),
              radial-gradient(circle at 12% 88%, rgba(79,70,229,.26), transparent 52%);
}
.page-banner__inner { position: relative; z-index: 2; }
.page-banner h1 { color: #fff; margin-bottom: 10px; }
.page-banner p { color: rgba(255,255,255,.76); max-width: 66ch; margin: 0; font-size: 1rem; }
.page-banner__eyebrow { color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; display: block; margin-bottom: 10px; }

.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a:hover { color: var(--accent-dark); }
.crumbs span { opacity: .5; }
.page-banner .crumbs { color: rgba(255,255,255,.6); }
.page-banner .crumbs a:hover { color: var(--accent); }

/* ============================================================
   ARTICLE  (3-column reading layout)
   ============================================================ */
.reader { display: grid; grid-template-columns: 232px minmax(0,1fr) 292px; gap: 36px; align-items: start; }

.toc { position: sticky; top: calc(var(--header-h) + 20px); font-size: .85rem; }
.toc__title { font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; }
.toc__list { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc__list a { display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.45; transition: all .18s ease; }
.toc__list a:hover { color: var(--primary); }
.toc__list a.is-active { color: var(--accent-dark); border-left-color: var(--accent); font-weight: 700; }
.toc__list .lvl-3 { padding-left: 26px; font-size: .81rem; }
.toc__empty { color: var(--muted); font-size: .8rem; font-style: italic; }

.article { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(22px, 4vw, 44px); }
.article__title { font-size: clamp(1.6rem, 3.6vw, 2.5rem); margin-bottom: 14px; }
.article__sub { font-size: 1.05rem; color: var(--muted); margin-bottom: 20px; font-weight: 400; }
.article__meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 26px; font-size: .82rem; color: var(--muted); }
.article__meta-item { display: inline-flex; align-items: center; gap: 6px; }
.article__meta-item svg { width: 15px; height: 15px; }
.article__cover { border-radius: 13px; overflow: hidden; margin-bottom: 30px; background: var(--primary); }
.article__cover img { width: 100%; }

.prose { font-size: 1.03rem; line-height: 1.85; color: #33415c; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: 1.9em 0 .6em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h3 { font-size: clamp(1.12rem, 2.2vw, 1.32rem); margin: 1.6em 0 .5em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose img { border-radius: 12px; margin: 1.6em 0; }
.prose video, .prose .article-video { width: 100%; aspect-ratio: 16/9; border-radius: 12px; margin: 1.6em 0; background: #000; }
.prose .video-embed { position: relative; width: 100%; aspect-ratio: 16/9; margin: 1.6em 0; overflow: hidden; border-radius: 12px; background: #000; }
.prose .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose a { color: var(--secondary); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-dark); }
.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1.3em; }
.prose li { margin-bottom: .55em; }
.prose blockquote {
  margin: 1.7em 0; padding: 18px 24px; border-left: 4px solid var(--accent);
  background: rgba(240,180,41,.08); border-radius: 0 12px 12px 0;
  font-size: 1.08rem; font-style: italic; color: var(--primary);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { background: rgba(20,38,74,.07); padding: 2px 7px; border-radius: 5px; font-size: .88em; }
.prose pre { background: var(--primary-dark); color: #e6ecf5; padding: 18px 20px; border-radius: 12px; overflow-x: auto; margin: 1.5em 0; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .93rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 13px; text-align: left; }
.prose th { background: rgba(20,38,74,.05); font-weight: 700; color: var(--primary); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 8px; }

.article__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border); }
.react-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: .85rem; font-weight: 700; transition: all .18s ease; }
.react-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.react-btn.is-on { background: rgba(240,180,41,.14); border-color: var(--accent); color: var(--accent-dark); }
.react-btn svg { width: 17px; height: 17px; }
.share { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.share__label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.share a, .share button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: transparent; display: grid; place-items: center; color: var(--muted); transition: all .18s ease; }
.share a:hover, .share button:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.share svg { width: 15px; height: 15px; }

/* ---- author box + comments ---- */
.author-box { display: flex; gap: 17px; align-items: flex-start; margin-top: 26px; padding: 22px; border-radius: 13px; background: rgba(20,38,74,.04); border: 1px solid var(--border); }
.author-box__avatar { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; flex: none; }
.author-box__name { font-family: var(--font-heading); font-weight: 800; color: var(--primary); font-size: 1.02rem; }
.author-box__role { font-size: .76rem; color: var(--accent-dark); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 2px 0 7px; }
.author-box__bio { font-size: .87rem; color: var(--muted); margin: 0; line-height: 1.65; }

.comments { margin-top: 30px; }
.comment { display: flex; gap: 13px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.comment__avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.comment__name { font-weight: 700; color: var(--primary); font-size: .9rem; }
.comment__time { font-size: .74rem; color: var(--muted); margin-left: 8px; }
.comment__body { font-size: .92rem; margin: 5px 0 0; color: #445069; line-height: 1.68; }
.comment__replies { margin-left: 32px; padding-left: 16px; border-left: 2px solid var(--border); }
.comment-box { background: rgba(20,38,74,.035); border: 1px solid var(--border); border-radius: 13px; padding: 22px; margin-top: 20px; }
.comment-login { text-align: center; padding: 30px 20px; background: rgba(20,38,74,.035); border: 1px dashed var(--border); border-radius: 13px; margin-top: 20px; }

/* ---- sidebar ---- */
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 22px; }
.widget { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.widget__title { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin: 0 0 14px; padding-bottom: 11px; border-bottom: 2px solid var(--accent); display: inline-block; }
.widget--dark { background: var(--primary); color: #fff; border-color: var(--primary); }
.widget--dark .widget__title { color: #fff; }
.widget--dark .mini__title { color: #fff; }
.widget--dark .mini { border-color: rgba(255,255,255,.12); }
.widget--dark .mini__meta { color: rgba(255,255,255,.6); }
.home-rail { display: grid; gap: 18px; align-self: start; }
.widget--thought,
.widget--watch {
  background:
    linear-gradient(rgba(5,5,5,.58), rgba(5,5,5,.88)),
    radial-gradient(circle at 78% 18%, rgba(245,181,27,.28), transparent 48%),
    var(--primary);
}
.widget--thought .widget__title,
.widget--watch .widget__title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.thought-card__quote {
  margin: 2px 0 12px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.08rem;
  line-height: 1.55;
  border: 0;
  padding: 0;
}
.thought-card__author { color: rgba(255,255,255,.68); font-size: .82rem; margin-bottom: 16px; }
.watch-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  margin-bottom: 13px;
}
.watch-card__media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch-card__title { color: #fff; font-size: .96rem; line-height: 1.42; margin: 0 0 13px; }
.watch-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud a { padding: 5px 12px; border-radius: 7px; background: rgba(20,38,74,.055); font-size: .78rem; font-weight: 600; color: var(--muted); transition: all .18s ease; }
.tag-cloud a:hover { background: var(--accent); color: var(--primary-dark); }

.reading-bar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--secondary)); z-index: 500; width: 0; transition: width .1s linear; }

/* ============================================================
   KNOWLEDGE HUB / BOOKS / AI
   ============================================================ */
.hub-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; height: 100%; display: flex; flex-direction: column; transition: all .26s ease; }
.hub-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(240,180,41,.55); }
.hub-card__num { font-family: var(--font-heading); font-size: .78rem; font-weight: 800; color: var(--accent-dark); background: rgba(240,180,41,.14); padding: 4px 11px; border-radius: 7px; align-self: flex-start; letter-spacing: .05em; }
.hub-card__title { font-size: 1.2rem; margin: 14px 0 8px; }
.hub-card__desc { font-size: .87rem; color: var(--muted); line-height: 1.65; margin: 0 0 18px; flex: 1; }
.hub-card__topics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.hub-card__topic { font-size: .74rem; padding: 4px 11px; border-radius: 7px; background: rgba(20,38,74,.05); color: var(--muted); }
.hub-card__foot { display: flex; align-items: center; justify-content: space-between; padding-top: 15px; border-top: 1px solid var(--border); font-size: .82rem; }
.hub-card__link { font-weight: 700; color: var(--accent-dark); }

.book-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; transition: all .26s ease; }
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.book-card__media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--primary); }
.book-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.book-card:hover .book-card__media img { transform: scale(1.05); }
.book-card__status { position: absolute; top: 12px; right: 12px; padding: 5px 12px; border-radius: 999px; background: rgba(11,23,48,.86); color: var(--accent); font-size: .66rem; font-weight: 800; letter-spacing: .05em; backdrop-filter: blur(6px); }
.book-card__body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.book-card__cat { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); }
.book-card__title { font-size: 1.02rem; margin: 0; line-height: 1.35; }
.book-card__sub { font-size: .84rem; color: var(--muted); margin: 0; flex: 1; }

.prompt-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; height: 100%; display: flex; flex-direction: column; gap: 11px; transition: all .26s ease; }
.prompt-card:hover { box-shadow: var(--shadow-lg); border-color: rgba(240,180,41,.5); }
.prompt-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prompt-card__cat { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); }
.prompt-card__tool { font-size: .7rem; padding: 3px 10px; border-radius: 999px; background: rgba(20,38,74,.06); color: var(--muted); }
.prompt-card__body { background: var(--primary-dark); color: #cfd9ea; border-radius: 11px; padding: 15px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .8rem; line-height: 1.6; max-height: 190px; overflow-y: auto; white-space: pre-wrap; }
.copy-btn { margin-top: auto; }
.copy-btn.is-done { background: #10b981; color: #fff; }

.gallery-item { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--primary); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery-item:hover img { transform: scale(1.07); }
.gallery-item__cap { position: absolute; inset: auto 0 0 0; padding: 30px 18px 16px; background: linear-gradient(transparent, rgba(11,23,48,.9)); color: #fff; }
.gallery-item__title { font-weight: 700; font-size: .95rem; }
.gallery-item__meta { font-size: .74rem; color: rgba(255,255,255,.7); }

/* ============================================================
   FORMS
   ============================================================ */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: .8rem; font-weight: 700; color: var(--primary); }
.field__hint { font-size: .75rem; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; padding: 12px 15px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--card-bg); color: var(--text); font: inherit; font-size: .92rem;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .textarea:focus, .select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,180,41,.16); }
.textarea { min-height: 150px; resize: vertical; line-height: 1.7; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 17px; padding-right: 40px; }
.checkbox { display: flex; align-items: center; gap: 9px; font-size: .87rem; color: var(--muted); cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--accent); }
.file-input { padding: 10px; border: 1px dashed var(--border); border-radius: 11px; font-size: .85rem; width: 100%; background: var(--card-bg); }

.auth-card { max-width: 460px; margin-inline: auto; background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; padding: 34px; box-shadow: var(--shadow); }
.auth-card__head { text-align: center; margin-bottom: 26px; }
.auth-card__head img { width: 62px; height: 62px; border-radius: 16px; margin: 0 auto 14px; object-fit: cover; }

.alert { padding: 13px 17px; border-radius: 11px; font-size: .88rem; display: flex; align-items: center; gap: 10px; }
.alert--success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #047857; }
.alert--error   { background: rgba(239,68,68,.09); border: 1px solid rgba(239,68,68,.3); color: #b91c1c; }
.alert--info    { background: rgba(79,70,229,.09); border: 1px solid rgba(79,70,229,.28); color: #4338ca; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 600; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast { background: var(--card-bg); border-left: 4px solid var(--accent); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 14px 18px; font-size: .88rem; animation: toastIn .35s cubic-bezier(.22,1,.36,1); }
.toast--error { border-left-color: #ef4444; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* ---- newsletter ---- */
.newsletter { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: var(--radius); padding: clamp(28px, 5vw, 52px); position: relative; overflow: hidden; }
.newsletter::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 88% 18%, rgba(240,180,41,.24), transparent 54%); }
.newsletter__inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.newsletter h2 { color: #fff; margin-bottom: 8px; }
.newsletter p { color: rgba(255,255,255,.74); margin: 0; max-width: 52ch; }
.newsletter__form { display: flex; gap: 10px; min-width: min(420px, 100%); }
.newsletter__form .input { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.24); color: #fff; }
.newsletter__form .input::placeholder { color: rgba(255,255,255,.5); }

/* ---- major website links ---- */
.major-links {
  padding: 42px 0 64px;
}
.major-links__rule {
  height: 1px;
  background: var(--border);
  margin-bottom: 38px;
}
.major-links__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  color: #020617;
  font-family: var(--font-body);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: 0;
}
.major-links__chain {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: #2563eb;
}
.major-links__chain svg { width: 22px; height: 22px; }
.major-links__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.major-link {
  min-height: 120px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--link-from), var(--link-to));
  color: #fff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 18px 12px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .22);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.major-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, .28);
  filter: saturate(1.08);
}
.major-link__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.92);
}
.major-link__icon svg { width: 34px; height: 34px; stroke-width: 2.2; }
.major-link__label {
  font-weight: 800;
  font-size: .9rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 8px rgba(0,0,0,.2);
}

/* ---- pagination ---- */
.pagination { display: flex; justify-content: center; gap: 7px; margin-top: 44px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 42px; height: 42px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--card-bg); display: grid; place-items: center; font-size: .88rem; font-weight: 700; color: var(--muted); transition: all .18s ease; }
.pagination a:hover { border-color: var(--accent); color: var(--accent-dark); }
.pagination .is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .is-disabled { opacity: .4; pointer-events: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 62px 0 0; margin-top: 70px; }
.footer__grid { display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: 40px; padding-bottom: 44px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer__brand-name { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 800; color: #fff; letter-spacing: .04em; margin-bottom: 8px; }
.footer-brand { font-size: 1.5rem; letter-spacing: -.02em; }
.footer-brand span + span { color: var(--accent); }
.footer__tagline { color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 12px; }
.footer__about { font-size: .89rem; line-height: 1.75; max-width: 44ch; margin-bottom: 20px; }
.footer__title { font-family: var(--font-heading); font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: #fff; margin-bottom: 16px; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer__list a { font-size: .89rem; transition: color .18s ease, padding-left .18s ease; }
.footer__list a:hover { color: var(--accent); padding-left: 5px; }
.footer__social { display: flex; gap: 10px; }
.footer__social a { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.08); display: grid; place-items: center; transition: all .2s ease; }
.footer__social a:hover { background: var(--accent); color: var(--primary-dark); transform: translateY(-3px); }
.footer__social svg { width: 17px; height: 17px; }
.footer__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; font-size: .82rem; color: rgba(255,255,255,.55); flex-wrap: wrap; }
.footer__bar a:hover { color: var(--accent); }

.to-top { position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: #fff; border: 0; display: grid; place-items: center; box-shadow: var(--shadow-lg); z-index: 300; opacity: 0; visibility: hidden; transform: translateY(14px); transition: all .25s ease; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--accent); color: var(--primary-dark); }
.to-top svg { width: 19px; height: 19px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ---------- <= 1460px : tighten the nav so nothing collides ---------- */
@media (max-width: 1460px) {
  .nav__link { padding: 10px 9px; font-size: .86rem; }
  .brand__tag { display: none; }
  .brand__name { font-size: 1.24rem; }
}

/* ---------- <= 1240px ---------- */
@media (max-width: 1240px) {
  .reader { grid-template-columns: 200px minmax(0,1fr) 260px; gap: 26px; }
  .nav__link { padding: 10px 8px; font-size: .84rem; }
  .brand__tag { display: none; }
}

/* ---------- <= 1080px : hide the table of contents ---------- */
@media (max-width: 1080px) {
  .reader { grid-template-columns: minmax(0,1fr) 270px; }
  .toc { display: none; }
  .grid--4 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- <= 960px : switch to the mobile drawer ---------- */
@media (max-width: 960px) {
  :root { --header-h: 66px; --topbar-h: 34px; }
  .nav { display: none; }
  .nav-toggle { display: grid; }
  .brand__mark { width: 40px; height: 40px; }
  .brand__name { font-size: 1.15rem; }
  .brand__logo-full { max-height: 42px; }
  .topbar__social { display: none; }

  .reader { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: static; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); }

  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }

  .hero__arrow { width: 42px; height: 42px; }
  .hero, .hero--with-header { height: 400px; min-height: 400px; max-height: 400px; }
  .hero__arrow--prev { left: 12px; }
  .hero__arrow--next { right: 12px; }
  .hero__portrait { height: 62%; opacity: .55; }
  .hero__scrim { --scrim: .82; }

  .newsletter__inner { grid-template-columns: 1fr; }
  .card--wide { flex-direction: column; }
  .card--wide .card__media { width: 100%; aspect-ratio: 16/10; }
}

/* ---------- <= 720px : single column everywhere ---------- */
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .section { padding: 46px 0; }
  .container { padding-inline: 16px; }

  .grid, .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; gap: 20px; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bar { flex-direction: column; text-align: center; gap: 10px; }

  .hero, .hero--with-header { height: 300px; min-height: 300px; max-height: 300px; }
  .hero__title { font-size: clamp(1.9rem, 8.5vw, 2.7rem); }
  .hero__text { font-size: .9rem; line-height: 1.45; max-width: 58ch; }
  .hero__actions .btn { flex: 1; min-width: 140px; }
  .hero__portrait { display: none; }
  .hero__scroll { display: none; }
  .hero__dots { bottom: 24px; }
  .hero__arrow { display: none; }

  .sec-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 20px 12px; }

  .article { padding: 20px 17px; border-radius: 13px; }
  .article__meta { gap: 12px; font-size: .78rem; }
  .prose { font-size: 1rem; }
  .share { margin-left: 0; width: 100%; }
  .author-box { flex-direction: column; text-align: center; align-items: center; }
  .comment__replies { margin-left: 12px; padding-left: 11px; }

  .newsletter__form { flex-direction: column; min-width: 100%; }
  .major-links { padding: 34px 0 48px; }
  .major-links__rule { margin-bottom: 28px; }
  .major-links__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .major-link { min-height: 104px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 20px; }
  .toast-stack { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

/* ---------- <= 460px ---------- */
@media (max-width: 460px) {
  .brand__tag { display: none; }
  .stats__grid { grid-template-columns: 1fr 1fr; }
  .header__actions .icon-btn { width: 36px; height: 36px; }
  .header__actions .btn { display: none; }
  .card__foot { flex-wrap: wrap; }
  .card__metrics { margin-left: 0; width: 100%; padding-top: 8px; }
  .pagination a, .pagination span { min-width: 36px; height: 36px; font-size: .8rem; }
  .hero__eyebrow { font-size: .66rem; padding: 6px 12px; }
  .hero, .hero--with-header { height: 220px; min-height: 220px; max-height: 220px; }
  .hero__inner { padding-inline: 18px; }
  .hero__title { font-size: 1.65rem; margin-bottom: 10px; }
  .hero__text { font-size: .78rem; line-height: 1.35; }
  .hero__dots { bottom: 16px; }
  .major-links__grid { grid-template-columns: 1fr; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .hero, .sidebar, .toc, .to-top, .article__foot, .comments { display: none !important; }
  body { background: #fff; }
  .article { border: 0; padding: 0; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .hero__bg img { transform: none; }
}

/* ---------- utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: 24px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 12px; }
.hide-sm { }
@media (max-width: 720px) { .hide-sm { display: none !important; } }
/* only hide before reveal when JavaScript is available */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* icon sizing helper */
.ico { width: 16px; height: 16px; flex: none; }
.topbar__social svg, .footer__social svg { width: 16px; height: 16px; }
.panel__icon svg { width: 17px; height: 17px; color: var(--accent-dark); }

/* ============================================================
   RESPONSIVE TWO-COLUMN LAYOUTS
   (replaces inline grid-template-columns so breakpoints apply)
   ============================================================ */
.grid--lead    { grid-template-columns: 1.35fr 1fr; align-items: start; }
.grid--main    { grid-template-columns: 1.6fr 1fr;  align-items: start; }
.grid--split   { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 34px; }
.grid--product { grid-template-columns: 340px minmax(0, 1fr); align-items: start; gap: 40px; }
.reader--right { grid-template-columns: minmax(0, 1fr) 292px; }
.reader--wide  { grid-template-columns: minmax(0, 1fr) 300px; }

@media (max-width: 1080px) {
  .grid--lead, .grid--main { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .reader--right, .reader--wide { grid-template-columns: minmax(0, 1fr); }
  .grid--product { grid-template-columns: 260px minmax(0, 1fr); gap: 26px; }
}
@media (max-width: 780px) {
  .grid--split, .grid--product { grid-template-columns: 1fr; gap: 22px; }
  .grid--product .book-card__media { max-width: 300px; margin-inline: auto; }
}

/* ============================================================
   DARK BLACK + GOLD THEME OVERRIDE
   ============================================================ */
:root {
  --primary:      #F8FAFC;
  --primary-dark: #050505;
  --accent:       #F5B51B;
  --accent-dark:  #F5B51B;
  --secondary:    #38BDF8;
  --body-bg:      #050505;
  --card-bg:      #111114;
  --text:         #F8FAFC;
  --muted:        #B8C0CC;
  --border:       #27272A;
  --header-bg:    #050505;
  --header-text:  #F8FAFC;
  --footer-bg:    #050505;
  --footer-text:  #B8C0CC;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.32);
  --shadow:    0 10px 26px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
}

body {
  background: #050505;
  color: var(--text);
}

h1, h2, h3, h4, h5,
.sec-head__title,
.card__title,
.article__title,
.hub-card__title,
.book-card__title,
.widget__title,
.field__label,
.brand__name,
.panel__head,
.panel__title,
.dropdown__title,
.search-result__title {
  color: #fff;
}

.section,
.section--alt,
.stats,
.major-links,
.site-footer {
  background: #050505;
}

.section,
.section--alt,
.stats,
.site-footer,
.major-links__rule {
  border-color: var(--border);
}

.site-header {
  background: rgba(5,5,5,.92);
  border-bottom-color: var(--border);
  backdrop-filter: blur(14px);
}

.topbar {
  background: #050505;
  border-bottom: 1px solid var(--border);
}

.nav__link:hover,
.dropdown__link:hover,
.panel__item:hover,
.search-result:hover,
.m-nav__sub,
.tag-cloud a,
.hub-card__topic {
  background: rgba(255,255,255,.06);
}

.nav__item.is-active > .nav__link,
.nav__link:hover,
.dropdown__link:hover .dropdown__title,
.mini:hover .mini__title,
.card:hover .card__title a,
.sec-head__link,
.sec-head__eyebrow,
.hub-card__num,
.hub-card__link,
.book-card__cat,
.prompt-card__cat,
.footer__list a:hover {
  color: var(--accent);
}

.dropdown,
.panel,
.search-box,
.drawer,
.card,
.widget,
.article,
.hub-card,
.book-card,
.prompt-card,
.auth-card,
.comment-box,
.author-box,
.a-login__card,
.input,
.textarea,
.select,
.toast,
.pagination a,
.pagination span {
  background: #111114;
  border-color: var(--border);
  color: var(--text);
}

.stats__grid {
  background: #1F1F23;
  gap: 16px;
}

.stat {
  background: #121215;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.stat:hover,
.card:hover,
.hub-card:hover,
.book-card:hover,
.prompt-card:hover {
  border-color: rgba(245,181,27,.55);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}

.stat__num,
.stat--cta .stat__num {
  color: #fff;
}

.stat__num span,
.stat__label,
.card__date,
.card__metrics,
.card__excerpt,
.mini__meta,
.article__sub,
.article__meta,
.prose,
.hub-card__desc,
.book-card__sub,
.panel__meta,
.dropdown__desc,
.search-box__hint,
.sec-head__sub,
.footer__about,
.major-links__rule,
.toc__list a,
.comment__body {
  color: var(--muted);
}

.card__foot,
.article__meta,
.article__foot,
.mini,
.panel__head,
.panel__item,
.panel__foot,
.search-box__top,
.search-result,
.drawer__head,
.drawer__foot,
.m-nav__row,
.m-nav__sub a,
.hub-card__foot {
  border-color: var(--border);
}

.card__cat,
.badge--primary,
.pill,
.pagination a,
.pagination span,
.tag-cloud a,
.hub-card__topic,
.prompt-card__tool {
  background: #232326;
  color: #D6D9E0;
  border-color: #2B2B30;
}

.card__flag,
.pill.is-active,
.pagination .is-active,
.btn--primary,
.stat--cta {
  background: var(--accent);
  border-color: var(--accent);
  color: #070707;
}

.btn--outline,
.btn--ghost,
.btn--dark,
.react-btn,
.icon-btn {
  background: #121215;
  color: #fff;
  border-color: var(--border);
}

.btn--outline:hover,
.btn--ghost:hover,
.btn--dark:hover,
.react-btn:hover,
.icon-btn:hover {
  background: rgba(245,181,27,.12);
  border-color: var(--accent);
  color: var(--accent);
}

.widget--dark {
  background: #111114;
  color: #fff;
  border-color: var(--border);
}

.widget--dark .mini__title {
  color: #fff;
}

.widget--dark .mini {
  border-color: var(--border);
}

.book-card__media,
.card__media,
.mini__thumb,
.article__cover,
.gallery-item {
  background: #0B0B0D;
}

.newsletter {
  background: #101013;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.newsletter::before {
  background: radial-gradient(circle at 88% 18%, rgba(245,181,27,.18), transparent 50%);
}

.major-links__title,
.major-links__chain {
  color: #fff;
}

.major-links__chain svg {
  color: var(--accent);
}

.page-banner {
  background: #050505;
  border-bottom: 1px solid var(--border);
}

.page-banner h1,
.page-banner__eyebrow {
  color: #fff;
}

.crumbs,
.page-banner p {
  color: var(--muted);
}

.prose h2,
.prose h3,
.prose strong,
.toc__title {
  color: #fff;
}

.prose blockquote,
.prompt-card__body {
  background: #050505;
  border-color: var(--border);
  color: #D6D9E0;
}

::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: #2C2C31; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Header overflow fixes: keep menu text out of the action buttons. */
.site-header .container,
.topbar .container {
  max-width: min(1560px, 100%);
}

.header__inner {
  min-width: 0;
}

.brand {
  min-width: 0;
}

.brand__text {
  min-width: 0;
}

.brand__name,
.brand__tag {
  white-space: nowrap;
}

.nav {
  flex: 1 1 auto;
  justify-content: flex-end;
}

.nav__list {
  min-width: 0;
}

.header__actions {
  margin-left: 4px;
}

@media (max-width: 1460px) {
  .site-header .container,
  .topbar .container {
    max-width: 100%;
  }

  .header__inner {
    gap: 8px;
  }

  .brand__mark {
    width: 42px;
    height: 42px;
  }

  .brand__name {
    font-size: 1.12rem;
  }

  .nav__link {
    padding: 9px 7px;
    font-size: .8rem;
  }

  .header__actions {
    gap: 6px;
  }

  .header__actions .btn {
    padding-inline: 15px;
  }
}

@media (max-width: 1320px) {
  .nav {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .brand__tag {
    display: none;
  }

  .header__actions {
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .brand__name {
    font-size: 1rem;
  }

  .brand__mark {
    width: 38px;
    height: 38px;
  }

  .header__actions .has-panel.hide-sm,
  .header__actions .btn.hide-sm {
    display: none;
  }

  .header__actions .has-panel {
    position: static;
  }

  .header__actions .panel {
    position: fixed;
    top: calc(var(--header-h, 66px) + 8px);
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* Homepage mobile sliders: keep desktop/laptop grids unchanged, but make dense home sections swipeable on phones. */
@media (max-width: 760px) {
  .page-home #stream .grid--4,
  .page-home .section .grid--lead,
  .page-home .section .grid--3,
  .page-home .section .grid--4,
  .page-home .section .grid--main > div > .grid--2 {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(278px, 84vw);
    grid-template-columns: none;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 18px 16px;
    margin-inline: -18px;
    scroll-padding-inline: 18px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .page-home #stream .grid--4 > *,
  .page-home .section .grid--lead > *,
  .page-home .section .grid--3 > *,
  .page-home .section .grid--4 > *,
  .page-home .section .grid--main > div > .grid--2 > * {
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .page-home .section .grid--lead {
    grid-auto-columns: minmax(296px, 86vw);
    align-items: stretch;
  }

  .page-home .section .grid--lead .widget {
    min-height: 100%;
    overflow: hidden;
  }

  .page-home .section .grid--main {
    gap: 28px;
  }

  .page-home .section .grid--main,
  .page-home .section .grid--main > * {
    min-width: 0;
  }

  .page-home .card,
  .page-home .hub-card,
  .page-home .book-card,
  .page-home .prompt-card {
    height: 100%;
  }

  .page-home .major-links__grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .page-home .stats__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    background: transparent;
    padding: 16px 0;
    margin-inline: 0;
    overflow: visible;
  }

  .page-home .stat {
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 92px;
    padding: 18px 10px;
    scroll-snap-align: unset;
  }

  .page-home .stats__grid > .stat:nth-child(n+5) {
    display: none;
  }

  .page-home .major-links__grid {
    grid-auto-columns: minmax(184px, 68vw);
    gap: 12px;
    padding: 4px 18px 14px;
    margin-inline: -18px;
    scroll-padding-inline: 18px;
  }

  .page-home .major-link {
    min-height: 106px;
    scroll-snap-align: start;
  }
}

@media (max-width: 420px) {
  .page-home #stream .grid--4,
  .page-home .section .grid--lead,
  .page-home .section .grid--3,
  .page-home .section .grid--4,
  .page-home .section .grid--main > div > .grid--2 {
    grid-auto-columns: minmax(258px, 86vw);
  }

  .page-home .major-links__grid {
    grid-auto-columns: minmax(172px, 72vw);
  }
}

/* Rich editor used by public contributor forms. */
.rich-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: visible;
  background: var(--card-bg);
}
.rich-editor__bar {
  position: sticky;
  top: calc(var(--header-h, 76px) + 8px);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--border);
}
.rich-editor__btn,
.rich-editor__select,
.rich-editor__color {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
}
.rich-editor__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 0 9px;
}
.rich-editor__btn:hover,
.rich-editor__select:hover,
.rich-editor__color:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.rich-editor__select { padding: 0 8px; }
.rich-editor__color {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
}
.rich-editor__color input {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
}
.rich-editor__sep {
  width: 1px;
  background: var(--border);
  margin: 3px 3px;
}
.rich-editor__area {
  min-height: 320px;
  padding: 18px;
  border-radius: 0 0 8px 8px;
  outline: 0;
  color: var(--text);
  line-height: 1.8;
}
.rich-editor__area:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}
.rich-editor__area.is-raw {
  white-space: pre-wrap;
  font-family: ui-monospace, Consolas, monospace;
  font-size: .84rem;
}
.rich-editor__area img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
}
.rich-editor__area video,
.rich-editor__area iframe,
.rich-editor__area .video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  margin: 12px 0;
  background: #000;
}
.rich-editor__area .video-embed iframe {
  height: 100%;
  margin: 0;
}

.theme-switch {
  width: 54px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #121215;
  color: #fff;
  display: inline-grid;
  place-items: center;
}
.theme-switch__track {
  position: relative;
  width: 48px;
  height: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
}
.theme-switch__icon svg {
  width: 13px;
  height: 13px;
  position: relative;
  z-index: 2;
}
.theme-switch__thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform .22s ease;
}
:root[data-theme="light"] .theme-switch__thumb { transform: translateX(22px); }

.major-link__icon img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.gallery-item video,
.ai-card__media {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #000;
  border-radius: 8px;
}
.ai-card__body {
  font-size: .88rem;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}
.book-reader {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
}
.book-reader__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .86rem;
  color: var(--muted);
}
.book-reader iframe {
  width: 100%;
  height: min(78vh, 760px);
  border: 0;
  background: #fff;
}
.book-download-note,
.book-download-request {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  padding: 18px;
}
.book-download-note { margin-top: 0; }
.book-download-request h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.book-download-request p,
.book-download-note p {
  color: var(--muted);
  font-size: .9rem;
}

/* Visitor-controlled light mode. */
:root[data-theme="light"] {
  --primary: #0B1B33;
  --primary-dark: #07101F;
  --accent: #E5A93C;
  --accent-dark: #B87812;
  --secondary: #2563EB;
  --body-bg: #EEF1FA;
  --card-bg: #FFFFFF;
  --text: #243047;
  --muted: #64748B;
  --border: #E2E8F0;
  --header-bg: #FFFFFF;
  --header-text: #0B1B33;
  --footer-bg: #07101F;
  --footer-text: #CBD5E1;
}
:root[data-theme="light"] body,
:root[data-theme="light"] .section,
:root[data-theme="light"] .section--alt,
:root[data-theme="light"] .stats,
:root[data-theme="light"] .major-links {
  background: var(--body-bg);
  color: var(--text);
}
:root[data-theme="light"] h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3,
:root[data-theme="light"] h4,
:root[data-theme="light"] h5,
:root[data-theme="light"] .sec-head__title,
:root[data-theme="light"] .card__title,
:root[data-theme="light"] .article__title,
:root[data-theme="light"] .hub-card__title,
:root[data-theme="light"] .book-card__title,
:root[data-theme="light"] .widget__title,
:root[data-theme="light"] .field__label,
:root[data-theme="light"] .brand__name,
:root[data-theme="light"] .panel__head,
:root[data-theme="light"] .panel__title,
:root[data-theme="light"] .dropdown__title,
:root[data-theme="light"] .search-result__title,
:root[data-theme="light"] .prose h2,
:root[data-theme="light"] .prose h3,
:root[data-theme="light"] .prose strong,
:root[data-theme="light"] .toc__title {
  color: var(--primary);
}
:root[data-theme="light"] .site-header,
:root[data-theme="light"] .dropdown,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .search-box,
:root[data-theme="light"] .drawer,
:root[data-theme="light"] .card,
:root[data-theme="light"] .widget,
:root[data-theme="light"] .article,
:root[data-theme="light"] .hub-card,
:root[data-theme="light"] .book-card,
:root[data-theme="light"] .prompt-card,
:root[data-theme="light"] .auth-card,
:root[data-theme="light"] .comment-box,
:root[data-theme="light"] .author-box,
:root[data-theme="light"] .input,
:root[data-theme="light"] .textarea,
:root[data-theme="light"] .select,
:root[data-theme="light"] .toast,
:root[data-theme="light"] .pagination a,
:root[data-theme="light"] .pagination span,
:root[data-theme="light"] .rich-editor,
:root[data-theme="light"] .rich-editor__btn,
:root[data-theme="light"] .rich-editor__select,
:root[data-theme="light"] .rich-editor__color {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}
:root[data-theme="light"] .topbar {
  background: var(--primary-dark);
}
:root[data-theme="light"] .footer__about,
:root[data-theme="light"] .prose,
:root[data-theme="light"] .article__sub,
:root[data-theme="light"] .article__meta,
:root[data-theme="light"] .hub-card__desc,
:root[data-theme="light"] .book-card__sub,
:root[data-theme="light"] .panel__meta,
:root[data-theme="light"] .dropdown__desc,
:root[data-theme="light"] .search-box__hint,
:root[data-theme="light"] .sec-head__sub,
:root[data-theme="light"] .toc__list a,
:root[data-theme="light"] .comment__body {
  color: var(--muted);
}
:root[data-theme="light"] .stats__grid,
:root[data-theme="light"] .stat,
:root[data-theme="light"] .card__cat,
:root[data-theme="light"] .pill,
:root[data-theme="light"] .tag-cloud a,
:root[data-theme="light"] .hub-card__topic,
:root[data-theme="light"] .prompt-card__tool,
:root[data-theme="light"] .rich-editor__bar {
  background: #F8FAFC;
  border-color: var(--border);
  color: var(--muted);
}
:root[data-theme="light"] .btn--outline,
:root[data-theme="light"] .btn--ghost,
:root[data-theme="light"] .btn--dark,
:root[data-theme="light"] .react-btn,
:root[data-theme="light"] .icon-btn,
:root[data-theme="light"] .theme-switch {
  background: #fff;
  color: var(--primary);
  border-color: var(--border);
}
:root[data-theme="light"] .btn--primary,
:root[data-theme="light"] .stat--cta,
:root[data-theme="light"] .pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary-dark);
}
:root[data-theme="light"] .widget--dark,
:root[data-theme="light"] .site-footer {
  background: var(--footer-bg);
  color: #fff;
}
:root[data-theme="light"] .widget--dark .mini__title,
:root[data-theme="light"] .site-footer .footer__title,
:root[data-theme="light"] .site-footer .footer__brand-name {
  color: #fff;
}
