@import url('./colors_and_type.css');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai+Looped:wght@400;500;600;700&display=swap');

/* =========================================================
   Book-site shared styles
   ========================================================= */
:root {
  --site-max: 1200px;
  /* Weave texture intensities (0–1) — derived from the cover photo */
  --weave-hero: 0.3;
  --weave-dark: 0.45;
  --weave-oa: 0.4;
  --weave-paper: 0.8;
}

body {
  background: var(--paper-100);
  color: var(--ink-900);
  margin: 0;
}
/* Cover-photo weave, bleached to the cream paper tone. Fixed so the
   texture reads as one continuous sheet behind the whole page. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: url('assets/weave-paper.jpg') center / cover no-repeat;
  opacity: var(--weave-paper);
  pointer-events: none;
}

.container {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
}

/* --- Top nav ---------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in oklab, var(--ink-1000) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--thread-500);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-sans); font-weight: 700; font-size: 14px;
  letter-spacing: -0.01em; color: #ffffff; text-decoration: none;
  white-space: nowrap; flex: 0 0 auto;
}
.brand .mark {
  width: 16px; height: 16px; position: relative;
}
.brand .mark::before, .brand .mark::after {
  content: ""; position: absolute; background: #ffffff;
}
.brand .mark::before { left: 0; right: 0; top: 7px; height: 2px; }
.brand .mark::after  { top: 0; bottom: 0; left: 7px; width: 2px; }

.nav-links {
  display: flex; align-items: center; gap: 28px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
}
.nav-links a {
  color: rgba(255,255,255,0.92); text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.nav-links a:hover { color: #ffffff; }
.nav-links .cta {
  background: var(--thread-500); color: #ffffff;
  padding: 8px 14px; border-radius: 2px; font-weight: 600;
}
.nav-links .cta:hover { background: var(--thread-600); color: #ffffff; }

@media (max-width: 1040px) {
  .nav-links { gap: 16px; font-size: 12.5px; }
}
@media (max-width: 720px) {
  .nav-links { gap: 14px; font-size: 12px; }
  .nav-links a:not(.cta) { display: none; }
}

/* --- Language switcher ------------------------------------ */
.lang-switch {
  display: flex; align-items: center; gap: 2px;
  border: 1px solid color-mix(in oklab, #ffffff 28%, transparent);
  border-radius: 2px; padding: 2px;
}
.lang-switch button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; line-height: 1;
  color: rgba(255,255,255,0.75);
  padding: 5px 9px; border-radius: 1px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.lang-switch button:hover { color: #ffffff; }
.lang-switch button.on { background: #ffffff; color: var(--ink-900); }
.lang-switch .lang-soon {
  position: relative;
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em; padding: 4px 8px; border-radius: 2px;
  color: color-mix(in oklab, #ffffff 50%, transparent);
  cursor: default; user-select: none;
}
.lang-switch .lang-soon::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--ink-900); color: #ffffff;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 3px; white-space: nowrap;
  opacity: 0; transform: translateY(-2px); pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.lang-switch .lang-soon:hover::after,
.lang-switch .lang-soon:focus-visible::after { opacity: 1; transform: translateY(0); }

/* --- Hero ------------------------------------------------- */
.hero {
  padding: 72px 0 88px;
  position: relative;
  background: var(--ink-1000);
  color: #ffffff;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr clamp(340px, 42%, 480px);
  gap: 80px;
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.78);
  display: inline-flex; gap: 10px; align-items: center;
}
.hero-eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,0.55); }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 7vw, 104px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 10px 0 16px;
  color: #ffffff;
  text-wrap: balance;
}
/* Thai rendering of the title — สังคมแห่งการเรียนรู้, "a society of
   learning", the phrase used across the Thai lifelong-learning movement. */
.hero-thai {
  display: block;
  font-family: 'Noto Sans Thai Looped', var(--font-sans);
  font-size: 18px; font-weight: 600;
  color: var(--thread-300);
  margin-top: 26px;
  letter-spacing: 0.01em;
}
.hero-thread {
  height: 4px; width: 96px; background: var(--thread-500);
  transform-origin: left center;
  animation: thread-grow 800ms var(--ease) 200ms both;
  margin: 8px 0 24px;
}
@keyframes thread-grow {
  from { transform: scaleX(0); } to { transform: scaleX(1); }
}
.hero-sub {
  font-family: var(--font-sans);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  font-weight: 600;
  color: rgba(255,255,255,0.94);
  margin: 0 0 28px;
  max-width: 24ch;
  text-wrap: balance;
}
.hero-desc {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255,255,255,0.84);
  margin: -10px 0 28px;
  max-width: 46ch;
  text-wrap: pretty;
}
.hero-authors {
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  color: #ffffff;
}
.hero-authors .sep { color: rgba(255,255,255,0.6); font-weight: 400; margin: 0 6px; }

.hero-meta {
  margin-top: 32px;
  display: flex; flex-wrap: wrap; gap: 20px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.75);
}
.hero-actions {
  margin-top: 36px;
  display: flex; flex-wrap: wrap; gap: 12px;
}

.cover-wrap {
  position: relative;
  display: flex; justify-content: center;
}
/* 3D paperback render from the publisher flyer — purple field knocked
   out, so it sits transparently on any hero background. */
.book3d {
  display: block;
  width: 100%; max-width: 480px;
  height: auto;
  transition: transform var(--dur-slow) var(--ease);
}
.cover-wrap:hover .book3d { transform: translateY(-6px); }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-grid .cover-wrap { order: -1; }
}

/* The real cover photograph — full color loom threads — sits behind the
   hero, darkened toward the text side so the white type reads like the
   jacket itself. */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: url('assets/weave-full.jpg') center 35% / cover no-repeat;
  opacity: var(--weave-hero);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(98deg,
    rgba(26,15,8,0.96) 0%,
    rgba(26,15,8,0.92) 38%,
    rgba(26,15,8,0.72) 70%,
    rgba(26,15,8,0.55) 100%);
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 1; }
/* Hero buttons — vermilion signal on the dark field */
.hero .btn.primary { background: var(--thread-500); color: #ffffff; }
.hero .btn.primary:hover { background: var(--thread-600); color: #ffffff; }
.hero .btn.ghost { color: #ffffff; border-color: #ffffff; }
.hero .btn.ghost:hover { background: #ffffff; color: var(--purple-700); }

/* --- Buttons --------------------------------------------- */
.btn {
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: 2px; border: 0; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  letter-spacing: -0.005em;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink-900); color: var(--paper-50); }
.btn.primary:hover { background: var(--ink-1000); }
.btn.accent { background: var(--thread-500); color: #fff; }
.btn.accent:hover { background: var(--thread-600); }
.btn.ghost {
  background: transparent; color: var(--ink-900);
  border: 1.5px solid var(--ink-900); padding: 10.5px 20.5px;
}
.btn.ghost:hover { background: var(--ink-900); color: var(--paper-50); }
.btn .arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* --- Sections -------------------------------------------- */
.section { padding: 96px 0; }
.section + .section { padding-top: 0; }
.section.dark { background: var(--ink-1000); color: var(--paper-50); padding: 112px 0; position: relative; }
.section.dark::before {
  content: ""; position: absolute; inset: 0;
  background: url('assets/weave-ink.jpg') center / cover no-repeat;
  opacity: var(--weave-dark);
  -webkit-mask-image: linear-gradient(115deg, transparent 28%, #000 80%);
  mask-image: linear-gradient(115deg, transparent 28%, #000 80%);
  pointer-events: none;
}
.section.dark > .container { position: relative; }
.section.dark.oa { background: var(--purple-800); }
.section.dark.oa::before {
  background-image: url('assets/weave-deep.jpg');
  opacity: var(--weave-oa);
}
.section-eyebrow {
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: inherit; opacity: 0.7;
  margin-bottom: 12px;
}
.section h2 {
  font-family: var(--font-display); font-size: clamp(32px, 4vw, 60px);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.05;
  margin: 0 0 32px; max-width: 22ch; text-wrap: balance;
  text-transform: none;
}
.section.dark h2 { color: var(--paper-50); }
.section-thread {
  height: 2px; width: 48px; background: var(--thread-500); margin-bottom: 24px;
}

/* --- Section mark: thread + Thai script + English eyebrow ---------- */
.section-mark {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 28px;
}
.section-mark-thread {
  align-self: center; flex: 0 0 auto;
  width: 28px; height: 2px; background: var(--thread-500);
}
.section-mark-thai {
  font-family: 'Noto Sans Thai Looped', var(--font-sans);
  font-size: 15px; font-weight: 600;
  color: var(--thread-700);
  white-space: nowrap;
}
.section-mark-en {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-500);
}
.section.dark .section-mark-thai { color: var(--thread-300); }
.section.dark .section-mark-en { color: var(--paper-300); }

/* --- About ----------------------------------------------- */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start;
}
.about-lede {
  font-family: var(--font-serif); font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.4; color: var(--ink-900);
  margin: 0; text-wrap: pretty;
}
.about-body {
  font-family: var(--font-serif); font-size: 17px; line-height: 1.65;
  color: var(--ink-700); display: grid; gap: 18px;
}
.about-body p { margin: 0; max-width: 56ch; }
.about-body em { font-style: italic; color: var(--ink-900); }
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }

/* --- Authors --------------------------------------------- */
.authors-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
}
.author-card {
  background: var(--paper-50);
  border: 1px solid color-mix(in oklab, var(--ink-900) 18%, transparent);
  border-radius: 4px;
  padding: 32px;
  display: grid; gap: 12px;
}
.author-portrait {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--paper-300);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-weight: 700; font-size: 22px;
  color: var(--ink-900);
  border: 2px solid var(--ink-900);
}
.author-photo {
  display: block; width: 114px; height: 114px;
  border: 2px solid var(--ink-900); border-radius: 50%;
  background: var(--paper-300);
}
.author-name {
  font-family: var(--font-sans); font-size: 22px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--ink-900); margin: 4px 0 0;
}
.author-role {
  font-family: var(--font-serif); font-style: italic; font-size: 14px;
  color: var(--ink-500); margin-bottom: 8px;
}
.author-bio {
  font-family: var(--font-serif); font-size: 15px; line-height: 1.55;
  color: var(--ink-700); margin: 0;
}
@media (max-width: 800px) { .authors-grid { grid-template-columns: 1fr; } }

/* --- Field studies -------------------------------------- */
/* Light sections are semi-transparent so the paper weave shows through
   while the bone/cream rhythm between sections is preserved. */
.field { background: color-mix(in oklab, var(--paper-50) 82%, transparent); }
.field-lede {
  font-family: var(--font-serif); font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.5; color: var(--ink-700);
  max-width: 60ch; margin: 0 0 48px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 280px;
  gap: 16px;
}
.field-card {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--ink-1000);
  display: flex; align-items: flex-end;
  cursor: pointer;
}
.field-card.wide { grid-column: span 2; grid-row: span 2; }
.field-card.tall { grid-column: span 1; grid-row: span 1; }
.field-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform 600ms var(--ease), filter var(--dur) var(--ease);
  filter: saturate(1.05);
}
.field-card:hover .field-img { transform: scale(1.04); }
.field-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,15,8,0.85) 0%, rgba(26,15,8,0.0) 55%);
  pointer-events: none;
}
.field-card figcaption {
  position: relative; z-index: 1;
  padding: 18px 20px;
  color: var(--paper-50);
  border-left: 3px solid var(--thread-500);
  margin: 16px;
  background: transparent;
}
.field-eyebrow {
  display: block;
  font-family: var(--font-sans); font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--thread-300);
  margin-bottom: 6px;
}
.field-card figcaption p {
  font-family: var(--font-serif); font-size: 14px; line-height: 1.45;
  margin: 0; color: var(--paper-50); max-width: 36ch;
}
.field-card.wide figcaption p { font-size: 16px; max-width: 44ch; }
@media (max-width: 1000px) {
  .field-grid { grid-template-columns: repeat(2, 1fr); }
  .field-card.wide { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 600px) {
  .field-grid { grid-template-columns: 1fr; }
  .field-card.wide { grid-column: span 1; }
}

/* --- Praise --------------------------------------------- */
.praise-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px;
}
.praise-card {
  border: 1px solid color-mix(in oklab, var(--paper-50) 25%, transparent);
  border-radius: 4px;
  padding: 32px;
  display: grid; gap: 16px;
}
.praise-card.lead {
  background: var(--paper-100); color: var(--ink-900);
  border: 0; padding: 40px;
}
.praise-card .quote {
  font-family: var(--font-serif); font-style: italic;
  font-size: 22px; line-height: 1.35; margin: 0; text-wrap: pretty;
}
.praise-card.lead .quote { font-size: 28px; }
.praise-card cite {
  font-style: normal; font-family: var(--font-sans);
  font-size: 12px; letter-spacing: 0.04em; opacity: 0.75;
}
.praise-card cite b { font-weight: 700; opacity: 1; }
.praise-thread { height: 2px; width: 32px; background: var(--thread-500); }
@media (max-width: 800px) { .praise-grid { grid-template-columns: 1fr; } }

/* --- Open access ---------------------------------------- */
.oa-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 56px; align-items: center;
}
.oa-callout {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.5vw, 52px);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.05;
  margin: 0; text-wrap: balance;
}
.oa-callout em { font-style: italic; color: var(--thread-400); }
.oa-body {
  font-family: var(--font-serif); font-size: 16px; line-height: 1.6;
  color: var(--paper-300); margin: 20px 0 28px; max-width: 50ch;
}
.oa-meta {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--paper-300); margin-bottom: 12px;
}
.oa-proceeds {
  font-family: var(--font-serif); font-size: 16px; line-height: 1.6;
  font-weight: 700; color: var(--paper-50);
  max-width: 52ch; margin: 14px 0 0;
}
@media (max-width: 800px) { .oa-grid { grid-template-columns: 1fr; gap: 32px; } }

/* --- Retailers ------------------------------------------ */
.retailers {
  background: color-mix(in oklab, var(--paper-50) 82%, transparent);
}
.retailer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.retailer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  background: var(--paper-100);
  border: 1px solid color-mix(in oklab, var(--ink-900) 14%, transparent);
  border-radius: 4px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  color: var(--ink-900);
  text-decoration: none;
  transition: all var(--dur) var(--ease);
}
.retailer:hover {
  background: var(--ink-900); color: var(--paper-50);
  border-color: var(--ink-900);
  text-decoration: none;
}
.retailer .arrow { font-family: var(--font-mono); }
.retailer-name { display: flex; align-items: center; gap: 10px; }
.retailer-flag { font-size: 17px; line-height: 1; }
.retailer-soon {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 4px 9px; border: 1px solid currentColor; border-radius: 999px;
  opacity: 0.6; white-space: nowrap;
}
.retailer.soon { opacity: 0.72; }
@media (max-width: 800px) { .retailer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .retailer-grid { grid-template-columns: 1fr; } }

/* --- Selvedge band — the real cover photo, full color ----- */
.weave-band {
  height: 14px;
  background: url('assets/weave-full.jpg') center 38% / cover no-repeat;
}
body.no-band .weave-band { display: none; }

/* --- Footer --------------------------------------------- */
.footer {
  border-top: 1px solid color-mix(in oklab, var(--ink-900) 14%, transparent);
  padding: 56px 0 40px;
  background: color-mix(in oklab, var(--paper-100) 45%, transparent);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
  margin-bottom: 56px;
}
.footer-brand { max-width: 36ch; }
.footer-brand .name {
  font-family: var(--font-sans); font-weight: 700; font-size: 18px;
  letter-spacing: -0.01em; margin: 12px 0 8px;
}
.footer-brand .desc {
  font-family: var(--font-serif); font-size: 14px; line-height: 1.55;
  color: var(--ink-500); margin: 0;
}
.footer h4 {
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-500);
  margin: 0 0 14px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer ul a {
  font-family: var(--font-sans); font-size: 13px; color: var(--ink-900);
  text-decoration: none;
}
.footer ul a:hover { color: var(--thread-700); text-decoration: underline; text-underline-offset: 3px; }
.footer h4.sub { margin-top: 26px; }
.footer ul.papers { gap: 12px; }
.footer ul.papers li { display: grid; gap: 3px; }
.footer ul.papers a { font-family: var(--font-serif); font-style: italic; line-height: 1.4; }
.footer ul.papers .paper-meta {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--ink-500);
}
.footer-papers {
  border-top: 1px solid color-mix(in oklab, var(--ink-900) 12%, transparent);
  padding-top: 32px; margin-bottom: 48px;
}
.footer-papers h4.sub { margin-top: 0; }
.footer-papers ul.papers { grid-template-columns: repeat(3, 1fr); gap: 22px 40px; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px;
  border-top: 1px solid color-mix(in oklab, var(--ink-900) 12%, transparent);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-500);
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-papers ul.papers { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}
@media (max-width: 520px) {
  .footer-papers ul.papers { grid-template-columns: 1fr; }
}

/* --- Buy menu (interactive) ------------------------------ */
.buy-menu-wrap { position: relative; }
.buy-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--paper-50);
  border: 1px solid color-mix(in oklab, var(--ink-900) 18%, transparent);
  border-radius: 4px;
  box-shadow: var(--elev-1);
  min-width: 220px;
  padding: 6px;
  display: grid;
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 20;
}
.buy-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.buy-menu a {
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  padding: 9px 12px; border-radius: 2px;
  color: var(--ink-900); text-decoration: none;
  display: flex; justify-content: space-between; align-items: center;
}
.buy-menu a:hover { background: var(--ink-900); color: var(--paper-50); }
.buy-menu a .arrow { font-family: var(--font-mono); opacity: 0.5; }

/* --- Praise reviewer photos ----------------------------- */
.praise-by {
  display: flex; align-items: center; gap: 14px;
  margin-top: 8px;
}
.praise-photo {
  display: block; flex: 0 0 auto;
  width: 76px; height: 76px; border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--paper-50) 30%, transparent);
  background: color-mix(in oklab, var(--paper-50) 12%, transparent);
}
.praise-card.lead .praise-photo {
  border-color: var(--ink-900);
  background: var(--paper-300);
}
.praise-card .praise-by cite { margin: 0; }

/* --- Open-access availability badge --------------------- */
.oa-availability {
  display: inline-flex; align-items: center; gap: 9px;
  white-space: nowrap;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--paper-50);
  border: 1px solid color-mix(in oklab, var(--paper-50) 28%, transparent);
  border-radius: 9999px;
  padding: 7px 16px 7px 13px;
  margin: 20px 0 4px;
}
.oa-availability-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--thread-500);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--thread-500) 28%, transparent);
}

/* --- Sample chapter ------------------------------------- */
.sample { background: color-mix(in oklab, var(--paper-50) 82%, transparent); }
.sample-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center;
}
.sample-body {
  font-family: var(--font-serif); font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55; color: var(--ink-700);
  max-width: 42ch; margin: 0 0 28px;
}
.sample-page {
  position: relative;
  background: var(--paper-0);
  border: 1px solid color-mix(in oklab, var(--ink-900) 14%, transparent);
  border-radius: 4px;
  box-shadow: var(--elev-2);
  padding: 44px 48px 56px;
  margin: 0;
}
.sample-page::before {
  content: ""; position: absolute; top: 24px; bottom: 24px; left: 22px;
  width: 1px; background: color-mix(in oklab, var(--ink-900) 10%, transparent);
}
.sample-page-marker {
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--thread-700); margin-bottom: 20px;
}
.sample-excerpt {
  font-family: var(--font-serif); font-size: 20px; line-height: 1.45;
  font-weight: 600; color: var(--ink-900);
  margin: 0 0 28px; text-wrap: pretty;
  padding-bottom: 24px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink-900) 12%, transparent);
}
.sample-cont {
  font-family: var(--font-serif); font-size: 15px; line-height: 1.65;
  color: var(--ink-700); margin: 0;
}
.sample-folio {
  position: absolute; bottom: 20px; right: 28px;
  font-family: var(--font-serif); font-size: 13px; color: var(--ink-300);
}
@media (max-width: 860px) {
  .sample-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* --- Chapter co-authors --------------------------------- */
.coauthors { background: color-mix(in oklab, var(--paper-100) 45%, transparent); }
.coauthors-lede {
  font-family: var(--font-serif); font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.5; color: var(--ink-700);
  max-width: 58ch; margin: -12px 0 48px;
}
.coauthors-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px;
}
.coauthor-card {
  background: var(--paper-50);
  border: 1px solid color-mix(in oklab, var(--ink-900) 16%, transparent);
  border-radius: 4px;
  padding: 22px 20px;
  display: grid; gap: 14px; align-content: start;
}
.coauthor-photo {
  display: block; width: 102px; height: 102px; border-radius: 50%;
  border: 2px solid var(--ink-900); background: var(--paper-300);
}
.coauthor-bio {
  font-family: var(--font-serif); font-size: 13.5px; line-height: 1.5;
  color: var(--ink-700); margin: 0;
}
.coauthor-bio b {
  font-family: var(--font-sans); font-weight: 700; font-size: 14px;
  color: var(--ink-900); letter-spacing: -0.01em;
}
.coauthor-bio b.coauthor-credit {
  display: inline; font-family: var(--font-serif); font-size: 13.5px;
  letter-spacing: 0; color: var(--thread-700);
}
.coauthor-chapter {
  justify-self: start;
  white-space: nowrap;
  font-family: var(--font-sans); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--thread-700);
  border: 1px solid color-mix(in oklab, var(--thread-700) 35%, transparent);
  border-radius: 9999px; padding: 4px 11px;
}
@media (max-width: 1080px) { .coauthors-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .coauthors-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .coauthors-grid { grid-template-columns: 1fr; } }

/* --- Subscribe ------------------------------------------ */
.subscribe {
  background: color-mix(in oklab, var(--paper-50) 82%, transparent);
}
.subscribe-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start;
}
.subscribe-intro h2 { margin: 0 0 18px; }
.subscribe-lede {
  font-family: var(--font-serif); font-size: 18px; line-height: 1.55;
  color: var(--ink-700); margin: 0; max-width: 42ch;
}
.subscribe-lede em { font-style: italic; color: var(--thread-700); }
.subscribe-fineprint {
  font-family: var(--font-mono); font-size: 11px; line-height: 1.5;
  letter-spacing: 0.02em; color: var(--ink-500);
  margin: 28px 0 0; max-width: 40ch;
}

.subscribe-panel {
  background: var(--paper-100);
  border: 1px solid color-mix(in oklab, var(--ink-900) 14%, transparent);
  border-radius: 4px; padding: 36px 36px 38px;
}
.subscribe-form { display: grid; gap: 22px; }
.field { display: grid; gap: 7px; }
.field label, .field legend {
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-700);
  padding: 0;
}
.field input[type="text"], .field input[type="email"], .field textarea {
  font-family: var(--font-sans); font-size: 15px; color: var(--ink-900);
  background: var(--paper-0, #fff);
  border: 1px solid color-mix(in oklab, var(--ink-900) 22%, transparent);
  border-radius: 2px; padding: 12px 14px; width: 100%;
  transition: border-color var(--dur) var(--ease);
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-500); opacity: 0.7; }
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--thread-500); outline-offset: 2px;
  border-color: var(--thread-500);
}
.field input.has-error { border-color: var(--thread-600); }
.field-error {
  font-family: var(--font-sans); font-size: 12.5px; color: var(--thread-700);
}

.field.interests { border: 0; margin: 0; }
.interest-list { display: grid; gap: 10px; margin-top: 4px; }
.interest {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  font-family: var(--font-serif); font-size: 15px; color: var(--ink-700);
}
.interest input { position: absolute; opacity: 0; width: 0; height: 0; }
.interest-box {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 2px;
  border: 1.5px solid color-mix(in oklab, var(--ink-900) 30%, transparent);
  position: relative; transition: all var(--dur-fast) var(--ease);
}
.interest.on { color: var(--ink-900); }
.interest.on .interest-box {
  background: var(--thread-500); border-color: var(--thread-500);
}
.interest.on .interest-box::after {
  content: ""; position: absolute; left: 5px; top: 1.5px;
  width: 5px; height: 9px; border: solid #fff;
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.interest input:focus-visible + .interest-box {
  outline: 2px solid var(--thread-500); outline-offset: 2px;
}
.subscribe-submit { justify-self: start; margin-top: 2px; }

/* confirmation state */
.subscribe-done { padding: 2px 0; }
.subscribe-done-thread {
  display: block; height: 2px; width: 48px; background: var(--thread-500);
  margin-bottom: 22px;
}
.subscribe-done-eyebrow {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--thread-700); margin-bottom: 14px;
}
.subscribe-done-msg {
  font-family: var(--font-display); font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
  color: var(--ink-900); margin: 0; text-wrap: balance;
}
.subscribe-done-msg em { font-style: italic; color: var(--thread-700); }
.subscribe-done-email {
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-700);
  margin: 16px 0 0;
}
.subscribe-done-list {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.subscribe-done-list li {
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  color: var(--ink-700);
  border: 1px solid color-mix(in oklab, var(--ink-900) 16%, transparent);
  border-radius: 9999px; padding: 5px 13px;
}
.subscribe-reset {
  appearance: none; background: 0; border: 0; cursor: pointer;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  color: var(--ink-900); padding: 0; margin-top: 26px;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  border-bottom: 1px solid color-mix(in oklab, var(--ink-900) 35%, transparent);
}
.subscribe-reset:hover { border-bottom-width: 2px; }
.subscribe-reset .arrow { transition: transform var(--dur) var(--ease); }
.subscribe-reset:hover .arrow { transform: translateX(3px); }

@media (max-width: 800px) {
  .subscribe-grid { grid-template-columns: 1fr; gap: 36px; }
  .subscribe-panel { padding: 28px 24px 30px; }
}
