/* ─── Research paper page ──────────────────────────────
   Email gate → unlocked paper UI with chapter-by-chapter
   navigation. Inherits all brand variables from /styles.css. */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* `display: grid` etc. would otherwise win over the [hidden] UA style. */
[hidden] { display: none !important; }

.research-main {
  position: relative;
  z-index: 1;
}

/* ─── Email gate ──────────────────────────────────────── */
.gate {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px var(--pad-h);
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
}
.gate-inner {
  max-width: 640px;
  text-align: left;
}
.gate-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}
.gate-headline {
  font-family: var(--serif);
  font-size: clamp(34px, 5.5vw, 56px);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -.5px;
  color: var(--ink);
  margin: 0 0 24px;
}
.gate-headline em { font-style: italic; color: var(--accent); }
.gate-sub {
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 16px;
}
.gate-sub em { color: var(--ink); font-style: italic; }
.gate-form {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.gate-form input[type="email"] {
  flex: 1 1 280px;
  min-width: 0;
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  outline: none;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.gate-form input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(94,139,109,.18);
}
.gate-form .btn-primary {
  flex: 0 0 auto;
  padding: 14px 24px;
}
.gate-note {
  font-size: 13px;
  color: var(--faint);
  margin-top: 14px;
}

/* ─── Paper UI ────────────────────────────────────────── */
.paper {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px var(--pad-h) 96px;
}
.paper-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 900px) {
  .paper-shell { grid-template-columns: 1fr; gap: 32px; }
}

/* Sidebar (sticky on desktop) */
.paper-toc {
  position: sticky;
  top: 84px;
  align-self: start;
}
@media (max-width: 900px) {
  .paper-toc { position: relative; top: 0; }
}
.paper-toc-title {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.paper-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.paper-toc-link {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.paper-toc-link:hover {
  color: var(--ink);
  background: rgba(94,139,109,.08);
}
.paper-toc-link[aria-current="true"] {
  color: var(--ink);
  background: rgba(94,139,109,.16);
  font-weight: 700;
}

/* Article column */
.paper-content {
  min-width: 0;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(94, 139, 109, 0.18);
  border-radius: 18px;
  padding: 56px clamp(28px, 4vw, 56px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 18px 40px -28px rgba(26, 61, 46, 0.25);
}

.chapter { display: none; animation: chapter-in .35s ease both; }
.chapter.active { display: block; }
@keyframes chapter-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.ch-eyebrow {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.ch-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: -.4px;
  color: var(--ink);
  margin: 0 0 28px;
}
.ch-title em { font-style: italic; color: var(--accent); }
.paper-content h3 {
  font-family: var(--brand);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: var(--ink);
  margin: 36px 0 14px;
}
.paper-content p,
.paper-content li {
  font-family: var(--ui);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-mid);
}
.paper-content p { margin: 0 0 16px; }
.paper-content ul,
.paper-content ol { padding-left: 22px; margin: 0 0 18px; }
.paper-content li { margin-bottom: 6px; }
.paper-content em { font-style: italic; color: var(--ink); }
.paper-content strong { color: var(--ink); font-weight: 700; }
.paper-content .dim { color: var(--muted); font-weight: 500; }

/* Cover chapter */
.ch-meta {
  color: var(--muted);
  margin-bottom: 36px;
}
.ch-cover-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 32px;
  margin: 32px 0;
  padding: 28px;
  border: 1px solid rgba(94,139,109,.18);
  border-radius: 14px;
  background: rgba(245, 243, 236, 0.4);
}
@media (max-width: 600px) {
  .ch-cover-grid { grid-template-columns: 1fr; }
}
.ch-cover-grid dt {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.ch-cover-grid dd {
  font-family: var(--brand);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}
.ch-cover-grid dd .dim {
  display: block;
  font-family: var(--ui);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}
.ch-cover-note {
  font-size: 13px;
  color: var(--faint);
  font-style: italic;
  margin-top: 24px;
}

/* Bridge chapter — special treatment */
.bridge-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 28px 0 36px;
}
.bridge-card {
  padding: 28px;
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(94,139,109,.18);
  border-radius: 14px;
  position: relative;
}
.bridge-card::before {
  content: "";
  position: absolute;
  left: -1px; top: -1px; bottom: -1px;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  border-radius: 14px 0 0 14px;
}
.bridge-tag {
  font-family: var(--ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.bridge-tag-now { margin-top: 16px; }
.bridge-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 6px !important;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

/* References */
.ref-list { padding-left: 24px; }
.ref-list li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-mid);
  margin-bottom: 12px;
}

/* Footer */
.paper-foot {
  text-align: center;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}
.paper-foot a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.paper-foot a:hover { border-bottom-color: var(--accent); }

/* Original PDF pages displayed inline on the Cover chapter */
.ch-pages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin: 32px 0;
}
.ch-page {
  margin: 0;
  padding: 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 24px 48px -28px rgba(26, 61, 46, .35),
    0 0 0 1px rgba(94, 139, 109, .14);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
}
.ch-page:hover {
  transform: translateY(-4px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 40px 70px -28px rgba(26, 61, 46, .45),
    0 0 0 1px rgba(94, 139, 109, .25);
}
.ch-page img {
  display: block;
  width: 100%;
  height: auto;
}
.ch-page figcaption {
  padding: 14px 18px;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
  background: rgba(245, 243, 236, .55);
  border-top: 1px solid var(--rule-soft);
}

/* Inline link inside paragraphs */
.inline-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}
.inline-link:hover { color: var(--ink); }

/* Chapter 9 — essay treatment in Cormorant Garamond. */
.chapter.ch-essay .ch-title {
  font-family: 'Cormorant Garamond', 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -.4px;
}
.chapter.ch-essay p {
  font-family: 'Cormorant Garamond', 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(20px, 1.55vw, 23px);
  line-height: 1.6;
  letter-spacing: .1px;
  color: var(--ink);
  max-width: 62ch;
}
.chapter.ch-essay p::first-letter {
  font-size: 1.45em;
  line-height: 0.95;
  font-weight: 600;
  color: var(--accent);
  padding-right: 4px;
}
.chapter.ch-essay em {
  font-style: italic;
  color: var(--accent);
}
