/* ============================================================
   Ethical Ontology — design system
   Register: academic / scientific. Neutral ground, grey rules,
   a single institutional blue. Sans-serif chrome and UI;
   serif reserved for sustained reading and canonical statements.
   Light + dark. No external requests.
   ============================================================ */

:root {
  /* ground + structure: neutral, not warm */
  --paper:      #ffffff;
  --paper-2:    #f6f7f8;
  --paper-3:    #eef1f4;
  --ink:        #1c1f23;
  --ink-2:      #3d434a;
  --muted:      #6a7178;
  --line:       #dfe3e7;
  --line-soft:  #ebeef1;

  /* institutional blue — the single accent */
  --accent:     #005a9b;
  --accent-ink: #004b81;
  --accent-pale:#d6e4f3;

  --sel:        #d6e4f3;
  --measure:    40rem;

  --sans: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
  --serif: 'Source Serif 4','Source Serif Pro',Charter,'Iowan Old Style',Georgia,Cambria,'Times New Roman',serif;
  --mono: ui-monospace,SFMono-Regular,Menlo,Consolas,'Liberation Mono',monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #12151a;
    --paper-2:    #171b21;
    --paper-3:    #1d222a;
    --ink:        #e8ebee;
    --ink-2:      #c2c8cf;
    --muted:      #8b939c;
    --line:       #2a3038;
    --line-soft:  #21262d;
    --accent:     #6fa8dc;
    --accent-ink: #8dbde8;
    --accent-pale:#1b2c3f;
    --sel:        #203146;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--sel); }

p, ul, ol, blockquote, figure, table { margin: 0 0 1.15em; }
a { color: var(--accent); text-underline-offset: 0.15em; text-decoration-thickness: 0.05em; }
a:hover { color: var(--accent-ink); }
strong { font-weight: 600; }
hr { border: 0; height: 1px; background: var(--line); margin: 2.5rem 0; }

/* ---- layout ---- */
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }
.wrap--wide { max-width: 54rem; }

/* ---- masthead: journal-style, ruled ---- */
.site-head {
  background: var(--paper);
  border-bottom: 2px solid var(--accent);
}
.site-head__inner {
  max-width: 62rem; margin: 0 auto; padding: 1rem 1.5rem 0.85rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--sans); font-weight: 600; font-size: 1.02rem;
  letter-spacing: 0.005em; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.nav {
  font-size: 0.8rem; letter-spacing: 0.03em; display: flex; gap: 1.35rem; flex-wrap: wrap;
}
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--accent); text-decoration: underline; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---- main ---- */
main { padding: clamp(2rem, 5vw, 3.5rem) 0 1rem; }

.eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 0.9rem;
}

h1 {
  font-family: var(--sans);
  font-weight: 600; font-size: clamp(1.75rem, 4.2vw, 2.35rem); line-height: 1.15;
  letter-spacing: -0.015em; margin: 0 0 1.1rem; color: var(--ink);
}
h2 {
  font-family: var(--sans);
  font-weight: 600; font-size: 1.22rem; line-height: 1.3; letter-spacing: -0.005em;
  margin: 2.4rem 0 0.8rem; padding-bottom: 0.45rem; border-bottom: 1px solid var(--line);
}
h3 { font-family: var(--sans); font-weight: 600; font-size: 1.0rem; margin: 1.8rem 0 0.5rem; }

/* ---- reading body: serif for sustained prose ---- */
.prose {
  font-family: var(--serif);
  font-size: 1.11rem;
  line-height: 1.68;
  color: var(--ink-2);
  font-feature-settings: "liga" 1, "kern" 1;
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose > p:first-of-type { margin-top: 0; }

.lede {
  font-family: var(--serif);
  font-size: 1.2rem; line-height: 1.55; color: var(--ink);
  padding-bottom: 1.25rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

/* ---- canonical statements: boxed, not decorative ---- */
blockquote.doctrine {
  font-family: var(--serif);
  margin: 1.75rem 0; padding: 1.05rem 1.25rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  font-size: 1.09rem; line-height: 1.5; color: var(--ink);
}
blockquote.doctrine strong { font-weight: 600; }

/* ---- index / navigation table (journal contents register) ---- */
.paths { list-style: none; margin: 2.25rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.paths li { border-bottom: 1px solid var(--line); }
.paths a {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 0.25rem 1.25rem; align-items: baseline;
  padding: 0.95rem 0.25rem; text-decoration: none; color: var(--ink); transition: background .12s ease;
}
.paths a:hover { background: var(--paper-2); }
.paths .k {
  font-family: var(--sans); font-size: 0.73rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
}
.paths .d { font-family: var(--serif); color: var(--ink-2); font-size: 1.0rem; line-height: 1.5; }
.paths .d em { color: var(--ink); }
@media (max-width: 36rem) {
  .paths a { grid-template-columns: 1fr; }
}

/* ---- metadata blocks (DOI, citation, status) ---- */
.meta {
  font-family: var(--sans); font-size: 0.86rem; line-height: 1.55;
  background: var(--paper-2); border: 1px solid var(--line);
  padding: 0.9rem 1.1rem; margin: 1.5rem 0;
}
.meta dl { margin: 0; display: grid; grid-template-columns: 8rem 1fr; gap: 0.35rem 1rem; }
.meta dt { color: var(--muted); font-weight: 500; }
.meta dd { margin: 0; color: var(--ink-2); }
.meta code, .hash { font-family: var(--mono); font-size: 0.82em; word-break: break-all; }
@media (max-width: 32rem) { .meta dl { grid-template-columns: 1fr; gap: 0.1rem 0; } .meta dd { margin-bottom: 0.5rem; } }

.citation {
  font-family: var(--serif); font-size: 0.95rem; line-height: 1.55;
  background: var(--paper-2); border-left: 3px solid var(--line);
  padding: 0.85rem 1rem; margin: 1.25rem 0; color: var(--ink-2);
}

/* ---- status pills ---- */
.pill {
  display: inline-block; font-family: var(--sans); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-pale);
  border-radius: 2px; padding: 0.2rem 0.55rem; margin: 0 0 0.9rem;
}

/* ---- attribution / notes ---- */
.attribution {
  font-family: var(--sans); font-size: 0.88rem; color: var(--muted);
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.attribution a { color: var(--muted); }
.attribution a:hover { color: var(--accent); }
.note { font-family: var(--sans); font-size: 0.88rem; color: var(--muted); }

/* ---- footer ---- */
.site-foot {
  border-top: 1px solid var(--line); margin-top: 3.5rem; background: var(--paper-2);
  font-family: var(--sans); font-size: 0.82rem; color: var(--muted);
}
.site-foot__inner {
  max-width: 62rem; margin: 0 auto; padding: 1.5rem 1.5rem 2.5rem;
  display: flex; justify-content: space-between; gap: 0.75rem 2rem; flex-wrap: wrap;
}
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; }
.site-foot__col { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* ---- figures: documentary, captioned, journal register ---- */
figure.fig { margin: 2.25rem 0; }
figure.fig img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); background: var(--paper-2);
}
figure.fig figcaption {
  font-family: var(--sans); font-size: 0.83rem; line-height: 1.55;
  color: var(--muted); margin-top: 0.6rem; padding-left: 0.05rem;
}
figure.fig figcaption strong { color: var(--ink-2); font-weight: 600; }

/* wide figure: allowed to breathe past the reading measure */
@media (min-width: 56rem) {
  figure.fig--wide { width: calc(100% + 8rem); margin-left: -4rem; }
}

/* ---- person block (Direction) ---- */
.person { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.15rem; align-items: start; margin: 1.25rem 0 0; }
.person img {
  width: 5.5rem; height: 5.5rem; border-radius: 2px; object-fit: cover;
  border: 1px solid var(--line); display: block;
}
.person__body { font-family: var(--serif); font-size: 1.0rem; line-height: 1.6; color: var(--ink-2); }
.person__name { font-family: var(--sans); font-weight: 600; font-size: 0.98rem; color: var(--ink); margin: 0 0 0.15rem; }
.person__role { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--muted); margin: 0 0 0.5rem; }
@media (max-width: 30rem) { .person { grid-template-columns: 1fr; } }

/* ---- status block ---- */
.status {
  font-family: var(--sans); font-size: 0.95rem; line-height: 1.6;
  border-left: 3px solid var(--accent); background: var(--paper-2);
  padding: 0.85rem 1.1rem; margin: 1.25rem 0; color: var(--ink-2);
}

/* ---- display formulae in the formal articles ---- */
pre.formula {
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 1.15rem 0;
  padding: 0.85rem 1.05rem;
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  overflow-x: auto;
  white-space: pre;
  color: var(--ink);
}
pre.formula sub, pre.formula sup { font-size: 0.72em; }
