/* Shared stylesheet for Epithre lab pages (/models, /research). Mirrors the
   www.epithre.com hub design: warm cream, manuscript ink, sogan brown, blue
   brandmark dot, kawung batik, Newsreader/IBM Plex/Crimson type. */
:root {
  --bg: #EFE9D8;
  --card: #F4EFE0;
  --ink: #1F1812;
  --ink-soft: rgba(31, 24, 18, 0.86);
  --ink-faint: rgba(31, 24, 18, 0.62);
  --rule: rgba(31, 24, 18, 0.14);
  --rule-soft: rgba(31, 24, 18, 0.07);
  --soga: #7A4E2D;
  --soga-deep: #5C3A1F;
  --bone: #F7F1DE;
  --accent: #2C4A6F;
  --maxw: 1080px;
  --read: 760px;
  --shadow: 0 1px 2px rgba(31, 24, 18, 0.05);
  --shadow-hover: 0 20px 44px -22px rgba(31, 24, 18, 0.4);
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Newsreader', 'Crimson Pro', Georgia, serif;
  --font-mono: 'IBM Plex Mono', Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* overflow-x: clip (not hidden) keeps the sticky header working — `hidden`
   would turn html/body into a scroll container and break position:sticky. */
html, body { background: var(--bg); color: var(--ink); overflow-x: clip; }
body {
  font-family: var(--font-sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'><g fill='none' stroke='%231F1812' stroke-width='0.6' opacity='0.05'><ellipse cx='28' cy='14' rx='6.5' ry='11'/><ellipse cx='28' cy='42' rx='6.5' ry='11'/><ellipse cx='14' cy='28' rx='11' ry='6.5'/><ellipse cx='42' cy='28' rx='11' ry='6.5'/></g></svg>");
  background-repeat: repeat; background-size: 56px 56px;
}
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.bar, .wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 36px; }

/* HEADER */
header.site { position: sticky; top: 0; z-index: 50; background: rgba(239,233,216,0.82); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--rule-soft); }
header.site .bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 36px; flex-wrap: wrap; }
.mast { font-family: var(--font-serif); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; color: var(--ink); }
.b-dot { color: var(--accent); }
nav.top { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
nav.top a { font-size: 13px; font-weight: 500; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.07em; border-bottom: 1px solid transparent; padding-bottom: 2px; transition: color .15s, border-color .15s; }
nav.top a:hover, nav.top a[aria-current] { color: var(--soga); border-bottom-color: var(--soga); }

main { display: block; padding-bottom: 100px; }

/* PAGE INTRO */
.lab-intro { padding: 76px 0 44px; border-bottom: 1px solid var(--rule-soft); margin-bottom: 52px; }
.lab-intro .eyebrow { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--soga); }
.lab-intro h1 { font-family: var(--font-serif); font-weight: 700; font-size: clamp(40px, 6vw, 60px); letter-spacing: -0.025em; line-height: 1.03; margin-top: 14px; }
.lab-intro p { font-size: 18.5px; line-height: 1.6; color: var(--ink-faint); max-width: 640px; margin-top: 16px; }

/* SECTION LABEL */
.section-label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--soga); margin: 56px 0 22px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.section-label:first-of-type { margin-top: 0; }

/* MODEL CARDS */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }
.model-card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 28px 28px 26px; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s, border-color .3s; }
.model-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(31,24,18,0.22); }
.mc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mc-head h3 { font-family: var(--font-serif); font-style: italic; font-weight: 600; font-size: 30px; line-height: 1; color: var(--ink); letter-spacing: -0.01em; }
.mc-type { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--rule); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.mc-desc { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin: 16px 0 18px; flex: 1; }
.mc-meta { font-size: 13.5px; border-top: 1px solid var(--rule-soft); padding-top: 14px; }
.mc-meta div { display: flex; gap: 10px; padding: 3px 0; }
.mc-meta dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); min-width: 92px; padding-top: 2px; }
.mc-meta dd { color: var(--ink-soft); }
.mc-link { margin-top: 18px; font-size: 14px; font-weight: 500; color: var(--soga); border-bottom: 1px solid var(--rule); padding-bottom: 2px; align-self: flex-start; }
.mc-link:hover { color: var(--soga-deep); border-bottom-color: var(--soga); }
.models-foot { margin-top: 44px; font-size: 15px; color: var(--ink-faint); max-width: 700px; }
.models-foot a { color: var(--soga); border-bottom: 1px solid var(--rule); }

/* RESEARCH INDEX */
.report-list { list-style: none; }
.report-item { border-bottom: 1px solid var(--rule-soft); padding: 30px 0; }
.report-item:first-child { padding-top: 0; }
.report-item a { display: block; }
.report-item .meta { font-family: var(--font-mono); font-size: 12px; color: var(--soga); text-transform: uppercase; letter-spacing: 0.07em; display: flex; gap: 14px; }
.report-item .meta time { color: var(--ink-faint); }
.report-item h2 { font-family: var(--font-serif); font-weight: 700; font-size: 28px; letter-spacing: -0.015em; line-height: 1.2; margin: 10px 0; }
.report-item a:hover h2 { color: var(--soga); }
.report-item p { color: var(--ink-faint); font-size: 16px; line-height: 1.6; max-width: 700px; }

/* REPORT (prose) */
.report-head { padding-top: 64px; padding-bottom: 28px; border-bottom: 1px solid var(--rule-soft); max-width: var(--read); margin: 0 auto; }
.report-head .back { font-family: var(--font-mono); font-size: 13px; color: var(--soga); border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
.report-head .eyebrow { display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 4px 13px; margin-top: 20px; }
.report-head h1 { font-family: var(--font-serif); font-weight: 700; font-size: clamp(32px, 5vw, 46px); line-height: 1.1; letter-spacing: -0.02em; margin: 16px 0; }
.report-head .byline { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); display: flex; gap: 16px; flex-wrap: wrap; }
.prose { max-width: var(--read); margin: 44px auto 0; font-size: 18.5px; line-height: 1.78; color: var(--ink-soft); }
.prose > * + * { margin-top: 24px; }
.prose > p:first-of-type { font-size: 21px; line-height: 1.7; color: var(--ink); }
.prose h2 { font-family: var(--font-serif); font-weight: 700; font-size: 27px; color: var(--ink); margin-top: 46px; letter-spacing: -0.01em; }
.prose h3 { font-family: var(--font-serif); font-weight: 600; font-size: 21px; color: var(--ink); margin-top: 32px; }
.prose a { color: var(--soga-deep); border-bottom: 1px solid var(--rule); }
.prose a:hover { border-bottom-color: var(--soga); }
.prose ul { list-style: none; padding-left: 4px; }
.prose ul li { position: relative; padding-left: 22px; }
.prose ul li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.prose ol { padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose blockquote { background: var(--card); border-left: 3px solid var(--accent); padding: 20px 24px; border-radius: 0 8px 8px 0; color: var(--ink-soft); }
.prose blockquote p { margin: 0; }
.report-note { max-width: var(--read); margin: 16px auto 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint); background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 18px; }

/* FOOTER */
footer.site { border-top: 1px solid var(--rule-soft); background: var(--bone); }
footer.site .bar { padding-top: 52px; padding-bottom: 28px; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.f-brand .mast { font-size: 20px; }
.f-brand p { color: var(--ink-faint); font-size: 14.5px; margin-top: 8px; max-width: 30ch; }
.f-links { display: flex; gap: 26px; flex-wrap: wrap; }
.f-links a { font-size: 14px; color: var(--ink-soft); border-bottom: 1px solid transparent; padding-bottom: 2px; }
.f-links a:hover { color: var(--soga); border-bottom-color: var(--soga); }
.f-base { border-top: 1px solid var(--rule-soft); padding-top: 22px; padding-bottom: 40px; font-size: 13px; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.f-base a { color: var(--ink-faint); border-bottom: 1px solid var(--rule); }
.f-base .legal-name { display: block; margin-top: 4px; font-size: 11px; opacity: .7; }
.f-base .pse-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; line-height: 1.3; color: var(--ink-faint); opacity: .85; border-bottom: none; }
.f-base .pse-badge:hover { opacity: 1; }

@media (max-width: 640px) {
  .lab-intro { padding-top: 48px; }
  /* unify side padding (header .bar was overriding to 36px) + honour notch */
  .bar, .wrap, .report-head, .prose,
  header.site .bar {
    padding-left: max(22px, env(safe-area-inset-left));
    padding-right: max(22px, env(safe-area-inset-right));
  }
  header.site .bar { padding-top: 16px; padding-bottom: 16px; }
  /* reserve the home-indicator strip under the footer */
  footer.site .f-base { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}
