/* The Diaspora Initiative — shared site styles.
 * Look (Nov 2026 brief): warm ivory ground with large pale circles, Raleway for headings, menu
 * and leads, Mulish for body text; soft and rounded — no hard rules, no borders, diffuse shadows.
 * Slate and coral stay. Coral is an accent; coral TEXT uses --coral-deep (#B93E29), which keeps
 * at least 4.5:1 on ivory (5.2), pale slate (4.7), blush (4.5) and white (5.6). */

@font-face { font-family: 'Raleway'; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url(/assets/fonts/raleway-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Raleway'; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url(/assets/fonts/raleway-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Mulish'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/mulish-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Mulish'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/mulish-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* palette */
  --ivory: #FBF7F4;
  --blush: #F8E3DC;
  --pale-slate: #E6EDF2;
  --ink: #2F4354;          /* headings */
  --panel: #3E5366;        /* solid slate panels */
  --coral: #D4776B;        /* accent only, never small text */
  --coral-light: #E8998D;
  --coral-deep: #B93E29;   /* coral text on light grounds */
  --slate: #5B7C8A;
  --white: #FFFFFF;
  /* roles (older names kept so every stylesheet picks up the new look) */
  --text: #44525E;
  --text-light: #5A6778;
  --slate-dark: var(--ink);
  --slate-deep: var(--ink);
  --bg: var(--ivory);
  --warm: var(--blush);
  --warm-card: var(--white);
  --warm-hover: var(--white);
  --line: rgba(47, 67, 84, .08);
  --shadow: 0 10px 30px rgba(47, 67, 84, .07), 0 2px 6px rgba(47, 67, 84, .04);
  --shadow-up: 0 18px 44px rgba(47, 67, 84, .12), 0 3px 8px rgba(47, 67, 84, .05);
  --radius: 28px;
  --display: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sans: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: var(--display);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --head-h: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  line-height: 1.7;
  color: var(--text);
  min-height: 100vh;
  overflow-x: clip;
  /* The ground: ivory with very large pale circles, partly off-screen, behind everything. */
  background:
    radial-gradient(circle 520px at calc(100% + 140px) -60px, var(--blush) calc(100% - 1px), transparent 100%),
    radial-gradient(circle 420px at -170px 1020px, var(--pale-slate) calc(100% - 1px), transparent 100%),
    radial-gradient(circle 340px at calc(100% + 90px) 2100px, var(--blush) calc(100% - 1px), transparent 100%),
    var(--ivory);
  background-repeat: no-repeat;
}
@media (max-width: 720px) {
  body {
    background:
      radial-gradient(circle 260px at calc(100% + 110px) -30px, var(--blush) calc(100% - 1px), transparent 100%),
      radial-gradient(circle 220px at -120px 900px, var(--pale-slate) calc(100% - 1px), transparent 100%),
      radial-gradient(circle 200px at calc(100% + 80px) 1900px, var(--blush) calc(100% - 1px), transparent 100%),
      var(--ivory);
    background-repeat: no-repeat;
  }
}
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); }
a:hover { color: var(--coral-deep); }
:focus-visible { outline: 2px solid var(--panel); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--panel); color: var(--white); padding: 10px 18px; border-radius: 999px;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; color: var(--white); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Header and menu (identical on every page) ---------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  height: var(--head-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 clamp(16px, 3vw, 36px);
  pointer-events: none;                 /* only the logo and menu take clicks */
  view-transition-name: site-head;      /* the menu stays put while pages cross-fade */
}
.site-head > * { pointer-events: auto; }
/* The bar's surface fades in once the page scrolls (opacity and transform only). */
.site-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  /* Solid and full height, so nothing shows through it or through a gap under it (was 90% with blur, scaled to 84%). */
  background: var(--ivory);
  box-shadow: 0 8px 24px rgba(47, 67, 84, .05);
  opacity: 0; transform-origin: top;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.site-logo, .site-nav, .nav-toggle { transition: transform .3s var(--ease); }
.site-logo { transform-origin: left center; display: block; flex: 0 0 auto; border-radius: 8px; }
.site-head.is-slim::before { opacity: 1; }
.site-head.is-slim .site-logo { transform: translateY(-6px) scale(.92); }
.site-head.is-slim .site-nav, .site-head.is-slim .nav-toggle { transform: translateY(-6px); }
.site-logo img { height: 38px; width: auto; }

.site-nav {
  display: flex; align-items: center; gap: 2px; padding: 5px;
  background: var(--white); border-radius: 999px; box-shadow: var(--shadow);
}
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-family: var(--display); font-size: 1rem; font-weight: 500;
  letter-spacing: .01em; white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--pale-slate); }
.site-nav a[aria-current] { background: var(--panel); color: var(--white); }
.nav-toggle {
  display: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 999px; background: var(--white); color: var(--ink); box-shadow: var(--shadow);
  font: 500 1rem var(--display); cursor: pointer;
}
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
  display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px;
  position: relative; transition: transform .35s var(--ease), opacity .2s ease;
}
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); background: var(--ink); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); background: var(--ink); }

@media (max-width: 820px) {
  .site-logo img { height: 36px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: calc(var(--head-h) - 4px); left: 12px; right: 12px;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 10px; border-radius: var(--radius); box-shadow: var(--shadow-up);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-head.is-slim .site-nav { transform: translateY(-12px); }
  .site-nav a { min-height: 50px; font-size: 1.1rem; padding: 0 20px; }
}

/* ---- Layout -------------------------------------------------------------- */
.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 0 32px; }
.wrap-narrow { width: min(820px, 100%); margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .wrap, .wrap-narrow { padding: 0 16px; } }

/* Sections are separated by space and, where a change is wanted, by a tinted panel with
   curved edges — never a rule or a boxed band. */
.band { padding: 96px 0 88px; scroll-margin-top: var(--head-h); }
.band-white, .band-bg { background: transparent; }
.band-warm, .band-tint {
  background: rgba(230, 237, 242, .78);
  border-radius: clamp(32px, 5vw, 64px);
  margin-inline: clamp(8px, 2vw, 28px);
}
.band-blush { background: rgba(248, 227, 220, .62); border-radius: clamp(32px, 5vw, 64px); margin-inline: clamp(8px, 2vw, 28px); }
@media (max-width: 720px) { .band { padding: 60px 0 56px; } }

.kicker {
  font-family: var(--display); font-size: .82rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--coral-deep); margin-bottom: 14px;
}
.section-title {
  font-family: var(--display); font-size: clamp(2.2rem, 4.4vw, 3.4rem); font-weight: 300; letter-spacing: -0.015em; line-height: 1.12;
  color: var(--ink); margin-bottom: 32px;
}
.lead-xl {
  font-family: var(--display); font-size: clamp(2.2rem, 4.6vw, 3.5rem); font-weight: 300; letter-spacing: -0.02em; line-height: 1.12;
  color: var(--ink); max-width: 17em;
}
.lead {
  font-family: var(--display); font-size: clamp(1.3rem, 2.2vw, 1.6rem); font-weight: 400; line-height: 1.5;
  color: var(--ink);
}
.prose p { color: var(--text); font-size: 1.15rem; line-height: 1.75; margin-bottom: 24px; }
.prose p.lead { font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.5; color: var(--ink); }
.prose p:last-child { margin-bottom: 0; }
@media (max-width: 720px) { .prose p { font-size: 1.06rem; } }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px;
}
.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 28px;
}
.card h3, .h3 {
  font-family: var(--display); font-size: 1.4rem; font-weight: 500; letter-spacing: -0.005em; color: var(--ink); margin-bottom: 10px;
  line-height: 1.3;
}
.card p { font-size: 1.08rem; line-height: 1.65; color: var(--text); }

/* Linked cards (research strands) */
.link-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .link-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .link-cards { grid-template-columns: 1fr; gap: 14px; } }
.link-card {
  display: flex; flex-direction: column; min-height: 230px; padding: 30px 28px 24px;
  border-radius: var(--radius); background: var(--white); color: inherit; text-decoration: none;
  box-shadow: var(--shadow);
  position: relative; isolation: isolate;
  transition: transform .24s var(--ease);
}
/* Lift on hover: the deeper shadow is its own layer and only its opacity changes. */
.link-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  box-shadow: var(--shadow-up); opacity: 0; transition: opacity .24s var(--ease);
}
.link-card:hover, .link-card:focus-visible { transform: translateY(-3px); }
.link-card:hover::after, .link-card:focus-visible::after { opacity: 1; }
.link-card .n { font-family: var(--display); font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--coral-deep); margin-bottom: 12px; }
.link-card h3 { font-size: 1.35rem; font-weight: 500; color: var(--ink); margin-bottom: 10px; line-height: 1.3; }
.link-card p { font-size: 1.04rem; line-height: 1.6; color: var(--text); }
.link-card .go { margin-top: auto; padding-top: 22px; color: var(--coral-deep); font-weight: 700; }
.link-card:hover h3 { color: var(--coral-deep); }

/* Missing content is listed for the editors in TODO.md, never shown to visitors. */
.todo, .todo-inline { display: none !important; }

/* Breadcrumb */
.trail { display: flex; flex-wrap: wrap; gap: 8px; font-size: .95rem; color: var(--text-light); margin-bottom: 18px; }
.trail a { color: var(--text-light); text-decoration: none; }
.trail a:hover { color: var(--coral-deep); }
.trail [aria-current] { color: var(--ink); font-weight: 600; }

/* Buttons, tags and outbound links: fully rounded, no borders. */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 22px;
  border-radius: 999px; background: var(--panel); color: var(--white); text-decoration: none;
  font-weight: 600; border: 0; cursor: pointer; font-family: var(--sans); font-size: 1rem;
}
.btn:hover { background: var(--ink); color: var(--white); }
.btn-quiet { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.btn-quiet:hover { background: var(--white); color: var(--coral-deep); }
.ext::after { content: " ↗"; font-weight: 400; }

/* ---- Footer: a slate panel with a curved top edge -------------------------- */
.site-foot {
  margin-top: 72px; padding: 56px 0 40px;
  background: var(--panel); color: rgba(255, 255, 255, .86);
  border-radius: clamp(32px, 5vw, 64px) clamp(32px, 5vw, 64px) 0 0;
  font-size: 1rem; line-height: 1.6;
}
.site-foot .foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 40px; }
.site-foot .org { font-family: var(--display); font-size: 1.2rem; font-weight: 500; color: var(--white); }
.site-foot .est { color: rgba(255, 255, 255, .86); }
.site-foot .reach, .site-foot .legal { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-foot .legal { margin-top: 28px; font-size: .95rem; }
.site-foot .copy { margin-top: 18px; font-size: .92rem; color: rgba(255, 255, 255, .8); }
.site-foot a { color: var(--white); text-decoration: none; }
.site-foot a:hover { color: var(--blush); }

/* ---- Motion ----------------------------------------------------------------
   Opacity and transform only, ≤ ~400 ms, all off under prefers-reduced-motion. */

/* Page transitions: a short cross-fade between pages (browsers with cross-document View Transitions). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: ease; }

/* Link underlines slide in on navigation-style links (the menu uses pills instead). */
.pager a, .trail a, .link-card .go, .pub-meta a, .site-foot a, .method-link a, .research-more a.btn-link {
  position: relative; text-decoration: none;
}
.pager a::after, .trail a::after, .pub-meta a::after, .site-foot a::after, .method-link a::after, .link-card .go::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .24s var(--ease);
}
.pager a::after { bottom: 4px; }
.pager .next::after { transform-origin: right; }
.pager a:hover::after, .trail a:hover::after, .pub-meta a:hover::after, .site-foot a:hover::after,
.method-link a:hover::after, .link-card:hover .go::after,
.pager a:focus-visible::after, .trail a:focus-visible::after, .site-foot a:focus-visible::after, .link-card:focus-visible .go::after { transform: scaleX(1); }
.trail a:hover, .pub-meta a:hover { text-decoration: none; }
.link-card .go { align-self: flex-start; }
.site-foot :focus-visible { outline-color: var(--blush); }

/* Entrance: below-the-fold blocks fade up once as they arrive (set up by site.js). */
.reveal-pending { opacity: 0; transform: translateY(14px); }
.reveal-pending.is-in {
  opacity: 1; transform: none;
  transition: opacity .28s ease-out, transform .28s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

/* Reading progress on long pages. */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80;
  background: var(--coral); transform: scaleX(0); transform-origin: left; pointer-events: none;
}

/* Count-up figures keep their width while digits change. */
.countup { display: inline-block; text-align: right; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  @view-transition { navigation: none; }
  .reveal-pending { opacity: 1; transform: none; }
}

/* Open layout: non-clickable cards are plain text on the background. Clickable cards (.link-card) keep their card. */
.card { background: none; box-shadow: none; border-radius: 0; padding: 0; }
.card-grid { gap: 32px 48px; }

/* 5. Secondary button, site-wide: transparent, 1px border and text in the primary button's navy, same pill and height. */
.btn-quiet, a.btn-quiet, button.btn-quiet {
  background: transparent; color: var(--panel); box-shadow: inset 0 0 0 1px var(--panel);
}
.btn-quiet:hover, a.btn-quiet:hover, button.btn-quiet:hover { background: var(--panel); color: var(--white); }

/* ---- Depth on scroll (narrative pages: body[data-depth]) ------------------------------------
   The pale circles become separate layers so they can sit at different depths. Same places,
   sizes and colours as the page background they replace. */
body[data-depth] { position: relative; background: var(--ivory); }
.depth-bg { position: absolute; top: 0; left: 0; right: 0; height: 100%; overflow: hidden; z-index: -1; pointer-events: none; }
.depth-bg span { position: absolute; display: block; border-radius: 50%; will-change: transform; }
.depth-bg .c1 { width: 1040px; height: 1040px; left: calc(100% + 140px - 520px); top: -580px; background: var(--blush); }
.depth-bg .c2 { width: 840px; height: 840px; left: -590px; top: 600px; background: var(--pale-slate); }
.depth-bg .c3 { width: 680px; height: 680px; left: calc(100% + 90px - 340px); top: 1760px; background: var(--blush); }
@media (max-width: 720px) {
  .depth-bg .c1 { width: 520px; height: 520px; left: calc(100% + 110px - 260px); top: -290px; }
  .depth-bg .c2 { width: 440px; height: 440px; left: -340px; top: 680px; }
  .depth-bg .c3 { width: 400px; height: 400px; left: calc(100% + 80px - 200px); top: 1700px; }
}
/* Section reveal: 14px rise and fade, ~500 ms, once. */
.reveal-pending.is-in { transition: opacity .5s ease-out, transform .5s cubic-bezier(.22, 1, .36, 1); transition-delay: var(--reveal-delay, 0ms); }
body[data-depth] .reveal-pending { transform: translateY(28px); }
body[data-depth] .reveal-pending.is-in { transform: none; }
@media (prefers-reduced-motion: reduce) { .depth-bg span { transform: none !important; } }
