/* AnansiBox — shared styles (home + 404). Bulma is the foundation; this file
   layers the white / ink + gold editorial skin on top. No load animations. */

:root {
  /* Warm near-white canvas, ink primary, gold used only as a signal */
  --bg:        oklch(0.992 0.004 85);   /* white, faintly warm */
  --surface:   oklch(0.975 0.006 85);
  --ink:       oklch(0.22 0.014 75);    /* near-black, warm */
  --muted:     oklch(0.46 0.014 75);
  --faint:     oklch(0.62 0.012 75);
  --line:      oklch(0.90 0.008 85);
  --gold:      oklch(0.66 0.125 72);    /* deep amber — holds on white */
  --gold-deep: oklch(0.57 0.135 66);

  --space: clamp(1.25rem, 4vw, 3rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Bulma theme: adopt our type + light scheme */
  --bulma-family-primary: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --bulma-scheme-main: var(--bg);
  --bulma-body-background-color: var(--bg);
  --bulma-text: var(--ink);
  --bulma-text-strong: var(--ink);
  --bulma-body-color: var(--ink);
}

html, body { background: var(--bg); }

body {
  color: var(--ink);
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.shell {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: var(--space);
  gap: var(--space);
  max-width: 1160px;
  margin-inline: auto;
}

/* ---- Masthead ---- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 1.075rem;
  text-decoration: none;
  color: var(--ink);
}
.brand svg { width: 26px; height: 26px; display: block; overflow: visible; }
.brand .strand { stroke: var(--ink); stroke-width: 1; fill: none; opacity: 0.55; }
.brand .net { stroke: color-mix(in oklch, var(--ink) 35%, transparent); stroke-width: 1; fill: none; }
.brand .core { fill: var(--gold); }
.brand b { font-weight: 700; }
.brand span { color: var(--muted); font-weight: 500; }

.main-menu { display: flex; align-items: center; gap: 1.4rem; margin-left: 1.8rem; margin-right: auto; }
.main-menu a {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
}
.main-menu a:hover { color: var(--ink); }

.status {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---- Masthead nav (login / profile) ---- */
.mast-right { display: flex; align-items: center; gap: 1.4rem; }
.mast-nav a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 0.1em;
  white-space: nowrap;
}
.mast-nav a:hover { color: var(--gold-deep); }

/* ---- Flash messages ---- */
.flash-messages { display: flex; flex-direction: column; gap: 0.5rem; }
.flash {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 9px;
  background: var(--surface);
  font-size: 0.92rem;
  color: var(--ink);
}

/* ---- Auth pages (allauth) + profile ---- */
.auth-page .shell > h1,
.auth-page .profile h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem);
  line-height: 1.1;
  color: var(--ink);
}
.auth-page .shell a { color: var(--gold-deep); text-decoration: none; border-bottom: 1px solid var(--gold); }
.auth-page .shell a:hover { color: var(--ink); }
.auth-page .shell a.brand, .auth-page .mast-nav a { color: var(--ink); }
.auth-page .shell a.brand { border-bottom: none; }
.auth-page form { margin-top: 1.5rem; max-width: 38rem; display: flex; flex-direction: column; gap: 0.8rem; align-items: flex-start; }
.auth-page form p { margin: 0; width: 100%; }
.auth-page form input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 1.02rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.auth-page form input:focus {
  outline: none;
  border-color: color-mix(in oklch, var(--gold) 70%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--gold) 16%, transparent);
}
.auth-page form button,
.auth-page .shell > a.button {
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.3s var(--ease-out);
}
.auth-page form button:hover { background: oklch(0.30 0.02 75); }
.auth-page ul { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.auth-page .errorlist { color: oklch(0.5 0.16 25); font-size: 0.88rem; }
/* Help text (e.g. password guidelines). Django marks it up as a .helptext span,
   but browsers hoist the inner <ul> out of it while parsing, so the list must be
   targeted directly. */
.auth-page form .helptext,
.auth-page form ul {
  display: block;
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--faint);
}
.auth-page form ul { margin: 0.15rem 0 0; padding: 0; list-style: none; }
.auth-page form ul li + li { margin-top: 0.15rem; }

/* ---- Entrance (sign in / sign up) ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.entrance {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(1rem, 4vh, 3rem);
}
.entrance-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 27rem;
}
.entrance .eyebrow { margin-bottom: 1rem; }
.entrance-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 1.6rem + 3vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.entrance-hint { margin-top: 0.9rem; color: var(--muted); font-size: 0.98rem; }
.auth-page .entrance-hint a { color: var(--gold-deep); border-bottom: 1px solid var(--gold); }
.auth-page .entrance-hint a:hover { color: var(--ink); }

.auth-page a.btn-google {
  margin-top: clamp(1.75rem, 4vh, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-decoration: none;
  transition: border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.auth-page a.btn-google:hover {
  color: var(--ink);
  border-color: color-mix(in oklch, var(--gold) 70%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--gold) 16%, transparent);
}
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

.or-rule {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-block: 1.4rem;
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.or-rule::before,
.or-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-page .entrance form { margin-top: 0; }
.entrance .field { width: 100%; }
.entrance .field + .field { margin-top: 0.15rem; }
.auth-page .entrance form button { width: 100%; margin-top: 0.5rem; }
.entrance .form-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.entrance .remember { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.entrance .remember input { accent-color: var(--gold-deep); width: 15px; height: 15px; }
.auth-page .entrance .quiet-link { color: var(--muted); border-bottom: 1px solid var(--line); }
.auth-page .entrance .quiet-link:hover { color: var(--gold-deep); border-color: var(--gold); }
.entrance .guidelines { margin-top: 0.5rem; }
.auth-page .entrance form ul.errorlist {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: oklch(0.5 0.16 25);
}

/* ---- Profile page ---- */
.profile { max-width: 34rem; }
.profile-facts { margin-top: 1.5rem; display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1.5rem; }
.profile-facts dt { color: var(--muted); font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.08em; align-self: center; }
.profile-facts dd { color: var(--ink); font-weight: 500; }
.profile-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 0.95rem; }

/* ---- Hero ---- */
.hero-wrap {
  position: relative;
  padding-block: clamp(1.5rem, 6vh, 4rem) 0;
}
.hero-wrap--center {
  max-width: min(72ch, 100%);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Faint, static rendering of the brand web — the mark, not an animation */
.web-accent {
  position: absolute;
  top: -6%;
  right: -4%;
  width: min(46vw, 520px);
  color: var(--ink);
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}
.web-accent .core { fill: var(--gold); opacity: 0.5; }

.hero-copy { position: relative; z-index: 1; max-width: min(72ch, 100%); }

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
}

h1.display {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 1.5rem + 6vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
  max-width: 16ch;
}
h1.display .line { display: block; }
h1.display em {
  font-style: italic;
  position: relative;
  white-space: nowrap;
}
h1.display em::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 0.05em;
  height: 2px;
  background: var(--gold);
  opacity: 0.8;
}

.lede {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  max-width: 46ch;
  color: var(--muted);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.4rem);
  line-height: 1.55;
}
.lede strong { color: var(--ink); font-weight: 600; }

/* ---- Signup (Bulma controls, custom row) ---- */
form { margin-top: clamp(2rem, 5vh, 3rem); max-width: 34rem; }
.signup-row { display: flex; align-items: stretch; gap: 0.6rem; }

.signup-row .input {
  flex: 1;
  min-width: 0;
  height: auto;
  padding: 0.7rem 0.9rem;
  font-size: 1.02rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: none;
  transition: border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.signup-row .input::placeholder { color: var(--faint); }
.signup-row .input:focus,
.signup-row .input:focus-within {
  border-color: color-mix(in oklch, var(--gold) 70%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--gold) 16%, transparent);
}

.signup-row .button {
  flex-shrink: 0;
  height: auto;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 9px;
  transition: background 0.3s var(--ease-out);
}
.signup-row .button:hover { background: oklch(0.30 0.02 75); color: var(--bg); }
.signup-row .button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.formnote {
  margin-top: 0.85rem;
  font-size: 0.84rem;
  color: var(--faint);
  min-height: 1.2em;
}
.formnote.ok { color: var(--gold-deep); }

form.sent .signup-row { display: none; }
.sent-msg { display: none; align-items: center; gap: 0.7rem; font-size: 1.1rem; color: var(--ink); }
form.sent .sent-msg { display: flex; }
.sent-msg .tick {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--gold);
  display: grid; place-items: center;
  color: var(--gold-deep);
}

/* ---- Back-home CTA (Bulma button, themed ink) ---- */
.cta { margin-top: clamp(2rem, 5vh, 3rem); }
.cta .button {
  height: auto;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 9px;
  padding: 0.7rem 1.4rem;
  text-decoration: none;
  transition: background 0.3s var(--ease-out);
}
.cta .button:hover { background: oklch(0.30 0.02 75); color: var(--bg); }
.cta .button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---- The shift ---- */
.rule { border: none; height: 1px; width: 100%; background: var(--line); margin: 0; }

.about { padding-block: clamp(0.5rem, 2vh, 1.25rem); }
.about .kicker,
.research-widget .kicker {
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding-top: 0.4rem;
}
.about-body {
  max-width: 56ch;
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vh, 2rem);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.15rem, 1rem + 0.65vw, 1.6rem);
  line-height: 1.5;
  color: var(--muted);
}
.about-body p:first-child { color: color-mix(in oklch, var(--ink) 85%, var(--muted)); }
.about-body strong { color: var(--ink); font-weight: 600; }
.about-body .punch { color: var(--gold-deep); font-style: italic; }

/* ---- Home: public research widget ---- */
.research-widget { padding-block: clamp(0.5rem, 2vh, 1.25rem); }
.research-list { display: flex; flex-direction: column; }
.research-list li { padding-block: 1.1rem; }
.research-list li + li { border-top: 1px solid var(--line); }
.research-list li:first-child { padding-top: 0.4rem; }
.research-list a {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}
.research-list a:hover { color: var(--gold-deep); }
.research-list p { margin-top: 0.35rem; max-width: 56ch; color: var(--muted); font-size: 0.98rem; line-height: 1.55; }
.research-list time {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---- Public research ---- */
.public-research { max-width: 62rem; display: flex; flex-direction: column; gap: clamp(1.5rem, 4vh, 2.5rem); }

.public-research .research-head .eyebrow { margin-bottom: 0.9rem; }
.public-research h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem);
  line-height: 1.1;
  color: var(--ink);
  text-wrap: balance;
}
.public-research .research-lede {
  margin-top: 0.75rem;
  color: var(--muted);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.55;
}

.research-question h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem);
  line-height: 1.15;
  color: var(--ink);
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.research-date {
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  line-height: 1.15;
  color: var(--ink);
}

/* Bulma table, themed to the ink/gold skin */
.public-research .table {
  margin-top: 0.6rem;
  --bulma-table-background-color: transparent;
  --bulma-table-color: var(--ink);
  --bulma-table-cell-border-color: var(--line);
  --bulma-table-cell-border-width: 0 0 1px;
  --bulma-table-head-cell-color: var(--muted);
  --bulma-table-head-cell-border-width: 0 0 2px;
  --bulma-table-striped-row-even-background-color: var(--surface);
  --bulma-table-row-hover-background-color: color-mix(in oklch, var(--gold) 8%, transparent);
  --bulma-table-striped-row-even-hover-background-color: color-mix(in oklch, var(--gold) 8%, transparent);
}
.public-research .table thead th {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.public-research .table .order-col { width: 3.5rem; text-align: center; color: var(--faint); }
.public-research .table td { font-weight: 400; }
.public-research .table td ul { list-style: disc; padding-left: 1.2rem; }
.public-research .table td li + li { margin-top: 0.2rem; }
.public-research .table .probability { margin-left: 0.35rem; font-weight: 400; color: var(--gold-deep); }
.public-research .table .direction-icon { width: 16px; height: 21px; vertical-align: -0.25em; }

.research-collapsible-row { display: none; }
.research-table-body.is-expanded .research-collapsible-row { display: table-row; }
.research-toggle-row td { border-bottom: none; }
.research-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--gold-deep);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.research-toggle-btn:hover { color: var(--gold); }

.research-empty { color: var(--faint); }

/* ---- Footer ---- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 0.82rem;
  margin-top: auto;
  padding-top: clamp(1.5rem, 4vh, 3rem);
}
.site-footer .myth { color: var(--muted); font-size: 0.95rem; }
.site-footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; }
.site-footer a:hover { border-color: var(--gold); }

@media (max-width: 540px) {
  .signup-row { flex-direction: column; }
  .signup-row .button { padding: 0.8rem; }
  .status span { display: none; }
  .web-accent { display: none; }
}

/* ---- Roost news (Wagtail) ---- */
/* Shared page shell: news index, sections, tags, authors, archives, articles */
.roost-page {
  max-width: 62rem;
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 4vh, 2.5rem);
}
.roost-page > header .eyebrow { margin-bottom: 0.9rem; }
.roost-page > header h1,
.roost-page .roost-article-main > header h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem);
  line-height: 1.1;
  color: var(--ink);
  text-wrap: balance;
}
.roost-page > header h1 a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--gold); }
.roost-page > header h1 a:hover { color: var(--gold-deep); }

.roost-intro {
  margin-top: 0.75rem;
  max-width: 56ch;
  color: var(--muted);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.55;
}
.roost-intro p + p { margin-top: 0.6rem; }

.roost-hero-img {
  display: block;
  margin-top: clamp(1.25rem, 3vh, 2rem);
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.roost-feed-link {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}
.roost-feed-link:hover { color: var(--ink); }

.roost-meta {
  margin-top: 0.5rem;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.roost-meta a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.roost-meta a:hover { color: var(--gold-deep); border-color: var(--gold); }

.roost-empty { color: var(--faint); }

/* Article cards — hairline-separated feed, matching .research-list */
.roost-feed { display: flex; flex-direction: column; }
.roost-article-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  column-gap: clamp(1rem, 3vw, 2rem);
  padding-block: 1.3rem;
}
.roost-article-card:first-child { padding-top: 0.4rem; }
.roost-article-card + .roost-article-card { border-top: 1px solid var(--line); }
.roost-article-card h3 {
  grid-column: 1;
  grid-row: 1;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  line-height: 1.2;
}
.roost-article-card h3 a {
  display: inline-block;
  padding-bottom: 0.15em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}
.roost-article-card h3 a:hover { color: var(--gold-deep); }
.roost-article-card .roost-meta { grid-column: 1; grid-row: 2; }
.roost-card-lead {
  grid-column: 1;
  grid-row: 3;
  margin-top: 0.35rem;
  max-width: 56ch;
  color: var(--muted);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.55;
}
.roost-card-img {
  grid-column: 2;
  grid-row: 1 / -1;
  width: clamp(96px, 16vw, 168px);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 9px;
}

/* Section page: article list as a 3-column grid of stacked cards */
.roost-news-index .roost-feed, .roost-section .roost-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vh, 2.5rem) clamp(1rem, 2.5vw, 1.75rem);
}
.roost-news-index .roost-article-card, .roost-section .roost-article-card {
  grid-template-columns: minmax(0, 1fr);
  padding-block: 0;
}
.roost-news-index .roost-article-card:first-child, .roost-section .roost-article-card:first-child { padding-top: 0; }
.roost-news-index .roost-article-card + .roost-article-card, .roost-section .roost-article-card + .roost-article-card { border-top: none; }
.roost-news-index .roost-card-img, .roost-section .roost-card-img {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  margin-bottom: 0.8rem;
}
.roost-news-index .roost-article-card h3, .roost-section .roost-article-card h3 {
  grid-row: 2;
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
}
.roost-news-index .roost-article-card .roost-meta, .roost-section .roost-article-card .roost-meta { grid-row: 3; }
.roost-news-index .roost-card-lead, .roost-section .roost-card-lead { grid-row: 4; font-size: 0.95rem; }

@media (max-width: 900px) {
  .roost-news-index .roost-feed, .roost-section .roost-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Public research: featured (first) article beside the title */
.research-head--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.research-featured .roost-article-card {
  grid-template-columns: minmax(0, 1fr);
  padding-block: 0;
}
.research-featured .roost-article-card:first-child { padding-top: 0; }
.research-featured .roost-card-img {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  margin-bottom: 0.8rem;
}
.research-featured .roost-article-card h3 { grid-row: 2; }
.research-featured .roost-article-card .roost-meta { grid-row: 3; }
.research-featured .roost-card-lead { grid-row: 4; }

@media (max-width: 900px) {
  .research-head--split { grid-template-columns: minmax(0, 1fr); row-gap: 1.75rem; }
}

/* Article page with sidebar (connected research) */
.roost-with-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  column-gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.roost-article-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 4vh, 2.5rem);
}
.roost-sidebar { position: sticky; top: 1.5rem; }

@media (max-width: 900px) {
  .roost-with-aside { grid-template-columns: minmax(0, 1fr); row-gap: clamp(1.5rem, 4vh, 2.5rem); }
  .roost-sidebar { position: static; }
}

/* Article page */
.roost-article .roost-article-main > header h1,
.roost-article > header h1 {
  font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  max-width: 22ch;
}
.roost-lead {
  margin-top: 1rem;
  max-width: 56ch;
  color: var(--muted);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  line-height: 1.5;
}

/* Article body — StreamField blocks arrive as .block-* divs (Bulma's reset
   zeroes p/heading/list margins, so spacing is restored here). */
.roost-body {
  max-width: 68ch;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.08rem, 1rem + 0.3vw, 1.22rem);
  line-height: 1.6;
}
.roost-body p + p { margin-top: 0.9rem; }
.roost-body a { color: var(--gold-deep); text-decoration: none; border-bottom: 1px solid var(--gold); }
.roost-body a:hover { color: var(--ink); }
.roost-body h2, .roost-body h3 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  margin-top: 0.9rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--gold);
}
.roost-body h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
.roost-body h3 { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem); }
.roost-body ul { list-style: disc; padding-left: 1.4rem; }
.roost-body ol { list-style: decimal; padding-left: 1.4rem; }
.roost-body li + li { margin-top: 0.35rem; }
.roost-body img, .roost-body iframe { max-width: 100%; height: auto; border-radius: 12px; }
.roost-body blockquote {
  padding-left: 1.2rem;
  border-left: 3px solid var(--gold);
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
  line-height: 1.4;
  color: var(--muted);
}
.roost-body blockquote cite {
  display: block;
  margin-top: 0.6rem;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-style: normal;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.roost-body pre {
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.55;
}
.roost-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
}
.roost-body th, .roost-body td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; }
.roost-body th {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-width: 2px;
}

/* Article tags */
.roost-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.roost-tags a {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.35s var(--ease-out), color 0.35s var(--ease-out);
}
.roost-tags a:hover { border-color: var(--gold); color: var(--gold-deep); }

/* Related articles + research links */
.roost-related, .roost-research, .research-articles { border-top: 1px solid var(--line); }
.roost-related .kicker, .roost-research .kicker, .research-articles .kicker {
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding-top: 1rem;
}
.roost-research ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.roost-research li { padding-block: 1.1rem; }
.roost-research li + li { border-top: 1px solid var(--line); }
.roost-research a {
  display: inline-block;
  padding-bottom: 0.15em;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}
.roost-research a:hover { color: var(--gold-deep); }
.roost-research p {
  margin-top: 0.35rem;
  max-width: 56ch;
  color: var(--muted);
  font-family: "Newsreader", Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Authors */
.roost-author-head { display: flex; align-items: center; gap: 1.5rem; }
.roost-author-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.roost-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  font-size: 0.88rem;
}
.roost-social-links a { color: var(--gold-deep); text-decoration: none; border-bottom: 1px solid var(--gold); }
.roost-social-links a:hover { color: var(--ink); }

.roost-author-list { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.roost-author-list li { display: flex; align-items: center; gap: 1.1rem; padding-block: 1rem; }
.roost-author-list li:first-child { padding-top: 0.4rem; }
.roost-author-list li + li { border-top: 1px solid var(--line); }
.roost-author-thumb { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.roost-author-list a {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}
.roost-author-list a:hover { color: var(--gold-deep); }

/* Archive prev / next */
.roost-archive-nav { display: flex; justify-content: space-between; gap: 1rem; }
.roost-archive-nav a { color: var(--gold-deep); text-decoration: none; border-bottom: 1px solid var(--gold); }
.roost-archive-nav a:hover { color: var(--ink); }

/* Masthead navigation menu (roost Navigation snippet) */
.main-menu .roost-nav { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.roost-nav summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.95rem;
  color: var(--muted);
  white-space: nowrap;
}
.roost-nav summary::-webkit-details-marker { display: none; }
.roost-nav summary::after { content: "\25BE"; font-size: 0.7em; margin-left: 0.35em; opacity: 0.6; }
.roost-nav summary:hover, .roost-nav details[open] summary { color: var(--ink); }
.roost-nav details { position: relative; }
.roost-nav details > ul {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: -0.9rem;
  min-width: 12rem;
  padding: 0.5rem 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 10px 30px color-mix(in oklch, var(--ink) 10%, transparent);
  list-style: none;
  z-index: 20;
}
.roost-nav details > ul a { display: block; padding: 0.4rem 0.9rem; font-size: 0.92rem; color: var(--muted); text-decoration: none; }
.roost-nav details > ul a:hover { color: var(--ink); background: var(--surface); }
/* Navigations nested inside a dropdown render inline, indented */
.roost-nav details > ul details { position: static; }
.roost-nav details > ul details > ul {
  position: static;
  border: none;
  box-shadow: none;
  padding: 0 0 0 0.9rem;
}

@media (max-width: 540px) {
  .roost-news-index .roost-feed, .roost-section .roost-feed { grid-template-columns: 1fr; }
  .roost-article-card { grid-template-columns: 1fr; }
  .roost-card-img {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 0.7rem;
  }
  .roost-article-card h3 { grid-row: 2; }
  .roost-article-card .roost-meta { grid-row: 3; }
  .roost-card-lead { grid-row: 4; }
  .roost-author-head { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
