/* bam.today — light editorial, auto dark. Hand-authored; no framework. */
:root {
  --bg: #fdfcfa;
  --ink: #1a1c20;
  --muted: #5c636e;
  --rule: #e3e0da;
  --accent: #b4552d;        /* burnt terracotta — road dust + terrain maps */
  --card: #f4f2ee;
  --code-bg: #f0eeea;
  --maxw: 76rem;
  --textw: 44rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --ink: #e8e6e1;
    --muted: #9aa1ab;
    --rule: #2b2f36;
    --accent: #e07a4a;
    --card: #1d2025;
    --code-bg: #101216;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
h1, h2, h3, .brand, .display {
  font-family: "Iowan Old Style", "Palatino", Georgia, serif;
  font-weight: 600; line-height: 1.15; letter-spacing: -0.01em;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-head {
  max-width: none; margin: 0 auto; padding: .45rem 2rem;
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--rule);
}
.brand { font-size: 1.15rem; color: var(--ink); }
.site-head nav a { margin-left: 1.6rem; color: var(--ink); font-size: 0.95rem; }
.site-head nav a:hover { color: var(--accent); }

main { max-width: var(--maxw); margin: 0 auto; padding: 2rem; }

.hero { padding: 5rem 0 4rem; max-width: 56rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0 0 1.2rem; }
.hero p.lede { font-size: 1.25rem; color: var(--muted); max-width: 38rem; }

/* ---- poster hero (wodniack-inspired): one color field, kinetic contours,
   monumental type. Full-bleed escape from the centered main column. ---- */
.poster {
  position: relative; overflow: hidden; background: var(--accent);
  height: min(88vh, 54rem); margin: 0 calc(50% - 50vw);
  --contour-ink: rgba(24, 16, 12, .5);
}
.poster canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.poster-chrome {
  position: absolute; top: 0; left: 0; right: 0; display: flex;
  justify-content: space-between; padding: 1rem 2rem;
  font-family: ui-monospace, monospace; font-size: .72rem; letter-spacing: .18em;
  color: rgba(20, 14, 10, .85); text-transform: uppercase;
}
.poster-title {
  position: absolute; left: 0; right: 0; bottom: 1.4rem; margin: 0;
  padding: 0 2rem; color: #16100c;
  font-family: -apple-system, "Helvetica Neue", sans-serif;
  font-weight: 900; text-transform: uppercase; letter-spacing: -0.03em;
  font-size: clamp(2.6rem, 9.5vw, 8.2rem); line-height: .92;
}
.poster-title .line { display: block; overflow: hidden; }
.poster-title .line > span { display: inline-block; }
.marquee {
  margin: 0 calc(50% - 50vw); border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule); overflow: hidden; white-space: nowrap;
  font-family: ui-monospace, monospace; font-size: .8rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted); padding: .55rem 0;
}
.marquee-track { display: inline-block; animation: marquee 56s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }
.home-lede { max-width: 40rem; font-size: 1.25rem; color: var(--muted); padding: 1rem 0 1rem; }
.idrow { display: flex; align-items: center; gap: 1rem; padding-top: 2.6rem; }
.idrow .avatar { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--rule); }
.idrow div { line-height: 1.4; font-size: .95rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; margin: 2rem 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); }
.gallery figure { margin: 0; }
.gallery figcaption { font-size: .8rem; color: var(--muted); padding-top: .3rem; }
.gallery figure.video { grid-column: 1 / -1; }
.gallery video { width: 100%; border-radius: 8px; border: 1px solid var(--rule); background: #000; }
.ph-slot { aspect-ratio: 1; border: 2px dashed var(--rule); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; padding: 1rem; text-align: center; color: var(--muted); font-size: .85rem; }
.ph-slot code { font-size: .72rem; color: var(--accent); }

/* ---- journey globe: Earth in space, orange/teal cinematic pairing ---- */
/* journey page article widens to hold the globe */
article.journey { max-width: 50rem; }
.globe-wrap {
  position: relative; aspect-ratio: 16/10; width: 100%; margin: 1.8rem 0 0;
  background: #07090d; border-radius: 12px; border: 1px solid var(--rule);
  overflow: hidden; touch-action: none;
}
.globe-btns {
  position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: .7rem; z-index: 6;
}
.gbtn {
  width: 3.4rem; height: 3.4rem; border-radius: 26%; cursor: pointer; padding: 0;
  background: rgba(22, 16, 12, .85); border: 1px solid rgba(245, 231, 208, .3);
  color: #4a423b; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.gbtn svg { width: 1.7rem; height: 1.7rem; }
.gbtn:hover { border-color: #fff; }
.gbtn.on {
  color: #fff; border-color: #f5e7d0;
  box-shadow: 0 0 12px rgba(245, 231, 208, .28);
}
.gbtn-tag {
  font-family: ui-monospace, monospace; font-size: .55rem; letter-spacing: .08em;
  display: block; text-align: center; margin-top: .15rem;
}
/* career decade sub-menu: vertical radio pills right of the CAREER squircle,
   hidden until the CAREER layer is activated */
.gbtn-row { display: flex; align-items: center; gap: .45rem; }
.dec-menu { display: flex; flex-direction: column; gap: .3rem; }
.decbtn {
  padding: .3rem .5rem; border-radius: 999px; cursor: pointer;
  background: rgba(22, 16, 12, .85); border: 1px solid rgba(245, 231, 208, .3);
  color: #b7aa99; font: .68rem/1 ui-monospace, monospace; letter-spacing: .05em;
}
.decbtn:hover { border-color: #fff; color: #fff; }
.decbtn.on { background: #f5e7d0; color: #16100c; border-color: #f5e7d0; }
.globe-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#globe-tip {
  position: absolute; display: none; pointer-events: none; z-index: 5;
  background: #16100c; color: #f5e7d0; padding: .3rem .65rem; border-radius: 4px;
  font-family: ui-monospace, monospace; font-size: .78rem;
  width: max-content; max-width: 20rem;
  border: 1px solid rgba(245, 231, 208, .3);
}
.globe-hint {
  text-align: center; font-size: .8rem; color: var(--muted);
  font-family: ui-monospace, monospace; margin: .6rem 0 2rem;
}
.globe-overlay {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto;
  background: rgba(7, 9, 13, .94); padding: 3.4rem 1.6rem 2rem;
}
.globe-overlay .go-inner { max-width: 64rem; margin: 0 auto; }
.globe-overlay h2 { color: #f5e7d0; margin-top: 0; }
.globe-overlay .gallery figcaption { color: #9aa1ab; }
.go-close {
  position: fixed; top: 1rem; right: 1.4rem; z-index: 51;
  width: 2.6rem; height: 2.6rem; border-radius: 50%; cursor: pointer;
  background: none; border: 1px solid #f5e7d0; color: #f5e7d0;
  font-size: 1.5rem; line-height: 1;
}
.go-close:hover { background: #f5e7d0; color: #16100c; }
.go-single { display: flex; min-height: 85vh; align-items: center; justify-content: center; }
.go-single figure { margin: 0; max-width: 52rem; }
.go-single img, .go-single video { width: 100%; max-height: 78vh; object-fit: contain;
  border-radius: 8px; border: 1px solid var(--rule); }
.go-single figcaption { color: #9aa1ab; padding-top: .5rem; text-align: center; }

/* floating photo cards popped out of a clicked route */
.photo-cloud { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.photo-cloud .pcard {
  position: absolute; padding: 0; cursor: pointer; pointer-events: auto;
  border: 2px solid #f5e7d0; border-radius: 6px; overflow: hidden;
  background: #16100c; box-shadow: 0 6px 22px rgba(0, 0, 0, .55);
  opacity: 0; transition: transform .55s cubic-bezier(.2, .8, .3, 1.15), opacity .4s;
}
.photo-cloud .pcard.in {
  opacity: 1; transform: translate(0, 0) scale(1) rotate(var(--rot, 0deg));
}
.photo-cloud .pcard:hover { z-index: 7; border-color: #fff;
  transform: translate(0, 0) scale(1.6) rotate(0deg); }
.photo-cloud .pcard img, .photo-cloud .pcard video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.cloud-close {
  position: absolute; top: .7rem; right: .7rem; z-index: 8; pointer-events: auto;
  width: 2.65rem; height: 2.65rem; border-radius: 50%; cursor: pointer;
  background: rgba(22, 16, 12, .8); border: 1px solid #f5e7d0; color: #f5e7d0;
  font-size: 1.55rem; line-height: 1;
  animation: xpulse 2.2s ease-in-out infinite;
}
@keyframes xpulse {
  0%, 100% { box-shadow: 0 0 2px 0 rgba(245, 231, 208, .35); }
  50% { box-shadow: 0 0 14px 3px rgba(245, 231, 208, .75); }
}
@media (prefers-reduced-motion: reduce) { .cloud-close { animation: none; } }
.cloud-close:hover { background: #f5e7d0; color: #16100c; animation: none; }

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.6rem; margin: 2rem 0 4rem; }
.pillar {
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
}
.pillar .art { aspect-ratio: 16/8; background: linear-gradient(135deg, #c9c2b6, #8d9aa5); position: relative; }
.pillar .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pillar .art .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; opacity: .85;
}
.pillar .body { padding: 1.4rem 1.6rem 1.6rem; }
.pillar h2 { margin: 0 0 .5rem; font-size: 1.5rem; }
.pillar p { margin: 0 0 1rem; color: var(--muted); }

.worklist { border-top: 1px solid var(--rule); padding-top: 2rem; margin-bottom: 4rem; }
.worklist h2 { font-size: 1.1rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.workitem { display: flex; gap: 1.4rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.workitem .num { font-family: ui-monospace, monospace; color: var(--accent); }
.workitem h3 { margin: 0; font-size: 1.25rem; }
.workitem p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }
.workitem .tag { margin-left: auto; font-size: .8rem; color: var(--muted); white-space: nowrap; }

article { max-width: var(--textw); margin: 2rem auto 4rem; }
article h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
article h2 { font-size: 1.5rem; margin-top: 2.6rem; border-bottom: 1px solid var(--rule); padding-bottom: .35rem; }
article h3 { font-size: 1.15rem; margin-top: 1.8rem; }
article img { max-width: 100%; border-radius: 8px; border: 1px solid var(--rule); }
article table { border-collapse: collapse; width: 100%; font-size: .92rem; }
article th, article td { border: 1px solid var(--rule); padding: .45rem .7rem; text-align: left; }
article blockquote { margin: 1.2rem 0; padding: .2rem 1.2rem; border-left: 3px solid var(--accent); color: var(--muted); }
pre, code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .86em; }
pre { background: var(--code-bg); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.2rem; overflow-x: auto; }
:not(pre) > code { background: var(--code-bg); padding: .12em .35em; border-radius: 4px; }

.site-foot {
  max-width: var(--maxw); margin: 0 auto; padding: 1.6rem 2rem 2.4rem;
  border-top: 1px solid var(--rule); display: flex; justify-content: space-between;
  color: var(--muted); font-size: .9rem; flex-wrap: wrap; gap: .6rem;
}
.greybox { outline: 2px dashed var(--accent); outline-offset: 4px; }
.greybox-note { font-size: .8rem; color: var(--accent); margin: .4rem 0 0; }

/* The A3 sheet — a one-page report rendered as itself. Article width is
   overridden so the sheet reads as a single artifact, not article prose. */
.a3-sheet {
  max-width: 64rem; margin: 2rem auto; padding: 1.2rem 1.4rem;
  background: var(--card); border: 1px solid var(--ink); border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,.12);
  font-size: .78rem; line-height: 1.45;
}
.a3-sheet .a3-title {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--ink); padding-bottom: .4rem; margin-bottom: .8rem;
}
.a3-sheet .a3-title h4 { font-size: 1.05rem; margin: 0; }
.a3-sheet .a3-title span { font-family: ui-monospace, monospace; color: var(--muted); font-size: .72rem; }
.a3-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .a3-grid { grid-template-columns: 1fr; } }
.a3-cell { border: 1px solid var(--rule); border-radius: 4px; padding: .6rem .8rem; background: var(--bg); }
.a3-cell h5 {
  margin: 0 0 .4rem; font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
  font-family: -apple-system, sans-serif;
}
.a3-cell ul { margin: 0; padding-left: 1.1rem; }
.a3-cell li { margin: .18rem 0; }
.a3-cell img { width: 100%; border-radius: 3px; border: 1px solid var(--rule); margin: .3rem 0; }
.a3-cell table { font-size: .7rem; }
.a3-cell th, .a3-cell td { padding: .22rem .4rem; }
.a3-verdict { border-left: 4px solid var(--accent); font-weight: 600; padding-left: .8rem; }

/* ---- A3 standard sheet (2026-07-28): ONE layout for every A3 page. ----
   Full page width, height locked to the viewport (never below the fold),
   evidence band flex-fills all remaining space so SHOW dominates at ~80%. */
.a3-std {
  display: flex; flex-direction: column; box-sizing: border-box;
  max-width: none; width: min(115rem, 97.5vw);
  height: calc(100vh - 3.4rem);
  margin: .2rem 0 0 50%; transform: translateX(-50%);
  padding: .55rem 1rem;
}
.a3-std .a3-title { flex: 0 0 auto; margin-bottom: .45rem; padding-bottom: .25rem; }
.a3-top { display: grid; grid-template-columns: 1fr 1.55fr 1.15fr; gap: .7rem; flex: 0 0 auto; }
.a3-strips { display: grid; grid-template-rows: 1fr 1fr; gap: .5rem; font-size: .66rem; }
.a3-strips > div { border-radius: 4px; padding: .3rem .55rem; }
.a3-strips .neg { border: 1px solid #8c2f24; }
.a3-strips .pos { border: 1px solid #2e6b34; }
.a3-ev { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-top: .5rem; }
.a3-figs { flex: 1 1 auto; min-height: 0; display: grid; gap: .6rem; }
.a3-figs figure, .a3-figs > div { margin: 0; display: flex; flex-direction: column; min-height: 0; justify-content: center; }
/* Images hug their real pixels (2026-07-29): natural aspect capped by the
   cell, so the glow border wraps the chart itself — never a letterbox box.
   Full detail is one click away in the lightbox. */
.a3-figs img {
  flex: 0 1 auto; min-height: 0; width: auto; height: auto;
  max-width: 100%; max-height: 100%; margin: 0 auto;
  object-fit: contain; border-radius: 4px;
}
.a3-figs figcaption { flex: 0 0 auto; font-size: .64rem; color: var(--muted); line-height: 1.25; margin-top: .15rem; }
.a3-next { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .5rem; flex: 0 0 auto; }
.a3-next .a3-cell { padding: .3rem .6rem; }
.a3-next ul { font-size: .66rem; margin: .1rem 0; padding-left: 1rem; }
.a3-mono {
  margin: .35rem 0 0; font-size: .64rem; font-family: ui-monospace, monospace;
  background: rgba(0,0,0,.25); padding: .25rem .5rem; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto;
}

/* ---- brand hover-card: portrait + contact links under the site name ---- */
.brand-wrap { position: relative; display: inline-block; }
.brand-card {
  display: none; position: absolute; top: 100%; left: 0; z-index: 30;
  width: 17rem; padding: .55rem .55rem .2rem; margin-top: .35rem;
  background: #16100c; border: 1px solid rgba(245, 231, 208, .3);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}
.brand-wrap:hover .brand-card, .brand-wrap:focus-within .brand-card { display: block; }
.brand-card::before {
  content: ""; position: absolute; top: -.5rem; left: 0; right: 0; height: .5rem;
}

.brand-card img { width: 100%; border-radius: 6px; display: block; }
.brand-card p { text-align: center; margin: .45rem 0; font-size: .9rem; }

/* ---- A3 SHOW lightbox (2026-07-29): EVERY SHOW item on an A3 sheet is
   interactable — the pulsing glow signals it, click opens it full-viewport
   (up to the browser width), the X closes it. Images are covered
   automatically; a native-HTML SHOW block (table, hand-built plot) opts in
   with class="a3-zoom" and fullscreens as a scaled live clone. Wired once
   in main.js for every current and future A3 page; NO per-article code. ---- */
.a3-sheet img, .a3-std img, .a3-zoom {
  cursor: zoom-in;
  border: 1px solid var(--accent);
  animation: a3-glow 2.2s ease-in-out infinite;
}
.a3-zoom { border-radius: 4px; }
@keyframes a3-glow {
  0%, 100% { box-shadow: 0 0 2px 0 var(--accent); }
  50% { box-shadow: 0 0 14px 2px var(--accent); }
}
@media (prefers-reduced-motion: reduce) {
  .a3-sheet img, .a3-std img, .a3-zoom { animation: none; box-shadow: 0 0 6px 1px var(--accent); }
}
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(5, 4, 3, .93);
}
.lightbox.open { display: flex; }
.lightbox > img {
  width: 100vw; height: 100vh; object-fit: contain;
  cursor: zoom-out;
}
.lightbox-holder { display: none; align-items: center; justify-content: center; }
.lightbox-holder .a3-zoom {
  animation: none; border: none; box-shadow: none; cursor: default;
  background: var(--bg); padding: .4rem;
}
.lightbox-x {
  position: fixed; top: .7rem; right: 1rem; z-index: 101;
  width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer;
  font: 700 1.9rem/1 -apple-system, sans-serif; color: #f5e7d0;
  background: rgba(22, 16, 12, .65); border: 1px solid rgba(245, 231, 208, .45);
}
.lightbox-x:hover { color: var(--accent); border-color: var(--accent); }

/* ---- A3 flip arrows: fixed ‹ › at the page edges to move through the A3
   set without returning to the research index. Emitted by build.py from
   the site.yaml articles list (wrapped chain); hover names the target. ---- */
.a3-flip {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 40;
  width: 2.75rem; height: 5.5rem;
  display: flex; align-items: center; justify-content: center;
  font: 700 2.9rem/1 -apple-system, sans-serif; color: var(--muted);
  background: rgba(22, 16, 12, .55); border: 1px solid var(--rule);
  border-radius: 8px;
}
.a3-flip:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.a3-flip-prev { left: .3rem; }
.a3-flip-next { right: .3rem; }

/* ---- research index: R2IA screenshot row ---- */
.shotrow { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .8rem; margin: 1.2rem 0; }
.shotrow figure { margin: 0; }
.shotrow img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); }
.shotrow figcaption { font-size: .8rem; color: var(--muted); margin-top: .35rem; line-height: 1.35; }
