/* ============================================================
   paper.css — journal-article aesthetic for the home page only
   Literata reading face + Archivo metadata; claret on warm ivory.
   ============================================================ */

:root {
  --paper:      oklch(98.8% 0.006 80);
  --surface:    oklch(97.2% 0.009 75);
  --ink:        oklch(26% 0.013 50);
  --muted:      oklch(46% 0.012 55);
  --faint:      oklch(58% 0.010 55);
  --rule:       oklch(86% 0.012 60);
  --rule-soft:  oklch(91% 0.010 65);
  --accent:     oklch(43% 0.115 22);
  --accent-deep:oklch(35% 0.10 22);
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Archivo", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --measure: 40rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.paper {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.62;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.paper a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in oklch, var(--accent) 35%, transparent); transition: color .15s, border-color .15s; }
.paper a:hover { color: var(--accent-deep); border-bottom-color: var(--accent-deep); }

/* --- masthead --- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklch, var(--paper) 92%, var(--accent) 3%);
}
.masthead-inner {
  max-width: 64rem; margin: 0 auto; padding: 0.7rem 2rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  font-family: var(--sans);
  font-size: 0.72rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted);
}
.masthead-inner .brand { color: var(--accent); font-weight: 600; }
.masthead-inner nav a { color: var(--muted); border: 0; margin-left: 1.1rem; }
.masthead-inner nav a:hover { color: var(--accent-deep); }
@media (max-width: 720px){ .masthead-inner nav { display:none; } }

/* --- article container --- */
.article {
  max-width: calc(var(--measure) + 4rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 2rem 4rem;
}
.article > * { max-width: var(--measure); }

/* --- header / front matter --- */
.art-type {
  font-family: var(--sans);
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.art-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.05rem); line-height: 1.1;
  letter-spacing: -0.012em; margin: 0 0 0.9rem;
  text-wrap: balance;
}
.art-subtitle {
  font-size: clamp(1.12rem, 2vw, 1.3rem); line-height: 1.45;
  color: var(--muted); font-style: italic; margin: 0 0 1.7rem; max-width: 36rem;
}
.byline { font-family: var(--sans); font-size: 0.92rem; line-height: 1.5; color: var(--ink); margin: 0 0 0.3rem; }
.byline .name { font-weight: 600; }
.affil, .corr { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin: 0; }
.meta-line {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; align-items: center;
  font-family: var(--sans); font-size: 0.78rem; color: var(--faint);
  margin-top: 0.9rem;
}
.status {
  display: inline-block; font-family: var(--sans); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  border-radius: 2px; padding: 0.18rem 0.55rem; background: color-mix(in oklch, var(--accent) 6%, transparent);
}

.rule { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem 0; }
.rule.accent { border-top: 2px solid var(--accent); width: 3.2rem; margin: 1.8rem 0; }

/* --- Highlights (Elsevier-style) --- */
.highlights {
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: 3px; padding: 1.4rem 1.6rem 1.5rem; margin: 2.2rem 0;
}
.highlights h2 {
  font-family: var(--sans); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 0.8rem;
}
.highlights ul { list-style: none; margin: 0; padding: 0; }
.highlights li { position: relative; padding-left: 1.3rem; margin-bottom: 0.55rem; font-size: 1.02rem; line-height: 1.45; }
.highlights li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.5rem; height: 0.5rem; background: var(--accent); border-radius: 1px;
}
.highlights li:last-child { margin-bottom: 0; }

/* --- structured abstract --- */
.abstract {
  background: color-mix(in oklch, var(--surface) 70%, var(--paper));
  border: 1px solid var(--rule-soft); border-radius: 3px;
  padding: 1.6rem 1.8rem; margin: 2.2rem 0;
}
.abstract h2 {
  font-family: var(--sans); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 0.9rem;
}
.abstract p { font-size: 1.04rem; line-height: 1.55; margin: 0 0 0.8rem; }
.abstract p:last-child { margin-bottom: 0; }
.abstract .lab { font-weight: 700; color: var(--ink); }

.keywords { font-family: var(--sans); font-size: 0.86rem; color: var(--muted); margin: 1.4rem 0 0; }
.keywords b { color: var(--ink); font-weight: 600; }

/* --- body sections --- */
.body { counter-reset: sec; margin-top: 2.6rem; }
.body section { margin-bottom: 2.6rem; }
.body h2.sec {
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1.25;
  margin: 0 0 0.9rem; letter-spacing: -0.005em;
}
.body h2.sec::before {
  counter-increment: sec; content: counter(sec) ".  ";
  color: var(--accent); font-variant-numeric: lining-nums;
}
.body h3 { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; margin: 1.6rem 0 0.5rem; }
.body p { margin: 0 0 1rem; }
.body p.lead::first-letter {
  float: left; font-family: var(--serif); font-weight: 600; color: var(--accent);
  font-size: 3.4rem; line-height: 0.82; padding: 0.05em 0.12em 0 0;
}
.body strong { font-weight: 700; }

/* --- figures (may break wider than the measure) --- */
figure.fig { max-width: calc(var(--measure) + 6rem); margin: 2rem 0; }
figure.fig img { width: 100%; display: block; border: 1px solid var(--rule); border-radius: 2px; background: #fff; }
figure.fig figcaption { font-family: var(--sans); font-size: 0.84rem; line-height: 1.5; color: var(--muted); margin-top: 0.6rem; }
figure.fig figcaption .fn { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- data table (compact, academic) --- */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 1.4rem 0; }
.tbl caption { caption-side: top; text-align: left; font-family: var(--sans); font-size: 0.84rem; color: var(--muted); margin-bottom: 0.5rem; }
.tbl caption .fn { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.tbl th, .tbl td { text-align: left; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--rule-soft); }
.tbl thead th { font-family: var(--sans); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 1.5px solid var(--rule); }
.tbl tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
.tbl .num { font-variant-numeric: tabular-nums; }

/* --- "further reading" sections index --- */
.contents { margin: 2.4rem 0; }
.contents h2 { font-family: var(--sans); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.contents ol { list-style: none; counter-reset: c; margin: 0; padding: 0; }
.contents li { counter-increment: c; border-top: 1px solid var(--rule-soft); padding: 0.85rem 0; display: grid; grid-template-columns: 2rem 1fr; gap: 0.4rem 0.8rem; align-items: baseline; }
.contents li:last-child { border-bottom: 1px solid var(--rule-soft); }
.contents li::before { content: counter(c, upper-roman); font-family: var(--sans); font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.contents a { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; border: 0; }
.contents .desc { grid-column: 2; font-size: 0.92rem; color: var(--muted); line-height: 1.45; }

/* --- references --- */
.refs { margin: 2.6rem 0 0; }
.refs h2 { font-family: var(--sans); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.9rem; }
.refs ol { font-size: 0.86rem; line-height: 1.5; color: var(--muted); padding-left: 1.4rem; }
.refs li { margin-bottom: 0.4rem; }
.refs li::marker { color: var(--accent); }

/* --- footer --- */
.paper-footer { border-top: 1px solid var(--rule); margin-top: 3rem; }
.paper-footer .inner { max-width: 64rem; margin: 0 auto; padding: 1.6rem 2rem; font-family: var(--sans); font-size: 0.78rem; color: var(--faint); display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; justify-content: space-between; }

/* --- entrance motion (quiet) --- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.article-header { animation: rise .7s cubic-bezier(.22,1,.36,1) both; }
@media (prefers-reduced-motion: reduce) { .article-header { animation: none; } }

@media (max-width: 640px) {
  body.paper { font-size: 1.08rem; }
  .article { padding-left: 1.3rem; padding-right: 1.3rem; }
  figure.fig, .article > * { max-width: 100%; }
}
