/* ==========================================================================
   Parilem — Popular science platform / Design system
   Colour identity: purple (primary), white (background), red (accent)
   ========================================================================== */

/* 1. TOKENS -------------------------------------------------------------- */
:root {
  /* Purple scale */
  --purple-50:  #f6f3ff;
  --purple-100: #ece5ff;
  --purple-200: #dbcdff;
  --purple-300: #c0a8ff;
  --purple-400: #a077ff;
  --purple-500: #7c4dff;
  --purple-600: #6a2ee8;
  --purple-700: #5620bd;
  --purple-800: #421a91;
  --purple-900: #2d1066;

  /* Red scale */
  --red-50:  #fff1f3;
  --red-100: #ffe0e6;
  --red-400: #f4577a;
  --red-500: #e8264a;
  --red-600: #c8143a;
  --red-700: #a30f30;

  /* Neutrals */
  --white: #ffffff;
  --gray-50:  #fafafb;
  --gray-100: #f3f3f6;
  --gray-200: #e7e6ee;
  --gray-300: #d3d1de;
  --gray-500: #7a7690;
  --gray-600: #5b5772;
  --gray-800: #2c2840;
  --gray-900: #1a1730;

  /* Semantic */
  --bg:        var(--white);
  --bg-alt:    var(--purple-50);
  --surface:     var(--white);
  --surface-2:   var(--gray-50);
  --line:     var(--gray-200);
  --line-2:   var(--gray-300);
  --text:     var(--gray-900);
  --text-soft: var(--gray-600);
  --text-faint:   var(--gray-500);
  --brand:     var(--purple-600);
  --brand-strong:var(--purple-800);
  --accent:     var(--red-500);
  --ring:     color-mix(in srgb, var(--purple-500) 45%, transparent);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(45, 16, 102, .06), 0 1px 3px rgba(45, 16, 102, .05);
  --shadow-md: 0 4px 16px -4px rgba(45, 16, 102, .12), 0 2px 6px -2px rgba(45, 16, 102, .07);
  --shadow-lg: 0 24px 48px -20px rgba(45, 16, 102, .28), 0 8px 20px -12px rgba(45, 16, 102, .16);
  --shadow-purple: 0 12px 28px -10px rgba(106, 46, 232, .45);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Typography */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: "Newsreader", Georgia, "Times New Roman", serif;

  /* Sizes */
  --container: 1240px;
  --container-narrow: 760px;
  --header-h: 68px;

  --ease: 180ms cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  --bg:        #0d0a1c;
  --bg-alt:    #140f2c;
  --surface:     #171232;
  --surface-2:   #1e1840;
  --line:     #2b2352;
  --line-2:   #3a3067;
  --text:     #efecff;
  --text-soft: #b9b2dd;
  --text-faint:   #8b83b5;
  --brand:     var(--purple-400);
  --brand-strong:var(--purple-300);
  --accent:     var(--red-400);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 20px -6px rgba(0, 0, 0, .55);
  --shadow-lg: 0 28px 56px -24px rgba(0, 0, 0, .75);
  --shadow-purple: 0 12px 30px -12px rgba(124, 77, 255, .5);
}

/* 2. BASE ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--ease), color var(--ease);
}

img, svg, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.2; letter-spacing: -.022em; font-weight: 750; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--purple-500); color: #fff; }

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.container-narrow { width: 100%; max-width: var(--container-narrow); margin-inline: auto; padding-inline: 20px; }

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

.skip-link {
  position: absolute; top: -60px; left: 16px; z-index: 200;
  background: var(--purple-600); color: #fff;
  padding: 10px 18px; border-radius: var(--r-sm); font-weight: 600;
  transition: top var(--ease);
}
.skip-link:focus { top: 12px; }

/* 3. TOP BAR (announcement) ----------------------------------------------- */
.announcement-bar {
  background: linear-gradient(100deg, var(--purple-800), var(--purple-600) 45%, var(--red-600));
  color: #fff;
  font-size: 13.5px;
  letter-spacing: .01em;
}
.announcement-bar .container {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; min-height: 38px; flex-wrap: wrap; text-align: center;
}
.announcement-bar strong { font-weight: 700; }
.announcement-badge {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 2px 9px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.announcement-bar a { text-decoration: underline; text-underline-offset: 3px; opacity: .95; }
.announcement-bar a:hover { opacity: 1; }
/* On phones the badge, text and link flow as one paragraph, so the bar takes
   two lines instead of three and doesn't crowd the top of the screen. */
@media (max-width: 720px) {
  .announcement-bar { font-size: 12.5px; }
  .announcement-bar .container { display: block; min-height: 0; padding-block: 8px; line-height: 1.5; }
  .announcement-badge { display: inline-block; margin-right: 6px; padding: 0 7px; font-size: 10px; vertical-align: 1px; }
  .announcement-bar a { margin-left: 4px; white-space: nowrap; font-weight: 650; }
}

/* 4. HEADER / NAVIGATION -------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 22px;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* The logo is an SVG with its own background and rounding; this radius
   (38 × 122/512 ≈ 9px) matches the corner of the drawing exactly. */
.logo__mark {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 9px;
  box-shadow: var(--shadow-purple);
}
.logo__wordmark { font-size: 22px; font-weight: 800; letter-spacing: -.035em; }
.logo__wordmark span { color: var(--accent); }
.logo__tagline {
  display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-faint); margin-top: -3px;
}

.site-header__inner nav { margin-inline: auto; }
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav > li { position: relative; }
.main-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 13px; border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 600; color: var(--text-soft);
  transition: color var(--ease), background var(--ease);
}
.main-nav a:hover { color: var(--brand); background: var(--bg-alt); }
.main-nav a.active { color: var(--brand); }
.main-nav a.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px;
  height: 2.5px; border-radius: 2px;
  background: linear-gradient(90deg, var(--purple-500), var(--red-500));
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--text-soft);
  cursor: pointer; transition: all var(--ease);
}
.icon-btn:hover {
  color: var(--brand); border-color: var(--purple-300);
  background: var(--bg-alt); transform: translateY(-1px);
}
.menu-btn { display: none; }

/* 5. BUTTONS -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-full);
  font-size: 14.5px; font-weight: 650; letter-spacing: -.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease), color var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--purple {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
  color: #fff; box-shadow: var(--shadow-purple);
}
.btn--purple:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(106, 46, 232, .6); }

.btn--red {
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  color: #fff; box-shadow: 0 12px 28px -12px rgba(232, 38, 74, .55);
}
.btn--red:hover { transform: translateY(-2px); }

.btn--outline {
  background: var(--surface); color: var(--text);
  border-color: var(--line-2);
}
.btn--outline:hover { border-color: var(--purple-400); color: var(--brand); background: var(--bg-alt); }

.btn--ghost { background: transparent; color: var(--brand); padding-inline: 12px; }
.btn--ghost:hover { background: var(--bg-alt); }

.btn--sm { padding: 8px 15px; font-size: 13.5px; }
.btn--block { width: 100%; }

/* 6. BADGES & TAGS -------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--purple-100); color: var(--purple-700);
}
[data-theme="dark"] .badge { background: color-mix(in srgb, var(--purple-500) 22%, transparent); color: var(--purple-300); }

.badge--red { background: var(--red-50); color: var(--red-600); }
[data-theme="dark"] .badge--red { background: color-mix(in srgb, var(--red-500) 22%, transparent); color: var(--red-400); }

.badge--solid { background: var(--purple-600); color: #fff; }
.badge--glass {
  background: rgba(255, 255, 255, .16); color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
  backdrop-filter: blur(6px);
}
.badge--live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red-500); animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 38, 74, .6); }
  50% { box-shadow: 0 0 0 5px rgba(232, 38, 74, 0); }
}

.meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-faint);
}
.meta__sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.meta svg { flex-shrink: 0; }

/* 7. COVER AREA (generated cover) ----------------------------------------- */
.cover {
  position: relative; overflow: hidden;
  border-radius: var(--r-md);
  background:
    radial-gradient(120% 130% at 12% 8%, var(--grad-from, var(--purple-500)) 0%, transparent 58%),
    radial-gradient(110% 110% at 88% 22%, var(--grad-to, var(--red-500)) 0%, transparent 52%),
    linear-gradient(155deg, #241a4d 0%, #0e0a20 100%);
  aspect-ratio: 16 / 10;
  isolation: isolate;
}
.cover::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px);
  background-size: 15px 15px;
  opacity: .45;
  mask-image: linear-gradient(200deg, #000, transparent 75%);
}
.cover::after {
  content: ""; position: absolute;
  width: 62%; aspect-ratio: 1; right: -14%; bottom: -32%;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .22);
  box-shadow: inset 0 0 60px rgba(255, 255, 255, .12);
}
.cover__glyph {
  position: absolute; left: 18px; bottom: 14px;
  font-size: 34px; line-height: 1; filter: saturate(1.15) drop-shadow(0 6px 14px rgba(0, 0, 0, .45));
  z-index: 2;
}
.cover__badge { position: absolute; top: 12px; left: 12px; z-index: 2; }
.cover__time {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  background: rgba(13, 10, 28, .6); color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(6px);
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 600;
}

/* 8. CARD ----------------------------------------------------------------- */
.card {
  position: relative;
  display: flex; flex-direction: column; gap: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 13px;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--purple-200);
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .card:hover { border-color: var(--purple-700); }

.card__body { display: flex; flex-direction: column; gap: 9px; padding: 0 4px 6px; flex: 1; }
.card__eyebrow { display: flex; align-items: center; gap: 8px; }
.card__title { font-size: 18px; line-height: 1.32; font-weight: 700; letter-spacing: -.02em; }
.card__title a { background-image: linear-gradient(var(--brand), var(--brand)); background-size: 0 2px;
  background-repeat: no-repeat; background-position: 0 100%; transition: background-size var(--ease); }
.card:hover .card__title a { background-size: 100% 2px; }
.card__summary { font-size: 14.5px; color: var(--text-soft); line-height: 1.6; }
.card__footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line);
}
.card__author { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); }

/* The whole card is clickable */
.card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.card .save-btn { position: relative; z-index: 2; }

.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 11px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--purple-500), var(--red-500));
}
.avatar--lg { width: 52px; height: 52px; font-size: 18px; }

.save-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--text-faint);
  cursor: pointer; transition: all var(--ease);
}
.save-btn:hover { color: var(--accent); border-color: var(--red-400); }
.save-btn[aria-pressed="true"] {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
.save-btn[aria-pressed="true"] svg { fill: currentColor; }

/* Horizontal card */
.card--horizontal { flex-direction: row; align-items: stretch; gap: 15px; }
.card--horizontal .cover { width: 168px; flex-shrink: 0; aspect-ratio: 4 / 3; }
.card--horizontal .card__body { padding: 4px 4px 4px 0; }
.card--horizontal .card__title { font-size: 16.5px; }

/* Plain list card */
.mini-list { display: flex; flex-direction: column; }
.mini-list li { position: relative; display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.mini-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-list__rank {
  font-size: 20px; font-weight: 800; letter-spacing: -.04em;
  background: linear-gradient(160deg, var(--purple-500), var(--red-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  min-width: 26px; line-height: 1.3;
}
.mini-list__title { font-size: 14.5px; font-weight: 650; line-height: 1.42; }
.mini-list li:hover .mini-list__title { color: var(--brand); }

/* 9. SECTION HEADING ------------------------------------------------------ */
.section { padding: 54px 0; }
.section--compact { padding: 36px 0; }
.section--alt { background: var(--bg-alt); }

.section-heading {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 26px; flex-wrap: wrap;
}
.section-heading h2 {
  font-size: clamp(22px, 3vw, 29px); display: flex; align-items: center; gap: 12px;
}
.section-heading h2::before {
  content: ""; width: 5px; height: 27px; border-radius: 3px;
  background: linear-gradient(180deg, var(--purple-500), var(--red-500));
}
.section-heading p { font-size: 14.5px; color: var(--text-faint); margin-top: 7px; padding-left: 17px; }
.section-heading__link { font-size: 14px; font-weight: 650; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.section-heading__link:hover { gap: 10px; }
.section-heading__link svg { transition: transform var(--ease); }

/* 10. GRIDS --------------------------------------------------------------- */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 42px; align-items: start; }
/* With the left column empty, the sidebar stands alone and centred. */
.content-layout--single { grid-template-columns: minmax(0, 560px); justify-content: center; }

/* 11. HERO ---------------------------------------------------------------- */
.hero { padding: 34px 0 8px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; z-index: -1;
  width: 620px; height: 620px; border-radius: 50%;
  top: -340px; left: 50%; transform: translateX(-30%);
  background: radial-gradient(circle, rgba(124, 77, 255, .22), transparent 65%);
  filter: blur(20px);
}
.hero::after {
  content: ""; position: absolute; z-index: -1;
  width: 420px; height: 420px; border-radius: 50%;
  top: -220px; right: -120px;
  background: radial-gradient(circle, rgba(232, 38, 74, .16), transparent 65%);
}
.hero-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; }
.hero-side { display: grid; gap: 22px; grid-template-rows: repeat(2, 1fr); }

.featured {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  min-height: 460px; display: flex; align-items: flex-end;
  color: #fff; padding: 36px;
  box-shadow: var(--shadow-lg);
  transition: box-shadow var(--ease), transform var(--ease);
}
/* Edge definition: a fine line between the dark cover and the light background. */
.featured::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.featured:hover { transform: translateY(-2px); box-shadow: 0 26px 60px -22px rgba(43, 12, 92, .55); }
.featured .cover { position: absolute; inset: 0; border-radius: 0; aspect-ratio: auto; }
.featured__shade {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(12deg, rgba(9, 6, 22, .94) 14%, rgba(9, 6, 22, .62) 48%, rgba(9, 6, 22, .12) 88%),
    radial-gradient(120% 90% at 12% 100%, rgba(9, 6, 22, .55), transparent 62%);
}
.featured__inner { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 13px; max-width: 620px; }
.featured h2 { font-size: clamp(27px, 3.6vw, 40px); line-height: 1.14; letter-spacing: -.03em; }
.featured h2 a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.featured p {
  font-size: 16px; line-height: 1.62; color: rgba(255, 255, 255, .84); max-width: 500px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.featured .meta { color: rgba(255, 255, 255, .72); }
.featured .badge-row { display: flex; gap: 8px; flex-wrap: wrap; }

.hero-side .card {
  padding: 0; overflow: hidden;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.hero-side .card:hover {
  border-color: var(--purple-400); box-shadow: var(--shadow-md); transform: translateY(-2px);
}
.hero-side .card--horizontal .cover { width: 38%; border-radius: 0; aspect-ratio: auto; min-height: 148px; }
.hero-side .card__body {
  padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; justify-content: center;
}
/* Both summaries take the same space, instead of six lines in one and three in the other. */
.hero-side .card__summary {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-side .card__footer { margin-top: auto; padding-top: 4px; }

/* 12. CATEGORY STRIP ------------------------------------------------------ */
.category-strip {
  display: flex; gap: 9px; overflow-x: auto; padding: 4px 0 14px;
  scrollbar-width: thin; scroll-snap-type: x proximity;
}
.category-strip::-webkit-scrollbar { height: 5px; }
.category-strip::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.chip {
  scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--r-full);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--text-soft);
  white-space: nowrap; cursor: pointer; transition: all var(--ease);
}
.chip:hover { border-color: var(--purple-300); color: var(--brand); transform: translateY(-1px); }
.chip[aria-selected="true"], .chip.active {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
  border-color: transparent; color: #fff; box-shadow: var(--shadow-purple);
}

/* 13. SIDEBAR ------------------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: calc(var(--header-h) + 20px); }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px;
}
.panel__title {
  font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 15px;
  display: flex; align-items: center; gap: 9px;
}
.panel__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.panel--accent {
  background: linear-gradient(150deg, var(--purple-700), var(--purple-900) 70%);
  border-color: transparent; color: #fff;
  position: relative; overflow: hidden;
}
.panel--accent::after {
  content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  right: -90px; top: -90px; background: radial-gradient(circle, rgba(232, 38, 74, .55), transparent 70%);
}
.panel--accent .panel__title { color: rgba(255, 255, 255, .7); }
.panel__title--light::after { background: rgba(255, 255, 255, .2); }
.panel--accent h3 { font-size: 19px; margin-bottom: 9px; position: relative; z-index: 1; }
.panel--accent p { font-size: 14px; color: rgba(255, 255, 255, .82); position: relative; z-index: 1; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 6px 12px; border-radius: var(--r-sm);
  background: var(--bg-alt); border: 1px solid transparent;
  font-size: 13px; font-weight: 600; color: var(--text-soft);
  transition: all var(--ease);
}
.tag:hover { color: var(--brand); border-color: var(--purple-200); transform: translateY(-1px); }
.tag span { color: var(--text-faint); font-weight: 500; font-size: 12px; }

/* 14. QUESTION CARD (Answered questions) ---------------------------------- */
.question-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-md);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 10px;
  transition: all var(--ease);
}
.question-card:hover { transform: translateX(4px); box-shadow: var(--shadow-md); border-left-color: var(--purple-500); }
.question-card__label {
  font-size: 13px; font-weight: 800; color: var(--accent);
  letter-spacing: .1em; text-transform: uppercase;
}
.question-card h3 { font-size: 17.5px; line-height: 1.35; }
.question-card p { font-size: 14.5px; color: var(--text-soft); }

/* 15. STATS --------------------------------------------------------------- */
.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
}
.stat { background: var(--surface); padding: 26px 20px; text-align: center; transition: background var(--ease); }
.stat:hover { background: var(--bg-alt); }
.stat__value {
  font-size: 34px; font-weight: 820; letter-spacing: -.04em; line-height: 1;
  background: linear-gradient(140deg, var(--purple-600), var(--red-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label { font-size: 13px; color: var(--text-faint); margin-top: 8px; font-weight: 550; }

/* 16. NEWSLETTER ---------------------------------------------------------- */
.newsletter {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: 52px 44px;
  background: linear-gradient(125deg, var(--purple-800) 0%, var(--purple-600) 52%, var(--red-600) 130%);
  color: #fff; text-align: center;
  box-shadow: var(--shadow-lg);
}
.newsletter::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .3) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .3;
  mask-image: radial-gradient(70% 70% at 50% 0%, #000, transparent);
}
.newsletter__inner { position: relative; z-index: 1; max-width: 560px; margin-inline: auto; }
.newsletter h2 { font-size: clamp(24px, 3.4vw, 33px); margin-bottom: 12px; }
.newsletter p { color: rgba(255, 255, 255, .85); margin-bottom: 24px; }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.newsletter-form input {
  flex: 1; min-width: 240px;
  padding: 13px 18px; border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .12); color: #fff;
  backdrop-filter: blur(8px);
  transition: border-color var(--ease), background var(--ease);
}
.newsletter-form input::placeholder { color: rgba(255, 255, 255, .62); }
.newsletter-form input:focus { outline: none; border-color: #fff; background: rgba(255, 255, 255, .2); }
.newsletter-form .btn { background: #fff; color: var(--purple-700); }
.newsletter-form .btn:hover { background: var(--purple-50); transform: translateY(-2px); }
.newsletter__note { font-size: 12.5px; color: rgba(255, 255, 255, .65); margin-top: 14px; }
.form-status { font-size: 13.5px; font-weight: 600; margin-top: 12px; min-height: 20px; }

/* 17. FOOTER -------------------------------------------------------------- */
.footer {
  background: var(--gray-900); color: #cdc8e8;
  padding: 56px 0 26px; margin-top: 70px;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--purple-500), var(--red-500)) 1;
}
[data-theme="dark"] .footer { background: #0a0716; }
.footer__grid {
  display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 38px; padding-bottom: 40px;
}
.footer h4 {
  font-size: 12px; letter-spacing: .13em; text-transform: uppercase;
  color: #fff; margin-bottom: 16px; font-weight: 750;
}
.footer ul { display: flex; flex-direction: column; gap: 11px; }
.footer a { font-size: 14px; color: #a9a2cc; transition: color var(--ease), padding-left var(--ease); }
.footer a:hover { color: #fff; padding-left: 4px; }
.footer__description { font-size: 14px; color: #a9a2cc; margin: 16px 0 20px; max-width: 380px; line-height: 1.7; }
.footer .logo__wordmark { color: #fff; }
.footer__social { display: flex; gap: 10px; }
.footer__social a {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1); color: #cdc8e8;
}
.footer__social a:hover { background: var(--purple-600); color: #fff; border-color: transparent; padding: 0; transform: translateY(-2px); }
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: #8d86b3;
}
.footer__bottom-menu { display: flex; gap: 20px; flex-wrap: wrap; }

/* 18. ARTICLE PAGE -------------------------------------------------------- */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 120;
  background: linear-gradient(90deg, var(--purple-500), var(--red-500));
  transition: width 90ms linear;
}

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-faint); flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--brand); }

.article-header { padding: 26px 0 8px; }
/* The header block lines up with the width of the text column below it */
.article-header__inner { max-width: calc(var(--container) - 40px - 336px - 42px); }
.article-header h1 {
  font-size: clamp(30px, 4.4vw, 47px); line-height: 1.13;
  letter-spacing: -.032em; margin: 16px 0 18px;
}
.article-header__standfirst {
  font-family: var(--font-text);
  font-size: clamp(17px, 2.1vw, 20px); line-height: 1.62;
  color: var(--text-soft); margin-bottom: 24px;
}

.byline {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 0; border-block: 1px solid var(--line);
}
.byline__info { display: flex; flex-direction: column; }
.byline__name { font-size: 14.5px; font-weight: 700; }
.byline__name a:hover { color: var(--brand); }
.byline__actions { margin-left: auto; display: flex; gap: 8px; }

.article-figure { margin: 30px 0; }
.article-figure .cover { aspect-ratio: 21 / 9; border-radius: var(--r-lg); }
figcaption {
  font-size: 13px; color: var(--text-faint); margin-top: 10px;
  padding-left: 13px; border-left: 3px solid var(--purple-300); line-height: 1.55;
}

/* Article body */
.prose { font-family: var(--font-text); font-size: 19px; line-height: 1.78; color: var(--text); }
.prose > * + * { margin-top: 24px; }
.prose h2 {
  font-family: var(--font-ui); font-size: 27px; margin-top: 46px;
  letter-spacing: -.025em; scroll-margin-top: 90px;
}
.prose h3 { font-family: var(--font-ui); font-size: 21px; margin-top: 36px; }
.prose p strong { font-weight: 650; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-decoration-color: var(--purple-300); }
.prose a:hover { text-decoration-color: var(--brand); background: var(--bg-alt); }
.prose ul, .prose ol { padding-left: 4px; display: flex; flex-direction: column; gap: 12px; }
.prose ul li { position: relative; padding-left: 26px; }
.prose ul li::before {
  content: ""; position: absolute; left: 4px; top: 12px;
  width: 8px; height: 8px; border-radius: 2px;
  background: linear-gradient(135deg, var(--purple-500), var(--red-500));
}
.prose ol { counter-reset: madde; }
.prose ol li { position: relative; padding-left: 34px; counter-increment: madde; }
.prose ol li::before {
  content: counter(madde); position: absolute; left: 0; top: 4px;
  width: 23px; height: 23px; border-radius: 50%;
  background: var(--purple-100); color: var(--purple-700);
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 750;
  display: grid; place-items: center;
}
[data-theme="dark"] .prose ol li::before { background: color-mix(in srgb, var(--purple-500) 25%, transparent); color: var(--purple-300); }

.prose blockquote {
  margin: 34px 0; padding: 24px 28px;
  background: var(--bg-alt); border-left: 4px solid var(--purple-500);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 20px; line-height: 1.6; font-style: italic; color: var(--text);
}
.prose blockquote cite {
  display: block; margin-top: 12px; font-family: var(--font-ui);
  font-size: 14px; font-style: normal; font-weight: 650; color: var(--text-faint);
}

.info-box {
  font-family: var(--font-ui); font-size: 15.5px; line-height: 1.68;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 22px 24px; margin: 34px 0;
  position: relative; box-shadow: var(--shadow-sm);
}
.info-box::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: var(--r-md) 0 0 var(--r-md);
  background: linear-gradient(180deg, var(--purple-500), var(--red-500));
}
.info-box h4 { font-size: 15px; margin-bottom: 9px; display: flex; align-items: center; gap: 9px; }
.info-box h4 .badge { text-transform: none; }

.references { font-family: var(--font-ui); font-size: 14px; }
.references ol { counter-reset: kaynak; gap: 10px; }
.references li { padding-left: 30px; }
.references li::before { top: 2px; }
.references a { word-break: break-word; }

.share-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 22px 0; margin-top: 40px; border-top: 1px solid var(--line);
}
.share-bar span { font-size: 13.5px; font-weight: 650; color: var(--text-faint); margin-right: 4px; }

.author-box {
  display: flex; gap: 18px; padding: 24px;
  background: var(--bg-alt); border-radius: var(--r-lg);
  margin: 28px 0; align-items: flex-start;
}
.author-box p { font-size: 14.5px; color: var(--text-soft); margin-top: 7px; }
.author-box h4 { font-size: 16.5px; }

/* Table of contents */
.toc ol { counter-reset: ic; display: flex; flex-direction: column; gap: 3px; }
.toc a {
  display: block; padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 13.8px; font-weight: 550; color: var(--text-soft);
  border-left: 2px solid var(--line); transition: all var(--ease);
}
.toc a:hover { color: var(--brand); background: var(--bg-alt); border-left-color: var(--purple-400); }
.toc a.active { color: var(--brand); border-left-color: var(--accent); background: var(--bg-alt); font-weight: 650; }

/* 19. SEARCH OVERLAY ------------------------------------------------------ */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in srgb, var(--gray-900) 55%, transparent);
  backdrop-filter: blur(6px);
  display: grid; place-items: start center; padding: 12vh 20px 20px;
  opacity: 0; visibility: hidden; transition: opacity var(--ease), visibility var(--ease);
}
.search-overlay[data-open="true"] { opacity: 1; visibility: visible; }
.search-box {
  width: 100%; max-width: 620px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 18px;
  transform: translateY(-14px); transition: transform var(--ease);
}
.search-overlay[data-open="true"] .search-box { transform: translateY(0); }
.search-field { display: flex; align-items: center; gap: 12px; padding: 4px 6px 14px; border-bottom: 1px solid var(--line); }
.search-field input { flex: 1; border: 0; background: transparent; font-size: 17px; }
.search-field input:focus { outline: none; }
.search-field kbd {
  font-family: var(--font-ui); font-size: 11px; font-weight: 650;
  padding: 3px 7px; border-radius: 6px;
  background: var(--bg-alt); border: 1px solid var(--line); color: var(--text-faint);
}
.search-suggestions { padding-top: 14px; }
.search-suggestions p { font-size: 11.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.search-suggestions ul { display: flex; flex-direction: column; gap: 2px; }
.search-suggestions a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: var(--r-sm); font-size: 14.5px; font-weight: 550;
}
.search-suggestions a:hover { background: var(--bg-alt); color: var(--brand); }

/* 20. MOBILE MENU --------------------------------------------------------- */
/* A full-screen panel that opens over the header too. It carries its own top
   row (logo + close) so it doesn't depend on the announcement bar's height. */
.mobile-menu {
  position: fixed; inset: 0; z-index: 150;
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 55% at 100% 0%, color-mix(in srgb, var(--purple-500) 16%, transparent), transparent 62%),
    radial-gradient(90% 45% at 0% 100%, color-mix(in srgb, var(--red-500) 10%, transparent), transparent 60%),
    var(--bg);
  opacity: 0; visibility: hidden; transform: translateY(-10px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  overscroll-behavior: contain;
}
/* A faint dot grid fading out from the top corner, as on the page headers. */
.mobile-menu::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--purple-500) 24%, transparent) 1px, transparent 1.3px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(75% 40% at 100% 0%, #000 10%, transparent 75%);
          mask-image: radial-gradient(75% 40% at 100% 0%, #000 10%, transparent 75%);
}
.mobile-menu[data-open="true"] { opacity: 1; visibility: visible; transform: none; }
@media (min-width: 901px) { .mobile-menu { display: none; } }

.mobile-menu__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--header-h); padding-inline: 20px; flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.mobile-menu__body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 18px;
  padding: 18px 20px 20px;
}

.mobile-search {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-faint); font-size: 14.5px; text-align: left; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease);
}
.mobile-search:hover { border-color: var(--purple-300); }
.mobile-search svg { flex-shrink: 0; color: var(--brand); }
.mobile-search span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mobile-menu__list { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu__list a {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 12px 9px 9px; border-radius: var(--r-md);
  font-size: 17px; font-weight: 650; letter-spacing: -.01em; color: var(--text);
  transition: background var(--ease), color var(--ease), transform .15s ease;
}
.mobile-menu__list a:hover { background: var(--bg-alt); }
.mobile-menu__icon {
  width: 42px; height: 42px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 12px;
  background: var(--bg-alt); color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--purple-500) 16%, transparent);
  transition: background var(--ease), color var(--ease);
}
.mobile-menu__text { flex: 1; min-width: 0; }
.mobile-menu__chevron { flex-shrink: 0; color: var(--text-faint); opacity: .6; transition: transform var(--ease), opacity var(--ease); }
.mobile-menu__list a:hover .mobile-menu__chevron { transform: translateX(3px); opacity: 1; }

.mobile-menu__list a.active { background: var(--bg-alt); color: var(--brand); }
.mobile-menu__list a.active .mobile-menu__icon {
  background: linear-gradient(135deg, var(--purple-600), var(--red-500));
  border-color: transparent; color: #fff; box-shadow: var(--shadow-purple);
}
.mobile-menu__list a.active .mobile-menu__chevron { color: var(--brand); opacity: 1; }

.mobile-menu__list a:active { transform: scale(.98); }

/* Opening sequence: search, then the items one by one (each icon pops in),
   then the preferences box and the footer. The close icon turns into place. */
.mobile-menu[data-open="true"] .mobile-search {
  animation: menu-rise .36s cubic-bezier(.2, .7, .2, 1) .04s both;
}
.mobile-menu[data-open="true"] .mobile-menu__list li {
  animation: menu-item-in .38s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--index, 0) * 45ms + 80ms);
}
.mobile-menu[data-open="true"] .mobile-menu__icon {
  animation: menu-icon-pop .5s cubic-bezier(.3, 1.5, .5, 1) both;
  animation-delay: calc(var(--index, 0) * 45ms + 140ms);
}
.mobile-menu[data-open="true"] .mobile-menu__box {
  animation: menu-rise .45s cubic-bezier(.2, .7, .2, 1) .32s both;
}
.mobile-menu[data-open="true"] .mobile-menu__footer {
  animation: menu-rise .45s cubic-bezier(.2, .7, .2, 1) .38s both;
}
.mobile-menu[data-open="true"] .mobile-menu__close svg {
  animation: menu-close-in .45s cubic-bezier(.2, .7, .2, 1) .06s both;
}
@keyframes menu-item-in {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: none; }
}
@keyframes menu-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes menu-icon-pop {
  from { transform: scale(.55); }
  to { transform: none; }
}
@keyframes menu-close-in {
  from { opacity: 0; transform: rotate(-90deg) scale(.6); }
  to { opacity: 1; transform: none; }
}

.mobile-menu__box {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line);
}
.mobile-menu__label {
  font-size: 11.5px; font-weight: 750; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-faint);
}
.mobile-menu__label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mobile-menu__current { font-size: 13px; font-weight: 650; color: var(--brand); }

/* Language switcher: one segmented track. The gradient pill behind the active
   language is placed from --active and slides in when the menu opens. */
.mobile-langs {
  position: relative;
  display: grid; grid-template-columns: repeat(var(--count, 5), minmax(0, 1fr));
  padding: 4px; border-radius: var(--r-full);
  background: var(--bg-alt); border: 1px solid var(--line);
}
.mobile-langs::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 8px) / var(--count, 5));
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--purple-600), var(--red-500));
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--purple-600) 75%, transparent);
  transform: translateX(calc(var(--active, 0) * 100%));
}
.mobile-menu[data-open="true"] .mobile-langs::before {
  animation: lang-pill-in .7s cubic-bezier(.3, .9, .3, 1) .42s both;
}
@keyframes lang-pill-in {
  from { opacity: 0; transform: translateX(0) scale(.7); }
  25% { opacity: 1; }
}
.mobile-langs a {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 0; height: 40px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 750; letter-spacing: .03em; color: var(--text-soft);
  transition: color .3s ease, transform .15s ease;
}
.mobile-langs a:hover { color: var(--brand); }
.mobile-langs a:active { transform: scale(.92); }
.mobile-langs a.active { color: #fff; }
/* The label turns white only once the pill has slid under it. */
.mobile-menu[data-open="true"] .mobile-langs a.active {
  animation: lang-label-in .7s ease .42s both;
}
@keyframes lang-label-in {
  from, 55% { color: var(--text-soft); }
  to { color: #fff; }
}
.mobile-langs__flag { font-size: 15px; line-height: 1; }
@media (max-width: 350px) { .mobile-langs__flag { display: none; } }

.mobile-menu__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 15px; font-weight: 650;
}
.theme-switch {
  position: relative; flex-shrink: 0;
  width: 52px; height: 30px; padding: 0;
  border-radius: var(--r-full); border: 1px solid var(--line-2);
  background: var(--gray-200); cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
}
.theme-switch__knob {
  position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--purple-600); box-shadow: var(--shadow-sm);
  transition: transform var(--ease);
}
.theme-switch__moon { display: none; }
[data-theme="dark"] .theme-switch { background: var(--purple-600); border-color: var(--purple-500); }
[data-theme="dark"] .theme-switch__knob { transform: translateX(22px); }
[data-theme="dark"] .theme-switch__moon { display: block; }
[data-theme="dark"] .theme-switch__sun { display: none; }

.mobile-menu__footer {
  flex-shrink: 0;
  padding: 14px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
}

/* Short phones (iPhone SE and the like): tighter spacing so the whole panel,
   preferences included, fits above the footer without scrolling. */
@media (max-height: 760px) {
  .mobile-menu__body { gap: 12px; padding-top: 12px; }
  .mobile-search { padding: 10px 14px; }
  .mobile-menu__list { gap: 2px; }
  .mobile-menu__list a { padding-block: 6px; font-size: 16px; }
  .mobile-menu__icon { width: 36px; height: 36px; border-radius: 10px; }
  .mobile-menu__box { padding: 12px 14px; gap: 10px; }
  .mobile-langs a { height: 36px; }
  .mobile-menu__row { padding-top: 10px; }
  .mobile-menu__footer { padding-top: 10px; }
  .mobile-menu__footer .mobile-login { margin-top: 6px; }
}

/* 21. CATEGORY PAGE ------------------------------------------------------- */
.category-hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: 46px 40px;
  background: linear-gradient(130deg, var(--purple-800), var(--purple-600) 60%, var(--red-600) 140%);
  color: #fff; margin: 26px 0 34px;
}
.category-hero::after {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 80px rgba(255, 255, 255, .1);
}
.category-hero h1 { font-size: clamp(28px, 4vw, 42px); margin: 14px 0 12px; }
.category-hero p { max-width: 620px; color: rgba(255, 255, 255, .85); font-size: 16px; }
.category-hero__stats { display: flex; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.category-hero__stats div strong { display: block; font-size: 24px; font-weight: 800; }
.category-hero__stats div span { font-size: 12.5px; color: rgba(255, 255, 255, .7); }

/* Page header with an image. The text sits on the left in white, so a shade
   that fades from left to right is laid over the image; contrast holds at every
   width. The view passes the image in `--hero-image`. */
.category-hero--image {
  background-image:
    linear-gradient(100deg,
      var(--purple-900) 0%,
      color-mix(in srgb, var(--purple-900) 82%, transparent) 30%,
      color-mix(in srgb, var(--purple-900) 30%, transparent) 55%,
      transparent 78%),
    var(--hero-image);
  background-size: cover, cover;
  background-position: center, center right;
  background-repeat: no-repeat;
  min-height: 232px;
  display: flex; flex-direction: column; justify-content: center;
}
/* The decorative ring clashes with the image. */
.category-hero--image::after { display: none; }

@media (max-width: 720px) {
  /* On narrow screens the image sits behind the text; the shade covers the whole surface. */
  .category-hero--image {
    background-image:
      linear-gradient(160deg,
        var(--purple-900) 0%,
        color-mix(in srgb, var(--purple-900) 80%, transparent) 55%,
        color-mix(in srgb, var(--purple-900) 55%, transparent) 100%),
      var(--hero-image);
    min-height: 0;
  }
}

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.sort-select { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-faint); }
.sort-select select {
  padding: 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
}

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 44px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; padding-inline: 12px;
  display: grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid var(--line); font-size: 14px; font-weight: 650;
  color: var(--text-soft); transition: all var(--ease);
}
.pagination a:hover { border-color: var(--purple-400); color: var(--brand); }
.pagination .active { background: var(--purple-600); border-color: transparent; color: #fff; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty-state strong { display: block; font-size: 18px; color: var(--text); margin-bottom: 6px; }

/* 22. MOTION -------------------------------------------------------------- */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.fade-in { animation: fade-in .5s cubic-bezier(.22, 1, .36, 1) both; }
.reveal { opacity: 0; }
.reveal.visible { animation: fade-in .55s cubic-bezier(.22, 1, .36, 1) both; }

/* 23. RESPONSIVE LAYOUT --------------------------------------------------- */
@media (max-width: 1080px) {
  .content-layout { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .article-header__inner { max-width: none; }
  .sidebar { position: static; }
  .grid--4 { grid-template-columns: repeat(3, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .menu-btn {
    display: grid; color: var(--brand);
    background: var(--bg-alt); border-color: color-mix(in srgb, var(--purple-500) 22%, transparent);
  }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .featured { min-height: 380px; padding: 26px; }
  .hero-side { grid-template-rows: none; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .newsletter { padding: 40px 26px; }
}

@media (max-width: 720px) {
  :root { --header-h: 60px; }
  .grid--3, .grid--4, .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .card--horizontal { flex-direction: column; }
  .card--horizontal .cover { width: 100%; aspect-ratio: 16 / 9; }
  .hero-side .card--horizontal .cover { width: 100%; }
  .hero-side .card__body { padding: 0 14px 15px; }
  .section { padding: 40px 0; }
  .prose { font-size: 17.5px; }
  .prose h2 { font-size: 23px; }
  .article-figure .cover { aspect-ratio: 16 / 10; }
  .footer__grid { grid-template-columns: minmax(0, 1fr); }
  .category-hero { padding: 32px 22px; }
  .byline__actions { margin-left: 0; width: 100%; }
  .logo__wordmark { font-size: 19px; }
  .header-cta { display: none; }
  /* On phones the language and theme controls live in the menu panel. */
  .header-actions .lang-switcher,
  .header-actions [data-theme-toggle] { display: none; }
  .site-header__inner { gap: 12px; justify-content: space-between; }
}

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

@media print {
  .site-header, .announcement-bar, .footer, .sidebar, .share-bar, .reading-progress { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { font-size: 12pt; }
}

/* 24. LANGUAGE SWITCHER --------------------------------------------------- */
.lang-switcher { position: relative; }
.lang-switcher > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 13px; font-weight: 650; color: var(--text-soft);
  transition: all var(--ease);
}
.lang-switcher > summary::-webkit-details-marker { display: none; }
.lang-switcher > summary:hover { color: var(--brand); border-color: var(--purple-300); background: var(--bg-alt); }
.lang-switcher[open] > summary { color: var(--brand); border-color: var(--purple-400); background: var(--bg-alt); }
.lang-switcher__code { letter-spacing: .04em; }
.lang-switcher > summary svg { transition: transform var(--ease); opacity: .7; }
.lang-switcher[open] > summary svg { transform: rotate(180deg); }

.lang-switcher ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 178px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  animation: fade-in .16s ease both;
}
.lang-switcher ul a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 550; color: var(--text-soft);
}
.lang-switcher ul a:hover { background: var(--bg-alt); color: var(--brand); }
.lang-switcher ul a.active { color: var(--brand); font-weight: 700; background: var(--bg-alt); }
.lang-switcher ul a.active::after {
  content: "✓"; margin-left: auto; font-size: 12px;
}


@media (max-width: 720px) {
  .lang-switcher > summary { padding: 0 9px; }
  .lang-switcher__code { display: none; }
}

/* 25. COVER ART ----------------------------------------------------------- */
.cover__art {
  position: absolute; inset: 11%; z-index: 1;
  width: 78%; height: 78%;
  object-fit: contain;
  opacity: .96;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .28));
}

/* On the cover story the text sits left; the art moves right and into the background. */
.featured .cover__art {
  inset: 5% 4% auto auto;
  width: 52%; height: 60%;
  opacity: .72;
}

/* The wide image in the article header can hold a slightly larger drawing. */
.article-figure .cover__art { inset: 8%; width: 84%; height: 84%; }

/* Photo covers (an engraving, a photograph) fill the frame instead of floating
   as a line drawing; the dot grid and ring overlays are dropped. */
.cover--photo::before,
.cover--photo::after { display: none; }
.cover--photo .cover__art,
.featured .cover--photo .cover__art,
.article-figure .cover--photo .cover__art {
  inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 1; filter: none;
}
/* On the cover story the text sits on top, so the image stays in the background. */
.featured .cover--photo .cover__art { opacity: .6; }
/* In the article header an image is shown whole, at its own proportions,
   rather than cropped to the wide frame used for the drawings. */
.article-figure .cover--photo { aspect-ratio: auto; }
.article-figure .cover--photo .cover__art { position: relative; inset: auto; display: block; height: auto; }

@media (max-width: 900px) {
  .featured .cover__art { opacity: .28; width: 60%; }
}

/* 26. ABOUT & TEAM -------------------------------------------------------- */
.about-heading {
  font-size: clamp(21px, 2.4vw, 26px);
  margin-bottom: 14px; letter-spacing: -.01em;
}
.about-text {
  font-family: var(--font-text); font-size: 16.5px; line-height: 1.75;
  color: var(--text-soft); margin-bottom: 14px;
}
.about-text:last-child { margin-bottom: 0; }

/* Principle cards: a panel with a little more breathing room. */
.principle-card { padding: 26px 24px; }
.principle-card h3 { font-size: 17.5px; margin-bottom: 9px; }
.principle-card p { font-size: 14.8px; line-height: 1.68; color: var(--text-soft); }

/* Team card */
.team-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.team-card:hover {
  border-color: var(--purple-400); box-shadow: var(--shadow-md); transform: translateY(-2px);
}
.team-card__head { display: flex; align-items: center; gap: 14px; }
.team-card__name { font-size: 16.5px; line-height: 1.3; }
.team-card__title {
  font-size: 13px; font-weight: 650; margin-top: 4px;
  color: var(--brand); letter-spacing: .01em;
}
.team-card__bio {
  font-size: 14.5px; line-height: 1.66; color: var(--text-soft);
  flex: 1; margin: 0;
}
.team-card__social { display: flex; gap: 8px; }
.team-card__social a {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--text-faint); transition: all var(--ease);
}
.team-card__social a:hover {
  color: #fff; background: var(--purple-600); border-color: transparent;
}

/* Call to join on the team page */
.team-join { padding: 34px 32px; }
.team-join h2 {
  font-size: clamp(21px, 2.6vw, 27px); margin: 14px 0 10px;
  position: relative; z-index: 1;
}
.team-join p {
  max-width: 620px; color: rgba(255, 255, 255, .85);
  font-size: 15.5px; line-height: 1.7; position: relative; z-index: 1;
}
.team-join .btn { margin-top: 20px; position: relative; z-index: 1; }

@media (max-width: 560px) {
  .team-card { padding: 18px; }
  .team-join { padding: 26px 22px; }
}

/* Portrait on the team card; without a photo the .avatar initials remain. */
.team-card__photo {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 50%; object-fit: cover;
  background: var(--bg-alt);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

/* 27. VIDEO --------------------------------------------------------------- */
/* The player keeps a 16:9 ratio; the iframe fills its box. */
.video-frame {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--gray-900); box-shadow: var(--shadow-md);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame--wide { border-radius: var(--r-xl); margin-bottom: 26px; }

.video-featured {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 26px; align-items: center;
}
.video-featured__inner h2 { font-size: clamp(21px, 2.6vw, 30px); margin: 12px 0 10px; }
.video-featured__inner h2 a { color: inherit; }
.video-featured__inner h2 a:hover { color: var(--brand); }
.video-featured__inner p { color: var(--text-soft); font-size: 15.5px; line-height: 1.7; }
.video-featured__inner .meta { margin-top: 16px; }

.video-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.video-card:hover { border-color: var(--purple-400); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.video-card__thumb {
  position: relative; display: block; aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  overflow: hidden;
}
.video-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card__play {
  position: absolute; inset: 0; margin: auto;
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50%; color: #fff;
  background: color-mix(in srgb, var(--gray-900) 55%, transparent);
  backdrop-filter: blur(3px);
  transition: transform var(--ease), background var(--ease);
}
.video-card:hover .video-card__play { transform: scale(1.08); background: var(--purple-600); }
.video-card__duration {
  position: absolute; right: 9px; bottom: 9px;
  padding: 2px 7px; border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--gray-900) 72%, transparent);
  color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}

.video-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.video-card__body h3 { font-size: 16.5px; line-height: 1.38; }
.video-card__body h3 a { color: inherit; }
.video-card__body h3 a:hover { color: var(--brand); }
.video-card__body p { font-size: 14px; color: var(--text-soft); line-height: 1.6; flex: 1; }

.video-head { margin-bottom: 24px; }
.video-head h1 { font-size: clamp(25px, 3.4vw, 36px); margin: 12px 0 14px; }

@media (max-width: 860px) {
  .video-featured { grid-template-columns: 1fr; }
}

/* 28. PUBLIC FORMS -------------------------------------------------------- */
.form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 32px; box-shadow: var(--shadow-sm);
}
.form-card > h2 { font-size: 22px; margin-bottom: 20px; }

.form-stack { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13.5px; font-weight: 650; color: var(--text); }
.form-field .required { color: var(--accent); }
.form-field input,
.form-field textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 14.5px; line-height: 1.6;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.form-field textarea { resize: vertical; min-height: 84px; }
.form-field input:focus,
.form-field textarea:focus {
  outline: none; border-color: var(--purple-400);
  box-shadow: 0 0 0 3px var(--ring);
}
.form-field--invalid input,
.form-field--invalid textarea { border-color: var(--red-500); }
.form-field__error { font-size: 13px; color: var(--red-600); }
.form-hint { font-size: 13px; color: var(--text-faint); line-height: 1.55; }

.form-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; padding-top: 6px;
  border-top: 1px solid var(--line); padding-top: 18px;
}

.form-success, .form-error {
  padding: 13px 16px; border-radius: var(--r-md);
  font-size: 14.5px; font-weight: 550; margin-bottom: 18px; border: 1px solid;
}
.form-success {
  background: color-mix(in srgb, #16a34a 12%, var(--surface));
  border-color: color-mix(in srgb, #16a34a 35%, transparent); color: #14663a;
}
.form-error {
  background: var(--red-50);
  border-color: color-mix(in srgb, var(--red-500) 35%, transparent); color: var(--red-700);
}
[data-theme="dark"] .form-success { color: #86efac; }
[data-theme="dark"] .form-error { background: color-mix(in srgb, var(--red-500) 14%, var(--surface)); color: var(--red-400); }

/* The honeypot field is invisible to every user. */
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 560px) {
  .form-card { padding: 22px 18px; }
  .form-row { grid-template-columns: 1fr; }
  .form-footer { flex-direction: column; align-items: stretch; }
}

/* 29. PAGE HEADER (hero) -------------------------------------------------- */
.page-header {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: 44px 40px;
  background: linear-gradient(130deg, var(--purple-800), var(--purple-600) 60%, var(--red-600) 140%);
  color: #fff; margin: 26px 0 34px;
}
/* Decorative ring — only on headers without an image. */
.page-header:not(.page-header--image)::after {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 80px rgba(255, 255, 255, .1);
}
.page-header__inner { position: relative; z-index: 1; max-width: 640px; }

.page-header__breadcrumb { color: rgba(255, 255, 255, .75); margin-bottom: 14px; }
.page-header__breadcrumb a { color: inherit; }
.page-header__breadcrumb a:hover { color: #fff; }

.page-header__top { display: flex; align-items: center; gap: 16px; }
.page-header__icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 54px; height: 54px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(4px);
}
.page-header h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.08; letter-spacing: -.02em; }

.page-header__description {
  margin-top: 14px; max-width: 560px;
  color: rgba(255, 255, 255, .86); font-size: 16px; line-height: 1.62;
}

/* Category chips */
.page-header__chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.page-header__chips a,
.page-header__chips span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .09);
  color: #fff; font-size: 13.8px; font-weight: 600;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
}
.page-header__chips a:hover {
  background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .5);
  transform: translateY(-1px);
}
.page-header__chips svg { opacity: .85; }
.page-header__chips .chip-more { color: rgba(255, 255, 255, .78); font-weight: 500; }

/* Number pairs (team page) */
.page-header__stats { display: flex; gap: 28px; margin-top: 24px; flex-wrap: wrap; }
.page-header__stats div strong { display: block; font-size: 24px; font-weight: 800; }
.page-header__stats div span { font-size: 12.5px; color: rgba(255, 255, 255, .7); }

/* Bottom strip */
.page-header__strip {
  margin-top: 26px; font-size: 12.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255, 255, 255, .58);
}

/* Image variant: a shade opening from the left sits behind the text. */
.page-header--image {
  background-image:
    linear-gradient(100deg,
      var(--purple-900) 0%,
      color-mix(in srgb, var(--purple-900) 82%, transparent) 32%,
      color-mix(in srgb, var(--purple-900) 30%, transparent) 58%,
      transparent 80%),
    var(--hero-image);
  background-size: cover, cover;
  background-position: center, center right;
  background-repeat: no-repeat;
  min-height: 268px;
  display: flex; flex-direction: column; justify-content: center;
}

@media (max-width: 860px) {
  .page-header { padding: 32px 26px; }
  .page-header__icon { width: 46px; height: 46px; }
  .page-header--image {
    background-image:
      linear-gradient(160deg,
        var(--purple-900) 0%,
        color-mix(in srgb, var(--purple-900) 80%, transparent) 55%,
        color-mix(in srgb, var(--purple-900) 55%, transparent) 100%),
      var(--hero-image);
    min-height: 0;
  }
}
@media (max-width: 560px) {
  .page-header__top { gap: 12px; }
  .page-header__strip { letter-spacing: .1em; font-size: 11.5px; }
}

/* Author portrait. Same size as the initials badge (.avatar), so authors
   with and without a photo line up. */
.author-photo {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%; object-fit: cover;
  background: var(--bg-alt);
  box-shadow: 0 0 0 1px var(--line);
}
.author-photo--lg {
  width: 52px; height: 52px;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
/* On dark backgrounds such as the cover story and video cover, the edge is light. */
.featured .author-photo,
.video-featured .author-photo { box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }

/* The goal sentence under the numbers strip. The numbers describe today and
   this line says where we are heading, so it gets its own tone. */
.stat-goal {
  margin-top: 20px; text-align: center;
  font-size: 14.5px; line-height: 1.65;
  color: var(--text-faint); max-width: 640px;
  margin-left: auto; margin-right: auto;
}

/* Action buttons on the support page */
.support-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  justify-content: center; margin-top: 30px;
}

/* Admin login link in the header — kept plain since readers don't need it. */
.header-login {
  font-size: 13.5px; font-weight: 600; color: var(--text-faint);
  padding: 6px 4px; transition: color var(--ease);
}
.header-login:hover { color: var(--brand); }
.mobile-login {
  display: block; text-align: center; margin-top: 10px;
  font-size: 14px; font-weight: 600; color: var(--text-faint);
}
@media (max-width: 900px) { .header-login { display: none; } }

/* 30. HIGHLIGHTED MENU ITEM ----------------------------------------------- */
/* "About" stands apart in the menu; its text is painted with a purple-to-red
   gradient. Because the gradient is clipped to the text, this item uses an
   underline that grows in on :hover instead of the background pill. */
.main-nav a.accent,
.main-nav a.accent:hover,
.main-nav a.accent.active {
  font-weight: 700;
  letter-spacing: -.1px;
  background-image: linear-gradient(96deg, var(--purple-600) 0%, var(--purple-500) 42%, var(--red-500) 100%);
  background-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.main-nav a.accent:hover,
.main-nav a.accent.active {
  background-image: linear-gradient(96deg, var(--purple-700) 0%, var(--purple-600) 38%, var(--red-600) 100%);
}

/* The gradient underline: short and transparent at rest, full width when active. */
.main-nav a.accent::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px;
  height: 2.5px; border-radius: 2px;
  background: linear-gradient(90deg, var(--purple-500), var(--red-500));
  opacity: 0; transform: scaleX(.55);
  transition: opacity var(--ease), transform var(--ease);
}
.main-nav a.accent:hover::after,
.main-nav a.accent.active::after { opacity: 1; transform: none; }

[data-theme="dark"] .main-nav a.accent,
[data-theme="dark"] .main-nav a.accent:hover,
[data-theme="dark"] .main-nav a.accent.active {
  background-image: linear-gradient(96deg, var(--purple-300) 0%, var(--purple-400) 42%, var(--red-400) 100%);
}

/* In the mobile menu the gradient only applies to the text; the icon box
   stands out with a purple-red tint. */
.mobile-menu a.accent .mobile-menu__text {
  font-weight: 750;
  background-image: linear-gradient(96deg, var(--purple-600) 0%, var(--purple-500) 42%, var(--red-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.mobile-menu a.accent:not(.active) .mobile-menu__icon {
  color: var(--accent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--purple-500) 12%, transparent), color-mix(in srgb, var(--red-500) 14%, transparent));
  border-color: color-mix(in srgb, var(--red-500) 22%, transparent);
}
[data-theme="dark"] .mobile-menu a.accent .mobile-menu__text {
  background-image: linear-gradient(96deg, var(--purple-300) 0%, var(--purple-400) 42%, var(--red-400) 100%);
}

/* Browsers without gradient text show the brand colour instead. */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .main-nav a.accent,
  .mobile-menu a.accent .mobile-menu__text { color: var(--brand); -webkit-text-fill-color: currentColor; }
}

/* 31. MULTI-AUTHOR BYLINE ------------------------------------------------- */
/* On co-authored articles the portraits overlap into one group; each is
   separated from its neighbour by a ring in the background colour. */
.author-stack { display: inline-flex; align-items: center; flex-shrink: 0; }
.author-stack > * { box-shadow: 0 0 0 2px var(--surface); }
.author-stack > * + * { margin-left: -9px; }
.author-stack--lg > * + * { margin-left: -14px; }
.author-stack__names { font-weight: 700; }

/* On dark cards the ring takes the card's own background. */
.featured .author-stack > *,
.video-featured .author-stack > * { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }

/* 32. TABLES IN ARTICLES -------------------------------------------------- */
/* Comparison table. On narrow screens it scrolls itself, not the page. */
.prose .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose table {
  width: 100%; min-width: 420px; border-collapse: collapse;
  font-family: var(--font-ui); font-size: 15.5px;
}
.prose th, .prose td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-faint); border-bottom: 2px solid var(--line-2);
}
/* Number columns align right with tabular figures. */
.prose th:not(:first-child), .prose td:not(:first-child) {
  text-align: right; font-variant-numeric: tabular-nums;
}
.prose tbody tr:last-child td { border-bottom: none; }
.prose tbody tr.highlight td { font-weight: 700; color: var(--brand); }
/* Tables with text columns align left. */
.prose table.text-table th, .prose table.text-table td { text-align: left; font-variant-numeric: normal; vertical-align: top; }

/* 33. AUTHOR PAGE & AUTHOR LINKS ------------------------------------------ */
/* Portrait in the header; without a photo the initials sit on a gradient. */
.page-header__photo {
  width: 88px; height: 88px; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-500), var(--red-500));
  border: 3px solid rgba(255, 255, 255, .85);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5);
  font-size: 30px; font-weight: 800; color: #fff;
}
.page-header__photo img { width: 100%; height: 100%; object-fit: cover; }
.page-header__subtitle {
  display: inline-block; margin-top: 9px; padding: 4px 12px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .24);
  font-size: 13px; font-weight: 650; color: #fff;
}
@media (max-width: 560px) {
  .page-header__photo { width: 68px; height: 68px; font-size: 24px; }
}

/* Profile variant: portrait centred above the name, kept compact so the
   header still fits on one screen with the articles starting below it.
   Background: soft glows over the brand gradient, a faint dot grid and an
   arc that frames the portrait. */
.page-header--profile {
  text-align: center;
  padding: 26px 32px 28px;
  background:
    radial-gradient(55% 70% at 50% 0%, rgba(255, 255, 255, .16), transparent 70%),
    radial-gradient(55% 90% at -8% 115%, color-mix(in srgb, var(--red-500) 42%, transparent), transparent 70%),
    radial-gradient(45% 75% at 100% 85%, color-mix(in srgb, var(--purple-400) 55%, transparent), transparent 70%),
    linear-gradient(165deg, var(--purple-900) 0%, var(--purple-700) 55%, var(--purple-800) 100%);
}
.page-header--profile::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(55% 80% at 50% 30%, #000 20%, transparent 75%);
          mask-image: radial-gradient(55% 80% at 50% 30%, #000 20%, transparent 75%);
}
.page-header--profile:not(.page-header--image)::after {
  /* The arc closes just under the portrait, framing it without crossing the name. */
  left: 50%; right: auto; top: -410px;
  width: 560px; height: 560px; transform: translateX(-50%);
  border-color: rgba(255, 255, 255, .13);
  box-shadow: inset 0 -30px 100px rgba(255, 255, 255, .07);
}
.page-header--profile .page-header__inner { max-width: 760px; margin: 0 auto; }
.page-header--profile .page-header__breadcrumb { justify-content: center; margin-bottom: 14px; }
.page-header--profile .page-header__top { flex-direction: column; gap: 10px; }
.page-header--profile .page-header__photo {
  width: 88px; height: 88px; font-size: 30px;
  border: 3px solid #fff;
  /* Two faint halo rings and a soft drop shadow. */
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, .12),
    0 0 0 12px rgba(255, 255, 255, .05),
    0 18px 40px -16px rgba(0, 0, 0, .6);
}
.page-header--profile h1 { font-size: clamp(26px, 3vw, 36px); }
.page-header--profile .page-header__subtitle { margin-top: 7px; }
.page-header--profile .page-header__description {
  max-width: 700px; margin: 10px auto 0; font-size: 15px; line-height: 1.55;
}
.page-header--profile .page-header__stats { justify-content: center; gap: 0; margin-top: 14px; }
.page-header--profile .page-header__stats div { padding: 0 20px; }
.page-header--profile .page-header__stats div strong { font-size: 20px; line-height: 1.2; }
.page-header--profile .page-header__stats div + div { border-left: 1px solid rgba(255, 255, 255, .2); }
@media (max-width: 560px) {
  .page-header--profile { padding: 22px 18px 24px; }
  .page-header--profile .page-header__breadcrumb { margin-bottom: 12px; }
  .page-header--profile .page-header__photo { width: 76px; height: 76px; font-size: 26px; }
  .page-header--profile .page-header__description { font-size: 14.5px; }
  .page-header--profile:not(.page-header--image)::after { width: 420px; height: 420px; top: -295px; }
}

/* Author names link to their page. They sit above the link that covers the
   whole card, so clicking a name opens the author, not the article. */
.author-link {
  text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 3px; text-decoration-thickness: 1.5px;
  transition: color var(--ease), text-decoration-color var(--ease);
}
.author-link:hover { color: var(--brand); text-decoration-color: currentColor; }
.card .author-link { position: relative; z-index: 2; }
.featured .author-link:hover,
.video-featured .author-link:hover { color: #fff; }
.author-box h4 a:hover,
.team-card__name a:hover { color: var(--brand); }

.team-card__articles {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-full);
  background: var(--bg-alt); color: var(--brand);
  font-size: 13.5px; font-weight: 650;
  transition: background var(--ease), gap var(--ease);
}
.team-card__articles:hover { gap: 9px; background: color-mix(in srgb, var(--purple-500) 16%, transparent); }

/* 34. CHINESE ------------------------------------------------------------- */
/* Inter and Newsreader have no CJK glyphs, so system CJK fonts take over for
   Chinese characters. Body text is sans throughout: serif Latin words and
   digits look out of place inside sans Chinese sentences. */
:root:lang(zh) {
  --font-ui: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", system-ui, sans-serif;
  --font-text: var(--font-ui);
}
/* CJK has no italics (browsers slant the glyphs) and no tight tracking. */
:root:lang(zh) :is(h1, h2, h3, h4) { letter-spacing: 0; }
:lang(zh) .prose blockquote { font-style: normal; font-weight: 500; }
:lang(zh) .prose em { font-style: normal; font-weight: 600; }
/* Reference titles are Latin, so they stay italic. */
:lang(zh) .prose .references em { font-style: italic; font-weight: inherit; }
