/* ============================================================
   DEUX VOIR — stylesheet
   Direction A: "Bookplate"
   Cream / near-black · serif-led · quiet, editorial
   ============================================================ */

:root {
  --cream:      #f6f2ea;
  --cream-soft: #efe9df;
  --ink:        #14110e;
  --ink-soft:   #3a3530;
  --ink-mute:   #7a7268;
  --rule:       #d9d2c5;
  --serif:      'Cormorant Garamond', 'Times New Roman', serif;
  --sans:       'Inter', system-ui, sans-serif;
  --max:        760px;
  --wide:       1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ---------- HEADER ---------- */

.site-header {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 36px 40px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 32px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-nav a:hover { color: var(--ink); }

/* ---------- MAIN LAYOUT ---------- */

main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 40px;
}

/* ---------- HERO ---------- */

.hero {
  padding: 120px 0 100px;
  max-width: var(--max);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 36px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(38px, 5.2vw, 62px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}

.hero-lede {
  font-size: 21px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 640px;
}

/* ---------- SPINE ---------- */

.spine {
  border-top: 1px solid var(--rule);
  padding: 72px 0 88px;
}

.section-label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 40px;
}

.spine-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 48px;
}

.spine-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spine-num {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}

.spine-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.spine-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.spine-arrow {
  font-size: 20px;
  color: var(--ink-mute);
  padding-top: 30px;
}

.spine-note {
  max-width: var(--max);
  font-size: 17px;
  font-style: italic;
  color: var(--ink-soft);
  border-left: 2px solid var(--ink);
  padding-left: 20px;
}

/* ---------- WORK ---------- */

.work {
  border-top: 1px solid var(--rule);
  padding: 72px 0 88px;
}

.paper-card {
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
}

.paper-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.paper-status {
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
}

.paper-venue { color: var(--ink-mute); }

.paper-title {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.005em;
}

.paper-title a:hover { color: var(--ink-soft); }

.paper-authors {
  font-style: italic;
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.paper-abstract {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: var(--max);
  margin-bottom: 28px;
}

.paper-links {
  display: flex;
  gap: 28px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.link-arrow {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity .2s;
}

.link-arrow:hover { opacity: 0.6; }
.link-arrow.muted { color: var(--ink-mute); border-bottom-color: var(--ink-mute); }

.work-footnote {
  margin-top: 40px;
  font-style: italic;
  font-size: 16px;
  color: var(--ink-mute);
  max-width: var(--max);
}

/* ---------- ABOUT STRIP ---------- */

.about-strip {
  border-top: 1px solid var(--rule);
  padding: 72px 0 100px;
}

.about-text {
  font-size: 22px;
  line-height: 1.5;
  max-width: var(--max);
  margin-bottom: 28px;
  color: var(--ink);
}

/* ---------- FOOTER ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  max-width: var(--wide);
  margin: 0 auto;
  padding: 36px 40px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-mute);
}

.footer-left {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.footer-mark {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
}

.footer-tag { font-style: italic; }

.footer-right {
  display: flex;
  gap: 26px;
}

.footer-right a:hover { color: var(--ink); }

/* ---------- RESPONSIVE ---------- */

@media (max-width: 720px) {
  .site-header { padding: 24px 24px 20px; }
  .site-nav { gap: 20px; }
  main { padding: 0 24px; }
  .hero { padding: 72px 0 64px; }
  .spine-diagram {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .spine-arrow { display: none; }
  .spine-step { padding-left: 16px; border-left: 1px solid var(--rule); }
  .site-footer {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    padding: 32px 24px 48px;
  }
  .footer-right { flex-wrap: wrap; }
}

/* ============================================================
   ADDENDUM — Research index + paper pages
   ============================================================ */

/* ---------- PAGE HEAD (shared by /research, /about) ---------- */

.page-head {
  padding: 96px 0 72px;
  max-width: var(--max);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
}

.page-title {
  font-family: var(--serif);
  font-size: clamp(36px, 4.6vw, 54px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.page-lede {
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 620px;
}

/* First section-label under page-head shouldn't double-pad */
.page-head + .work {
  border-top: none;
  padding-top: 56px;
}

/* ---------- WORK FOOTNOTE BLOCK ---------- */

.work-footnote-block {
  padding: 0 0 96px;
}

/* ---------- PAPER PAGE ---------- */

.paper-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 0 120px;
}

.back-link {
  display: inline-block;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 56px;
  transition: color .2s;
}

.back-link:hover { color: var(--ink); }

.paper-header {
  padding-bottom: 44px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 56px;
}

.paper-page-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 50px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 24px 0 20px;
}

.paper-page-authors {
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.paper-page-date {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 32px;
}

.paper-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 10px 20px;
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: 999px;
  transition: background .2s, color .2s;
}

.btn:hover {
  background: var(--ink);
  color: var(--cream);
}

/* ---------- PAPER SECTIONS ---------- */

.paper-section {
  margin-bottom: 56px;
}

.paper-section-title {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  margin-bottom: 24px;
}

.paper-section p {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.paper-section p:last-child { margin-bottom: 0; }

.paper-section em {
  font-style: italic;
  color: var(--ink);
}

/* Page-level spine diagram stacks on narrow screens */
.spine-diagram--page {
  margin: 12px 0 32px;
}

/* ---------- BIBTEX ---------- */

.bibtex {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  background: var(--cream-soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 24px 26px;
  overflow-x: auto;
  color: var(--ink-soft);
  white-space: pre;
}

/* ---------- RESPONSIVE (paper page) ---------- */

@media (max-width: 720px) {
  .page-head { padding: 64px 0 48px; }
  .paper-page { padding: 48px 0 80px; }
  .paper-header { padding-bottom: 32px; margin-bottom: 40px; }
  .paper-section { margin-bottom: 44px; }
  .bibtex { font-size: 12px; padding: 18px; }
  .spine-diagram--page { grid-template-columns: 1fr; }
  .spine-diagram--page .spine-arrow { display: none; }
}

/* ============================================================
   ADDENDUM 2 — Full paper page
   ============================================================ */

.paper-keywords {
  font-size: 16px;
  color: var(--ink-mute);
  margin-top: 24px !important;
  font-style: italic;
}

.paper-subhead {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin: 36px 0 16px;
  letter-spacing: -0.005em;
}

.paper-list {
  list-style: none;
  padding-left: 0;
  margin: 20px 0;
}

.paper-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 16px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.paper-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-mute);
}

.paper-list code,
.paper-section code {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--cream-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 6px;
  color: var(--ink);
}

.paper-figure {
  margin: 40px 0;
  padding: 0;
}

.paper-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--cream-soft);
}

.paper-figure figcaption {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-mute);
  font-style: italic;
  max-width: 640px;
}

.paper-figure figcaption strong {
  font-style: normal;
  color: var(--ink);
  font-weight: 500;
}

.paper-emphasis {
  margin-bottom: 24px;
}

.paper-emphasis strong {
  color: var(--ink);
  font-weight: 500;
}

.paper-emphasis code {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--cream-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 6px;
  color: var(--ink);
}

/* In-page anchor offset for the Cite link */
#cite { scroll-margin-top: 40px; }

/* Mobile tweaks */
@media (max-width: 720px) {
  .paper-subhead { font-size: 20px; margin-top: 28px; }
  .paper-list li { font-size: 17px; padding-left: 22px; }
  .paper-figure figcaption { font-size: 15px; }
}

/* ============================================================
   ADDENDUM 3 — Paper tables
   ============================================================ */

.paper-table {
  width: 100%;
  border-collapse: collapse;
  margin: 36px 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.paper-table caption {
  caption-side: top;
  text-align: left;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  padding-bottom: 14px;
  font-style: italic;
}

.paper-table thead {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.paper-table thead th {
  text-align: left;
  padding: 12px 14px 12px 0;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.paper-table tbody tr {
  border-bottom: 1px solid var(--rule);
}

.paper-table tbody tr:last-child {
  border-bottom: 1px solid var(--ink);
}

.paper-table td {
  padding: 12px 14px 12px 0;
  vertical-align: top;
}

.paper-table td code {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--cream-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--ink);
}

/* Right-align numeric columns where possible (simple heuristic: last N cells) */
.paper-table td:not(:first-child):not(:nth-child(2)) {
  font-variant-numeric: tabular-nums;
}

/* Mobile: allow horizontal scroll for wide tables */
@media (max-width: 720px) {
  .paper-table {
    font-size: 13px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .paper-table caption {
    white-space: normal;
    display: block;
  }
}

/* ---------- Paper equations ---------- */

.paper-equation {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  text-align: center;
  color: var(--ink);
  margin: 24px 0;
  padding: 0 20px;
  line-height: 1.5;
}

.paper-equation sub {
  font-style: normal;
  font-size: 0.7em;
}

.paper-section sub {
  font-size: 0.72em;
  vertical-align: baseline;
  position: relative;
  bottom: -0.25em;
  line-height: 0;
}

.paper-table sub {
  font-size: 0.7em;
  vertical-align: baseline;
  position: relative;
  bottom: -0.2em;
  line-height: 0;
}