/* =============================================================
   DreamNoos — main.css
   Dreamy Night Theme — research-driven color psychology palette.

   Dark mode is the DEFAULT (dream sites = night atmosphere).
   Light mode activates only via manual toggle (data-theme="light").

   Atmospheric features (zero-perf-cost):
     - SVG data URI star pattern on body (GPU-tiled, no repaints)
     - Twinkle animation via opacity keyframes (compositor-only)
     - Wave dividers between sections (clip-path)
     - Ambient glow on hero and cards

   Sections: variables, reset, base, layout, header, footer,
   hero, article, hub, lists, cards, breadcrumbs, pagination,
   tags, related, ads, search, comments, newsletter, dictionary,
   governance, theme-toggle, atmosphere, utilities, responsive.
   ============================================================= */

/* ---------- VARIABLES (Dark — DEFAULT) ---------- */
:root {
  /* Typography (shared) */
  --font-body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Source Serif Pro", "Noto Serif", "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Dark mode — night-sky navy (DEFAULT for a dream site) */
  --fg: #e0dde5;
  --fg-muted: #9b95a8;
  --fg-soft: #8884a0;
  --bg: #111122;
  --bg-soft: #181830;
  --bg-muted: #20203a;
  --border: #2e2a48;
  --link: #a78bfa;
  --link-hover: #c4b5fd;
  --link-underline: rgba(167, 139, 250, .3);

  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-soft: #2a2440;
  --accent-glow: rgba(167, 139, 250, .15);

  --gradient-hero: linear-gradient(135deg, #111122 0%, #1a1a3e 40%, #2d1b69 100%);
  --gradient-cta: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  --gradient-card-hover: linear-gradient(135deg, #20203a 0%, #2a2450 100%);

  --hero-overlay-opacity: .25;
  --hero-title-gradient: linear-gradient(135deg, #e0dde5 0%, #a78bfa 50%, #c4b5fd 100%);

  --header-bg: rgba(17, 17, 34, .92);
  --nl-email-bg: rgba(24, 24, 48, .9);
  --nl-email-border: #2e2a48;
  --nl-email-color: #e0dde5;
  --nl-btn-bg: rgba(167, 139, 250, .9);
  --nl-btn-color: #fff;

  --gold: #f0d97a;
  --gold-soft: #2c2410;

  --warn-bg: #2c2410;
  --warn-fg: #f0d97a;
  --warn-border: #5a4a1a;

  /* Layout (shared) */
  --maxw: 680px;
  --maxw-wide: 1080px;
  --gutter: 1.25rem;
  --radius: 8px;
  --radius-lg: 14px;

  /* Type scale */
  --line: 1.7;
  --fs-base: 17px;

  /* Shadows — dark mode */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .5);
  --shadow-glow: 0 0 24px rgba(167, 139, 250, .2);

  /* Transitions */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --duration: .2s;

  /* Atmosphere */
  --star-opacity: 1;
  --wave-color: var(--bg-soft);
}

/* ---------- LIGHT MODE (manual toggle only) ---------- */
:root[data-theme="light"] {
  --fg: #1a1a2e;
  --fg-muted: #5b5b7e;
  --fg-soft: #686888;
  --bg: #fafaff;
  --bg-soft: #f2f0f8;
  --bg-muted: #e8e5f0;
  --border: #ddd8e8;
  --link: #4a3aff;
  --link-hover: #3628cc;
  --link-underline: rgba(74, 58, 255, .3);

  --accent: #4a3aff;
  --accent-hover: #3628cc;
  --accent-soft: #ede8ff;
  --accent-glow: rgba(74, 58, 255, .12);

  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 40%, #4a3aff 100%);
  --gradient-cta: linear-gradient(135deg, #4a3aff 0%, #7c3aed 100%);
  --gradient-card-hover: linear-gradient(135deg, #f2f0f8 0%, #ede8ff 100%);

  --hero-overlay-opacity: .06;
  --hero-title-gradient: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 50%, #4a3aff 100%);

  --header-bg: rgba(250, 250, 255, .92);
  --nl-email-bg: rgba(255, 255, 255, .95);
  --nl-email-border: rgba(255, 255, 255, .3);
  --nl-email-color: #1a1a2e;
  --nl-btn-bg: #fff;
  --nl-btn-color: #1a1a2e;

  --gold: #d4a017;
  --gold-soft: #fdf6e3;

  --warn-bg: #fff8e1;
  --warn-fg: #6b4f00;
  --warn-border: #f0d97a;

  --shadow-sm: 0 1px 3px rgba(26, 26, 46, .06);
  --shadow-md: 0 4px 12px rgba(26, 26, 46, .08);
  --shadow-lg: 0 8px 30px rgba(26, 26, 46, .1);
  --shadow-glow: 0 0 20px rgba(74, 58, 255, .15);

  --star-opacity: 0;
  --wave-color: var(--bg-soft);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--line);
  color: var(--fg);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Ccircle cx='23' cy='32' r='1' fill='rgba(167,139,250,0.15)'/%3E%3Ccircle cx='98' cy='12' r='.7' fill='rgba(255,255,255,0.08)'/%3E%3Ccircle cx='167' cy='58' r='1.2' fill='rgba(167,139,250,0.12)'/%3E%3Ccircle cx='52' cy='118' r='.5' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='138' cy='143' r='.8' fill='rgba(167,139,250,0.1)'/%3E%3Ccircle cx='78' cy='183' r='1' fill='rgba(255,255,255,0.06)'/%3E%3Ccircle cx='185' cy='165' r='.6' fill='rgba(167,139,250,0.08)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
:root[data-theme="light"] body { background-image: none; }
img, svg { max-width: 100%; height: auto; display: block; }
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 3px;
  transition: color var(--duration) var(--ease), text-decoration-color var(--duration) var(--ease);
}
a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 1.6em 0 .6em;
  letter-spacing: -.01em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li { margin: .3em 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
code {
  font-family: var(--font-mono); font-size: .9em;
  background: var(--bg-soft); padding: .15em .4em;
  border-radius: 4px; color: var(--accent);
}
pre {
  font-family: var(--font-mono); background: var(--bg-soft);
  padding: 1em; border-radius: var(--radius); overflow: auto;
}
blockquote {
  margin: 1.5em 0; padding: .5em 1.2em;
  border-left: 3px solid var(--accent); color: var(--fg-muted);
  background: var(--bg-soft); border-radius: 0 var(--radius) var(--radius) 0;
}
table { width: 100%; border-collapse: collapse; }
th { padding: .6em .75em; border-bottom: 2px solid var(--border); text-align: left; font-weight: 600; }
td { padding: .6em .75em; border-bottom: 1px solid var(--border); text-align: left; }

/* ---------- LAYOUT ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.layout-home .container,
.layout-category .container,
.layout-hub .container,
.layout-base .container { max-width: var(--maxw-wide); }
.main { padding: 2rem 0 3.5rem; position: relative; }

.skip-link {
  position: absolute; left: -9999px; top: auto;
  background: var(--bg); color: var(--fg); padding: .5em 1em;
}
.skip-link:focus { left: 1em; top: 1em; z-index: 1000; }

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

/* ---------- HEADER ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: var(--header-bg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.site-header__inner {
  display: grid; align-items: center;
  grid-template-columns: minmax(180px, auto) 1fr auto;
  gap: 1rem; padding: .6rem var(--gutter);
  max-width: var(--maxw-wide); margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none; color: var(--fg); font-weight: 600;
}
.brand__text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .14rem;
}
.brand__logo {
  width: 56px; height: 56px;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-glow);
  transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.brand:hover .brand__logo {
  box-shadow: 0 0 18px var(--accent-glow);
  transform: scale(1.06);
}
.brand__name {
  font-family: var(--font-display); font-size: 1.44rem;
  letter-spacing: -.01em;
  line-height: 1;
}
.brand__tagline {
  color: var(--fg-soft);
  font-size: .72rem;
  letter-spacing: .02em;
  line-height: 1.15;
}
.brand__dream {
  color: var(--fg);
  font-weight: 400;
  letter-spacing: -.02em;
}
.brand__noos {
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: .01em;
}
.brand:hover .brand__noos {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--gold) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-header__controls {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: .5rem;
}
.header-search {
  width: 2.78rem;
  height: 2.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 1.05rem;
  line-height: 1;
  transition: background var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              color var(--duration) var(--ease);
}
.header-search:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.header-search:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-primary { min-width: 0; }
.nav-primary ul {
  list-style: none; display: flex; gap: .3rem; padding: 0; margin: 0;
  align-items: center; justify-content: center; flex-wrap: wrap;
}
.nav-primary a {
  display: inline-flex;
  align-items: center;
  color: var(--fg-muted); text-decoration: none; font-size: .9rem;
  padding: .45em .75em; border-radius: 999px;
  border: 1px solid transparent;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.nav-primary a:hover { color: var(--fg); background: var(--bg-muted); border-color: var(--border); }
.nav-primary a[aria-current="page"] {
  color: var(--accent); background: var(--accent-soft); font-weight: 600; border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

/* ---------- THEME TOGGLE ---------- */
.theme-toggle {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 2.78rem; height: 2.78rem;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--fg-muted);
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              color var(--duration) var(--ease);
}
.theme-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle__icon--sun,
.theme-toggle__icon--moon { pointer-events: none; }

/* Default = dark → show moon; light override → show sun */
.theme-toggle__icon--sun { display: none; }
:root[data-theme="light"] .theme-toggle__icon--sun { display: inline; }
:root[data-theme="light"] .theme-toggle__icon--moon { display: none; }

/* ---------- HERO ---------- */
.hero {
  padding: 1.95rem 0 2.2rem;
  position: relative;
}
.layout-home .hero { text-align: center; }
.hero::before {
  content: "";
  position: absolute; inset: -2rem calc(var(--gutter) * -1) 0;
  background: var(--gradient-hero);
  opacity: var(--hero-overlay-opacity);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--duration) var(--ease);
}
.hero::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 1;
}
.hero__title {
  font-size: 2.1rem; margin: 0 0 .26em;
  line-height: 1.08;
  letter-spacing: -.02em;
}
.hero__dream {
  color: var(--fg);
  font-weight: 500;
  letter-spacing: -.03em;
}
.hero__noos {
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: .01em;
}
.hero__kicker {
  display: inline-flex;
  margin: 0 0 .8rem;
  padding: .28rem .72rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
  color: var(--accent-hover);
  font-size: .77rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
}
.hero__lede {
  font-size: 1.06rem; color: var(--fg-muted);
  margin: 0 0 1.5em; max-width: 36em; line-height: 1.6;
}
.hero__search-wrap {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  padding: .72rem .78rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg) 82%, var(--bg-soft));
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.hero__search-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .42rem;
}
.hero__search-hint {
  margin: 0;
  color: var(--fg);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.hero__search-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 40%, transparent);
  color: var(--accent-hover);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.hero__search-meta {
  margin: .42rem 0 0;
  color: var(--fg-soft);
  font-size: .75rem;
}

.home-section { margin: 3rem 0; }
.layout-home .home-section:first-of-type { margin-top: 2rem; }
.home-section__intro {
  margin: -.15rem 0 1.2rem;
  color: var(--fg-muted);
  max-width: 52ch;
  line-height: 1.6;
}
.home-section h2 {
  font-size: 1.4rem;
  display: flex; align-items: center; gap: .5em;
}
.home-section h2::before {
  content: "";
  display: inline-block; width: 4px; height: 1.1em;
  background: var(--gradient-cta); border-radius: 2px;
}
.link-arrow {
  font-weight: 600; text-decoration: none;
  color: var(--accent);
  transition: color var(--duration) var(--ease);
}
.link-arrow:hover { color: var(--accent-hover); }

/* ---------- FOOTER ---------- */
.site-footer {
  position: relative;
  border-top: none;
  background: var(--bg-soft);
  padding: 3.5rem 0 1.5rem;
  margin-top: 3.5rem;
  transition: background var(--duration) var(--ease);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -28px; left: 0; right: 0;
  height: 30px;
  background: var(--bg-soft);
  clip-path: ellipse(55% 100% at 50% 100%);
  transition: background var(--duration) var(--ease);
}
.site-footer__inner {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(260px, 1.35fr) repeat(auto-fit, minmax(170px, 1fr));
  align-items: start;
  max-width: var(--maxw-wide); margin: 0 auto; padding: 0 var(--gutter);
}
.site-footer__col { min-width: 0; }
.site-footer__col--brand {
  grid-column: auto;
  display: grid;
  align-content: start;
  gap: .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 1rem 1.05rem;
}
.site-footer__title { font-size: 1rem; margin: 0 0 .6em; color: var(--fg); }
.site-footer__col--brand .site-footer__title {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: .01em;
}
.site-footer__tagline { color: var(--fg-muted); font-size: .93rem; }
.site-footer__col--brand .site-footer__tagline { margin: 0; }
.site-footer__meta { margin: 0; }
.site-footer__col:not(.site-footer__col--brand) {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: .95rem 1rem;
}
.site-footer__col:not(.site-footer__col--brand) .site-footer__title {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-soft);
  margin-bottom: .75rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .42em 0; }
.site-footer a {
  color: var(--fg-muted); text-decoration: none; font-size: .93rem;
  transition: color var(--duration) var(--ease);
  line-height: 1.35;
}
.site-footer a:hover { color: var(--accent); }
.site-footer__meta a {
  color: var(--fg-soft);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.site-footer__legal {
  max-width: var(--maxw-wide); margin: 2rem auto 0; padding: 1rem var(--gutter) 0;
  border-top: 1px solid var(--border); font-size: .85rem; color: var(--fg-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
}
.site-footer__legal p { margin: 0; }
.site-footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}
.site-footer__legal-links a {
  font-size: .85rem;
  color: var(--fg-soft);
}
.site-footer__legal-links a:hover { color: var(--accent); }
.site-footer__consent-btn {
  border: none;
  padding: 0;
  background: transparent;
  font: inherit;
  color: var(--fg-soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.site-footer__consent-btn:hover { color: var(--accent); }

/* ---------- COOKIE CONSENT ---------- */
.cookie-consent {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
}
.cookie-consent__text {
  margin: 0;
  color: var(--fg-muted);
  font-size: .92rem;
  line-height: 1.5;
}
.cookie-consent__text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.cookie-consent__actions {
  margin-top: .8rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.cookie-consent__btn {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  font-size: .9rem;
  font-weight: 600;
  padding: .55rem .85rem;
  cursor: pointer;
}
.cookie-consent__btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}
.cookie-consent__btn--primary:hover { background: var(--accent-hover); }
.cookie-consent__btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- ARTICLE ---------- */
.article { margin: 0 auto; }
.article__header { margin: 1rem 0 2rem; }
.article__kicker-emoji { font-size: .9em; margin-right: .15em; opacity: .6; }
.article__title-emoji {
  font-size: .85em; vertical-align: -0.03em; margin-right: .1em;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--cat-accent, var(--accent)) 40%, transparent));
}
.article__kicker {
  color: var(--accent); font-size: .88rem;
  margin: 0 0 .5em; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase;
}
.article__kicker a {
  color: var(--accent); text-decoration: none;
  transition: color var(--duration) var(--ease);
}
.article__kicker a:hover { color: var(--accent-hover); }
.article__title {
  font-size: 2.2rem; margin: 0 0 .4em;
  line-height: 1.2; letter-spacing: -.015em;
}
.article__lede {
  font-size: 1.12rem; color: var(--fg-muted);
  margin: 0 0 1em; line-height: 1.6;
}
.article__hero { margin: 1rem 0 2rem; }
.article__hero img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.article__byline {
  font-size: .9rem; color: var(--fg-muted); margin: .3em 0 0;
  line-height: 1.5;
}
.article__byline a { color: var(--accent); text-decoration: none; font-weight: 600; }
.article__byline a:hover { color: var(--accent-hover); }
.article__byline-role { font-style: italic; }
.article__byline-time { white-space: nowrap; }

/* ---------- TOC ---------- */
.toc {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 .5rem .5rem 0;
}
.toc__heading {
  font-weight: 700; font-size: .85rem;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--fg-muted); margin: 0 0 .6rem;
}
.toc__list {
  list-style: none; padding: 0; margin: 0;
  counter-reset: toc;
}
.toc__list li {
  counter-increment: toc;
  padding: .3rem 0;
}
.toc__list li::before {
  content: counter(toc) ".";
  display: inline-block; width: 1.6em;
  color: var(--accent); font-size: .85rem; font-weight: 600;
}
.toc__list a {
  color: var(--fg); font-size: .92rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.toc__list a:hover { border-color: var(--accent); color: var(--link); }

.article__body { font-size: 1.02rem; }
.article__body h2 {
  font-size: 1.4rem; margin-top: 2.2em;
  padding-bottom: .3em;
  border-bottom: 1px solid var(--border);
}
.article__body h3 { font-size: 1.15rem; margin-top: 1.6em; color: var(--fg); }
.article__body p, .article__body ul, .article__body ol { max-width: var(--maxw); }
.article__body strong { color: var(--fg); }

/* ---------- HUB / CATEGORY ---------- */
.hub-header { margin: 1rem 0 1.5rem; }
.hub-header__emoji {
  font-size: 1.15em; vertical-align: -0.05em;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--cat-accent, var(--accent)) 45%, transparent));
  margin-right: .15em;
}
.hub-header__kicker {
  color: var(--accent); font-size: .88rem;
  margin: 0 0 .4em; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase;
}
.hub-header__kicker a { color: var(--accent); text-decoration: none; }
.hub-header__lede { color: var(--fg-muted); margin-bottom: 1em; line-height: 1.6; }
.hub-header__intro { color: var(--fg); }
.hub-intro { margin: 0 auto 2.5rem; }
.hub-dreams h2 { margin-top: 2.5rem; }

/* ---------- DREAM LIST ---------- */
.dream-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.dream-list > li { margin: 0; }
.dream-list a {
  display: block; padding: 1em 1.1em;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease);
}
.dream-list a:hover {
  background: var(--gradient-card-hover);
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-md), 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}
.dream-list__planned {
  display: block; padding: 1em 1.1em;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-soft) 70%, var(--bg));
  opacity: .88;
}
.dream-list__planned .dream-list__title { color: var(--fg-muted); }
.dream-list__planned .dream-list__desc { color: var(--fg-soft); }
.dream-list__badge {
  display: inline-block;
  margin-top: .45rem;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg-soft);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.dream-list__emoji { font-size: .95rem; margin-right: .3em; opacity: .55; vertical-align: baseline; }
.dream-list li:hover .dream-list__emoji { opacity: .85; }
.dream-list__title { display: inline; font-weight: 600; color: var(--fg); }
.dream-list__desc { display: block; color: var(--fg-muted); font-size: .92rem; margin-top: .2em; }

/* ---------- CATEGORY CARDS (homepage / dreams hub) ---------- */
.category-cards {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: center;
}
.category-cards__card { flex: 0 1 calc(33.333% - .67rem); min-width: 240px; }

.category-cards__card {
  --cat-accent: var(--accent);
  margin: 0;
}
.category-cards__card a {
  display: block; padding: 1.2em 1.25em;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; background: var(--bg); height: 100%;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--cat-accent);
  transition: transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease),
              background var(--duration) var(--ease),
              border-color var(--duration) var(--ease);
  position: relative; overflow: hidden;
}
.category-cards__card--has-emoji a { padding-right: 3.8em; }
.category-cards__card a::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 85% -10%, color-mix(in srgb, var(--cat-accent) 10%, transparent) 0%, transparent 65%);
  pointer-events: none; opacity: .6;
  transition: opacity var(--duration) var(--ease);
}
.category-cards__card a:hover::before { opacity: 1; }
.category-cards__card a:hover {
  box-shadow: var(--shadow-md), 0 0 24px color-mix(in srgb, var(--cat-accent) 25%, transparent);
  transform: translateY(-3px);
  border-top-color: var(--cat-accent);
}
.category-cards__emoji {
  display: block; font-size: 2.4rem; line-height: 1;
  position: absolute; top: .55em; right: 1rem;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--cat-accent) 50%, transparent));
  transition: transform var(--duration) var(--ease), filter var(--duration) var(--ease);
  pointer-events: none; z-index: 1;
}
.category-cards__card a:hover .category-cards__emoji {
  transform: scale(1.2) rotate(5deg);
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--cat-accent) 70%, transparent));
}
.category-cards__divider { display: none; }
.category-cards__title {
  margin: 0 0 .3em; font-size: 1.08rem;
  font-family: var(--font-display); color: var(--fg);
  position: relative; z-index: 1;
}
.category-cards__desc {
  color: var(--fg-muted); font-size: .9rem; margin: 0; line-height: 1.5;
  position: relative; z-index: 1;
}
.category-cards__star {
  position: absolute; bottom: .6em; right: .8em;
  font-size: .7rem; color: var(--cat-accent); opacity: .25;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
  pointer-events: none;
}
.category-cards__card a:hover .category-cards__star {
  opacity: .6; transform: scale(1.3) rotate(15deg);
}

/* ---------- BREADCRUMBS ---------- */
.breadcrumbs { font-size: .88rem; color: var(--fg-soft); margin: .5rem 0 .75rem; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25em; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: .25em; margin: 0; }
.breadcrumbs a {
  color: var(--fg-soft); text-decoration: none;
  transition: color var(--duration) var(--ease);
}
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs__sep { color: var(--border); }
.breadcrumbs [aria-current="page"] { color: var(--fg-muted); }

/* ---------- PAGINATION ---------- */
.pagination { margin: 2.5rem 0; }
.pagination ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
}
.pagination li { margin: 0; }
.pagination a, .pagination span {
  display: inline-block; padding: .45em .9em;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--link); background: var(--bg);
  min-width: 2.4em; text-align: center;
  transition: all var(--duration) var(--ease);
}
.pagination a:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.pagination .is-current {
  background: var(--accent); color: #fff;
  border-color: var(--accent); font-weight: 600;
}
.pagination .is-disabled span { color: var(--fg-soft); background: var(--bg-soft); }

/* ---------- ENTITY TAG PILLS ---------- */
.entity-tags {
  margin: 2.5rem 0 1.5rem; padding: 1.1rem 1.25rem;
  background: var(--bg-soft); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.entity-tags__group { margin: .3em 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.entity-tags__label {
  color: var(--fg-soft); font-size: .85rem;
  margin-right: .3em; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.entity-tags__pill {
  display: inline-block; padding: .2em .7em;
  background: var(--bg); color: var(--fg-muted);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: .84rem; text-decoration: none;
  line-height: 1.6;
  transition: all var(--duration) var(--ease);
}
.entity-tags__pill:hover {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent);
}
.entity-tags__pill.is-inactive { color: var(--fg-soft); background: transparent; cursor: default; }

/* ---------- SHARE ---------- */
.share {
  margin: 2rem 0; padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.share__label {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--fg-muted); margin: 0 0 .5rem; font-weight: 600;
}
.share__list {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: .5rem; flex-wrap: wrap;
}
.share__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  font-size: .95rem; font-weight: 700; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.share__btn:hover { transform: translateY(-2px); }

.share__btn--x {
  color: rgba(29,155,240,.8); background: rgba(29,155,240,.12);
  border: 1px solid rgba(29,155,240,.25);
}
.share__btn--x:hover { background: #1d9bf0; color: #fff; border-color: #1d9bf0; }

.share__btn--fb {
  color: rgba(24,119,242,.8); background: rgba(24,119,242,.12);
  border: 1px solid rgba(24,119,242,.25);
}
.share__btn--fb:hover { background: #1877f2; color: #fff; border-color: #1877f2; }

.share__btn--pin {
  color: rgba(230,0,35,.8); background: rgba(230,0,35,.12);
  border: 1px solid rgba(230,0,35,.25);
}
.share__btn--pin:hover { background: #e60023; color: #fff; border-color: #e60023; }

.share__btn--rd {
  color: rgba(255,69,0,.8); background: rgba(255,69,0,.12);
  border: 1px solid rgba(255,69,0,.25);
}
.share__btn--rd:hover { background: #ff4500; color: #fff; border-color: #ff4500; }

.share__btn--mail {
  color: color-mix(in srgb, var(--accent) 80%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.share__btn--mail:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- DREAM CTA ---------- */
.dream-cta {
  margin: 2.5rem 0; padding: 1.5rem;
  background: linear-gradient(135deg, var(--bg-soft), var(--bg-muted));
  border: 1px solid var(--border); border-radius: var(--radius);
  text-align: center;
}
.dream-cta__icon { font-size: 2rem; margin: 0 0 .3rem; }
.dream-cta__heading {
  font-size: 1.1rem; font-weight: 700; color: var(--fg); margin: 0 0 .4rem;
}
.dream-cta__text {
  font-size: .88rem; color: var(--fg-muted); margin: 0 0 1rem;
  max-width: 36rem; margin-inline: auto;
}
.dream-cta__btn {
  display: inline-block; padding: .6rem 1.6rem;
  background: var(--accent); color: #fff; font-weight: 600;
  border-radius: 2rem; text-decoration: none; font-size: .9rem;
  transition: background .15s, transform .15s;
}
.dream-cta__btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ---------- FAQ (VISIBLE) ---------- */
.faq-block {
  margin: 2.5rem 0;
  padding: 1.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.faq-block h2 {
  margin: 0 0 .75rem;
  font-size: 1.05rem;
}
.faq-block__items {
  display: grid;
  gap: .6rem;
}
.faq-block__item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: .1rem .75rem;
}
.faq-block__item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--fg);
  padding: .6rem 0;
  list-style: none;
}
.faq-block__item summary::-webkit-details-marker { display: none; }
.faq-block__item summary::after {
  content: "+";
  float: right;
  color: var(--accent);
}
.faq-block__item[open] summary::after { content: "−"; }
.faq-block__item p {
  margin: 0 0 .7rem;
  color: var(--fg-muted);
}

/* ---------- RELATED DREAMS / FURTHER READING / CITED BY ---------- */
.related-dreams, .further-reading, .cited-by, .references, .related-taxa {
  margin: 2.5rem 0; padding: 1.25rem 1.25rem;
  background: var(--bg-soft); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.related-dreams h2, .further-reading h2, .cited-by h2, .references h2, .related-taxa h2 {
  font-size: 1.05rem; margin: 0 0 .75em; color: var(--fg);
}
.related-dreams ul, .further-reading ul, .cited-by ul, .related-taxa ul { list-style: none; padding: 0; margin: 0; }
.related-dreams li, .further-reading li, .cited-by li, .related-taxa li { margin: .2em 0; }
.related-dreams a, .further-reading a, .cited-by a {
  display: block; padding: .55em .85em;
  border-radius: var(--radius); text-decoration: none; color: var(--fg);
  transition: all var(--duration) var(--ease);
}
.related-dreams a:hover, .further-reading a:hover, .cited-by a:hover {
  background: var(--accent-soft); color: var(--accent);
}
.related-dreams__emoji { font-size: .85rem; margin-right: .25em; opacity: .45; vertical-align: baseline; }
.related-dreams li:hover .related-dreams__emoji { opacity: .75; }
.related-dreams__title, .further-reading__title { font-weight: 600; display: inline; }
.related-dreams__reason {
  display: inline-block;
  margin-left: .4rem;
  padding: .05rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-soft);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  vertical-align: middle;
}
.related-dreams__desc, .further-reading__desc { color: var(--fg-muted); font-size: .9rem; display: block; }
.related-taxa__kind { color: var(--fg-soft); font-size: .85em; }

/* ---------- SOURCE BACKBONE NOTE ---------- */
.source-backbone {
  margin: 2.5rem 0;
  padding: 1.1rem 1.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.source-backbone h2 {
  margin: 0 0 .6rem;
  font-size: 1rem;
}
.source-backbone p {
  margin: 0 0 .55rem;
  color: var(--fg-muted);
  font-size: .93rem;
}
.source-backbone p:last-child { margin-bottom: 0; }

/* ---------- ADS (CLS-safe placeholders) ---------- */
.ad { display: block; margin: 1.5rem 0; text-align: center; background: var(--bg-soft); border-radius: var(--radius); }
.ad ins { margin: 0 auto; }
.ad--custom { position: relative; border: 1px solid var(--border); padding: 1rem; }
.ad__label { position: absolute; top: .35rem; right: .5rem; font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-soft); opacity: .7; }

/* ---------- SEARCH BOX ---------- */
.search-box { display: flex; gap: .5em; margin: 0; max-width: 100%; }
.search-box input {
  flex: 1 1 auto; padding: .72em .95em; font: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-soft); color: var(--fg);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-box button {
  padding: .72em 1.15em; font: inherit; font-weight: 700;
  background: var(--gradient-cta); color: #fff;
  border: 0; border-radius: var(--radius); cursor: pointer;
  transition: opacity var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  letter-spacing: .01em;
}
.search-box button:hover { opacity: .9; box-shadow: var(--shadow-glow); }
.search-box--hero { gap: .42rem; }
.search-box--hero input {
  padding: .62em .85em;
  font-size: .93rem;
}
.search-box--hero button {
  padding: .62em .95em;
  min-width: 4.9rem;
  font-size: .9rem;
}
.search-suggest {
  list-style: none;
  margin: .45rem 0 0;
  padding: .25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: var(--shadow-md);
}
.search-suggest li { margin: 0; }
.search-suggest__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .46rem .55rem;
  border-radius: .45rem;
  text-decoration: none;
  color: var(--fg);
  border: 1px solid transparent;
}
.search-suggest__item:hover,
.search-suggest__item.is-active {
  background: var(--bg);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.search-suggest__title {
  font-size: .9rem;
  font-weight: 600;
}
.search-suggest__cat {
  --cat-accent: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: color-mix(in srgb, var(--cat-accent) 70%, var(--fg-soft));
  font-size: .72rem;
  border: 1px solid color-mix(in srgb, var(--cat-accent) 35%, var(--border));
  background: color-mix(in srgb, var(--cat-accent) 12%, var(--bg));
  border-radius: 999px;
  padding: .13rem .45rem;
  letter-spacing: .01em;
}
.search-suggest__cat-emoji {
  font-size: .9em;
  opacity: .9;
}

/* ---------- GOVERNANCE NOTICE (dev-only) ---------- */
.governance-notice {
  background: var(--warn-bg); color: var(--warn-fg);
  border: 1px solid var(--warn-border);
  padding: .75em 1em; border-radius: var(--radius);
  margin: 1rem 0; font-size: .92rem;
}
.governance-notice code { background: rgba(0,0,0,.06); }

/* ---------- COMMENTS ---------- */
.comments {
  margin: 3rem 0 1rem;
  padding: 1.75rem;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.comments__heading {
  font-size: 1.2rem;
  margin: 0 0 .25em;
}
.comments__subheading {
  color: var(--fg-muted);
  font-size: .93rem;
  margin: 0 0 1.5em;
  line-height: 1.5;
}
.comments__list { margin: 0 0 1.5rem; }
.comments__empty {
  color: var(--fg-soft);
  font-style: italic;
  font-size: .93rem;
  margin: 0;
}
.comments__form-row { margin: 0 0 .85rem; }
.comments__input,
.comments__textarea {
  width: 100%;
  padding: .65em .9em;
  font: inherit;
  font-size: .95rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.comments__input:focus,
.comments__textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.comments__input--name { max-width: 320px; }
.comments__textarea { resize: vertical; min-height: 110px; }
.comments__form-actions {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.comments__submit {
  padding: .6em 1.5em;
  font: inherit; font-size: .95rem; font-weight: 600;
  color: #fff;
  background: var(--gradient-cta);
  border: 0; border-radius: var(--radius); cursor: pointer;
  transition: opacity var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.comments__submit:hover { opacity: .9; box-shadow: var(--shadow-glow); }
.comments__form-note { color: var(--fg-soft); font-size: .83rem; }

/* ---------- NEWSLETTER SIGNUP ---------- */
.newsletter-box {
  margin: 2.5rem 0;
  padding: 2rem 1.75rem;
  background: var(--gradient-hero);
  border-radius: var(--radius-lg);
  text-align: center;
  color: #e0dde5;
  position: relative;
  overflow: hidden;
}
.newsletter-box::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(167, 139, 250, .15) 0%, transparent 70%);
  pointer-events: none;
}
.newsletter-box__heading {
  font-size: 1.25rem;
  margin: 0 0 .35em;
  color: #fff;
  position: relative;
}
.newsletter-box__desc {
  color: rgba(224, 221, 229, .85);
  font-size: .95rem;
  margin: 0 0 1.25em;
  max-width: 32em;
  margin-inline: auto;
  position: relative;
  line-height: 1.5;
}
.newsletter-box__form {
  display: flex;
  gap: .5rem;
  max-width: 440px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
}
.newsletter-box__email {
  flex: 1 1 220px;
  padding: .65em .9em;
  font: inherit; font-size: .95rem;
  color: var(--nl-email-color);
  background: var(--nl-email-bg);
  border: 1px solid var(--nl-email-border);
  border-radius: var(--radius);
}
.newsletter-box__email:focus {
  outline: none;
  border-color: rgba(167, 139, 250, .6);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, .2);
}
.newsletter-box__btn {
  padding: .65em 1.6em;
  font: inherit; font-size: .95rem; font-weight: 600;
  color: var(--nl-btn-color);
  background: var(--nl-btn-bg);
  border: 0; border-radius: var(--radius); cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.newsletter-box__btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.newsletter-box__note {
  width: 100%;
  color: rgba(224, 221, 229, .75);
  font-size: .8rem;
  margin-top: .6rem;
  position: relative;
}

/* ---------- DICTIONARY ---------- */
.dictionary-nav {
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin: 1rem 0 1.5rem; padding: 0; list-style: none;
}
.dictionary-nav__letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.3em; height: 2.3em;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; font-weight: 600; font-size: .93rem;
  color: var(--accent); background: var(--bg);
  transition: all var(--duration) var(--ease);
}
.dictionary-nav__letter:hover {
  background: var(--accent); color: #fff;
  border-color: var(--accent); box-shadow: var(--shadow-glow);
}
.dictionary-nav__letter.is-empty {
  color: var(--fg-soft); background: var(--bg-muted);
  cursor: default; pointer-events: none;
}
.dictionary-group { margin: 2.5rem 0; }
.dictionary-group__letter {
  font-size: 1.7rem; font-family: var(--font-display);
  color: var(--accent); margin: 0 0 .6em;
  padding-bottom: .3em;
  border-bottom: 2px solid var(--accent-soft);
}
.dictionary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .5rem; list-style: none; padding: 0; margin: 0;
}
.dictionary-grid a {
  display: block; padding: .55em .85em;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--fg); font-size: .93rem;
  transition: all var(--duration) var(--ease);
}
.dictionary-grid a:hover {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent); transform: translateY(-1px);
}
.dictionary-grid__type {
  color: var(--fg-soft); font-size: .78rem;
  margin-left: .4em; font-style: italic;
}
.dictionary-stats {
  display: flex; flex-wrap: wrap; gap: 2rem;
  margin: 1.25rem 0 1.5rem; padding: 1.1rem 1.25rem;
  background: var(--bg-soft); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.dictionary-stats dt { font-size: .82rem; color: var(--fg-soft); text-transform: uppercase; letter-spacing: .04em; }
.dictionary-stats dd {
  font-size: 1.5rem; font-weight: 700;
  font-family: var(--font-display); margin: 0;
  color: var(--accent);
}

/* =============================================================
   ATMOSPHERE — dreamy visual cues (zero performance cost)
   ============================================================= */

/* ---------- TWINKLE STARS (opacity-only = GPU compositor) ---------- */
@keyframes twinkle-slow {
  0%, 100% { opacity: .3; }
  50% { opacity: .8; }
}
@keyframes twinkle-mid {
  0%, 100% { opacity: .2; }
  50% { opacity: .7; }
}
@keyframes twinkle-fast {
  0%, 100% { opacity: .15; }
  50% { opacity: .6; }
}

.main::before,
.main::after {
  content: "";
  position: fixed;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: -1;
  will-change: opacity;
  opacity: 0;
}
:root:not([data-theme="light"]) .main::before {
  top: 18%; right: 12%;
  opacity: .4;
  animation: twinkle-slow 5s ease-in-out infinite;
  box-shadow:
    0 0 6px 1px rgba(167, 139, 250, .3),
    120px 60px 0 0 rgba(167, 139, 250, .2),
    -80px 140px 0 1px rgba(199, 181, 253, .25),
    200px 200px 0 0 rgba(167, 139, 250, .15);
}
:root:not([data-theme="light"]) .main::after {
  top: 55%; left: 8%;
  opacity: .3;
  animation: twinkle-mid 7s ease-in-out infinite 2s;
  box-shadow:
    0 0 6px 1px rgba(199, 181, 253, .25),
    150px -100px 0 0 rgba(167, 139, 250, .2),
    -60px -200px 0 1px rgba(167, 139, 250, .15);
}

/* ---------- AMBIENT GLOW (hero enhancement in dark mode) ---------- */
:root:not([data-theme="light"]) .hero::before {
  opacity: .35;
}
:root:not([data-theme="light"]) .hero {
  text-shadow: 0 0 40px rgba(167, 139, 250, .08);
}

/* ---------- SECTION HEADING STAR DECORATION ---------- */
.home-section h2::after {
  content: "✦";
  font-size: .6em;
  color: var(--accent);
  opacity: .5;
  margin-left: .4em;
  vertical-align: middle;
}
:root[data-theme="light"] .home-section h2::after { opacity: .25; }

.article__body h2::after {
  content: " ☽";
  font-size: .65em;
  color: var(--accent);
  opacity: .3;
}
:root[data-theme="light"] .article__body h2::after { opacity: .15; }

/* ---------- MOBILE NAV TOGGLE (CSS-only) ---------- */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; }
.nav-toggle-label__close { display: none; }

/* ---------- TABLE OVERFLOW ---------- */
.article__body table {
  display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
}

/* ---------- UTILITIES ---------- */
.empty { color: var(--fg-muted); font-style: italic; }
.is-inactive { color: var(--fg-soft); cursor: default; }

/* ---------- RESPONSIVE: TABLET (≤ 900px) ---------- */
@media (max-width: 900px) {
  .brand__logo { width: 48px; height: 48px; }
  .brand__tagline { font-size: .68rem; }
  .site-header__inner { grid-template-columns: auto 1fr auto; gap: .7rem; }
  .nav-primary ul { justify-content: flex-start; }
  .nav-primary a { padding: .4em .65em; font-size: .88rem; }
  .hero__title { font-size: 2.3rem; }
  .hero__search-wrap { max-width: 100%; }
  .article__title { font-size: 2rem; }
  .category-cards__card { flex: 0 1 calc(50% - .5rem); min-width: 200px; }
  .dictionary-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .site-footer__inner { grid-template-columns: minmax(220px, 1.2fr) repeat(auto-fit, minmax(165px, 1fr)); }
  .site-footer__col--brand { gap: .55rem; }
  .site-footer__col:not(.site-footer__col--brand) { padding: .85rem .9rem; }
}

/* ---------- RESPONSIVE: MOBILE (≤ 640px) ---------- */
@media (max-width: 640px) {
  :root { --gutter: 1.05rem; --fs-base: 16px; }
  .layout-article .container {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
  }
  .brand__logo { width: 44px; height: 44px; }
  .brand__name { font-size: 1.18rem; }
  .brand__tagline { display: none; }
  .brand { margin-right: auto; }

  .site-header__controls {
    order: 2;
    margin-left: auto;
    gap: .45rem;
  }

  .nav-toggle-label {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.85rem; height: 2.85rem;
    background: var(--bg-muted); border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    color: var(--fg-muted); font-size: 1.2rem;
    flex-shrink: 0;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease), border-color var(--duration) var(--ease);
  }
  .nav-toggle-label:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
  .theme-toggle { width: 2.85rem; height: 2.85rem; font-size: 1.05rem; }
  .header-search { width: 2.85rem; height: 2.85rem; font-size: 1.06rem; }

  .nav-primary {
    order: 3; width: 100%;
    max-height: 0; overflow: hidden;
    transition: max-height .3s var(--ease), opacity var(--duration) var(--ease);
    opacity: 0;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
  }
  .nav-primary ul {
    flex-direction: column; gap: 0;
    align-items: stretch;
    padding: .45rem 0;
  }
  .nav-primary a {
    display: block; padding: .7em .8em; font-size: .95rem;
    border-radius: 0;
    border: none;
  }

  .nav-toggle:checked ~ .nav-primary {
    max-height: 360px;
    opacity: 1;
    border-color: var(--border);
    background: var(--bg-soft);
  }
  .nav-toggle:checked ~ .site-header__controls .nav-toggle-label .nav-toggle-label__open { display: none; }
  .nav-toggle:checked ~ .site-header__controls .nav-toggle-label .nav-toggle-label__close { display: inline; }

  .hero { padding: 1.15rem 0 1.45rem; }
  .hero__title { font-size: 1.72rem; }
  .hero__lede { font-size: 1.05rem; }
  .home-section__intro { margin: -.1rem 0 1rem; font-size: .95rem; }
  .hero__kicker { margin-bottom: .65rem; }
  .hero__search-wrap { padding: .65rem .68rem; }
  .hero__search-hint { font-size: .74rem; }
  .hero__search-count { font-size: .7rem; }
  .hero__search-meta { font-size: .72rem; }

  .article__title { font-size: 1.7rem; }
  .article__lede { font-size: 1rem; }
  .article__body h2 { font-size: 1.25rem; }

  .category-cards__card { flex: 0 0 100%; min-width: 0; }
  .dream-list a { padding: .8em .9em; }

  .dictionary-grid { grid-template-columns: 1fr 1fr; }
  .dictionary-stats { gap: .75rem; }
  .dictionary-stats dd { font-size: 1.2rem; }
  .dictionary-nav__letter { width: 2.75rem; height: 2.75rem; font-size: .88rem; }

  .newsletter-box { padding: 1.5rem 1rem; }
  .newsletter-box__email { flex: 1 1 100%; }
  .newsletter-box__btn { flex: 1 1 100%; }
  .newsletter-box__heading { font-size: 1.1rem; }

  .comments { padding: 1.25rem; margin: 2rem 0 1rem; }
  .comments__input--name { max-width: 100%; }

  .search-box { flex-direction: column; max-width: 100%; }
  .search-box input, .search-box button { width: 100%; }

  .site-footer__inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .site-footer { padding: 1.5rem 0 1rem; margin-top: 2.5rem; }
  .site-footer__col--brand {
    display: block;
    padding: .95rem 1rem;
  }
  .site-footer__col--brand .site-footer__tagline,
  .site-footer__col--brand .site-footer__meta { margin-top: .45rem; }
  .site-footer__legal { display: block; }
  .site-footer__legal p + p { margin-top: .5rem; }
  .cookie-consent { left: .75rem; right: .75rem; bottom: .75rem; }
  .cookie-consent__actions > * { flex: 1 1 100%; }

  .pagination a, .pagination span { padding: .65em 1em; min-width: 3rem; min-height: 3rem; }

  .breadcrumbs { font-size: .82rem; }

  .entity-tags { padding: .85rem 1rem; }
  .entity-tags__pill { padding: .25em .6em; font-size: .82rem; }

  .related-dreams, .further-reading, .cited-by, .references, .related-taxa {
    padding: 1rem; margin: 2rem 0;
  }

  .hub-header__kicker { font-size: .82rem; }

  /* Twinkle stars smaller on mobile */
  .main::before, .main::after { display: none; }
}

/* ---------- RESPONSIVE: SMALL PHONE (≤ 380px) ---------- */
@media (max-width: 380px) {
  :root { --gutter: .95rem; }
  .layout-article .container {
    padding-left: 1.05rem;
    padding-right: 1.05rem;
  }
  .brand__logo { width: 38px; height: 38px; }
  .hero__title { font-size: 1.52rem; }
  .article__title { font-size: 1.5rem; }
  .dictionary-grid { grid-template-columns: 1fr; }
  .brand__name { font-size: 1.02rem; }
  .newsletter-box__heading { font-size: 1rem; }
  .newsletter-box__desc { font-size: .88rem; }
}
