/* ============================================================
   Occam Research — homepage theme  ·  "Scientific Manuscript"
   Self-contained (does NOT depend on duellum-design/). Aged
   parchment, sepia iron-gall ink (never pure black), sealing-wax
   red accent, antiqua-only type. No dark mode. No emoji.
   Scoped to index.html only; the science viz pages keep style.css.
   ============================================================ */

:root {
  /* ---- Parchment grounds & surfaces ---------------------- */
  --paper:          #f4ecd8;
  --paper-alt:      #eae0c8;
  --surface:        #fbf5e6;
  --surface-alt:    #efe5cd;
  --surface-sunken: #efe5cd;
  --surface-ink:    #2b2620;

  /* ---- Ink (sepia — no pure black) ----------------------- */
  --ink:    #241f18;
  --ink-2:  #463c2e;
  --ink-3:  #655741;
  --ink-inv:#f4ecd8;

  /* legacy aliases used by shared class names */
  --text:   var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);

  /* ---- Hairlines ---------------------------------------- */
  --line:        rgba(43, 38, 32, 0.18);
  --line-soft:   rgba(43, 38, 32, 0.09);
  --line-strong: rgba(43, 38, 32, 0.34);
  --border:       var(--line);
  --border-light: var(--line-soft);

  /* ---- Accent — sealing-wax red ------------------------- */
  --accent:        #8b0000;
  --accent-hover:  #6b0000;
  --accent-strong: #6b0000;
  --accent-light:  #efdccb;
  --accent-tint:   #efdccb;

  /* ---- Status hues used by scorecard -------------------- */
  --teal:   #3f5d4a;  --teal-light:  #e3e6cf;   /* verdigris green */
  --warm:   #8a6a23;  --warm-light:  #efe1c4;   /* ochre           */
  --coral:  #8b0000;  --coral-light: #efdccb;   /* wax red         */

  /* ---- Fluid type scale --------------------------------- */
  --text-2xs:  0.75rem;
  --text-xs:   clamp(0.8125rem, calc(0.78rem + 0.15vw), 0.875rem);
  --text-sm:   clamp(0.875rem,  calc(0.83rem + 0.18vw), 1rem);
  --text-base: clamp(1.0625rem, calc(1rem    + 0.3vw),  1.1875rem);
  --text-lg:   clamp(1.375rem,  calc(1.2rem  + 0.7vw),  1.75rem);
  --text-xl:   clamp(1.75rem,   calc(1.4rem  + 1.3vw),  2.5rem);
  --text-2xl:  clamp(2.25rem,   calc(1.6rem  + 2.4vw),  3.5rem);
  --text-3xl:  clamp(2.75rem,   calc(1.8rem  + 4vw),    5rem);

  /* ---- 4px spacing -------------------------------------- */
  --space-1: 0.25rem; --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;   --space-20: 5rem;   --space-24: 6rem;

  /* ---- Radii & shadows (printed-journal feel) ----------- */
  --radius-xs: 3px; --radius-sm: 5px; --radius: 7px; --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(26,27,29,.05), 0 1px 1px rgba(26,27,29,.03);
  --shadow-md: 0 2px 6px rgba(26,27,29,.06), 0 6px 18px rgba(26,27,29,.05);
  --shadow-lg: 0 4px 12px rgba(26,27,29,.07), 0 16px 40px rgba(26,27,29,.06);

  /* ---- Type families ------------------------------------ */
  --font-body:    "PT Serif", Georgia, "Times New Roman", serif;
  --font-display: "EB Garamond", "Caslon Antique", Georgia, serif;
  --font-mono:    "Cutive Mono", ui-monospace, "Courier New", monospace;

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --transition-fast: 140ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.66;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(120,96,54,0.05), transparent 60%),
    radial-gradient(120% 80% at 50% 110%, rgba(120,96,54,0.06), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-attachment: fixed, fixed, fixed;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display); line-height: 1.2;
  font-weight: 600; text-wrap: balance; color: var(--ink);
}
p, li, figcaption { text-wrap: pretty; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 0.16em;
    transition: color var(--transition-fast); }
a:hover { color: var(--accent-strong); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
::selection { background: var(--accent-tint); color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   LAYOUT + NAV
   ============================================================ */
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 clamp(var(--space-5), 4vw, var(--space-8)); }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.nav { padding: var(--space-4) 0; display: flex; justify-content: space-between; align-items: center; }
.nav-brand {
  display: flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
  font-size: var(--text-base); letter-spacing: 0.06em;
  font-variant: small-caps; text-transform: lowercase;
}
.nav-brand:hover { color: var(--accent); text-decoration: none; }
.nav-logo { border-radius: 3px; flex-shrink: 0; }
.nav-right { display: flex; gap: var(--space-4); align-items: center; font-size: var(--text-xs); }
.nav-right a {
  color: var(--ink-2); font-weight: 600; font-variant: small-caps;
  letter-spacing: 0.08em; text-transform: lowercase;
}
.nav-right a:hover { color: var(--accent); text-decoration: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: clamp(var(--space-12), 6vw, var(--space-20)) 0 clamp(var(--space-8), 4vw, var(--space-12)); }
.hero-center { text-align: center; }
.hero-center .hero-sub { margin-inline: auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: var(--accent-tint); color: var(--accent);
  font-size: var(--text-xs); font-weight: 600; font-variant: small-caps;
  letter-spacing: 0.1em; text-transform: lowercase;
  padding: var(--space-1) var(--space-4); border-radius: var(--radius-pill, 999px);
  margin-bottom: var(--space-6); border: 1px solid var(--accent-line, #d2a48f);
}
.hero h1 {
  font-family: var(--font-display); font-size: var(--text-3xl);
  font-weight: 600; line-height: 1.06; letter-spacing: 0.01em;
  margin-bottom: var(--space-4); color: var(--ink);
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: var(--text-base); color: var(--ink-2); max-width: 680px; line-height: 1.76; }

.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-8); }
.hero-center .hero-actions { justify-content: center; }
.hero-actions .btn { padding: var(--space-3) var(--space-6); font-size: var(--text-sm); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block; background: var(--accent); color: var(--ink-inv);
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-4); font-family: var(--font-display);
  font-size: var(--text-sm); font-weight: 600; font-variant: small-caps;
  letter-spacing: 0.06em; text-transform: lowercase; cursor: pointer;
  transition: all var(--transition-fast);
}
.btn:hover { background: var(--accent-strong); color: var(--ink-inv); text-decoration: none; transform: translateY(-1px); }
.btn.outline { background: none; color: var(--accent); }
.btn.outline:hover { background: var(--accent-tint); color: var(--accent-strong); }

/* ============================================================
   FEATURED PAPER
   ============================================================ */
.featured {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: clamp(var(--space-6), 3vw, var(--space-8));
  margin: var(--space-6) 0 clamp(var(--space-8), 4vw, var(--space-12));
  box-shadow: var(--shadow-md);
}
.feat-label {
  font-family: var(--font-display); font-size: var(--text-xs); font-weight: 600;
  font-variant: small-caps; letter-spacing: 0.14em; text-transform: lowercase;
  color: var(--accent); margin-bottom: var(--space-3);
}
.feat-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; line-height: 1.25; color: var(--ink); margin-bottom: var(--space-2); max-width: 60ch; }
.feat-meta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); margin-bottom: var(--space-4); font-variant-numeric: tabular-nums; }
.feat-desc { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.75; max-width: 68ch; margin-bottom: var(--space-5); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  margin: clamp(var(--space-12), 6vw, var(--space-20)) 0;
  padding-top: clamp(var(--space-8), 4vw, var(--space-12));
  border: 0;
  border-top: 16px solid transparent;
  border-image: var(--swords-rule, none);
  position: relative;
}
/* crossed-swords ornamental top rule */
.section::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 16px;
  transform: translateY(-50%);
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) left center / calc(50% - 26px) 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right center / calc(50% - 26px) 1px no-repeat,
    center / 44px 16px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='16' viewBox='0 0 44 16'%3E%3Cg stroke='%238b0000' stroke-width='1.4' fill='none' stroke-linecap='round'%3E%3Cpath d='M14 3 L30 13'/%3E%3Cpath d='M30 3 L14 13'/%3E%3C/g%3E%3Ccircle cx='22' cy='8' r='2.1' fill='%238b0000'/%3E%3C/svg%3E");
}
.section h2 {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600;
  margin-bottom: var(--space-4); letter-spacing: 0.01em; color: var(--ink);
}
.section p { font-size: var(--text-base); color: var(--ink-2); line-height: 1.8; margin-bottom: var(--space-4); max-width: 72ch; }
.section p:last-child { margin-bottom: 0; }
.section strong { color: var(--ink); font-weight: 700; }

/* ============================================================
   CARDS
   ============================================================ */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-5); margin: clamp(var(--space-8), 4vw, var(--space-12)) 0;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-6); transition: box-shadow var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer; color: inherit; display: block; position: relative;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--line-strong); text-decoration: none; }
.card.static { cursor: default; }
.card.static:hover { box-shadow: none; transform: none; border-color: var(--line); }
.card.static p:last-child { margin-bottom: 0; }
.card-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
  color: var(--accent); margin-bottom: var(--space-4);
  border: 1px solid var(--line-soft);
}
.card h3 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--space-2); line-height: 1.3; color: var(--ink); }
.card p { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.7; margin-bottom: var(--space-4); max-width: 56ch; }
.card-meta { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 400;
  padding: 2px var(--space-3); border-radius: var(--radius-xs);
  background: var(--surface-sunken); color: var(--ink-3); border: 1px solid var(--line-soft);
}
.card-date { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-3); margin-top: var(--space-3); font-variant-numeric: tabular-nums; }

/* ============================================================
   CRN collapsible
   ============================================================ */
.crn-details { margin-top: var(--space-6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 var(--space-6); }
.crn-details summary {
  cursor: pointer; list-style: none; padding: var(--space-5) 0;
  font-family: var(--font-display); font-size: var(--text-base); font-weight: 600;
  letter-spacing: 0.01em; color: var(--ink); display: flex; align-items: center; gap: var(--space-3);
}
.crn-details summary::-webkit-details-marker { display: none; }
.crn-details summary::before { content: '+'; font-family: var(--font-mono); font-size: var(--text-lg); color: var(--accent); line-height: 1; }
.crn-details[open] summary::before { content: '\2212'; }
.crn-details summary:hover { color: var(--accent); }
.crn-details p { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.8; max-width: 78ch; padding-bottom: var(--space-6); margin: 0; }
.crn-details strong { color: var(--ink); font-weight: 700; }

.disclaimer {
  margin-top: var(--space-6); padding: var(--space-5) var(--space-6);
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-sm); color: var(--ink-2); line-height: 1.7; max-width: 72ch;
}
.disclaimer strong { color: var(--ink); font-weight: 700; }

/* ============================================================
   SCORECARD
   ============================================================ */
.scorecard { margin: clamp(var(--space-12), 6vw, var(--space-20)) 0; }
.scorecard h2 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--space-2); }
.scorecard-meta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); margin-bottom: var(--space-6); font-variant-numeric: tabular-nums; }
.sc-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5) var(--space-6); margin-bottom: var(--space-3); }
.sc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-2); }
.sc-id { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 400; color: var(--accent); background: var(--accent-tint); padding: 2px var(--space-2); border-radius: var(--radius-xs); flex-shrink: 0; }
.sc-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); flex: 1; color: var(--ink); }
.sc-score { font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 700; flex-shrink: 0; min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.sc-score.high { color: var(--teal); }
.sc-score.mid { color: var(--warm); }
.sc-score.low { color: var(--coral); }
.sc-bar { height: 6px; border-radius: var(--radius-xs); background: var(--line-soft); margin: var(--space-3) 0; overflow: hidden; }
.sc-bar-fill { height: 100%; border-radius: var(--radius-xs); transition: width .8s var(--ease); }
.sc-desc { font-size: var(--text-sm); color: var(--ink-2); margin-bottom: var(--space-2); max-width: 72ch; }
.sc-evidence { font-size: var(--text-xs); color: var(--ink-3); line-height: 1.7; max-width: 72ch; }
.sc-evidence strong { color: var(--ink-2); font-weight: 700; }

/* ============================================================
   PUBLICATIONS + DUELS list
   ============================================================ */
.pub-list { margin-top: var(--space-4); }
.pub-item { padding: var(--space-5) 0; border-bottom: 1px solid var(--line-soft); }
.pub-item:last-child { border-bottom: none; }
.pub-tag {
  display: inline-block; font-family: var(--font-display); font-size: 0.75rem;
  font-weight: 600; font-variant: small-caps; padding: 2px var(--space-3);
  border-radius: var(--radius-xs); margin-bottom: var(--space-2);
  letter-spacing: 0.08em; text-transform: lowercase;
}
.pub-tag.review   { background: var(--pro, #2c4a6e); color: var(--ink-inv); }
.pub-tag.preprint { background: var(--accent); color: var(--ink-inv); }
.pub-tag.dataset  { background: var(--tie, #6b5d4c); color: var(--ink-inv); }
.pub-tag.software { background: var(--ink-2); color: var(--ink-inv); }
.pub-title { font-family: var(--font-display); font-size: var(--text-base); font-weight: 600; line-height: 1.4; margin-bottom: var(--space-1); color: var(--ink); }
.pub-meta { font-family: var(--font-body); font-size: var(--text-sm); color: var(--ink-2); margin-bottom: var(--space-2); line-height: 1.55; }
.pub-links { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.pub-links a {
  font-family: var(--font-mono); font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--ink-2); transition: all var(--transition-fast);
}
.pub-links a:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ============================================================
   PI / CONTACT
   ============================================================ */
.pi-box { display: flex; gap: var(--space-6); align-items: flex-start; margin-top: var(--space-4); }
.pi-info h3, h3.pi-info { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; margin-bottom: 2px; color: var(--ink); }
.pi-role { font-size: var(--text-sm); color: var(--ink-3); margin-bottom: var(--space-2); }
.pi-bio { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.8; max-width: 65ch; }
.contact-row { display: flex; gap: var(--space-8); flex-wrap: wrap; margin-top: var(--space-4); font-size: var(--text-sm); }
.contact-row .label { font-family: var(--font-display); font-size: var(--text-xs); font-variant: small-caps; letter-spacing: 0.12em; text-transform: lowercase; color: var(--ink-3); margin-bottom: 2px; font-weight: 600; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { padding: clamp(var(--space-8), 4vw, var(--space-12)) 0; background: var(--surface-ink); margin-top: clamp(var(--space-12), 6vw, var(--space-16)); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: var(--space-8); }
.footer-brand { display: flex; flex-direction: column; gap: var(--space-2); }
.footer-brand-name { font-family: var(--font-display); font-size: var(--text-lg); color: var(--ink-inv); font-weight: 600; font-variant: small-caps; letter-spacing: 0.06em; text-transform: lowercase; }
.footer-brand-sub { font-size: var(--text-xs); color: rgba(244,236,216,0.6); max-width: 300px; line-height: 1.6; }
.footer-links { display: flex; gap: clamp(var(--space-8), 4vw, var(--space-12)); }
.footer-col h4 { font-family: var(--font-display); font-size: var(--text-xs); font-weight: 600; font-variant: small-caps; letter-spacing: 0.12em; text-transform: lowercase; color: rgba(244,236,216,0.5); margin-bottom: var(--space-3); }
.footer-col a { display: block; font-size: var(--text-sm); color: rgba(244,236,216,0.78); margin-bottom: var(--space-2); transition: color var(--transition-fast); }
.footer-col a:hover { color: var(--ink-inv); text-decoration: none; }
.footer-bottom { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid rgba(244,236,216,0.14); display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: var(--text-xs); color: rgba(244,236,216,0.5); }
.footer-bottom a { color: rgba(244,236,216,0.5); }
.footer-bottom a:hover { color: var(--ink-inv); text-decoration: none; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 1; }
@supports (animation-timeline: view()) {
  .reveal { opacity: 0; animation: reveal-fade linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
}
@keyframes reveal-fade { to { opacity: 1; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .hero h1 { font-size: var(--text-2xl); }
  .card-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .footer-links { flex-direction: column; gap: var(--space-6); }
  .footer-bottom { flex-direction: column; gap: var(--space-2); text-align: center; }
  .pi-box { flex-direction: column; }
  .contact-row { flex-direction: column; gap: var(--space-4); }
  .nav-right { gap: var(--space-3); }
}
