/* site.css — layout + the panel state machine. Structure only; all text comes from content/. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--color-paper); color: var(--color-ink);
  font-family: var(--font-body); font-weight: 300; font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-ink); text-decoration: none; }
a:hover { color: var(--color-accent); }
a:active, button:active { color: var(--color-accent-deep); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }

.mono { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0.08em; }
.muted { color: var(--color-muted); }
.muted-strong { color: var(--color-muted-2); }
.accent { color: var(--color-accent); }
a.accent:hover { color: var(--color-accent-deep); }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--color-muted); text-transform: uppercase; }
.display { font-family: var(--font-display); font-size: clamp(2.4rem, 3.9vw, 3.5rem); line-height: 1.02; }
.display-2 { font-family: var(--font-display); font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1; }
mark.band {
  color: inherit;
  background: linear-gradient(180deg, transparent 38%, var(--color-highlight) 38%, var(--color-highlight) 92%, transparent 92%);
}

/* ---------- the stage: five panels, one grid, four-and-a-half states ---------- */
.stage {
  display: grid; height: 100vh; min-height: 640px;
  grid-template-columns: 39fr 26.4fr 18fr 16.6fr;
  transition: grid-template-columns 560ms var(--ease-spring);
}
.stage[data-state="research"] { grid-template-columns: 96px minmax(0, 1fr) 82px 82px; }
.stage[data-state="practice"] { grid-template-columns: 96px 82px minmax(0, 1fr) 82px; }
.stage[data-state="lab"]      { grid-template-columns: 96px 82px 82px minmax(0, 1fr); }

.panel { position: relative; min-width: 0; overflow: hidden; border-right: 1px solid var(--color-rule); }
.panel:last-of-type { border-right: 0; }

/* content faces: preview / full / sliver — crossfade AFTER the geometry lands */
.section-preview, .section-full, .sliver-face, .identity-full, .identity-rail {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-short) var(--ease-out), visibility 0s linear var(--dur-short);
}
.is-shown { opacity: 1; visibility: visible; transition-delay: 300ms, 0s; }

/* ---------- identity panel ---------- */
.identity-full {
  background: var(--color-panel);
  padding: 44px 52px 36px 52px;
  display: flex; flex-direction: column;
}
.portrait { width: 128px; height: 128px; object-fit: cover; border: 1px solid var(--color-rule-strong); margin-bottom: var(--s-24); }
.role { margin-top: var(--s-16); font-size: 15px; font-weight: 400; color: var(--color-muted-2); }
.statement { margin-top: var(--s-24); font-size: 16px; line-height: 1.6; color: var(--color-ink-body); max-width: 42ch; }
.nowline { margin-top: var(--s-24); display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: 0.1em; color: var(--color-accent); line-height: 1; }
.nowrule { width: 22px; height: 1px; background: var(--color-accent); flex: none; }
.identity-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--color-muted-2); }
.identity-links { display: flex; flex-wrap: wrap; gap: 18px; }
.linklike { color: var(--color-ink); }
.linklike:hover { color: var(--color-accent); }

.identity-rail {
  background: var(--color-panel);
  padding: 24px 0; display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.rail-photo { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--color-rule-strong); }
.rail-name { font-family: var(--font-display); font-size: 20px; writing-mode: vertical-rl; color: var(--color-muted-2); }
.rail-back { margin-top: auto; width: 40px; height: 40px; border: 1px solid var(--color-rule-strong); display: flex; align-items: center; justify-content: center; color: var(--color-accent); }
.rail-back:hover { border-color: var(--color-accent); }

/* ---------- section previews (landing) ---------- */
.section-preview { padding: 44px 32px 36px 36px; display: flex; flex-direction: column; cursor: pointer; text-align: left; }
.section-preview .display-2 { margin-top: 10px; font-size: clamp(1.8rem, 2.9vw, 2.75rem); }
.section-desc { margin-top: 12px; font-size: 14px; color: var(--color-muted-2); max-width: 30ch; }
.panel-section { transition: background var(--dur-micro) var(--ease-out); }
.stage[data-state="landing"] .panel-section:hover { background: var(--color-panel-hover); }

.preview, .preview-list { margin-top: auto; transition: transform var(--dur-short) var(--ease-out); }
.stage[data-state="landing"] .panel-section:hover :is(.preview, .preview-list) { transform: translateY(-8px); }
.preview-row { padding: 12px 0; border-top: 1px solid var(--color-rule); font-size: 13.5px; font-weight: 400; }

.preview { position: relative; height: 250px; }
.stack-card {
  position: absolute; left: 0; width: min(300px, 92%); padding: 13px 16px;
  background: var(--color-paper); border: 1px solid var(--color-rule);
  font-size: 13px; font-weight: 500; color: var(--color-muted);
  font-family: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.stack-card:hover { border-color: var(--color-accent); color: var(--color-ink); }
.stack-card.stack-focal:hover { border-color: var(--color-accent); color: var(--color-ink-inverse); }
.stack-card > span:first-child { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack-card.sc0 { top: 8px; transform: rotate(-2deg); }
.stack-card.sc1 { top: 70px; transform: rotate(-0.6deg); border-color: var(--color-rule-strong); color: var(--color-muted-2); }
.stack-focal {
  top: 134px; transform: rotate(0.6deg);
  background: var(--color-ink); border-color: var(--color-ink); color: var(--color-ink-inverse);
  display: flex; flex-direction: column; gap: 5px; font-size: 14px;
}
.tag-inverse { font-size: 9.5px; letter-spacing: 0.1em; color: var(--color-muted-inverse); }
.enter { position: absolute; right: 0; bottom: 4px; display: inline-flex; align-items: center; gap: 9px; font-size: 11px; letter-spacing: 0.1em; color: var(--color-accent); line-height: 1; }

/* ---------- sliver faces ---------- */
.sliver-face { display: flex; flex-direction: column; align-items: center; padding: 36px 0 28px 0; width: 100%; }
.sliver-face .mono { font-size: 10.5px; color: var(--color-muted); }
.sliver-title { font-family: var(--font-display); font-size: 24px; writing-mode: vertical-rl; margin-top: 16px; }
.sliver-face:hover { background: var(--color-panel-hover); }

/* ---------- open sections ---------- */
.section-full { padding: 44px 52px 0 56px; display: flex; flex-direction: column; overflow-y: auto; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex: none; }
.section-head > div { display: flex; flex-direction: column; gap: 8px; }
.section-aside { font-size: 13.5px; color: var(--color-muted-2); }
.section-intro { margin-top: var(--s-16); font-size: 15.5px; color: var(--color-ink-body); max-width: 62ch; }

/* research entries */
.entry-list { margin-top: var(--s-24); }
.entry { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--color-rule); }
.entry-year { font-size: 12px; color: var(--color-muted); padding-top: 6px; }
.entry-title { font-family: var(--font-display); font-size: 24px; line-height: 1.2; cursor: pointer; }
.entry-title:hover { color: var(--color-accent); }
.entry-meta { margin-top: 6px; font-size: 13.5px; color: var(--color-muted-2); }
.entry-more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--dur-long) var(--ease-out), opacity var(--dur-long) var(--ease-out); }
.entry-more > * { overflow: hidden; min-height: 0; }
.entry-open .entry-more { grid-template-rows: 1fr; opacity: 1; }
.entry-open .entry-more { max-height: 320px; opacity: 1; }
.takeaway { margin-top: 12px; font-size: 15px; color: var(--color-ink-body); max-width: 58ch; }
.entry-links { margin-top: 14px; display: flex; gap: 22px; font-size: 11px; letter-spacing: 0.06em; }
.entry-links a { color: var(--color-muted); }
.entry-links a.accent { color: var(--color-accent); }
.entry-open .entry-year { color: var(--color-accent); }

/* ---------- the Paper Wheel ---------- */
.view-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.08em; line-height: 1; }
.view-btn { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--color-muted); padding: 3px 2px; border-bottom: 2px solid transparent; }
.view-btn.is-active { color: var(--color-ink); border-bottom-color: var(--color-accent); }
.view-btn:hover { color: var(--color-accent); }

.section-full[data-view="wheel"] .entry-list { display: none; }
.section-full[data-view="list"] .wheel-view { display: none; }

.wheel-view {
  flex: 1; min-height: 0; margin-top: var(--s-24);
  display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 48px;
}
.wheel-details { position: relative; min-height: 300px; }
.wheel-detail {
  position: absolute; inset: 0; max-width: 640px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out),
    visibility 0s linear var(--dur-short);
}
.wheel-detail.is-current { opacity: 1; visibility: visible; transform: none; transition-delay: 140ms, 140ms, 0s; }
.wd-eyebrow { font-size: 10.5px; letter-spacing: 0.1em; color: var(--color-accent); }
.wd-title { font-family: var(--font-display); font-size: clamp(1.9rem, 2.9vw, 2.6rem); line-height: 1.1; margin-top: 14px; }
.wd-authors { margin-top: 10px; font-size: 14px; color: var(--color-muted-2); }
.wheel-detail .takeaway { margin-top: 16px; font-size: 16px; line-height: 1.65; max-width: 58ch; }
.wheel-detail .entry-links { margin-top: 20px; font-size: 11.5px; }

.wheel { position: relative; min-height: 380px; overflow: visible; }
.wheel-arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.wheel-card {
  position: absolute; right: 0; top: calc(50% - 36px); width: min(340px, 100%);
  padding: 13px 17px; text-align: left;
  background: var(--color-paper); border: 1px solid var(--color-rule-strong);
  font-size: 13px; font-weight: 500; color: var(--color-muted-2);
  display: flex; flex-direction: column; gap: 5px;
  transition: transform 520ms var(--ease-spring), opacity 300ms var(--ease-out),
    background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.wheel-card:hover { border-color: var(--color-accent); }
.wc-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-tag { font-size: 9px; letter-spacing: 0.1em; color: var(--color-muted); }
.wheel-card.is-focal {
  background: var(--color-ink); border-color: var(--color-ink); color: var(--color-ink-inverse); font-size: 14px;
}
.wheel-card.is-focal .wc-tag { color: var(--color-muted-inverse); }
.wheel-hint {
  position: absolute; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  font-size: 10.5px; letter-spacing: 0.1em; color: var(--color-muted); line-height: 1;
  background: var(--color-paper); padding: 8px 0 8px 14px;
}

/* wheel degrades to the list on small screens and reduced motion */
@media (max-width: 880px), (prefers-reduced-motion: reduce) {
  .view-toggle, .wheel-view { display: none; }
  .section-full[data-view="wheel"] .entry-list { display: block; }
}

/* practice */
.practice-note { margin-top: var(--s-40); font-size: 11px; color: var(--color-muted); border: 1px dashed var(--color-rule-strong); padding: 18px 22px; align-self: flex-start; }

/* lab cards */
.lab-cards { margin-top: var(--s-24); display: flex; gap: 24px; align-items: flex-start; }
.lab-card { background: var(--color-card); border: 1px solid var(--color-rule); width: 420px; flex: none; }
.lab-card.lab-focal { width: 560px; border-color: var(--color-rule-strong); }
.lab-cover { height: 200px; background: var(--color-ink); position: relative; overflow: hidden; }
.lab-cover::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(transparent 61px, #24506e 61px, #24506e 62px, transparent 62px) 0 0/100% 62px,
    linear-gradient(90deg, transparent 119px, #24506e 119px, #24506e 120px, transparent 120px) 0 0/120px 100%,
    linear-gradient(0deg, var(--color-data) 0 0) 40px 120px/28px 60px no-repeat,
    linear-gradient(0deg, var(--color-accent) 0 0) 118px 70px/28px 110px no-repeat,
    linear-gradient(0deg, var(--color-data) 0 0) 79px 95px/28px 85px no-repeat,
    linear-gradient(0deg, var(--color-data-strong) 0 0) 157px 140px/28px 40px no-repeat;
}
.lab-body { padding: 22px 26px 24px 26px; display: flex; flex-direction: column; gap: 10px; }
.lab-title { font-family: var(--font-display); font-size: 27px; line-height: 1.12; }
.lab-pitch { font-size: 14px; color: var(--color-muted-2); max-width: 58ch; }
.lab-keyline { font-size: 12.5px; }
.lab-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; font-size: 10.5px; }

/* about */
.about-grid { margin-top: var(--s-24); display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 52px; }
.about-photo { width: 300px; height: 300px; object-fit: cover; border: 1px solid var(--color-rule-strong); }
.about-contact { margin-top: var(--s-24); display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: var(--color-muted-2); }
.about-contact .mono { font-size: 10.5px; }
.about-main p { font-size: 15.5px; line-height: 1.65; color: var(--color-ink-body); max-width: 60ch; }
.about-main p + p { margin-top: var(--s-16); }
.cv-block { margin-top: var(--s-24); }
.cv-head { font-size: 10.5px; letter-spacing: 0.14em; color: var(--color-muted); padding: 20px 0 10px 0; border-bottom: 1px solid var(--color-rule); }
.cv-head:first-child { padding-top: 0; }
.cv-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--color-rule); font-size: 14.5px; align-items: baseline; }
.cv-year { font-size: 11px; color: var(--color-muted); }
.cv-more { padding-top: 12px; font-size: 13px; }

/* colophon */
.colophon {
  margin-top: auto; border-top: 1px solid var(--color-rule);
  padding: 16px 0 18px 0; display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--color-muted); flex: none;
}
.colophon-links { display: flex; gap: 22px; }
.colophon a { color: var(--color-muted); }
.colophon a.accent { color: var(--color-accent); }
.section-full > .colophon { margin-top: auto; }
.section-full > *:nth-last-child(2) { margin-bottom: var(--s-64); }

/* ---------- page-load reveal ---------- */
@keyframes reveal { to { opacity: 1; transform: none; } }
.js .stage[data-state="landing"] .is-shown > * { opacity: 0; transform: translateY(8px); animation: reveal var(--dur-long) var(--ease-out) forwards; }
.js .stage[data-state="landing"] .is-shown > *:nth-child(1) { animation-delay: 0ms; }
.js .stage[data-state="landing"] .is-shown > *:nth-child(2) { animation-delay: 60ms; }
.js .stage[data-state="landing"] .is-shown > *:nth-child(3) { animation-delay: 120ms; }
.js .stage[data-state="landing"] .is-shown > *:nth-child(4) { animation-delay: 180ms; }
.js .stage[data-state="landing"] .is-shown > *:nth-child(5) { animation-delay: 240ms; }
.js.revealed .stage .is-shown > * { animation: none; opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .stage { transition: none; }
  *, *::before, *::after { animation-duration: 150ms !important; transition-duration: 150ms !important; }
}

/* ---------- mobile: stacked one-pager ---------- */
@media (max-width: 880px) {
  .stage { display: block; height: auto; }
  .panel { border-right: 0; border-bottom: 1px solid var(--color-rule); overflow: visible; }
  .section-preview, .sliver-face, .identity-rail { display: none; }
  .identity-full, .section-full {
    position: static; opacity: 1; visibility: visible; transition: none;
  }
  .identity-full { padding: 36px 24px; }
  .section-full { padding: 36px 24px 0 24px; overflow: visible; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .lab-cards { flex-direction: column; }
  .lab-card, .lab-card.lab-focal { width: 100%; }
  .colophon { flex-wrap: wrap; gap: 10px; }
  .entry { grid-template-columns: 1fr; gap: 4px; }
  .entry-year { padding-top: 0; }
  .about-photo { width: min(300px, 100%); }
  .js .stage .is-shown > * { animation: none; opacity: 1; transform: none; }
}
