/* nellwatson.com design system — 2026 rebuild
   Palette derived from the Kogan Page book covers.
   Type: Fraunces (display) + Source Serif 4 (text), self-hosted. */

/* ---------- tokens ---------- */
:root {
  --ink: #14102f;
  --ink-soft: #2c2650;
  --paper: #fafaf7;
  --paper-shade: #f1f0ea;
  --accent: #3e7f82;
  --accent-deep: #2c5c5e;  /* the site's historic teal, kept by request */
  --cyan: #9bd1e1;
  --orchid: #c0619e;
  --gold: #d4b45a;
  --text: #201c3a;
  --text-muted: #5a5570;
  --line: #dedbd2;
  --line-strong: #8a8578;   /* for control borders: 3:1 against paper, WCAG 1.4.11 */
  --orchid-text: #a8447f;   /* readable orchid for label text (4.8:1); --orchid stays for décor */
  --band-text: #eef3f5;
  --maxw: 72rem;
  --measure: 70ch;
  --radius: 6px;
  font-size: 17px;
  /* Lets the browser render its own furniture -- scrollbars, form controls, the address
     bar -- to match. Without it a dark page keeps a bright white scrollbar. */
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}

@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) { --ink: #0d0a20;
    --ink-soft: #191434;
    --paper: #14111f;
    --paper-shade: #1b1729;
    --text: #e6e3ef;
    --text-muted: #a29dbb;
    --line: #322c4a;
    --line-strong: #6d6690;
    --orchid-text: #c0619e;
    --accent: #8fc3c5;
    --accent-deep: #a8d4d6;
    --band-text: #e6e3ef; }
}
:root[data-theme="dark"] { --ink: #0d0a20;
    --ink-soft: #191434;
    --paper: #14111f;
    --paper-shade: #1b1729;
    --text: #e6e3ef;
    --text-muted: #a29dbb;
    --line: #322c4a;
    --line-strong: #6d6690;
    --orchid-text: #c0619e;
    --accent: #8fc3c5;
    --accent-deep: #a8d4d6;
    --band-text: #e6e3ef; }

/* ---------- fonts ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Source Serif 4", Georgia, serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
.progressive-image {
  display: block;
  background-color: var(--paper-deep);
  background-image: var(--lqip);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
.progressive-image img { display: block; }
a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.5em;
  font-variation-settings: "opsz" 72;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) h1,
:root:not([data-theme="light"]) h2,
:root:not([data-theme="light"]) h3,
:root:not([data-theme="light"]) h4 { color: var(--band-text); }
}
:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4 { color: var(--band-text); }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-top: 1.6em; }
h3 { font-size: 1.25rem; }
p, ul, ol { max-width: var(--measure); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.band {
  background: var(--ink);
  color: var(--band-text);
}
.band h1, .band h2, .band h3 { color: #fff; }
.band a { color: var(--cyan); }
.band a:hover { color: #fff; }

/* ---------- header / nav ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.site-head .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding-top: 1.1rem;
  padding-bottom: 1rem;
}
.brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
/* The mark sits on the page background, so it swaps by scheme: dark teal on
   paper, family teal on ink, where dark teal would sink into the background. */
.brand img { width: 2rem; height: 2rem; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .logo-light { display: none; }
:root:not([data-theme="light"]) .logo-dark { display: inline; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }
.foot-heart { width: 1.6rem; height: 1.6rem; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .brand { color: var(--band-text); }
}
:root[data-theme="dark"] .brand { color: var(--band-text); }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.15rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.92rem;
}
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .site-nav a:hover { color: var(--band-text); }
}
:root[data-theme="dark"] .site-nav a:hover { color: var(--band-text); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .site-nav a[aria-current="page"] { color: var(--band-text); }
}
:root[data-theme="dark"] .site-nav a[aria-current="page"] { color: var(--band-text); }

/* ---------- hero ---------- */
.banner-hero { background: var(--ink); }
.banner-hero img { display: block; width: 100%; height: auto; }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 2.5rem;
  align-items: center;
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}
.hero .kicker {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  margin-bottom: 0.6rem;
}
.hero p.lede { font-size: 1.15rem; }
.hero-portrait img {
  border-radius: var(--radius);
  display: block;
  filter: grayscale(12%);
}
.hero-portrait figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-family: system-ui, sans-serif;
}
@media (max-width: 44rem) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-portrait { max-width: 18rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1.5px solid var(--accent-deep);
  margin: 0.35rem 0.6rem 0 0;
}
.btn-solid { background: var(--accent-deep); color: #fff; }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Dark mode lightens --accent-deep to a pale teal so links stay legible; as a button
   background that leaves white label text at 1.6:1. Dark ink on the pale teal is 12:1.
   .band .btn-solid keeps its own cyan/ink pairing via higher specificity. */
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .btn-solid,
:root:not([data-theme="light"]) .btn-solid:hover { color: var(--ink); }
}
:root[data-theme="dark"] .btn-solid,
:root[data-theme="dark"] .btn-solid:hover { color: var(--ink); }
.btn-ghost { color: var(--accent-deep); background: transparent; }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
.band .btn-solid { background: var(--cyan); border-color: var(--cyan); color: var(--ink); }
.band .btn-solid:hover { background: #fff; border-color: #fff; color: var(--ink); }
.band .btn-ghost { color: var(--cyan); border-color: var(--cyan); }

/* ---------- press strip ---------- */
.press-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-shade);
}
.press-strip .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2.2rem;
  align-items: baseline;
  justify-content: center;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}
.press-strip .label {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.press-strip .outlet {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .press-strip .outlet { color: var(--text); }
}
:root[data-theme="dark"] .press-strip .outlet { color: var(--text); }

/* ---------- sections ---------- */
.section { padding: 3rem 0; }
.section-head { margin-bottom: 1.5rem; }
.section-head p { color: var(--text-muted); }

/* books band */
.books-band { padding: 3.2rem 0; }
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 2.5rem;
  margin-top: 1.6rem;
}
.book {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.4rem;
  align-items: start;
}
.book img { border-radius: 3px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
.book h3 { margin-bottom: 0.3rem; }
.book .meta { font-size: 0.85rem; color: var(--cyan); font-family: system-ui, sans-serif; }
.book blockquote {
  margin: 0.7rem 0 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--orchid);
  font-style: italic;
  font-size: 0.95rem;
}
@media (max-width: 30rem) { .book { grid-template-columns: 1fr; } .book img { max-width: 10rem; } }

/* cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.4rem;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.2rem;
  background: var(--paper);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card h3 { margin-top: 0; }
.card p { font-size: 0.95rem; }
.card .more { font-family: system-ui, sans-serif; font-size: 0.9rem; }

/* card interaction polish: a quiet lift with a teal edge on hover/focus */
.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 14px 32px -14px rgba(20, 16, 47, 0.30);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .card:hover,
:root:not([data-theme="light"]) .card:focus-within { border-color: var(--accent);
    box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.62); }
}
:root[data-theme="dark"] .card:hover,
:root[data-theme="dark"] .card:focus-within { border-color: var(--accent);
    box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.62); }

/* uniform logo zone so every card heading aligns on the same baseline */
.proj-logo {
  display: block;
  height: 4.25rem;
  width: auto;
  max-width: 72%;
  margin: 0 0 1.1rem;
  object-fit: contain;
  object-position: left center;
  transition: transform 0.2s ease;
}
.card:hover .proj-logo,
.card:focus-within .proj-logo { transform: scale(1.045); }

@media (prefers-reduced-motion: reduce) {
  .card,
  .proj-logo { transition: none; }
  .card:hover,
  .card:focus-within { transform: none; }
  .card:hover .proj-logo,
  .card:focus-within .proj-logo { transform: none; }
}

/* projects showcase: a soft editorial rule trailing each section heading */
.projects-page h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap;
}
.projects-page h2::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(to right, var(--line), transparent);
}
@media (max-width: 34rem) {
  .projects-page h2 { display: block; white-space: normal; }
  .projects-page h2::after { content: none; }
}

/* feature card: logo beside prose, for a standout single-project entry */
.card-feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.6rem;
  align-items: start;
  max-width: 46rem;
}
.card-feature img { margin: 0.2rem 0 0 !important; }
.card-feature h3 { margin-top: 0; }
@media (max-width: 34rem) {
  .card-feature { grid-template-columns: 1fr; gap: 1rem; }
}

/* essay list */
.essay-list { list-style: none; padding: 0; margin: 0; max-width: none; }
.essay-list li {
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
}
.essay-list .date {
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.essay-list h3 { margin: 0.1rem 0 0.25rem; font-size: 1.15rem; }
.essay-list p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }

/* ---------- post page ---------- */
.post-head { padding-top: 2.8rem; }
.post-head .date {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.post-body { padding-bottom: 3rem; }
.post-body > * { max-width: var(--measure); }
.post-body h3 { margin-top: 1.5em; }
.post-body img { border-radius: var(--radius); margin: 1rem 0; }
.post-body iframe { max-width: 100%; }
.post-body blockquote {
  margin: 1.2rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--cyan);
  color: var(--text-muted);
}
.editor-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-shade);
  padding: 0.7rem 1rem;
  margin: 1.2rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: system-ui, sans-serif;
}
.editor-note p { margin: 0; }
.editor-note::before {
  content: "2026 note";
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--orchid-text);
  margin-bottom: 0.25rem;
}
.first-published {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.8rem;
  margin-bottom: 1.6rem;
}

/* ---------- essay imagery ---------- */
.post-hero { margin: 1.4rem 0 0; }
.post-hero img { width: 100%; max-width: var(--maxw); border-radius: var(--radius); }
.essay-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.6rem;
  margin: 1.4rem 0 2.4rem;
}
.essay-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
.essay-card img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
  display: block;
}
.essay-card .pad { padding: 0.9rem 1.1rem 1.1rem; }
.essay-card h3 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.essay-card h3 a { text-decoration: none; color: inherit; }
.essay-card h3 a:hover { color: var(--accent); }
.essay-card .date {
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.essay-card p { margin: 0.35rem 0 0; font-size: 0.92rem; color: var(--text-muted); }
.thumb-list { list-style: none; padding: 0; }
.thumb-list li {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  gap: 0.9rem;
  align-items: center;
  padding: 0.45rem 0;
}
.thumb-list img {
  width: 5.2rem;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: 4px;
}
.page-banner img { width: 100%; border-radius: var(--radius); margin: 0.5rem 0 1rem; }

/* ---------- archive & simple lists ---------- */
.archive-year { margin-top: 2rem; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: 0.35rem 0; }
.plain-list .sub { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- press page ---------- */

/* The masthead strip: the first question a booker asks is "where has she been?" */
.press-marquee {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  padding: 1rem 0 1.4rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}
.press-marquee .mq {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.02rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.press-kit {
  background: var(--paper-shade);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  margin-bottom: 2.6rem;
}
.press-kit h2 { margin-top: 0; }
.press-kit h3 {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.4rem 2.4rem;
}
.kit-bio { margin-top: 0; }

/* Outlet is the scanning key, so it gets its own aligned column rather than sitting
   inline. The year is optional: most items in press.json carry no date. */
.pr-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.pr-row {
  display: grid;
  grid-template-columns: 11rem 1fr auto;
  gap: 0.2rem 1rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.pr-outlet {
  font-family: system-ui, sans-serif;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--accent-deep);
  line-height: 1.5;
}
.pr-title { text-wrap: pretty; }
.pr-year {
  font-family: system-ui, sans-serif;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.pr-featured .pr-title { font-size: 1.05rem; }

@media (max-width: 44rem) {
  .pr-row {
    grid-template-columns: 1fr auto;
  }
  .pr-outlet { grid-column: 1 / -1; }
}

/* ---------- forms ---------- */
.contact-form { max-width: 34rem; }
.contact-form label {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1rem 0 0.3rem;
}
.contact-form input, .contact-form textarea, .contact-form select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.98rem;
  color: var(--text);
  border-color: var(--line-strong);  /* field boundary needs 3:1; --line alone is ~1.3:1 */
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.form-note { font-size: 0.85rem; color: var(--text-muted); font-family: system-ui, sans-serif; }

/* testimonials */
.testimonial-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.4rem 2.2rem;
}
.testimonial {
  border-left: 3px solid var(--cyan);
  padding-left: 1.1rem;
  margin: 1rem 0;
}
.testimonial p:first-child::before {
  content: "\201C";
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.6em;
  color: var(--gold);
  line-height: 0;
  margin-right: 0.15rem;
  vertical-align: -0.25em;
}
.testimonial .who {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- footer ---------- */
.site-foot {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: var(--paper-shade);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  justify-content: space-between;
  padding-top: 1.6rem;
  padding-bottom: 2rem;
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; }
.site-foot a { color: var(--text-muted); }
.site-foot a:hover { color: var(--ink); }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .site-foot a:hover { color: var(--band-text); }
}
:root[data-theme="dark"] .site-foot a:hover { color: var(--band-text); }

/* ---------- character ---------- */
.asterism {
  text-align: center;
  color: var(--gold);
  font-size: 1.3rem;
  padding: 0.4rem 0 0;
  user-select: none;
}
.sigil { color: var(--gold); display: block; margin: 0 auto; }
.sigil-divider { text-align: center; padding: 1.6rem 0 0.2rem; }
.credo blockquote {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-soft);
  border: 0;
  margin: 2.2rem auto;
  max-width: 44rem;
  padding: 0;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .credo blockquote { color: var(--text); }
}
:root[data-theme="dark"] .credo blockquote { color: var(--text); }
.credo .src {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
[data-dropcap]::first-letter {
  font-family: "Fraunces", Georgia, serif;
  font-size: 3.1em;
  line-height: 0.85;
  float: left;
  padding: 0.06em 0.12em 0 0;
  color: var(--accent-deep);
}
/* magazine-style floated images from the original essays */
.post-body .float-left, .post-body .sqs-block-image.float-left {
  float: left; width: 46%; margin: 0.3rem 1.4rem 0.9rem 0;
}
.post-body .float-right, .post-body .sqs-block-image.float-right {
  float: right; width: 46%; margin: 0.3rem 0 0.9rem 1.4rem;
}
@media (max-width: 34rem) {
  .post-body .float-left, .post-body .float-right { float: none; width: 100%; margin: 1rem 0; }
}
.video-embed {
  position: relative; aspect-ratio: 16 / 9; margin: 0.4rem 0 0.2rem;
  border-radius: var(--radius); overflow: hidden; background: var(--ink);
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-body .embed-block-wrapper { position: relative; }
.video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1.5rem; margin: 1.2rem 0 2rem;
}
.video-grid figcaption {
  font-family: system-ui, sans-serif; font-size: 0.85rem; color: var(--text-muted);
}
.post-cats { margin: 1.6rem 0 0; }
.cat-chip {
  display: inline-block; font-family: system-ui, sans-serif; font-size: 0.75rem;
  color: var(--accent-deep); border: 1px solid var(--line); border-radius: 99px;
  padding: 0.1rem 0.65rem; margin: 0 0.4rem 0.4rem 0;
}
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  border-top: 1px solid var(--line); padding-top: 1.1rem;
}
.post-nav a {
  text-decoration: none; font-family: "Fraunces", Georgia, serif; font-size: 1.02rem;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .post-nav a { color: var(--band-text); }
}
:root[data-theme="dark"] .post-nav a { color: var(--band-text); }
.post-nav a:hover { color: var(--accent); }
.post-nav a span {
  display: block; font-family: system-ui, sans-serif; font-size: 0.75rem;
  color: var(--text-muted); margin-bottom: 0.15rem;
}
.post-nav .older { text-align: right; }
.quote-band {
  background: var(--paper-shade);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2.6rem 0;
}
.quote-band blockquote {
  margin: 0 auto;
  max-width: 46rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  line-height: 1.45;
  text-align: center;
  color: var(--ink-soft);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .quote-band blockquote { color: var(--text); }
}
:root[data-theme="dark"] .quote-band blockquote { color: var(--text); }
.quote-band .who {
  /* Right-aligned under the quote's own right edge, not the far page edge: the paragraph
     shares the blockquote's 46rem centred measure and the text sits at its right. */
  max-width: 46rem;
  margin: 0.7rem auto 0;
  text-align: right;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- utilities ---------- */
.muted { color: var(--text-muted); }
.small { font-size: 0.9rem; }
.skip-link {
  position: absolute;
  left: -999px;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; z-index: 10; }

/* ---------- now page ---------- */
.now-list { list-style: none; padding: 0; margin: 2rem 0 0; }
.now-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.now-item:last-child { border-bottom: 1px solid var(--line); }
.now-date {
  flex: 0 0 9.5rem;
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--accent-deep);
  padding-top: 0.2rem;
}
.now-body { display: block; }
.now-detail { display: block; color: var(--text-muted); margin-top: 0.2rem; }
.now-meta {
  display: block;
  margin-top: 0.35rem;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
}
.now-note { color: var(--text-muted); font-style: italic; cursor: help; }
.now-updated { margin-top: 2rem; color: var(--text-muted); font-size: 0.9rem; }

@media (max-width: 34rem) {
  .now-item { flex-direction: column; gap: 0.3rem; }
  .now-date { flex-basis: auto; }
}

/* ---------- theme toggle ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin-left: 0.15rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 99px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:root[data-theme="dark"] .theme-toggle:hover { color: var(--band-text); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle:hover { color: var(--band-text); }
}
/* Show the icon for the mode you would switch TO: a moon on a light page. */
.theme-toggle .i-moon { display: block; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* ---------- early-access galleys (/books) ---------- */
.galley-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.4rem;
}
.galley {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  background: var(--paper-shade);
  display: flex;
  flex-direction: column;
}
.galley h3 { margin: 0.15rem 0 0.35rem; }
.galley .meta { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 0.7rem; }
.galley p:last-child { margin-top: auto; margin-bottom: 0; padding-top: 0.6rem; }
.galley-tag {
  font-family: system-ui, sans-serif;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-deep);
  margin: 0;
}

/* ---------- publications (/research) ---------- */
.pub-scholar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  align-items: baseline;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.pub-metrics {
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.pub-list { padding-left: 1.2rem; }
.pub-list li { margin-bottom: 0.9rem; }
.pub-meta {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ---------- quote band controls ---------- */
.spark-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.1rem;
  /* Override the base `p { max-width: 70ch }`: without this the flex row is a narrow
     left-pinned box and justify-content only centres the button within it, leaving it
     visibly left of the page centre. Full width -> the button lands on the true centre. */
  max-width: none;
}
/* The band sits on --paper-shade, a LIGHT ground in both themes, so these take the normal
   text tokens; --band-text is near-white and would vanish here. */
.spark-btn {
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 0.35rem 0.95rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.spark-btn:hover, .spark-btn:focus-visible {
  border-color: var(--accent);
  background: var(--paper);
}
@media (prefers-reduced-motion: reduce) {
  .spark-btn { transition: none; }
}

/* ---------- quote archive (/quotes) ---------- */
.quote-group { margin-bottom: 2.6rem; }
.quote-group h2 {
  font-size: 1.15rem;
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.quote-group h2 .small { color: var(--text-muted); font-weight: 400; }
.quote-list { list-style: none; padding: 0; margin: 0; }
.quote-list li { margin-bottom: 0.9rem; }
.quote-list blockquote {
  margin: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  max-width: var(--measure);
  text-wrap: pretty;
}
