/* Paperback: the look of the five site pages (home, Research, Workshop, Contact, 404).
   Loaded only by those pages, after styles.css on the subpages; the tools and the map pages never see it.
   Big flat panels of navy, gold, and brick; Maxwell and the demon in each department's scene.
   No shadows, no rounded corners, no grain (style guide section 2). Built in pop-lab/, ported 11/9/26. */
:root {
  --paper: #f3f0e8; --ink: #151515; --graphite: #575853; --navy: #173a63;
  --gold: #eeb211; --brick: #9c3526;
  --sans: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "Overpass Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
html { overflow-x: clip; }
body.pb { overflow-x: clip; }
[hidden] { display: none !important; }


/* ======================= home ======================= */
.pb-home { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--mono); }
.pb-home *, .pb-home *::before, .pb-home *::after { box-sizing: border-box; }
.pb-home a { color: inherit; }
.pb-home img { max-width: 100%; }
.pb-home .skip-link { position: absolute; top: 0; left: 0; z-index: 40; padding: .75rem 1rem; background: var(--ink); color: var(--paper); transform: translateY(-120%); }
.pb-home .skip-link:focus { transform: none; }
.pb-home :focus-visible { outline: 4px solid var(--ink); outline-offset: -8px; }

.home { position: relative; min-height: 100vh; display: flex; flex-direction: column; }
.home .meta { position: absolute; z-index: 3; top: 0; left: 0; width: 38%; padding: clamp(1.25rem, 3vw, 2.5rem); display: grid; gap: .5rem; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.home .meta span { display: block; }
.home .meta-r { color: var(--graphite); }
.home .hero { flex: 1; display: grid; grid-template-columns: 38% 62%; }
.home .copy { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 8rem clamp(1.25rem, 3vw, 2.5rem) 2rem; }
.home .wordmark { margin: 0; font: 800 clamp(2.7rem, 5.5vw, 6.5rem)/.92 var(--sans); letter-spacing: -.005em; text-transform: uppercase; }
.home .wordmark span { display: block; }
.home .statement { margin: 1.75rem 0 0; font-family: var(--serif); font-size: clamp(1.1rem, 1.6vw, 1.45rem); line-height: 1.5; }

/* the three department panels */
.home .links { display: grid; grid-template-columns: repeat(3, 1fr); }
.home .link { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 22rem; padding: clamp(1rem, 2vw, 1.75rem); text-decoration: none; }
.home .link--research { grid-area: 1 / 1; background: var(--navy); color: var(--paper); }
.home .link--workshop { grid-area: 1 / 2; background: var(--gold); color: var(--ink); }
.home .link--contact { grid-area: 1 / 3; background: var(--brick); color: var(--paper); }
.home .link-code { display: block; font-size: .7rem; line-height: 1.5; letter-spacing: .07em; text-transform: uppercase; }
.home .link-name { display: block; margin-top: .8rem; font: 800 clamp(1.5rem, 2.7vw, 3.2rem)/.95 var(--sans); letter-spacing: -.005em; text-transform: uppercase; }
.home .link-pose { position: absolute; left: 50%; bottom: .5rem; width: 92%; max-width: none; height: auto; transform: translateX(-50%); transition: transform .3s ease; }
.home .link:hover .link-pose, .home .link:focus-visible .link-pose { transform: translateX(-50%) translateY(-1.25rem) scale(1.04); }
.home .link--research:focus-visible, .home .link--contact:focus-visible { outline-color: var(--paper); }

/* Diagram 17B hangs in the Research panel, above Maxwell and the demon. The layer shares the panel's
   grid cell and lets clicks through to the Research link, except on its Motion switch.
   The drawing fills x 80-727 and y 58-543 of its 820 x 700 frame: a 116% frame pulled 6% left spans
   about 92% of the panel. */
.home .hang { grid-area: 1 / 1; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 0 50%; overflow: hidden; pointer-events: none; color: var(--paper); }
.home .hang .diagram-wrap { position: relative; width: 116%; margin: 0 0 0 -6%; transition: transform .3s ease; }
.home .link--research:hover + .hang .diagram-wrap { transform: translateY(-.6rem); }
.home .hang svg { display: block; width: 100%; height: auto; overflow: visible; }
.home .hang .d-light { stroke: #cfdcec; opacity: .55; }
.home .hang .d-heavy { stroke: var(--paper); }
.home .hang .d-nodes { fill: var(--gold); }
.home .hang .d-labels { fill: var(--paper); }
.home .hang .d-ticks { stroke: var(--paper); }
.home .diagram-caption { position: absolute; bottom: 100%; right: 16%; margin: 0; font-size: .58rem; line-height: 1.5; letter-spacing: .06em; text-align: right; text-transform: uppercase; opacity: .85; }
.home .motion-switch { min-height: 24px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; pointer-events: auto; }
.home .motion-switch:hover { text-decoration: underline; }
.home .hang :focus-visible { outline: 2px solid var(--gold); outline-offset: .2rem; }

/* the easter egg: the demon peeks up from the bottom of the cream column; click him for the apparatus */
.home .egg { position: absolute; left: clamp(1.25rem, 3vw, 2.5rem); bottom: 0; width: 3.4rem; height: 2.3rem; padding: 0; border: 0; background: none; overflow: hidden; cursor: pointer; }
.home .egg img { position: absolute; left: 0; top: .55rem; width: 100%; height: auto; transition: top .25s ease; }
.home .egg:hover img, .home .egg:focus-visible img { top: .1rem; }
.home .egg:focus-visible { outline-offset: 2px; }

.egg-dialog { width: min(68rem, calc(100vw - 2rem)); max-width: none; max-height: calc(100vh - 2rem); padding: 4.5rem clamp(1rem, 3vw, 2rem) 1.5rem; border: 3px solid var(--ink); background: var(--paper); color: var(--ink); font-family: var(--mono); overflow: auto; }
.egg-dialog::backdrop { background: rgb(21 21 21 / .6); }
.egg-dialog :focus-visible { outline: 2px solid var(--navy); outline-offset: .2rem; }
.egg-head { position: absolute; top: 1rem; left: clamp(1rem, 3vw, 2rem); right: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
.egg-head h2 { margin: 0; font: inherit; }
.egg-dialog button { min-height: 28px; padding: .25rem .55rem; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.egg-dialog button:hover { background: var(--ink); color: var(--paper); }
.egg-dialog .plate { display: flex; flex-direction: column; height: min(30rem, calc(100vh - 12rem)); min-height: 18rem; margin-top: 5.5rem; }
.egg-dialog .chamber { position: relative; flex: 1; min-height: 15rem; border: 3px solid var(--ink); background: #faf8f3; }
.egg-dialog .chamber canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.egg-dialog .demon { position: absolute; left: 50%; bottom: calc(100% - .45rem); width: auto; height: clamp(6.5rem, 9vw, 8.75rem); transform: translateX(-50%); pointer-events: none; }
.egg-dialog .plate-foot { display: grid; grid-template-columns: auto 1fr auto auto; gap: .5rem 2rem; align-items: center; padding-top: .7rem; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
.egg-dialog .gauge { display: flex; gap: .7rem; align-items: baseline; }
.egg-dialog .gauge-v { min-width: 4.5ch; font: 800 1.6rem/1 var(--sans); }
.egg-dialog .gauge:first-child .gauge-v { color: var(--navy); }
.egg-dialog .gauge--r .gauge-v { color: #a8370b; }
.egg-dialog .verdict { margin: 0; text-align: center; color: var(--graphite); }
.egg-dialog .plate-btns { display: flex; gap: .5rem; }


/* ======================= subpages ======================= */
/* The intro becomes a full-width band in the department's color, with its scene on the right. */
.pb-sub .subpage-shell { width: min(100%, 1240px); padding-top: 0; gap: 0; }
.pb-sub .subpage-shell > header, .pb-sub .subpage-intro { margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); background: var(--band); color: var(--band-ink); }
.pb-sub .subpage-shell > header { padding-top: clamp(1.25rem, 3vw, 2.5rem); }
.pb-sub .back-link { color: inherit; font-weight: 500; }
.pb-sub .back-link:focus-visible, .pb-sub .subpage-intro :focus-visible { outline: 2px solid currentColor; }
.pb-sub .subpage-main { padding: 0 0 4rem; }
.pb-sub .subpage-intro { position: relative; max-width: none; min-height: max(18rem, calc(28vw * .82 - 2rem)); padding-top: clamp(2.5rem, 7vw, 5rem); padding-bottom: 2.5rem; }
.pb-sub .eyebrow { color: inherit; }
.pb-sub .subpage-title { font-weight: 800; font-size: clamp(3rem, 8vw, 7.5rem); line-height: .9; letter-spacing: -.005em; text-transform: uppercase; }
.pb-sub .subpage-copy { max-width: 26rem; font-size: 1.25rem; line-height: 1.7; }
.pb-sub .subpage-copy a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }
.pb-sub .pb-scene { position: absolute; z-index: 1; right: calc(50vw - 50%); bottom: 0; width: clamp(14rem, 28vw, 26rem); height: auto; }
.pb-sub .subpage-intro > :not(.pb-scene) { position: relative; z-index: 2; }

.pb-workshop { --band: var(--gold); --band-ink: var(--ink); --hover: var(--gold); --hover-ink: var(--ink); }
.pb-research { --band: var(--navy); --band-ink: var(--paper); --hover: var(--navy); --hover-ink: var(--paper); }
.pb-contact { --band: var(--brick); --band-ink: var(--paper); --hover: var(--brick); --hover-ink: var(--paper); }
.pb-404 { --band: var(--ink); --band-ink: var(--paper); }
.pb-contact .subpage-copy { max-width: 30rem; }

/* the catalog: one card per entry, two to a row */
.pb-sub .sort-bar { margin-top: 1.75rem; }
.pb-sub .project-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 2.5rem; border-top: 0; }
.pb-sub .sort-bar + .sr-only + .project-index { margin-top: 1rem; }
.pb-sub .project-entry { position: relative; display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem 1.35rem 1.5rem; border: 2px solid var(--ink); transition: background .12s; }
.pb-sub .project-code, .pb-sub .status-label { color: var(--ink); }
.pb-sub .project-entry__body h2 { font-weight: 800; font-size: clamp(1.45rem, 2.3vw, 2.1rem); }
.pb-sub .project-entry__body h2 a { color: inherit; }
.pb-sub .project-entry__body p { color: inherit; }
/* a linked entry is clickable as a whole card; links inside its text stay their own */
.pb-sub .project-entry__body h2 a::before { content: ""; position: absolute; inset: 0; }
.pb-sub .project-entry__body p a, .pb-sub .sub-index a { position: relative; z-index: 1; }
.pb-sub .project-entry:has(h2 a):hover { background: var(--hover); color: var(--hover-ink); border-color: var(--hover); }
.pb-sub .project-entry:has(h2 a):hover :is(.project-code, .section-label, .status-label, .sub-index__code, a) { color: var(--hover-ink); }
.pb-sub .project-entry:has(h2 a):hover h2 a { text-decoration: none; }
/* Workshop: what is live wears navy (marked by the sort script) */
.pb-sub .project-entry.is-live { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.pb-sub .project-entry.is-live :is(.project-code, .status-label, p, a) { color: var(--paper); }
.pb-sub .project-entry.is-live:hover { background: var(--brick); border-color: var(--brick); color: var(--paper); }
.pb-sub .project-entry.is-live:hover :is(.project-code, .status-label, a) { color: var(--paper); }

/* the 404 sends you on with the three homepage panels as blocks */
.pb-404 .primary-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2.5rem; }
.pb-404 .primary-link { width: auto; display: flex; align-items: flex-end; min-height: 9rem; padding: 1.25rem; font: 800 clamp(1.5rem, 2.6vw, 2.4rem)/1 var(--sans); letter-spacing: 0; text-decoration: none; text-transform: uppercase; }
.pb-404 .primary-link::after { content: none; }
.pb-404 .primary-link:nth-child(1) { background: var(--navy); color: var(--paper); }
.pb-404 .primary-link:nth-child(2) { background: var(--gold); color: var(--ink); }
.pb-404 .primary-link:nth-child(3) { background: var(--brick); color: var(--paper); }
.pb-404 .primary-link:hover { text-decoration: underline; text-underline-offset: .15em; }
.pb-404 .primary-link:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }


/* ======================= phones ======================= */
@media (max-width: 760px) {
  .home .meta { position: static; width: auto; padding: 1.25rem 1.25rem 0; }
  .home .hero { display: block; }
  .home .copy { padding: 2rem 1.25rem; }
  .home .wordmark { font-size: 15vw; }
  .home .links { grid-template-columns: 1fr; }
  .home .link { min-height: 19rem; }
  .home .link--research { grid-area: 1 / 1; min-height: 31rem; }
  .home .link--workshop { grid-area: 2 / 1; }
  .home .link--contact { grid-area: 3 / 1; }
  .home .link-pose { width: min(64%, 17rem); left: auto; right: .75rem; bottom: .5rem; transform: none; }
  .home .link:hover .link-pose, .home .link:focus-visible .link-pose { transform: translateY(-.75rem); }
  /* the scene is 64% wide on the right, so the drawing matches its width and sits over it */
  .home .hang { padding-bottom: calc(35% + .5rem); }
  .home .hang .diagram-wrap { width: 81%; margin-left: 25%; }
  .egg-dialog .plate-foot { grid-template-columns: 1fr 1fr; }
  .egg-dialog .verdict { grid-column: 1 / -1; grid-row: 2; }
  .egg-dialog .plate-btns { grid-column: 1 / -1; }

  .pb-sub .subpage-intro { min-height: 0; padding-bottom: 0; }
  .pb-sub .pb-scene { position: static; display: block; width: min(86%, 22rem); margin: 1.5rem 0 0 auto; }
  .pb-sub .project-index { grid-template-columns: 1fr; }
  .pb-404 .primary-links { grid-template-columns: 1fr; }
  .pb-404 .primary-link { min-height: 5.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .home .link-pose, .home .hang .diagram-wrap, .home .egg img, .pb-sub .project-entry { transition: none; }
}
