/* magnanimo.us — "A Sky Full of Kindness". Hand-written CSS, no framework.
   Night-to-dawn palette, Fraunces (display) + Nunito (body), self-hosted. */

@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/fraunces.woff2) format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 400 600; font-display: swap; src: url(/fonts/fraunces-italic.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/nunito.woff2) format("woff2"); }
/* Metric-matched fallbacks keep the swap from shifting layout. */
@font-face { font-family: "Fraunces Fallback"; src: local("Georgia"); size-adjust: 104%; ascent-override: 94%; descent-override: 24%; }
@font-face { font-family: "Nunito Fallback"; src: local("Arial"); size-adjust: 101%; ascent-override: 101%; descent-override: 35%; }

:root {
  /* the sky (identical in both themes) */
  --night-0: #07061a;
  --night-1: #120f38;
  --night-2: #241b62;
  --night-3: #3b2a86;
  --dusk: #7b3f9e;
  --dawn-1: #ff7f7a;
  --dawn-2: #ffb36b;
  --dawn-3: #ffd98a;
  --star: #fff6dc;
  --on-night: #f6f2ff;
  --on-night-2: #d9d2f7;
  --sunrise: linear-gradient(135deg, #ffe08a 0%, #ffb36b 45%, #ff7f7a 100%);

  /* page (daybreak) */
  --bg: #fdf8f3;
  --bg-2: #f5eefb;
  --surface: #ffffff;
  --glass: rgba(255, 255, 255, .78);
  --ink: #1c1740;
  --ink-2: #3d3666;
  --muted: #5b5480;
  --line: #e4daf0;
  --link: #5b2bc4;
  --link-hover: #37138c;
  --accent: #d9512c;
  --accent-2: #7a4be0;
  --num: #4b2bb0;
  --gold-ink: #8a4b00;
  --focus: #1d5fd1;
  --shadow: 0 1px 2px rgba(40, 20, 90, .06), 0 10px 30px rgba(60, 30, 120, .10);
  --glow: 0 0 0 1px rgba(122, 75, 224, .18), 0 12px 40px rgba(122, 75, 224, .18);

  /* data viz — validated categorical order (light on #fff) */
  --s1: #6250d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #2a78d6; --s7: #9c6b3f;
  --viz-track: #ece6f5;

  --radius: 22px;
  --radius-sm: 12px;
  --max: 1180px;
  --measure: 70ch;
  --font-display: "Fraunces", "Fraunces Fallback", Georgia, serif;
  --font-body: "Nunito", "Nunito Fallback", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --dawn: 0;
  --hero-dawn: 0;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0a24; --bg-2: #141137; --surface: #19163f; --glass: rgba(32, 27, 82, .62);
    --ink: #f5f1ff; --ink-2: #d8d1f4; --muted: #b1a9d9; --line: #2f2966;
    --link: #ffc98a; --link-hover: #ffe6c4; --accent: #ff9d7c; --accent-2: #b79bff; --num: #ffd27e; --gold-ink: #ffd27e;
    --focus: #9ec1ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 34px rgba(0, 0, 0, .40);
    --glow: 0 0 0 1px rgba(255, 201, 138, .22), 0 14px 44px rgba(124, 92, 255, .28);
    --s1: #9085e9; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #3987e5; --s7: #a77a52;
    --viz-track: #29245a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0a24; --bg-2: #141137; --surface: #19163f; --glass: rgba(32, 27, 82, .62);
  --ink: #f5f1ff; --ink-2: #d8d1f4; --muted: #b1a9d9; --line: #2f2966;
  --link: #ffc98a; --link-hover: #ffe6c4; --accent: #ff9d7c; --accent-2: #b79bff; --num: #ffd27e; --gold-ink: #ffd27e;
  --focus: #9ec1ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 34px rgba(0, 0, 0, .40);
  --glow: 0 0 0 1px rgba(255, 201, 138, .22), 0 14px 44px rgba(124, 92, 255, .28);
  --s1: #9085e9; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #3987e5; --s7: #a77a52;
  --viz-track: #29245a;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.68;
  overflow-x: hidden;
  position: relative;
}
/* Ambient sky behind everything: faint aurora by day, stars by night; warms with scroll (--dawn). */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; }
body::before {
  background:
    radial-gradient(60vw 40vh at 0% 0%, rgba(160, 120, 255, .10), transparent 70%),
    radial-gradient(50vw 40vh at 100% 30%, rgba(255, 170, 120, .10), transparent 70%);
}
body::after {
  background: radial-gradient(120vw 60vh at 50% 120%, rgba(255, 190, 110, .28), transparent 70%);
  opacity: var(--dawn);
  will-change: opacity;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::before {
    background:
      radial-gradient(1.2px 1.2px at 23px 41px, rgba(255, 246, 220, .7) 50%, transparent 51%),
      radial-gradient(1px 1px at 141px 113px, rgba(255, 246, 220, .5) 50%, transparent 51%),
      radial-gradient(1.4px 1.4px at 197px 19px, rgba(255, 246, 220, .6) 50%, transparent 51%),
      radial-gradient(1px 1px at 77px 181px, rgba(255, 246, 220, .45) 50%, transparent 51%),
      radial-gradient(60vw 40vh at 0% 0%, rgba(124, 92, 255, .16), transparent 70%),
      radial-gradient(50vw 40vh at 100% 40%, rgba(60, 200, 190, .07), transparent 70%);
    background-size: 220px 220px, 220px 220px, 220px 220px, 220px 220px, auto, auto;
  }
}
:root[data-theme="dark"] body::before {
  background:
    radial-gradient(1.2px 1.2px at 23px 41px, rgba(255, 246, 220, .7) 50%, transparent 51%),
    radial-gradient(1px 1px at 141px 113px, rgba(255, 246, 220, .5) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 197px 19px, rgba(255, 246, 220, .6) 50%, transparent 51%),
    radial-gradient(1px 1px at 77px 181px, rgba(255, 246, 220, .45) 50%, transparent 51%),
    radial-gradient(60vw 40vh at 0% 0%, rgba(124, 92, 255, .16), transparent 70%),
    radial-gradient(50vw 40vh at 100% 40%, rgba(60, 200, 190, .07), transparent 70%);
  background-size: 220px 220px, 220px 220px, 220px 220px, 220px 220px, auto, auto;
}

img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--link-hover); text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(255, 201, 120, .55); color: #1c1740; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 10px;
  font-weight: 800; text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--bg); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
@media (max-width: 520px) { .wrap { padding: 0 1rem; } }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  color: var(--ink);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 5.4vw, 3.8rem); margin: .2em 0 .35em; font-weight: 650; }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); margin: 2.2em 0 .6em; }
h3 { font-size: 1.3rem; margin: 1.8em 0 .5em; }
p { margin: 0 0 1.05em; }
strong { font-weight: 800; }
kbd { font-family: var(--font-body); font-size: .72rem; font-weight: 800; padding: .08rem .4rem; border-radius: 6px; border: 1px solid currentColor; opacity: .8; }

/* ---------- Header (part of the night sky) ---------- */
.site-header {
  position: relative; z-index: 20;
  background: var(--night-0);
  color: var(--on-night);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
@media (min-width: 861px) {
  .site-header { position: sticky; top: 0; background: rgba(7, 6, 26, .82); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 66px; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  text-decoration: none; color: var(--on-night);
  font-family: var(--font-display); font-weight: 650; font-size: 1.35rem; letter-spacing: -0.015em;
}
.brand:hover { color: #fff; }
.brand svg { width: 34px; height: 34px; flex: none; color: var(--on-night); }
.brand .dot, .footer-brand .dot { color: var(--dawn-2); }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem; flex-wrap: wrap; }
.site-nav a {
  display: block; padding: .42rem .75rem; border-radius: 999px;
  color: var(--on-night-2); text-decoration: none; font-weight: 700; font-size: .94rem;
}
.site-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.site-nav a[aria-current="page"] { background: rgba(255, 201, 138, .16); color: #ffe0b0; box-shadow: inset 0 0 0 1px rgba(255, 201, 138, .35); }
.header-actions { display: flex; gap: .4rem; align-items: center; }
html:not(.js) .header-actions { display: none; }
.icon-btn {
  display: inline-flex; align-items: center; gap: .45rem; height: 38px; min-width: 38px; justify-content: center;
  padding: 0 .7rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06); color: var(--on-night); font: 700 .9rem var(--font-body); cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.theme-btn { padding: 0; width: 38px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}
@media (max-width: 1060px) { .search-btn .search-label, .search-btn kbd { display: none; } .search-btn { width: 38px; padding: 0; } }
@media (max-width: 860px) {
  .site-header .wrap { padding-top: .55rem; padding-bottom: .15rem; gap: .2rem .6rem; }
  .header-actions { margin-left: auto; }
  .site-nav { order: 3; margin-left: 0; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { flex-wrap: nowrap; padding-bottom: .45rem; }
  .site-nav a { white-space: nowrap; padding: .38rem .7rem; font-size: .92rem; }
}

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem; justify-content: center;
  padding: .82rem 1.4rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--sunrise); color: #1c1740; font: 800 1rem var(--font-body); text-decoration: none;
  box-shadow: 0 6px 22px rgba(255, 140, 90, .32), inset 0 -2px 0 rgba(0, 0, 0, .08);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn:hover { color: #1c1740; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255, 140, 90, .45); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent-2); }
.btn.sm { padding: .55rem 1rem; font-size: .92rem; }
.btn.star { background: linear-gradient(135deg, #fff1b8, #ffd27e 50%, #ffb36b); }
.btn.glow { animation: btnGlow 3.2s ease-in-out infinite; }
@keyframes btnGlow { 50% { box-shadow: 0 6px 34px rgba(255, 190, 110, .7); } }

/* ---------- Night sky surfaces: hero + page heads ---------- */
.sky, .page-head {
  position: relative; isolation: isolate; overflow: hidden;
  color: var(--on-night);
  background:
    radial-gradient(1.3px 1.3px at 31px 47px, rgba(255, 246, 220, .9) 50%, transparent 51%),
    radial-gradient(1px 1px at 163px 91px, rgba(255, 246, 220, .7) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 251px 23px, rgba(255, 246, 220, .85) 50%, transparent 51%),
    radial-gradient(1px 1px at 97px 201px, rgba(255, 246, 220, .6) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 211px 163px, rgba(255, 246, 220, .7) 50%, transparent 51%),
    linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 30%, var(--night-2) 62%, var(--dusk) 86%, #c4607e 100%);
  background-size: 280px 280px, 280px 280px, 280px 280px, 280px 280px, 280px 280px, auto;
}
.sky h1, .sky h2, .page-head h1 { color: #fff; }
.page-head { padding: clamp(2.2rem, 5vw, 3.6rem) 0 clamp(3.2rem, 6vw, 4.6rem); }
.page-head::before {
  content: ""; position: absolute; z-index: -1; left: -10%; right: -10%; bottom: -60%; height: 110%;
  background: radial-gradient(closest-side, rgba(255, 190, 120, .55), rgba(255, 127, 122, .25) 55%, transparent 100%);
}
.page-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 34px; z-index: 0;
  background: var(--bg); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.page-head .wrap { position: relative; z-index: 1; }
.page-head .dek { font-size: clamp(1.08rem, 2vw, 1.25rem); color: var(--on-night-2); max-width: 44em; margin-bottom: .8rem; }
.page-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .9rem; color: var(--on-night-2); font-weight: 700; margin: 0; }
.page-meta span::before { content: "✦"; margin-right: 1.1rem; color: var(--dawn-3); font-size: .7em; vertical-align: .15em; }
.page-meta span:first-child::before { display: none; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-ink);
}
.sky .eyebrow, .page-head .eyebrow {
  color: #ffe2b4; background: rgba(255, 201, 138, .12); border: 1px solid rgba(255, 201, 138, .3);
  padding: .32rem .8rem; border-radius: 999px;
}
.crumbs ol { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .35rem; font-size: .88rem; font-weight: 700; }
.crumbs li { color: var(--on-night-2); }
.crumbs li + li::before { content: "›"; margin-right: .35rem; color: var(--dawn-3); }
.crumbs a { color: var(--on-night-2); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }

/* ---------- Home hero: the living sky ---------- */
.hero {
  min-height: clamp(620px, 92svh, 880px);
  display: flex; align-items: center;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(8rem, 14vw, 11rem);
  background: linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 34%, var(--night-2) 62%, var(--night-3) 84%, var(--dusk) 100%);
}
.sky-layers { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.sky-layers canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: auto; cursor: crosshair; }
html:not(.js) .sky-layers canvas { display: none; }
.sky-dawn {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(255, 127, 122, .35) 62%, rgba(255, 179, 107, .75) 84%, rgba(255, 217, 138, .9) 100%);
  opacity: calc(.28 + var(--hero-dawn) * .72);
  will-change: opacity;
}
.sun {
  position: absolute; left: 66%; bottom: 40px; width: min(38vw, 360px); aspect-ratio: 1; margin-left: max(-19vw, -180px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fff6d0 0%, #ffd98a 32%, #ffb36b 52%, rgba(255, 127, 122, .5) 64%, transparent 72%);
  transform: translateY(calc(62% - var(--hero-dawn) * 46%));
  will-change: transform;
}
.aurora { position: absolute; border-radius: 50%; filter: blur(48px); opacity: .55; will-change: transform; }
.aurora.a1 { width: 70vw; height: 32vh; left: -10vw; top: 6vh; background: linear-gradient(90deg, rgba(64, 224, 196, .55), rgba(124, 92, 255, .5), transparent); animation: drift 26s ease-in-out infinite alternate; }
.aurora.a2 { width: 60vw; height: 26vh; right: -14vw; top: 22vh; background: linear-gradient(270deg, rgba(232, 107, 250, .45), rgba(124, 92, 255, .35), transparent); animation: drift 32s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate3d(-4vw, 0, 0) rotate(-4deg); } to { transform: translate3d(6vw, 3vh, 0) rotate(5deg); } }
.hills { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(90px, 14vw, 180px); }
.hill-back { fill: rgba(36, 27, 98, .82); }
.hill-front { fill: var(--bg); }
.lanterns { position: absolute; inset: 0; overflow: hidden; }
.lantern {
  position: absolute; bottom: -60px; width: 18px; height: 24px; border-radius: 6px 6px 9px 9px;
  background: linear-gradient(180deg, #ffe9a8, #ffb36b 60%, #ff7f5a);
  box-shadow: 0 0 18px 6px rgba(255, 180, 100, .45), 0 0 50px 12px rgba(255, 150, 90, .18);
  opacity: 0; animation: rise 24s linear infinite;
}
.lantern::after { content: ""; position: absolute; left: 5px; right: 5px; bottom: -3px; height: 4px; border-radius: 2px; background: #ffdf9a; }
.lantern.l1 { left: 8%; animation-delay: -2s; }
.lantern.l2 { left: 22%; animation-delay: -11s; animation-duration: 29s; transform: scale(.8); }
.lantern.l3 { left: 54%; animation-delay: -6s; animation-duration: 33s; }
.lantern.l4 { left: 78%; animation-delay: -17s; animation-duration: 27s; }
.lantern.l5 { left: 91%; animation-delay: -22s; animation-duration: 36s; }
@keyframes rise {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0; }
  8% { opacity: .95; }
  50% { transform: translate3d(28px, -48vh, 0) scale(.82); }
  85% { opacity: .7; }
  100% { transform: translate3d(-12px, -96vh, 0) scale(.55); opacity: 0; }
}
.hero-inner { position: relative; z-index: 2; width: 100%; pointer-events: none; }
.hero-inner a, .hero-inner button, .hero-inner p, .hero-inner h1 { pointer-events: auto; }
.hero-copy { max-width: 40rem; }
.hero h1 { font-size: clamp(2.8rem, 7.4vw, 5.6rem); line-height: 1; margin: .3em 0 .3em; letter-spacing: -0.025em; text-shadow: 0 2px 30px rgba(7, 6, 26, .5); }
.hero h1 em { font-style: italic; font-weight: 500; color: #ffd38f; }
.hero .dek { font-size: clamp(1.1rem, 2vw, 1.28rem); color: var(--on-night-2); max-width: 34em; text-shadow: 0 1px 14px rgba(7, 6, 26, .6); }
.hero .btn.ghost, .tool-card .btn.ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45); backdrop-filter: blur(6px); }
.hero .btn.ghost:hover { color: #fff; box-shadow: inset 0 0 0 2px #ffd98a; }
.star-cta { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: 1.6rem; }
html:not(.js) .star-btn { display: none; }
.star-btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 226, 180, .5); background: rgba(255, 226, 180, .1); color: #ffe7c0; font: 800 .95rem var(--font-body);
}
.star-btn:hover { background: rgba(255, 226, 180, .2); }
.star-btn span { color: #ffd98a; }
.star-count { margin: 0; color: var(--on-night-2); font-size: .95rem; font-weight: 700; text-shadow: 0 1px 10px rgba(7, 6, 26, .7); }
@media (max-width: 760px) {
  .hero { align-items: flex-start; }
  .sun { left: 50%; }
  .hide-sm { display: none; }
  .hero { padding-bottom: 11rem; }
  .lantern.l2, .lantern.l4 { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(2.8rem, 6vw, 5rem) 0; position: relative; }
.section.tint { background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.section-head h2 { margin: .35em 0 0; max-width: 22em; }
.section-head p { margin: 0; color: var(--muted); max-width: 36em; }
.tools-band { padding-top: clamp(1rem, 3vw, 2rem); padding-bottom: clamp(1rem, 3vw, 2rem); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1.1rem; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.2rem; box-shadow: var(--shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--glow); border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); }
.card .kicker { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.card h3 { margin: .35rem 0 .45rem; font-size: 1.22rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card h3 a:focus-visible { outline: none; }
.card:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.card p { margin: 0; color: var(--ink-2); font-size: .98rem; }
.card .meta { margin-top: auto; padding-top: .9rem; font-size: .85rem; color: var(--muted); font-weight: 700; }

/* Tool cards: little windows into the night sky */
.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1.1rem; }
.tool-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  border-radius: var(--radius); padding: 1.4rem 1.35rem 1.25rem; color: var(--on-night);
  background:
    radial-gradient(1px 1px at 30px 30px, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 120px 60px, #fff6dc 50%, transparent 51%),
    radial-gradient(1px 1px at 190px 20px, #fff 50%, transparent 51%),
    radial-gradient(120% 80% at 100% 120%, rgba(255, 150, 110, .55), transparent 60%),
    linear-gradient(160deg, var(--night-1), var(--night-2) 60%, var(--night-3));
  background-size: 220px 110px, 220px 110px, 220px 110px, auto, auto;
  box-shadow: 0 12px 34px rgba(18, 15, 56, .28);
  transition: transform .22s ease, box-shadow .22s ease;
}
.tool-card:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: 0 18px 46px rgba(80, 50, 200, .38), 0 0 0 1px rgba(255, 217, 138, .45); }
.tool-card .tool-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: #1c1740; background: var(--sunrise); box-shadow: 0 0 24px rgba(255, 190, 110, .55); }
.tool-card .tool-icon svg { width: 30px; height: 30px; }
.tool-card h3 { color: #fff; margin: 1rem 0 .4rem; font-size: 1.3rem; }
.tool-card h3 a { color: inherit; text-decoration: none; }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; }
.tool-card h3 a:focus-visible { outline: none; }
.tool-card:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.tool-card p { margin: 0; color: var(--on-night-2); font-size: .97rem; }
.tool-card .meta { margin-top: auto; padding-top: 1rem; font-weight: 800; font-size: .9rem; color: #ffd98a; }
.tool-card:hover .meta span { display: inline-block; transform: translateX(4px); transition: transform .2s; }

/* Hub cards: four planets */
.hub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 1.1rem; }
.hub-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  border-radius: var(--radius); padding: 1.5rem 1.4rem 1.3rem; color: #241c3f;
  box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.hub-card::before {
  content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 60%), var(--planet, #fff);
  opacity: .55; box-shadow: 0 0 0 14px rgba(255, 255, 255, .18);
}
.hub-card svg { width: 54px; height: 54px; position: relative; }
.hub-card h3 { color: #1c1740; font-size: 1.45rem; margin: .8rem 0 .4rem; position: relative; }
.hub-card h3 a { color: inherit; text-decoration: none; }
.hub-card h3 a::after { content: ""; position: absolute; inset: -400px; }
.hub-card h3 a:focus-visible { outline: none; }
.hub-card:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.hub-card p { margin: 0; font-size: .97rem; color: #3b3158; position: relative; }
.hub-card .count { margin-top: auto; padding-top: 1rem; font-weight: 800; font-size: .88rem; color: #3b2a6b; position: relative; }
.hub-giving-smart { background: linear-gradient(160deg, #ffe7b0, #ffc98a); --planet: #ffb35c; }
.hub-food-and-community { background: linear-gradient(160deg, #ffd9c9, #ffab94); --planet: #ff7f7a; }
.hub-everyday-generosity { background: linear-gradient(160deg, #d9f3ec, #a6e3d5); --planet: #3fc7aa; }
.hub-magnanimity { background: linear-gradient(160deg, #e6dcff, #c6b4ff); --planet: #8b6cf0; }
.hub-card:hover { transform: translateY(-4px); box-shadow: var(--glow); }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: .9rem; margin: 1.6rem 0 1.8rem; }
.stats:has(> :nth-child(4):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.stat {
  position: relative; overflow: hidden;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1.1rem 1.1rem 1rem; box-shadow: var(--shadow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--sunrise); }
.stat::after { content: "✦"; position: absolute; right: .8rem; top: .55rem; color: var(--accent-2); opacity: .35; font-size: .9rem; }
.stat-num { display: block; font-family: var(--font-display); font-weight: 650; font-size: clamp(1.9rem, 3.4vw, 2.5rem); line-height: 1.05; color: var(--num); margin-bottom: .35rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-label { display: block; font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.stat-label a { color: var(--muted); }

/* ---------- Article layout ---------- */
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 3.5rem; padding-top: 1.5rem; padding-bottom: 3rem; }
.prose { max-width: var(--measure); min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose .lede { font-size: 1.24rem; line-height: 1.6; color: var(--ink); }
.prose .lede::first-letter { font-family: var(--font-display); font-size: 3.4em; float: left; line-height: .82; margin: .06em .1em 0 0; color: var(--num); font-weight: 650; }
.prose h2 { padding-top: .2rem; }
.prose h2::before {
  content: "✦"; display: block; width: max-content; font-size: .9rem; line-height: 1; margin-bottom: .55rem;
  color: var(--accent-2); text-shadow: 0 0 12px rgba(160, 120, 255, .6);
}
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--accent); }

.toc { position: sticky; top: 5.5rem; align-self: start; font-size: .92rem; }
.toc details { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1rem .8rem; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.toc h2 { font-family: var(--font-body); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; font-weight: 800; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: .3rem 0 .3rem .9rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.toc a:hover, .toc a.is-active { border-left-color: var(--accent-2); color: var(--ink); }
.toc a.is-active { font-weight: 800; }
@media (max-width: 980px) {
  .article-grid { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; order: -1; margin-bottom: 1.5rem; }
}
.toc summary { cursor: pointer; font-weight: 800; color: var(--ink-2); list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
@media (min-width: 981px) { .toc summary { display: none; } }
@media (max-width: 980px) { .toc h2 { display: none; } .toc ol { margin-top: .6rem; } }

/* Callouts */
.callout {
  background: var(--glass); border: 1px solid var(--line); border-left: 5px solid #f2a93b;
  border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.6rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout.note { border-left-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 8%, var(--surface)); }
.callout.warn { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }

/* Tool promo inside guides */
.tool-promo {
  display: flex; gap: 1rem; align-items: center; margin: 1.8rem 0;
  padding: 1rem 1.2rem; border-radius: var(--radius-sm); color: var(--on-night);
  background: radial-gradient(120% 120% at 100% 120%, rgba(255, 150, 110, .5), transparent 60%), linear-gradient(135deg, var(--night-1), var(--night-3));
  box-shadow: 0 10px 30px rgba(18, 15, 56, .25);
}
.tool-promo .tool-icon { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--sunrise); color: #1c1740; }
.tool-promo .tool-icon svg { width: 26px; height: 26px; }
.tool-promo p { margin: 0; }
.tool-promo-k { font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #ffe2b4; }
.tool-promo-t { color: var(--on-night-2); line-height: 1.5; }
.tool-promo a { color: #ffd98a; font-weight: 800; }
.tool-promo a:hover { color: #fff; }

/* Lists */
ul.checklist { list-style: none; padding: 0; }
ul.checklist li { position: relative; padding: .55rem .2rem .55rem 2.1rem; border-bottom: 1px dashed var(--line); margin: 0; }
ul.checklist li:last-child { border-bottom: 0; }
ul.checklist li::before {
  content: "✦"; position: absolute; left: .35rem; top: .5rem; font-size: 1rem;
  color: #f2a93b; text-shadow: 0 0 10px rgba(255, 190, 110, .7);
}
ol.steps { list-style: none; counter-reset: step; padding: 0; }
ol.steps > li { counter-increment: step; position: relative; padding: .2rem 0 .9rem 3.1rem; margin: 0 0 .4rem; min-height: 2.4rem; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #ffc978 45%, #ff8f7a);
  color: #1c1740; font-weight: 800; font-size: .95rem; box-shadow: 0 0 16px rgba(255, 180, 110, .55);
}
ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 1.08rem; top: 2.4rem; bottom: .1rem; width: 2px; background: linear-gradient(var(--line), transparent); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.5rem 0 1.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.5; }
th, td { text-align: left; padding: .7rem .9rem; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: var(--bg-2); font-weight: 800; color: var(--ink); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-2) 45%, transparent); }

blockquote { margin: 1.6rem 0; padding: .4rem 0 .4rem 1.3rem; border-left: 4px solid var(--accent-2); font-family: var(--font-display); font-size: 1.2rem; }
blockquote p { margin-bottom: .5rem; }
blockquote cite { display: block; font-family: var(--font-body); font-style: normal; font-size: .92rem; color: var(--muted); font-weight: 700; }

/* FAQ */
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--glass); margin: .6rem 0; transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--glow); }
.faq summary { cursor: pointer; padding: .9rem 2.8rem .9rem 1.1rem; font-weight: 800; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "✦"; position: absolute; right: 1.1rem; top: .85rem; color: var(--accent-2); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(135deg); color: #f2a93b; }
.faq details > :not(summary) { padding: 0 1.1rem; }
.faq details > :last-child { padding-bottom: .4rem; }

ol.sources { font-size: .9rem; color: var(--ink-2); padding-left: 1.4rem; }
ol.sources li { margin: .35rem 0; overflow-wrap: anywhere; }

.related { padding: 2.8rem 0 3.6rem; background: color-mix(in srgb, var(--bg-2) 75%, transparent); border-top: 1px solid var(--line); }
.related h2 { margin-top: 0; }
.related .more-tools-h { margin-top: 2.6rem; }

.source-index { list-style: none; padding: 0; columns: 2 320px; column-gap: 2rem; }
.source-index li { break-inside: avoid; margin: 0 0 1rem; }
.source-index .domain { font-weight: 800; font-size: .95rem; }
.source-index ul { padding-left: 1.1rem; margin: .2rem 0 0; font-size: .9rem; }
.source-index ul li { margin: .15rem 0; overflow-wrap: anywhere; }
.source-index .cited { color: var(--muted); font-size: .82rem; }

/* ---------- Data viz (server-rendered SVG, animated on reveal) ---------- */
.viz { margin: 1.8rem 0 2rem; padding: 1.2rem 1.2rem 1rem; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.viz figcaption { font-size: .86rem; color: var(--muted); margin-top: .9rem; }
.viz figcaption a { color: var(--muted); }
.viz-title { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin: 0 0 .9rem; }
.viz-body { display: grid; grid-template-columns: minmax(170px, 240px) 1fr; gap: 1.4rem; align-items: center; }
@media (max-width: 560px) { .viz-body { grid-template-columns: 1fr; justify-items: center; } .viz-body svg { max-width: 240px; } }
.track { fill: none; stroke: var(--viz-track); stroke-width: 26; }
.seg { fill: none; stroke-width: 26; transition: stroke-dasharray 1.3s cubic-bezier(.2, .8, .2, 1), stroke-dashoffset 1.3s cubic-bezier(.2, .8, .2, 1); }
.donut-big { font-family: var(--font-display); font-weight: 650; font-size: 27px; fill: var(--ink); }
.donut-sub { font-size: 13px; font-weight: 700; fill: var(--muted); }
.viz-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; width: 100%; }
.viz-legend li { display: grid; grid-template-columns: 14px 1fr auto auto; gap: .6rem; align-items: center; font-size: .95rem; padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.viz-legend li:last-child { border-bottom: 0; }
.sw { width: 14px; height: 14px; border-radius: 4px; }
.lg-l { font-weight: 700; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.lg-v { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lg-p { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.bars li { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr minmax(4.6rem, auto); gap: .8rem; align-items: center; font-size: .93rem; }
.bar-l { font-weight: 700; }
.bar-v { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink-2); }
.bar { display: block; overflow: visible; }
.bar-track { fill: var(--viz-track); }
.bar-fill { fill: var(--s1); transform-box: fill-box; transform-origin: left center; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1); }
.bars li:nth-child(2) .bar-fill { transition-delay: .05s; } .bars li:nth-child(3) .bar-fill { transition-delay: .1s; }
.bars li:nth-child(4) .bar-fill { transition-delay: .15s; } .bars li:nth-child(5) .bar-fill { transition-delay: .2s; }
.bars li:nth-child(n+6) .bar-fill { transition-delay: .25s; }
@media (max-width: 560px) { .bars li { grid-template-columns: 1fr auto; } .bars li .bar { grid-column: 1 / -1; grid-row: 2; } }
.split-row { display: grid; gap: .35rem; margin-bottom: .9rem; }
.split-l { font-weight: 800; font-size: .9rem; color: var(--ink-2); }
.split-rest { fill: var(--viz-track); }
.split-hl { fill: var(--s2); transform-box: fill-box; transform-origin: left center; transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.split-v { font-size: .92rem; color: var(--ink-2); }
.split-v b { color: var(--ink); }
.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.ring { text-align: center; }
.ring svg { width: 150px; }
.ring .track { stroke-width: 14; }
.ring-fill { fill: none; stroke-width: 14; stroke-linecap: round; transition: stroke-dasharray 1.4s cubic-bezier(.2, .8, .2, 1); }
.ring-num { font-family: var(--font-display); font-weight: 650; font-size: 24px; fill: var(--ink); }
.ring p { margin: .4rem auto 0; max-width: 15em; font-weight: 700; color: var(--ink-2); font-size: .93rem; }
.js .viz:not(.in) .seg, .js .viz:not(.in) .ring-fill { stroke-dasharray: 0 100; }
.js .viz:not(.in) .bar-fill, .js .viz:not(.in) .split-hl { transform: scaleX(0); }

/* ---------- Tool pages ---------- */
.tool-head .eyebrow .tool-icon.sm { width: 20px; height: 20px; display: inline-grid; }
.tool-head .eyebrow .tool-icon.sm svg { width: 18px; height: 18px; }
.tool-wrap { padding-top: 1rem; padding-bottom: 3rem; }
.tool-h { font-size: clamp(1.4rem, 2.6vw, 1.8rem); margin: 0 0 1rem; }
.tool-app {
  position: relative; border-radius: calc(var(--radius) + 6px); padding: clamp(1.1rem, 3vw, 2rem);
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--glow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  margin-top: -1.2rem; z-index: 2;
}
.tool-prose { margin-top: 3rem; }
.hint { font-size: .86rem; color: var(--muted); margin: .4rem 0 0; }
.opt { font-weight: 600; color: var(--muted); font-size: .9em; }
.field { margin: 0 0 1.15rem; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend, .cc-name > label, .kg-filters legend { display: block; font-weight: 800; margin-bottom: .4rem; color: var(--ink); padding: 0; }
.field label.sub { font-weight: 700; margin-top: .8rem; font-size: .92rem; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; font: 600 1rem var(--font-body); color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: .62rem .8rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 25%, transparent); }
input[type="range"] { width: 100%; accent-color: var(--accent-2); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-2); }
.money { position: relative; }
.money span { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--muted); }
.money input { padding-left: 1.7rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

.kg-grid > *, .cc-grid > *, .gc-grid > *, .mt-grid > *, .row2 > *, .kg-stage > * { min-width: 0; }
input, select, textarea { max-width: 100%; min-width: 0; }
input[type="date"], input[type="time"] { min-height: 2.9rem; -webkit-appearance: none; appearance: none; }

/* pill radios / checkboxes */
.pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.pills label { position: relative; cursor: pointer; }
.pills input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pills span {
  display: inline-block; padding: .38rem .8rem; border-radius: 999px; font-weight: 700; font-size: .9rem;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); transition: all .15s;
}
.pills input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pills input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.pills label:hover span { border-color: var(--accent-2); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }

/* Kindness generator */
.kg-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(1.2rem, 3vw, 2.4rem); }
@media (max-width: 900px) { .kg-grid { grid-template-columns: 1fr; } }
.kg-stage { display: grid; grid-template-columns: minmax(180px, 250px) 1fr; gap: 1.4rem 1.6rem; align-items: center; align-content: start; padding-top: .6rem; }
@media (max-width: 620px) { .kg-stage { grid-template-columns: 1fr; justify-items: center; } }
.kg-wheel-wrap { position: relative; width: 100%; max-width: 250px; aspect-ratio: 1; }
.kg-wheel { width: 100%; height: 100%; filter: drop-shadow(0 10px 30px rgba(98, 80, 214, .35)); }
.wheel-rot { transform-origin: 100px 100px; transition: transform 3.6s cubic-bezier(.12, .7, .1, 1); }
.wedge path { stroke: var(--surface); stroke-width: 2; transition: opacity .3s; }
.wedge text { font: 800 10.5px var(--font-body); fill: #fff; paint-order: stroke; stroke: rgba(20, 15, 60, .55); stroke-width: 2.6px; letter-spacing: .02em; }
.wedge.dim path { opacity: .22; }
.wedge.dim text { opacity: .45; }
.wedge.hit path { filter: brightness(1.15); }
.kg-wheel .hub { fill: var(--surface); stroke: var(--line); stroke-width: 3; }
.kg-pointer { position: absolute; left: 50%; top: -6px; width: 0; height: 0; transform: translateX(-50%); border: 11px solid transparent; border-top: 20px solid var(--ink); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
.idea-card {
  position: relative; min-height: 13rem; padding: 1.3rem 1.4rem; border-radius: var(--radius);
  color: var(--on-night);
  background: radial-gradient(120% 90% at 100% 120%, rgba(255, 150, 110, .55), transparent 60%), linear-gradient(150deg, var(--night-1), var(--night-3));
  box-shadow: 0 16px 40px rgba(18, 15, 56, .35); transform-style: preserve-3d; outline: none;
}
.idea-card.flip { animation: flip .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes flip { 0% { transform: perspective(900px) rotateY(80deg) scale(.96); opacity: .2; } 100% { transform: none; opacity: 1; } }
.idea-card-k { margin: 0 0 .5rem; font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #ffe2b4; }
.idea-card-t { font-family: var(--font-display); font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.28; margin: 0 0 .8rem; color: #fff; }
.idea-card-t a { color: #ffd98a; }
.idea-card .chips span { background: rgba(255, 255, 255, .12); color: var(--on-night); border-color: rgba(255, 255, 255, .2); }
.kg-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .6rem; }
.kg-side { display: grid; gap: 1.2rem; align-content: start; }
.kg-filters fieldset { margin-bottom: .8rem; }
.kg-filters legend { font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kg-count { font-weight: 800; color: var(--ink-2); margin: .3rem 0 0; }
.kg-sky { display: grid; grid-template-columns: 150px 1fr; gap: .2rem 1rem; align-items: center; border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--on-night); background: linear-gradient(170deg, var(--night-0), var(--night-2)); }
.kg-sky-h { grid-column: 1 / -1; margin: 0; font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #ffe2b4; }
.constellation { display: block; width: 100%; max-width: 150px; margin: .2rem auto; grid-row: span 2; }
.constellation .cs { fill: rgba(255, 255, 255, .22); transition: fill .4s, r .4s; }
.constellation .cs.lit { fill: #ffe8a8; r: 2.4; filter: drop-shadow(0 0 2.5px #ffd98a); }
.constellation .cs.new { animation: pop 1s ease-out; }
@keyframes pop { 0% { r: 7; fill: #fff; } 100% { r: 2.4; } }
.cs-line { stroke: rgba(255, 226, 180, .55); stroke-width: .6; stroke-linejoin: round; }
.kg-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .4rem 0 .6rem; text-align: center; }
.kg-stats dt { font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--on-night-2); }
.kg-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 650; color: #ffd98a; font-variant-numeric: tabular-nums; }
.kg-sky-note { font-size: .84rem; color: var(--on-night-2); margin: 0; }
.kg-sky-note a { color: #ffd98a; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.chips span { font-size: .76rem; font-weight: 800; padding: .14rem .55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); background: var(--bg-2); }
.tool-list { margin-top: 3rem; }
.tool-list-head h2 { margin-top: 0; }
.tool-list-head p { color: var(--ink-2); max-width: 46em; }
.idea-group h3 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
.ideas { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: .6rem; }
.idea { display: flex; flex-direction: column; gap: .5rem; padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--line); }
.idea.picked { box-shadow: 0 0 0 2px #f2a93b, var(--glow); }
.idea.done .idea-text::before { content: "✦ "; color: #f2a93b; }
.idea[hidden], .idea-group[hidden] { display: none; }

/* Charity checker */
.cc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); gap: clamp(1.2rem, 3vw, 2.4rem); align-items: start; }
@media (max-width: 900px) { .cc-grid { grid-template-columns: 1fr; } }
.cc-name { margin-bottom: 1.4rem; }
.cc-lookups { list-style: none; padding: 0; margin: .8rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.cc-lookups a { display: inline-block; padding: .34rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 700; font-size: .87rem; }
.cc-lookups a:hover { border-color: var(--accent-2); }
.cc-set legend { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; margin-bottom: .6rem; }
.cc-step { width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; font: 800 .95rem var(--font-body); color: #1c1740; background: var(--sunrise); }
.cc-step.warn { background: linear-gradient(135deg, #ffb3a1, #ff7f7a); }
.cc-list { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: .5rem; }
.cc-list label { display: grid; grid-template-columns: 1.4rem 1fr; gap: .7rem; align-items: start; padding: .75rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; line-height: 1.5; transition: border-color .15s, background .15s; }
.cc-list label:hover { border-color: var(--accent-2); }
.cc-list input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; }
.cc-list label:has(input:checked) { border-color: color-mix(in srgb, var(--s3) 70%, var(--line)); background: color-mix(in srgb, var(--s3) 9%, var(--surface)); }
.cc-flags .cc-list label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cc-result { position: sticky; top: 5.5rem; padding: 1.3rem; border-radius: var(--radius); color: var(--on-night); background: radial-gradient(120% 90% at 100% 120%, rgba(255, 150, 110, .45), transparent 60%), linear-gradient(160deg, var(--night-1), var(--night-3)); }
@media (max-width: 900px) { .cc-result { position: static; } }
.cc-result-h { color: #fff; margin: 0 0 .6rem; font-size: 1.2rem; }
.gauge { position: relative; width: 150px; margin: 0 auto; }
.gauge .track { stroke: rgba(255, 255, 255, .14); stroke-width: 12; }
.gauge-fill { fill: none; stroke: #ffd98a; stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .7s cubic-bezier(.2, .8, .2, 1), stroke .3s; }
.gauge.bad .gauge-fill { stroke: #ff8f7a; }
.gauge-num { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-family: var(--font-display); font-size: 2.3rem; font-weight: 650; color: #fff; line-height: 1; }
.gauge-num .of { display: block; font-size: .9rem; color: var(--on-night-2); font-family: var(--font-body); font-weight: 700; }
.gauge-num > span:first-child { display: block; }
.gauge-num { align-content: center; justify-items: center; gap: .15rem; }
.cc-verdict { font-weight: 800; color: #fff; text-align: center; margin: .9rem 0 .6rem; font-size: 1.05rem; }
.cc-result .hint { color: var(--on-night-2); }
.cc-result ul { padding-left: 1.1rem; font-size: .92rem; color: var(--on-night-2); margin: .4rem 0 .8rem; }
.cc-result .flag-list li::marker { content: "⚠ "; color: #ffb3a1; }
.cc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 .4rem; }
.cc-result .btn.ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }

/* Giving planner */
.gc-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(1.2rem, 3vw, 2.4rem); }
@media (max-width: 900px) { .gc-grid { grid-template-columns: 1fr; } }
.presets { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.presets button { font: 800 .88rem var(--font-body); padding: .34rem .8rem; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.presets button:hover, .presets button[aria-pressed="true"] { border-color: var(--accent-2); color: var(--ink); }
output { font-weight: 800; color: var(--num); }
.gc-causes ol { list-style: none; padding: 0; margin: 0 0 .7rem; display: grid; gap: .5rem; }
.cause { display: grid; grid-template-columns: 14px minmax(0, 1fr) minmax(80px, 140px) 2rem; gap: .5rem; align-items: center; }
.cause::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--c, var(--s1)); }
.cause input[type="text"] { padding: .45rem .6rem; }
.cause .rm { width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.cause .rm:hover { border-color: var(--accent); color: var(--accent); }
.gc-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 0 0 1.2rem; }
.gc-big div { padding: .9rem .9rem .8rem; border-radius: var(--radius-sm); background: linear-gradient(160deg, var(--night-1), var(--night-3)); color: var(--on-night); }
.gc-big dt { font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--on-night-2); }
.gc-big dt .opt { color: var(--on-night-2); text-transform: none; letter-spacing: 0; }
.gc-big dd { margin: .2rem 0 0; font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 650; color: #ffd98a; font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .gc-big { gap: .4rem; } .gc-big div { padding: .7rem .6rem; } .gc-big dd { font-size: 1.2rem; } .gc-big dt { font-size: .66rem; }
  .cause { grid-template-columns: 14px minmax(0, 1fr) 2rem; }
  .cause input[type="range"] { grid-column: 2; grid-row: 2; }
  .cause .rm { grid-column: 3; grid-row: 1; }
}
.gc-donut { margin: 0 auto 1rem; max-width: 240px; }
.gc-legend { margin-bottom: 1rem; }
.gc-tax { margin: 0; }

/* Meal train */
.mt-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(1.2rem, 3vw, 2.4rem); align-items: start; }
@media (max-width: 900px) { .mt-grid { grid-template-columns: 1fr; } }
.mt-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.2rem .6rem; }
.mt-sheet h3 { margin: 0 0 .3rem; }
.mt-summary { color: var(--ink-2); margin: 0 0 .6rem; }
.mt-allergy { font-weight: 800; color: var(--ink); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-left: 4px solid var(--accent); padding: .5rem .8rem; border-radius: 8px; }
.mt-table td:first-child { white-space: nowrap; font-weight: 700; }
.mt-table .open { color: var(--muted); font-style: italic; white-space: nowrap; }
.mt-tips { font-size: .9rem; color: var(--ink-2); padding-left: 1.1rem; }
.mt-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

/* ---------- Search palette ---------- */
.search-dialog {
  width: min(640px, calc(100vw - 2rem)); max-height: min(70vh, 640px); padding: 0; border: 1px solid var(--line);
  border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(7, 6, 26, .5);
  margin: 12vh auto auto; overflow: hidden;
}
.search-dialog::backdrop { background: rgba(7, 6, 26, .55); backdrop-filter: blur(4px); }
.search-dialog form { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.search-dialog input { border: 0; padding: .4rem 0; font-size: 1.1rem; background: transparent; }
.search-dialog input:focus-visible { box-shadow: none; }
.search-dialog ul { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; max-height: calc(min(70vh, 640px) - 4.5rem); }
.search-dialog li a { display: block; padding: .6rem .8rem; border-radius: 12px; text-decoration: none; color: var(--ink); }
.search-dialog li a .s { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.search-dialog li a .t { display: block; font-weight: 800; }
.search-dialog li a .d { display: block; font-size: .88rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-dialog li a[aria-selected="true"], .search-dialog li a:hover { background: var(--bg-2); box-shadow: inset 3px 0 0 var(--accent-2); }
.search-dialog .empty { padding: 1rem; color: var(--muted); }
.search-dialog .close { border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-2); border-radius: 8px; font: 800 .75rem var(--font-body); padding: .25rem .5rem; cursor: pointer; }

/* ---------- Reading progress: a rising sun ---------- */
.read-sun {
  position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(180deg, var(--night-1), var(--night-3) 70%, var(--dusk));
  box-shadow: 0 8px 24px rgba(7, 6, 26, .35), 0 0 0 2px rgba(255, 255, 255, .35);
  pointer-events: none; opacity: 0; transition: opacity .3s;
}
.read-sun.on { opacity: 1; }
@media (max-width: 600px) { .read-sun { width: 40px; height: 40px; right: 12px; bottom: 12px; } .read-sun i { width: 22px; height: 22px; margin: -11px 0 0 -11px; transform: translateY(calc(var(--p, 0) * -26px + 6px)); } .read-sun b { height: 9px; } }
.read-sun i { position: absolute; left: 50%; top: 100%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: radial-gradient(circle, #fff6d0, #ffd98a 50%, #ff9f6b); box-shadow: 0 0 18px 6px rgba(255, 190, 110, .6); transform: translateY(calc(var(--p, 0) * -38px + 8px)); }
.read-sun b { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: #2a1f6b; border-top: 1px solid rgba(255, 217, 138, .6); }
.read-bar { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 40; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--sunrise); pointer-events: none; }

/* ---------- Footer ---------- */
.site-footer { position: relative; background: var(--night-0); color: #e6defc; padding: 3.6rem 0 2rem; font-size: .95rem; overflow: hidden; }
.site-footer .horizon { position: absolute; left: -10%; right: -10%; top: -120px; height: 220px; background: radial-gradient(closest-side, rgba(255, 179, 107, .35), transparent); pointer-events: none; }
.site-footer a { color: #ffd59a; }
.site-footer a:hover { color: #fff; }
.footer-grid { position: relative; display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 2rem; }
.footer-grid h2 { font-family: var(--font-body); color: #e6defc; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .7rem; font-weight: 800; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: .3rem 0; }
.footer-brand { font-family: var(--font-display); font-size: 1.5rem; color: #fff; font-weight: 600; margin: 0; }
.footer-brand + p { color: #c9bfe8; margin-top: .5rem; }
.network { position: relative; margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, .14); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; color: #c9bfe8; font-size: .88rem; }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Misc ---------- */
.prose .muted, .muted { color: var(--muted); }
.center { text-align: center; }
.big-quote { font-family: var(--font-display); font-size: clamp(1.6rem, 3.6vw, 2.5rem); line-height: 1.28; max-width: 26em; margin: 0 auto; text-wrap: balance; }
.big-quote p::before { content: "✦"; display: block; font-size: 1.2rem; color: #f2a93b; margin-bottom: .6rem; }
.big-quote cite { display: block; margin-top: 1rem; font-family: var(--font-body); font-size: 1rem; font-style: normal; color: var(--muted); font-weight: 700; }
.notfound { padding: 5rem 0 6rem; text-align: center; }
.notfound h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); }
.pill-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; }
.pill-list a { display: inline-block; padding: .45rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 700; color: var(--ink-2); }
.pill-list a:hover { border-color: var(--accent-2); color: var(--ink); }

/* Light-a-star burst (generator + home) */
.burst { position: fixed; z-index: 60; pointer-events: none; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #ffe8a8; box-shadow: 0 0 10px #ffd98a; animation: burst .9s ease-out forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .lantern { display: none; }
  .aurora { animation: none; }
}

@media print {
  .site-header, .site-footer, .toc, .related, .skip-link, .read-sun, .read-bar, .tool-promo, .header-actions { display: none !important; }
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .page-head, .sky { background: none; color: #000; padding: 1rem 0; }
  .page-head h1, .page-head .dek, .page-meta, .crumbs li, .crumbs a { color: #000; }
  .page-head::before, .page-head::after { display: none; }
  .tool-app { box-shadow: none; backdrop-filter: none; }
  body.print-only-sheet * { visibility: hidden; }
  body.print-only-sheet .mt-sheet, body.print-only-sheet .mt-sheet * { visibility: visible; }
  body.print-only-sheet .mt-sheet { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
}
