/* LUCAS field report: warm paper, serif display, fixed rail, open sections.
 * A different composition from the working page, not a re-skin of it.
 */
:root {
  --paper: oklch(95.5% 0.018 85);
  --paper-2: oklch(93% 0.02 85);
  --ink: oklch(22% 0.02 60);
  --ink-2: oklch(34% 0.02 60);
  --muted: oklch(48% 0.025 65);
  --faint: oklch(48% 0.02 70);
  --rule: oklch(22% 0.02 60 / 0.22);
  --rule-strong: oklch(22% 0.02 60 / 0.55);
  --accent: oklch(40% 0.12 25);
  --accent-soft: oklch(40% 0.12 25 / 0.1);
  --display: "Fraunces", Georgia, serif;
  --body: "IBM Plex Sans", ui-sans-serif, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --rail: 232px;
  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
html, body { margin: 0; overflow-x: clip; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(oklch(22% 0.02 60 / 0.035) 0.6px, transparent 0.6px);
  background-size: 4px 4px;
}
::selection { background: var(--accent); color: var(--paper); }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--paper); padding: 8px 12px; }

/* rail */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 20;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 30px 24px 26px; border-right: 1px solid var(--rule);
  background: var(--paper);
}
.rail-word { display: block; font-family: var(--display); font-weight: 300; font-size: 34px; line-height: 1; letter-spacing: 0.01em; }
.rail-sub { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.rail-nav { display: grid; gap: 2px; }
.rail-nav a {
  display: flex; gap: 10px; align-items: baseline; padding: 5px 0;
  font-size: 13px; color: var(--ink-2); text-decoration: none;
  border-bottom: 1px solid transparent; transition: color 140ms var(--ease), border-color 140ms var(--ease);
}
.rail-nav a span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rail-nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.rail-nav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.rail-foot { display: grid; gap: 4px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rail-foot a { color: var(--muted); font-size: 12px; }

main { margin-left: var(--rail); padding: 0 var(--gutter) 40px; max-width: 1400px; }

/* cover */
.cover { min-height: 94vh; display: flex; flex-direction: column; justify-content: center; padding: 56px 0 40px; border-bottom: 1px solid var(--rule-strong); }
.cover-top { display: flex; justify-content: space-between; gap: 20px; font-family: var(--mono); font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
h1 {
  font-family: var(--display); font-weight: 300; font-size: clamp(5rem, 17vw, 15rem);
  line-height: 0.86; letter-spacing: -0.03em; margin: 28px 0 20px;
}
.deck { font-family: var(--display); font-weight: 300; font-size: clamp(20px, 2.4vw, 30px); line-height: 1.32; max-width: 44ch; margin: 0 0 44px; color: var(--ink-2); }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule-strong); }
.fig { padding: 16px 18px 4px 0; border-right: 1px solid var(--rule); }
.fig:last-child { border-right: 0; }
.fig-num { display: block; font-family: var(--display); font-weight: 300; font-size: clamp(34px, 4.4vw, 60px); line-height: 1; letter-spacing: -0.02em; }
.fig-lab { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cover-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 34px; font-size: 13px; }
.cover-links a { display: inline-flex; gap: 6px; align-items: baseline; text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
.cover-links a:hover { border-bottom-color: var(--accent); }
.cover-links span { color: var(--faint); }

/* sections */
.sec { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; padding: 72px 0; border-bottom: 1px solid var(--rule); }
.sec-label { position: sticky; top: 28px; align-self: start; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.sec-label span { display: block; color: var(--faint); margin-bottom: 2px; }
.sec-body { min-width: 0; }
.sec.wide { grid-template-columns: 1fr; gap: 18px; }
.sec.wide .sec-label { position: static; display: flex; gap: 8px; align-items: baseline; }
.sec.wide .sec-label span { margin: 0; }
.lede { font-family: var(--display); font-weight: 300; font-size: clamp(20px, 2vw, 26px); line-height: 1.36; max-width: 46ch; margin: 0 0 26px; }
h2 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0 0 12px; letter-spacing: -0.005em; }
h3 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 0 0 6px; }

/* tags as a line, not chips */
.taglist { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; padding: 0; margin: 0 0 30px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.taglist li::after { content: " / "; color: var(--faint); padding: 0 8px; }
.taglist li:last-child::after { content: ""; }

/* plates */
.plate { margin: 0; padding-top: 14px; border-top: 1px solid var(--rule-strong); }
.plate figcaption { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--faint); max-width: 70ch; }
.map-plate .studymap-host { min-height: 380px; }
#sankey svg { width: 100%; height: auto; display: block; }

/* methods */
.methods-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 12px 0 12px 40px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-2); }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 13px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.steps li b { color: var(--ink); font-weight: 500; }
.steps.stages li::before { content: "—"; }

/* findings */
.claims { display: grid; }
.claim-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; padding: 28px 0; border-top: 1px solid var(--rule); }
.claim-no { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.claim-body p { margin: 0 0 10px; max-width: 74ch; color: var(--ink-2); font-size: 15px; }
.claim-verdict { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.claim-verdict.yes { color: oklch(45% 0.1 150); }
.claim-verdict.partial { color: oklch(50% 0.11 70); }
.claim-work { color: var(--ink) !important; }
.claim-limit { color: var(--muted) !important; font-size: 13px !important; }

/* register */
.register { width: 100%; border-collapse: collapse; font-size: 14px; }
.register th { text-align: left; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted); padding: 0 12px 8px 0; border-bottom: 1px solid var(--rule-strong); }
.register td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.register td:last-child { color: var(--muted); }
.register a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.register a:hover { border-bottom-color: var(--accent); }
.fine { margin: 14px 0 0; font-size: 12px; color: var(--faint); max-width: 72ch; }

.foot { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; padding: 26px 0 10px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.foot a { color: var(--muted); }

/* component skin: warm paper */
#qc-explorer, #sample-table, #analyses, #analyses .dw-panels {
  --bg: var(--paper); --panel: var(--paper); --panel-sunk: var(--paper-2);
  --ink: var(--ink); --ink-soft: var(--ink-2); --body: var(--ink-2);
  --muted: var(--muted); --faint: var(--faint);
  --line: var(--rule); --line-soft: oklch(22% 0.02 60 / 0.12);
  --chip: var(--paper-2); --accent: var(--accent); --accent-bg: var(--accent-soft); --accent-line: oklch(40% 0.12 25 / 0.35);
  --fs-body: 14px; --fs-meta: 12px; --fs-micro: 12px;
  color: var(--ink);
}
.sec .dw-tabs { border-bottom: 1px solid var(--rule-strong); padding-bottom: 10px; margin-bottom: 18px; }
.sec .dw-tab {
  font: 500 12px var(--body); color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 0; padding: 8px 12px; min-height: 34px;
}
.sec .dw-tab:hover { color: var(--ink); background: var(--paper-2); }
.sec .dw-tab[aria-selected="true"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.sec .qc-tab { border: 1px solid var(--rule); border-radius: 0; background: transparent; color: var(--muted); min-height: 34px; }
.sec .qc-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sec .dw-controls, .sec .qc-ctrls { background: var(--paper-2); border-color: var(--rule); border-radius: 0; }
.sec .dw-controls select, .sec .qc-ctrls select { background: var(--paper); color: var(--ink); border-color: var(--rule); border-radius: 0; }
.sec .dw-stat, .sec .dw-chart, .sec .dw-detail, .sec .dw-table-scroll, .sec .st-scroll, .sec .st-colpanel, .sec .st-btn, .sec .st-search input {
  border-radius: 0 !important; box-shadow: none !important;
}
.sec .dw-stat { background: transparent; border-color: var(--rule); }
.sec .dw-stat b { font-family: var(--mono); }
.sec .dw-chart-head { color: var(--ink-2); font-family: var(--body); font-size: 13px; }
.sec .dw-tip { background: var(--ink); color: var(--paper); border-radius: 0; font-family: var(--mono); }
.sec .dw-read-k { color: var(--muted); text-transform: none; letter-spacing: 0.02em; }
.sec .dw-detail { background: var(--paper-2); border-color: var(--rule); }
.sec .st-btn { background: transparent; border: 1px solid var(--rule); color: var(--ink-2); }
.sec .st-table thead th, .sec .st-table .st-filters th { background: var(--paper-2); }
.sec .st-table tbody tr:hover td { background: var(--paper-2); }
.sec .dw-table th, .sec .st-table thead th { color: var(--muted); }
.sec .dw-chart svg text { fill: var(--muted); }
.sec .dw-scroll-y { border-color: var(--rule); }
.sec .dw-table-scroll, .sec .st-scroll { border-color: var(--rule); }
.sec .dw-acc, .sec .claim { border-color: var(--rule); background: transparent; }

/* motion */
@media (prefers-reduced-motion: no-preference) {
  .cover h1, .cover .deck, .cover .figures { animation: rise 620ms var(--ease) both; }
  .cover .deck { animation-delay: 90ms; }
  .cover .figures { animation-delay: 160ms; }
  .rail-nav a { transition: color 140ms var(--ease), border-color 140ms var(--ease); }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* small screens */
@media (max-width: 980px) {
  .rail { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 18px 20px; gap: 14px; }
  .rail-nav { display: flex; overflow-x: auto; gap: 14px; }
  .rail-nav a { white-space: nowrap; border-bottom: 0; }
  .rail-foot { display: none; }
  main { margin-left: 0; padding: 0 20px 30px; }
  .cover { min-height: 0; padding: 44px 0 30px; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fig { border-bottom: 1px solid var(--rule); }
  .fig:nth-child(2n) { border-right: 0; }
  .sec { grid-template-columns: 1fr; gap: 12px; padding: 48px 0; }
  .sec-label { position: static; display: flex; gap: 8px; }
  .sec-label span { margin: 0; }
  .methods-grid { grid-template-columns: 1fr; gap: 30px; }
  .claim-row { grid-template-columns: 36px 1fr; gap: 12px; }
}
