/* maxc.life. One stylesheet. Reference: thesephist.com home page (see docs/DESIGN.md). */

@font-face { font-family: "Plex Serif"; src: url("/fonts/ibm-plex-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("/fonts/ibm-plex-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("/fonts/ibm-plex-serif-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: #f8f8f6;
  --ink: #222222;
  --muted: #5d5d6a;
  --rule: #e2e1dc;
  --accent: #2f7d78;      /* link underline */
  --card: #ffffff;
  --shot-border: rgba(0,0,0,.08);
  --serif: "Plex Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a; --ink: #e8e6e1; --muted: #9b9ba8; --rule: #2b2e33;
    --accent: #79c2bc; --card: #1c1f23; --shot-border: rgba(255,255,255,.08);
  }
}
:root[data-theme="dark"] {
  --bg: #15171a; --ink: #e8e6e1; --muted: #9b9ba8; --rule: #2b2e33;
  --accent: #79c2bc; --card: #1c1f23; --shot-border: rgba(255,255,255,.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.625;
  font-kerning: normal;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 24px 24px 48px; }
@media (max-width: 480px) { .wrap { padding: 16px 16px 40px; } body { font-size: 17px; } }

/* header: bold site name, plain lowercase links, like the reference */
.top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; padding: 8px 0 0; }
.top .home { font-weight: 700; text-decoration: none; color: var(--ink); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.top nav a { text-decoration: none; color: var(--ink); }
.top nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.top nav a:hover, .top .home:hover { color: var(--accent); }

main { padding-top: 40px; }
h1 { font-size: 27px; line-height: 1.325; font-weight: 700; margin: 0 0 18px; letter-spacing: -0.005em; }
h2 { font-size: 20px; line-height: 1.4; font-weight: 700; margin: 48px 0 8px; }
h3 { font-size: 18px; line-height: 1.4; font-weight: 700; margin: 0; }
p, ol, ul, dl { margin: 0 0 18px; }
ol { padding-left: 1.3em; }
li { margin-bottom: 8px; }
.lede { font-size: 20px; line-height: 1.6; }
@media (max-width: 480px) { .lede { font-size: 18px; } h1 { font-size: 25px; } }

a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.mono { font-family: var(--mono); font-size: 13.5px; letter-spacing: 0; }
.meta { color: var(--muted); margin: 2px 0 6px; }
.meta a { color: var(--muted); }
.crumbs { margin-bottom: 10px; }
.note { color: var(--muted); font-size: 16px; font-style: italic; margin-top: 36px; }
.more { margin-top: 8px; }

/* entries: picture beside text on wide screens, above it on phones */
.list { margin-top: 16px; }
.entry {
  display: grid; grid-template-columns: 216px 1fr; gap: 22px; align-items: start;
  padding: 22px 0; border-top: 1px solid var(--rule);
}
.list .entry:first-child { border-top: 0; padding-top: 8px; }
.entry.noimg { grid-template-columns: 1fr; }
.entry.research { border-left: 3px solid var(--accent); padding-left: 18px; margin: 6px 0; border-top: 0; }
.entry.research + .entry { border-top: 0; }
.entry p:last-child { margin-bottom: 0; }
.shot { display: block; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px var(--shot-border); line-height: 0; }
.shot img { width: 100%; height: auto; aspect-ratio: 960 / 504; object-fit: cover; object-position: left top; display: block; transition: transform .2s ease; }
.shot:hover img { transform: scale(1.015); }
@media (max-width: 600px) {
  .entry { grid-template-columns: 1fr; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { .shot img { transition: none; } .shot:hover img { transform: none; } }

/* governance cards */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 20px 22px 6px; margin: 24px 0; }
.card h2 { margin: 0 0 12px; font-size: 19px; }
.card dl { display: grid; grid-template-columns: 128px 1fr; gap: 6px 18px; font-size: 16.5px; line-height: 1.55; }
.card dt { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 3px; }
.card dd { margin: 0 0 8px; }
@media (max-width: 480px) { .card { padding: 16px 16px 4px; } .card dl { grid-template-columns: 1fr; gap: 0; } .card dd { margin-bottom: 12px; } }

/* cv */
dl.cv { display: grid; grid-template-columns: 84px 1fr; gap: 4px 18px; font-size: 17px; line-height: 1.55; }
dl.cv dt { font-family: var(--mono); font-size: 13.5px; color: var(--muted); padding-top: 3px; }
dl.cv dd { margin: 0 0 12px; }
@media (max-width: 480px) { dl.cv { grid-template-columns: 1fr; gap: 0; } dl.cv dd { margin-bottom: 14px; } }

.foot { margin-top: 64px; padding-top: 18px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 15px; line-height: 1.55; }
.foot p { margin: 0 0 8px; }
.foot a { color: var(--muted); }
.foot .build { font-size: 11.5px; opacity: .8; margin-top: 12px; }

/* builds index: compact rows, unlike the home page's pictured entries */
.index { margin-top: 8px; }
.row { display: grid; grid-template-columns: 56px 1fr; gap: 0 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.index .row:first-child { border-top: 0; }
.row .yr { color: var(--muted); padding-top: 4px; }
.row p { margin: 0; }
.row .dom { color: var(--muted); margin-left: 6px; }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } .row .yr { padding: 0 0 2px; } }

/* home: what's on the site */
dl.sections { display: grid; grid-template-columns: 112px 1fr; gap: 6px 18px; margin: 8px 0 18px; }
dl.sections dt { font-weight: 700; }
dl.sections dd { margin: 0 0 8px; }
@media (max-width: 480px) { dl.sections { grid-template-columns: 1fr; gap: 0; } dl.sections dd { margin-bottom: 12px; } }

.credit { font-size: 13px; color: var(--muted); margin-top: 6px; }
.credit a { color: var(--muted); }

/* photo laid over a card: a circle on the right third, matching the card's shadow */
.shot { position: relative; }
.shot img.overlay { position: absolute; left: 53.1%; top: 12.7%; width: 39.6%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; transform: none; }
.shot:hover img.overlay { transform: none; }

/* Lab password form (served by worker/index.js) */
.gate { margin-top: 24px; max-width: 360px; }
.gate label { font-size: 15px; color: var(--muted, #6b6b66); }
.gate input { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; margin: 6px 0 12px; border: 1px solid currentColor; border-radius: 2px; background: transparent; color: inherit; min-height: 44px; }
.gate button { font: inherit; padding: 10px 18px; border: 1px solid currentColor; border-radius: 2px; background: transparent; color: inherit; cursor: pointer; min-height: 44px; }
.gate button:hover { text-decoration: underline; }

/* Threshold's live strip on the home card (filled by /threshold.js). Neutral greys: no party colour implied. */
.live-th { margin: 12px 0 0; }
.live-th p { margin: 0; }
.th-bar { position: relative; height: 12px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.th-bar .th-l, .th-bar .th-r { position: absolute; top: 0; bottom: 0; background: var(--muted); }
.th-bar .th-l { left: 0; }
.th-bar .th-r { right: 0; }
.th-bar .th-mid { position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dashed var(--bg); }
.th-labels { display: flex; justify-content: space-between; gap: 16px; margin-top: 6px; font-size: 15px; line-height: 1.4; }
.th-side { max-width: 48%; }
.th-side strong { display: block; font-size: 16px; }
.th-right { text-align: right; }
.th-key { color: var(--muted); margin-top: 6px !important; font-size: 12.5px; line-height: 1.5; }
.th-count { margin-top: 8px !important; font-size: 12.5px; line-height: 1.5; }
.th-note { font-size: 16px; line-height: 1.5; }
.num { font-variant-numeric: tabular-nums; }
