/* ============================================================
   Shared stylesheet for ilcarjuc.github.io project pages.
   Referenced from a project page as: ../assets/style.css

   Layout contract: everything lives on one centred axis.
   Headings, ledes, figures and tables are centred; running prose
   and captions are left-aligned blocks that are themselves
   centred, so nothing hugs the left edge of the page.
   ============================================================ */

:root {
  --ink:        #0e1c2f;
  --ink-soft:   #3d4c62;
  --ink-faint:  #6d7c92;
  --paper:      #ffffff;
  --surface:    #f4f7fa;
  --line:       #dce3ea;
  --line-soft:  #eaeff4;
  --accent:     #0d6e8c;
  --accent-ink: #095267;
  --accent-bg:  #e6f1f6;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* One column for everything: figures, tables, captions, prose and lists
     all share this width, so both page edges stay flush top to bottom. */
  --wrap: 1160px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

/* Running text spans the same column as the figures and is justified, so the
   right edge lines up with the edge of every image and table above it. */
.prose, .findings, figcaption, .steps, .takehome, .bib {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}
.prose, figcaption, .findings li, .steps p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* ---------- Skip link ---------- */
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
.nav-mark { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); }
.nav-mark:hover { text-decoration: none; }
.nav-links { margin-left: auto; display: flex; gap: 22px; }
.nav-links a { color: var(--ink-soft); font-size: 14.5px; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero {
  background: var(--ink);
  color: #fff;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--accent);
}
/* Orthogonal coordinate grid: the geometry the method is built on. */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.055) 0 1px, transparent 1px 56px),
    repeating-linear-gradient( 0deg, rgba(255,255,255,.055) 0 1px, transparent 1px 56px);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 78%);
          mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 78%);
  pointer-events: none;
}
.hero .wrap { position: relative; padding-top: 58px; padding-bottom: 54px; text-align: center; }

.venue {
  display: inline-block;
  font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase;
  color: #9fd3e6;
  border: 1px solid rgba(159,211,230,.4);
  padding: 4px 14px;
  margin-bottom: 26px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 1.2rem + 3vw, 3.05rem);
  line-height: 1.14;
  letter-spacing: -.015em;
  margin: 0 auto 12px;
  /* No measure cap: the <br> in the markup sets the two lines. */
  max-width: none;
}
.hero .subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, .95rem + .6vw, 1.4rem);
  color: #b9cbdd;
  margin: 0 auto 32px;
  max-width: 50ch;
  line-height: 1.4;
}

.authors { font-size: 17px; line-height: 2; margin: 0 auto 8px; max-width: 74ch; color: #eef4f9; }
.authors a { color: #eef4f9; border-bottom: 1px solid rgba(255,255,255,.3); }
.authors a:hover { color: #9fd3e6; border-color: #9fd3e6; text-decoration: none; }
.authors sup { color: #9fd3e6; font-size: 11px; padding-left: 1px; }

.affil { font-size: 14.5px; line-height: 1.8; color: #9fb0c4; margin: 0 auto 32px; max-width: 66ch; }
.affil sup { color: #9fd3e6; padding-right: 2px; }

.links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border: 1px solid rgba(255,255,255,.28);
  color: #fff; font-size: 15px;
  background: rgba(255,255,255,.04);
}
.links a:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.55); text-decoration: none; }
.links a.primary { background: var(--accent); border-color: var(--accent); }
.links a.primary:hover { background: #0a7ea1; border-color: #0a7ea1; }
.links svg { width: 15px; height: 15px; fill: currentColor; flex: none; }

/* ---------- Sections ---------- */
section { padding: 68px 0; }
section + section { border-top: 1px solid var(--line-soft); }
section.tinted { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Centred section header: eyebrow, title, lede. Wide enough that every h2 on
   the page holds one line; the lede keeps its own narrower measure below. */
.sec-head { text-align: center; max-width: min(100%, 960px); margin: 0 auto 38px; }
.eyebrow {
  font-size: 12.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.eyebrow::after {
  content: ""; display: block;
  width: 26px; height: 2px; background: var(--accent);
  margin: 11px auto 0;
}
h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.05rem);
  letter-spacing: -.012em;
  line-height: 1.22;
  margin: 0;
  text-wrap: balance; /* if a narrow viewport forces a wrap, split it evenly */
}
.sec-head .lede { color: var(--ink-soft); margin: 16px auto 0; max-width: 64ch; }
.sec-head .lede:last-child { margin-bottom: 0; }
/* Evidence sections carry no lede: their intro is full-column prose, so the
   header sits closer to it. */
.sec-head.compact { margin-bottom: 24px; }

h3 {
  font-family: var(--sans);
  font-size: 1.02rem; font-weight: 600;
  letter-spacing: .005em;
  text-align: center;
  margin: 58px 0 16px;
}
h3::before {
  content: ""; display: block;
  width: 18px; height: 2px; background: var(--line);
  margin: 0 auto 16px;
}
p { margin: 0 0 18px; }
.prose > p:last-child { margin-bottom: 0; }

/* ---------- Findings: bold lead-in, one claim per line (poster voice) ---------- */
.findings { list-style: none; padding: 0; margin: 26px auto 0; }
.findings li { position: relative; padding-left: 24px; margin-bottom: 11px; color: var(--ink-soft); }
.findings li:last-child { margin-bottom: 0; }
.findings li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 7px; height: 7px; background: var(--accent);
}
.findings strong { color: var(--ink); font-weight: 600; }

/* ---------- Highlight cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 0;
}
.card { background: var(--paper); padding: 24px 22px; }
section.tinted .card { background: var(--surface); }
.card b { display: block; font-size: 15.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
.card span { display: block; font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }

/* ---------- Key numbers ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 38px 0 0;
}
.stat { background: var(--paper); padding: 26px 20px; text-align: center; }
section.tinted .stat { background: var(--surface); }
.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 2.15rem; font-weight: 500;
  line-height: 1.1; letter-spacing: -.02em;
  color: var(--accent-ink);
  margin-bottom: 8px;
}
.stat span { font-size: 14px; color: var(--ink-soft); line-height: 1.45; display: block; }

/* ---------- Figures ---------- */
figure { margin: 40px 0; text-align: center; }
figure img { display: block; width: 100%; height: auto; margin: 0 auto; }
figure.framed img { border: 1px solid var(--line); background: #fff; padding: 16px; }
figcaption {
  font-size: 14.5px; line-height: 1.6;
  color: var(--ink-faint);
  margin-top: 14px;
}
figcaption b { color: var(--ink-soft); font-weight: 600; }
.figno { color: var(--accent); font-weight: 600; }

/* ---------- Tables shipped as SVG ---------- */
figure.table-fig { margin: 36px 0 40px; }
figure.table-fig a { display: block; }
/* Every table fills the column, so all of them line up at the same width. */
figure.table-fig img {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 18px;
}
figure.table-fig a:hover img { border-color: var(--accent); }
/* Only the overhead table has few enough columns to look wrong at full width. */
figure.w-mid img { max-width: min(100%, 820px); }
.zoomhint { font-size: 13px; color: var(--ink-faint); margin: 10px 0 0; display: none; text-align: center; }
@media (max-width: 760px) { .zoomhint { display: block; } }

/* ---------- Method steps ---------- */
.steps {
  counter-reset: step;
  margin: 8px auto 0;
  padding: 0;
  list-style: none;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
}
.steps li:last-child { border-bottom: 1px solid var(--line-soft); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  padding-top: 5px;
  letter-spacing: .04em;
}
.steps h4 { margin: 0 0 6px; font-size: 1rem; font-weight: 600; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.steps .eq { margin: 12px 0 0; overflow-x: auto; overflow-y: hidden; }

/* ---------- Take-home panel ---------- */
.takehome {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 34px 38px;
  margin: 0;
}
.takehome .findings { margin-top: 0; }
/* Take-away numbers sit directly under the panel, so they share its ground. */
#takehome .stats { margin-top: 0; }
#takehome .stat { background: var(--paper); }

/* ---------- Resources ---------- */
.resources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 0;
}
.resources a { background: var(--paper); padding: 24px 20px; color: var(--ink); display: block; text-align: center; }
section.tinted .resources a { background: var(--surface); }
.resources a:hover { background: var(--accent-bg); text-decoration: none; }
.resources b { display: block; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.resources span { display: block; font-size: 13.5px; color: var(--ink-faint); }

/* ---------- BibTeX ---------- */
.bib {
  background: var(--ink);
  color: #dbe6f0;
  font-family: var(--mono);
  font-size: 13px; line-height: 1.7;
  padding: 24px 28px;
  overflow-x: auto;
  margin: 0;
}
.bib .k { color: #9fd3e6; }

/* ---------- Footer ---------- */
footer { background: var(--ink); color: #9fb0c4; font-size: 14.5px; padding: 42px 0; text-align: center; }
footer a { color: #cfe3ee; }
footer .fmain { margin: 0; }
footer .fmain span { color: #56697f; padding: 0 10px; }
footer .note { font-size: 13px; color: #6f8298; margin: 16px auto 0; max-width: 76ch; line-height: 1.6; }

/* ---------- MathJax ---------- */
mjx-container { font-size: 96% !important; }
mjx-container[display="true"] { margin: .5em 0 !important; }
