@font-face {
  font-family: "Didact Gothic";
  src: url("fonts/DidactGothic-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #1b1d1a;
  --ink-2: #4c524b;            /* secondary text, 8.2:1 on white */
  --hair: #c9cdc7;
  --green: #2f7a3e;            /* planning green, 5.4:1 on white */
  --film: rgba(232, 240, 242, .72);   /* tracing paper */
  --film-solid: #eef3f4;
  --mist: rgba(236, 242, 243, .4);       /* the laid sheet itself: thin enough to read the plan */
  --film-edge: #aebfc3;
  --gut: clamp(1rem, 3.2vw, 3rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --strip-h: 4rem;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--strip-h) + 1rem); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Didact Gothic", "Century Gothic", "URW Gothic", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums lining-nums;
  scrollbar-color: var(--film-edge) var(--paper);
  caret-color: var(--green);
  font-kerning: none;
}
::selection { background: var(--green); color: var(--paper); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--green); }
:focus-visible { outline: 1px solid var(--green); outline-offset: 3px; }
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
button { font: inherit; color: inherit; }

/* language switch */
html[lang="ru"] [data-l="en"], html[lang="en"] [data-l="ru"] { display: none !important; }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--paper); padding: .4rem .8rem; border: 1px solid var(--ink); z-index: 50; }
.skip:focus { left: .5rem; }

/* ---------- title strip ---------- */
.strip {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: clamp(.75rem, 2vw, 2rem);
  height: var(--strip-h);
  padding: 0 var(--gut);
  background: var(--paper);
  border-bottom: 1px solid var(--hair);
}
.strip__id { flex: none; display: block; }
.strip__mark { width: auto; height: 2.6rem; }
.strip__name { min-width: 0; line-height: 1.2; }
.strip__name h1 { font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.strip__name p { margin: 0; font-size: .82rem; color: var(--ink-2); letter-spacing: .04em; }
.strip__nav { display: flex; gap: 1.5rem; margin-left: auto; font-size: .9rem; }
.strip__nav a { text-decoration: none; color: var(--ink-2); }
.strip__nav a:hover { color: var(--green); }
.strip__act { display: flex; align-items: center; gap: .9rem; }
.lang { background: none; border: 0; padding: .3rem .1rem; cursor: pointer; font-size: .9rem; letter-spacing: .08em; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; }
.lang:hover { color: var(--green); }
.act { display: inline-flex; align-items: baseline; gap: .45rem; text-decoration: none; font-size: .9rem; padding: .45rem .8rem; border: 1px solid var(--ink); background: var(--paper); transition: background-color .2s, color .2s, border-color .2s; }
.act small { font-size: .74rem; color: var(--ink-2); transition: color .2s; }
.act:hover { color: var(--paper); background: var(--green); border-color: var(--green); }
.act:hover small { color: var(--paper); }

/* ---------- projects ---------- */
main { padding: 0 var(--gut); }
.proj { padding: clamp(2.5rem, 6vw, 5.5rem) 0; border-bottom: 1px solid var(--hair); }
.proj:first-child { padding-top: clamp(1.25rem, 3vw, 2.25rem); }
.proj h2 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); line-height: 1.15; letter-spacing: -.01em; }
.lead { font-size: clamp(1.05rem, 1.35vw, 1.25rem); line-height: 1.5; max-width: 46ch; color: var(--ink-2); }
.meta { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; margin: .7rem 0 1.2rem; font-size: .85rem; color: var(--ink-2); letter-spacing: .04em; }
.meta > span { white-space: nowrap; }
.comp { font-size: .92rem; color: var(--ink-2); max-width: 46ch; }
.tools { font-size: .82rem; color: var(--ink-2); letter-spacing: .04em; margin-top: 1.4rem; }
.result { color: var(--ink); }
.facts { list-style: none; padding: 0; margin: 1.6rem 0 0; display: flex; gap: 2.2rem; flex-wrap: wrap; }
.facts li { display: flex; flex-direction: column; border-top: 1px solid var(--ink); padding-top: .45rem; min-width: 7rem; }
.facts b { font-weight: 400; font-size: 1.6rem; line-height: 1.2; }
.facts span { font-size: .82rem; color: var(--ink-2); }

.proj__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: .5rem var(--gut); align-items: end; margin-bottom: 1.1rem; }
.proj__head .lead { grid-row: span 2; margin: 0; align-self: start; }
.proj__head h2 { grid-column: 2; }
.proj__head .meta { grid-column: 2; margin-bottom: 0; }
.proj__body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gut); margin-top: 2rem; }
.proj__text { max-width: 66ch; }
.proj__body .facts { margin-top: 0; align-self: start; justify-content: flex-end; }
.strip-fig { margin: 2rem 0 0; border: 1px solid var(--hair); }

.proj--tall, .proj--stack { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--gut); align-items: start; }
.proj--stack { grid-template-columns: auto minmax(0, 1fr); }
.proj--stack.proj--flip { grid-template-columns: minmax(0, 1fr) auto; }
.proj--stack .stack { width: min(46vw, calc((100svh - 14rem) * .707 + 2.25rem)); }
.proj--tall .plate { max-width: calc((100svh - 13rem) * 1800 / 1978); }
.proj--tall .edge { max-width: calc((100svh - 13rem) * 1800 / 1978); }
.proj--tall .tabs { max-width: calc((100svh - 13rem) * 1800 / 1978); }
.proj--flip > .stack { order: 2; }
.proj__side { max-width: 62ch; position: sticky; top: calc(var(--strip-h) + 2rem); }
.proj__side h2 { margin-top: .2rem; }

/* ---------- light table: base plate + tracing sheets ---------- */
.table { position: relative; }
.tabs { display: flex; flex-wrap: wrap; align-items: flex-end; margin: 0 1.6rem; position: relative; z-index: 3; }
.tabs button {
  flex: none;
  position: relative;
  padding: .55rem 1rem .5rem;
  margin: 0 -1px -1px 0;
  font-size: .86rem; line-height: 1.25; text-align: left; white-space: nowrap;
  color: var(--ink-2);
  background: var(--film);
  border: 1px solid var(--film-edge);
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.tabs button:first-child { background: var(--paper); border-color: var(--hair); }
.tabs button:hover { color: var(--ink); background: var(--film-solid); }
.tabs button[aria-pressed="true"] { color: var(--green); background: var(--paper); border-color: var(--ink); border-bottom-color: var(--paper); z-index: 2; }

.pan { position: relative; }
.plate {
  --fold: 56%;
  position: relative;
  aspect-ratio: var(--ar);
  margin: 0 1.6rem;
  border: 1px solid var(--ink);
  background: var(--film-solid);
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.plate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* the laid sheet: a misted, slightly diffused read of the plan, with the analysis ink on top */
.film { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--fold)) 0 0); }
.mist { position: absolute; inset: 0; clip-path: inset(var(--bt, 0%) max(var(--br, 0%), calc(100% - var(--fold))) var(--bb, 0%) var(--bl, 0%)); }
.mist, .film { pointer-events: none; }
.mist[hidden], .film[hidden] { display: none; }
.mist img { filter: blur(.7px) saturate(.85); }
.mist::after { content: ""; position: absolute; inset: 0; background: var(--mist); }
.film img { visibility: hidden; }
.film img.on { visibility: visible; }
.fold {
  position: absolute; top: -1px; bottom: -1px; left: var(--fold);
  width: 1px; background: var(--film-edge);
  cursor: ew-resize;
}
.film[hidden] ~ .fold { display: none; }
.fold::after { /* lifted edge: the shadow widens as the sheet is raised further */
  content: ""; position: absolute; top: 0; bottom: 0; left: 1px;
  width: calc(.4rem + (100 - var(--fold-n, 56)) * .02rem);
  background: linear-gradient(90deg, rgba(27, 29, 26, .2), rgba(27, 29, 26, 0));
  pointer-events: none;
}
.fold__grip {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  display: grid; place-items: center;
  width: 1.5rem; height: 3.2rem;
  background: var(--film-solid); border: 1px solid var(--ink);
  color: var(--ink);
  touch-action: none;
}
.fold__grip svg { width: .75rem; height: 1.75rem; }
.plate.is-drag .fold__grip, .fold__grip:hover { color: var(--green); border-color: var(--green); }

/* registration marks: base set in ink at the corners, the laid sheet's set travels with it */
.reg { position: absolute; width: 1.5rem; height: 1.5rem; fill: none; stroke: var(--ink); stroke-width: 1; pointer-events: none; z-index: 2; }
.reg--tl { left: -.75rem; top: -.75rem; }
.reg--tr { right: -.75rem; top: -.75rem; }
.reg--bl { left: -.75rem; bottom: -.75rem; }
.reg--br { right: -.75rem; bottom: -.75rem; }
.reg.ghost { stroke: var(--green); }

.edge { display: flex; align-items: center; gap: 1rem; margin: .9rem 1.6rem 0; font-size: .82rem; color: var(--ink-2); letter-spacing: .04em; }
.edge input { flex: 1; -webkit-appearance: none; appearance: none; height: 1.6rem; background: transparent; cursor: ew-resize; margin: 0; }
.edge input::-webkit-slider-runnable-track { height: 1px; background: var(--hair); }
.edge input::-moz-range-track { height: 1px; background: var(--hair); }
.edge input::-webkit-slider-thumb { -webkit-appearance: none; width: 3px; height: 1.4rem; margin-top: -.7rem; background: var(--ink); border: 0; }
.edge input::-moz-range-thumb { width: 3px; height: 1.4rem; background: var(--ink); border: 0; border-radius: 0; }
.edge input:focus-visible { outline: 1px solid var(--green); outline-offset: 2px; }
.edge input:hover::-webkit-slider-thumb { background: var(--green); }
.table.is-base .edge { visibility: hidden; }

.says { margin: 1rem 1.6rem 0; min-height: 3.2em; }
.says p { display: none; margin: 0; max-width: 70ch; font-size: .98rem; }
.says p.on { display: block; }
.proj__side .says { margin: 1.2rem 0 0; padding-top: .9rem; border-top: 1px solid var(--film-edge); }

/* ---------- offset stacks ---------- */
.stack { position: relative; min-width: 0; }
.stack__pile {
  position: relative;
  aspect-ratio: var(--ar);
  margin-right: 2.25rem; margin-bottom: 2.25rem;  /* room for the offsets */
}
.leaf {
  position: absolute; inset: 0; margin: 0;
  background: var(--paper);
  border: 1px solid var(--hair);
  transform: translate(calc(var(--i, 0) * .75rem), calc(var(--i, 0) * .75rem));
  transition: transform .5s var(--ease), opacity .3s;
  z-index: calc(10 - var(--i, 0));
}
.leaf::after { /* lower sheets read through tracing film */
  content: ""; position: absolute; inset: 0; background: var(--film); opacity: 0; transition: opacity .3s; pointer-events: none;
}
.leaf:not(.top)::after { opacity: 1; }
.leaf.top { border-color: var(--ink); cursor: pointer; }
.leaf.deep { opacity: 0; }
.leaf img { width: 100%; height: 100%; object-fit: contain; }
.stack--land .leaf img { object-fit: cover; }
.leaf figcaption { display: none; }
.stack__cap { margin: 0 2.25rem 0 0; min-height: 2.8em; font-size: .85rem; line-height: 1.4; color: var(--ink-2); }
.stack__ctl { display: flex; align-items: center; gap: .8rem; margin-top: .6rem; font-size: .9rem; }
.stack--land .stack__ctl { margin-top: .4rem; }
.stack__ctl button { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; background: var(--paper); border: 1px solid var(--ink); cursor: pointer; }
.stack__ctl button:hover { background: var(--green); border-color: var(--green); color: var(--paper); }
.stack__ctl svg { width: 1.25rem; height: .75rem; }
.count { min-width: 3.4rem; text-align: center; color: var(--ink-2); }
.count b { font-weight: 400; color: var(--ink); }
.open { margin-left: auto; font-size: .85rem; }

/* ---------- architecture ---------- */
.arch { padding: clamp(2.5rem, 6vw, 5.5rem) 0; border-bottom: 1px solid var(--hair); }
.arch__head h2 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); }
.arch__pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gut); margin-top: 1.6rem; }
.arch h3 { font-size: 1.05rem; margin-bottom: .8rem; }

/* ---------- about / contacts ---------- */
.about { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: var(--gut); padding: clamp(2.5rem, 6vw, 5.5rem) 0; }
.about__photo { width: 100%; border: 1px solid var(--hair); }
.about h2 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); margin-bottom: 1rem; }
.about .lead { color: var(--ink); max-width: 54ch; }
.cv { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .7rem 1.5rem; margin: 2rem 0 0; max-width: 64rem; }
.cv dt { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding-top: .2rem; grid-column: 1; }
.cv dd { margin: 0; grid-column: 2; padding-bottom: .7rem; border-bottom: 1px solid var(--hair); max-width: 66ch; }

.contacts { padding: clamp(2.5rem, 6vw, 4.5rem) var(--gut); border-top: 1px solid var(--ink); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--gut); }
.contacts h2 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); }
.contacts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; font-size: clamp(1.1rem, 1.6vw, 1.45rem); }
.contacts .act { font-size: 1rem; margin-top: .6rem; }
.colophon { grid-column: 1 / -1; margin: 1.5rem 0 0; font-size: .8rem; color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .strip__nav { display: none; }
  .strip__act { margin-left: auto; }
}
@media (max-width: 900px) {
  .proj__head, .proj__body, .proj--tall, .proj--stack, .proj--stack.proj--flip, .about, .contacts { grid-template-columns: minmax(0, 1fr); }
  .proj__head h2, .proj__head .meta { grid-column: 1; }
  .proj__head .lead { grid-row: auto; margin-bottom: .6rem; }
  .proj__body .facts { justify-content: flex-start; }
  .proj__side { position: static; }
  .proj--flip > .stack { order: 0; }
  .proj--stack .stack { width: min(100%, 34rem); }
  .proj--tall .plate { max-width: none; }
  .proj--tall .edge, .proj--tall .tabs { max-width: none; }
  .proj__head { margin-bottom: .8rem; }
  .proj--tall .proj__side, .proj--stack .proj__side { order: -1; }
  .arch__pair { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .about__photo { max-width: 16rem; }
}
@media (max-width: 640px) {
  :root { --strip-h: 3.4rem; }
  .strip { gap: .6rem; }
  .strip__mark { height: 2rem; }
  .strip__name h1 { font-size: .78rem; letter-spacing: .04em; white-space: normal; line-height: 1.15; max-width: 7.5rem; }
  .strip__name p { display: none; }
  .strip__act { gap: .55rem; }
  .act { padding: .35rem .55rem; font-size: .84rem; }
  .strip .act--pdf small { display: none; }
  .tabs { margin: 0 .8rem; }
  .tabs button { padding: .5rem .7rem .45rem; font-size: .8rem; }
  .plate { margin: 0 .8rem; }
  .edge, .says { margin-left: .8rem; margin-right: .8rem; }
  .proj--wide .pan { overflow-x: auto; margin: 0 calc(var(--gut) * -1); padding: 0 var(--gut) .8rem; scrollbar-width: thin; }
  .proj--wide .plate { width: 260vw; margin: 0; touch-action: pan-x pan-y; }
  .proj--wide .tabs, .proj--wide .edge, .proj--wide .says { margin-left: 0; margin-right: 0; padding-left: 0; }
  .stack__pile { margin-right: 1.5rem; margin-bottom: 1.5rem; }
  .leaf { transform: translate(calc(var(--i, 0) * .5rem), calc(var(--i, 0) * .5rem)); }
  .stack__cap { margin: 0; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .strip-fig__pan { overflow-x: auto; }
  .strip-fig__pan img { height: 9rem; width: auto; max-width: none; }
  .cv { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .cv dt, .cv dd { grid-column: 1; }
  .cv dt { margin-top: .8rem; }
  .facts { gap: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .leaf, .leaf::after, .tabs button, .act, .act small { transition: none; }
}
.stack__cap:empty { display: none; }

/* hint on the sheet edge: shown until the visitor first moves it */
.fold__hint {
  position: absolute; top: 50%; left: 1.1rem; transform: translateY(-50%);
  padding: .3rem .55rem; white-space: nowrap;
  font-size: .78rem; letter-spacing: .04em; color: var(--ink);
  background: var(--paper); border: 1px solid var(--ink);
  pointer-events: none;
  transition: opacity .4s;
}
.fold__hint::before { content: ""; position: absolute; left: -.45rem; top: 50%; width: .45rem; height: 1px; background: var(--ink); }
.plate.touched .fold__hint { opacity: 0; }
.tabs__hint { margin: 0 1.6rem .5rem; font-size: .8rem; color: var(--ink-2); letter-spacing: .04em; }
.tabs__group { display: flex; flex-wrap: wrap; align-items: flex-end; }
.tabs__label { align-self: center; padding: 0 .7rem 0 0; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.tabs__group { margin-left: 1rem; }

/* legend (экспликация): one redrawn style for every sheet, her colours and wording */
.says { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: start; }
.key { margin: 0; display: none; }
.key.on { display: block; }
.key figcaption { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: .45rem; }
.lg, .lg-num { list-style: none; margin: 0; padding: 0; display: grid; gap: .32rem; font-size: .84rem; line-height: 1.3; }
.lg li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .55rem; align-items: start; }
.lg-num { counter-reset: n; margin-top: .7rem; padding-top: .55rem; border-top: 1px solid var(--hair); }
.lg-num li { counter-increment: n; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .55rem; }
.lg-num li::before { content: counter(n) "."; color: var(--ink-2); text-align: right; }
.sw { display: block; width: 1.6rem; height: .85rem; margin-top: .12rem; box-sizing: border-box; background: var(--c); border: 1px solid rgba(27, 29, 26, .28); }
.sw--o { background: transparent; border: 2px solid var(--c); }
.sw--h { background: repeating-linear-gradient(135deg, var(--c) 0 1.5px, transparent 1.5px 4px); }
.sw--v { background: repeating-linear-gradient(90deg, var(--c) 0 1.5px, transparent 1.5px 4px); }
.sw--l { border: 0; height: .25rem; margin-top: .4rem; }
.sw--d { border: 0; height: .2rem; margin-top: .42rem; background: repeating-linear-gradient(90deg, var(--c) 0 4px, transparent 4px 7px); }
.sw--a { border: 0; height: .85rem; background: none; position: relative; }
.sw--a::before { content: ""; position: absolute; left: 0; right: .35rem; top: 50%; height: 2px; margin-top: -1px; background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }
.sw--a::after { content: ""; position: absolute; right: 0; top: 50%; margin-top: -.3rem; border-left: .45rem solid var(--c); border-top: .3rem solid transparent; border-bottom: .3rem solid transparent; }
.sw--c, .sw--r { width: .85rem; height: .85rem; margin-left: .375rem; border-radius: 50%; }
.sw--r { background: transparent; border: 2px solid var(--c); }
.lg-age__bar { display: grid; grid-template-columns: .5fr repeat(9, 1fr) .5fr; height: .85rem; border: 1px solid rgba(27, 29, 26, .28); }
.lg-age__bar i { background: var(--c); }
.lg-age__ticks { display: grid; grid-template-columns: .5fr repeat(9, 1fr) .5fr; font-size: .75rem; color: var(--ink-2); margin-top: .2rem; }
.lg-age__ticks b { font-weight: 400; transform: translateX(-50%); white-space: nowrap; }
.lg-age__ticks b:first-child { visibility: hidden; }
.lg-age { max-width: 26rem; }
.says .key { max-width: 28rem; }
.proj__side .says { grid-template-columns: minmax(0, 1fr); }
.proj__side .key.on { padding: .8rem .9rem; background: var(--film-solid); border: 1px solid var(--film-edge); }
.proj__side .lg { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); column-gap: 1.2rem; }

/* P3: the legend sits on the laid sheet itself, in the corner of the plan */
.plate-keys { position: absolute; left: 1rem; top: 1rem; z-index: 3; max-width: min(24rem, 34%); pointer-events: none; }
.plate-keys .key.on { padding: .7rem .8rem .75rem; background: rgba(255, 255, 255, .9); border: 1px solid var(--ink); }
.plate-keys .lg { font-size: .78rem; gap: .26rem; }
.plate-keys .sw { width: 1.35rem; height: .75rem; }
.plate-keys .lg li { grid-template-columns: 1.35rem minmax(0, 1fr); }
.plate-keys .sw--c { width: .75rem; height: .75rem; margin-left: .3rem; }
.film[hidden] ~ .plate-keys, .table.is-base .plate-keys { display: none; }
.key--m { display: none !important; }
@media (max-width: 900px) { .says { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .plate-keys { display: none; }
  .key--m.on { display: block !important; padding: .8rem .9rem; background: var(--film-solid); border: 1px solid var(--film-edge); }
}

/* analysis sheets beside a light table */
.side-sheets { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.6rem; }
.side-sheets a { display: block; text-decoration: none; }
.side-sheets img { border: 1px solid var(--hair); transition: border-color .2s; }
.side-sheets a:hover img { border-color: var(--green); }
.side-sheets span { display: block; margin-top: .4rem; font-size: .8rem; line-height: 1.35; color: var(--ink-2); }
.proj--tall .plate.p2 { max-width: calc((100svh - 15rem) * 2000 / 1984); }
@media (max-width: 900px) { .proj--tall .plate.p2 { max-width: none; } }

@media (max-width: 640px) { .tabs__hint { margin: 0 0 .5rem; } .tabs__group { margin-left: .7rem; flex-wrap: nowrap; flex: none; } }

/* P2: grouped sheets as labelled rows (base / before / after) */
.tabs--rows { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); align-items: center; row-gap: .45rem; padding-bottom: .7rem; }
.tabs--rows .tabs__label { padding: 0; }
.tabs__row { display: flex; flex-wrap: wrap; min-width: 0; }
.tabs--rows button { margin: 0 -1px 0 0; }
.tabs--rows button:first-child { background: var(--film); border-color: var(--film-edge); }
.tabs--rows .tabs__row:first-of-type button { background: var(--paper); border-color: var(--hair); }
.tabs--rows button[aria-pressed="true"] { background: var(--paper); border-color: var(--ink); border-bottom-color: var(--ink); }
@media (max-width: 640px) {
  .tabs--rows { grid-template-columns: 3.4rem minmax(0, 1fr); overflow: visible; }
  .tabs__row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs__row::-webkit-scrollbar { display: none; }
}

/* P1: legend + analysis folder | light table | text + concepts folder */
.proj--p1 { --mist: rgba(236, 242, 243, .7); display: grid; grid-template-columns: minmax(0, 1fr) min(calc((100svh - 13rem) * 2000 / 2598), 44vw) minmax(0, 1fr); gap: var(--gut); align-items: start; }
.proj--p1 .plate, .proj--p1 .edge, .proj--p1 .tabs { max-width: calc((100svh - 13rem) * 2000 / 2598); }
.proj--p1 .tabs, .proj--p1 .tabs__hint { margin-left: 0; margin-right: 0; }
.proj--p1 .tabs { flex-wrap: nowrap; }
.proj--p1 .tabs button { flex: 1 1 auto; min-width: 0; padding: .5rem .5rem .45rem; font-size: .8rem; text-align: center; }
.proj--p1 .table > * { margin-left: auto; margin-right: auto; max-width: calc((100svh - 13rem) * 2000 / 2598); }
.proj--p1 .plate { margin-left: 0; margin-right: 0; }
.proj--p1 .edge { padding-left: 0; padding-right: 0; }
.says--keys { display: block; margin-top: 2.1rem; }
.says--caps { display: block; }
.folder { margin-top: 2rem; }
.folder__label { margin: 0 0 .6rem; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.folder .stack__pile { margin-right: 1.6rem; margin-bottom: 1.6rem; }
.folder .leaf { transform: translate(calc(var(--i, 0) * .5rem), calc(var(--i, 0) * .5rem)); }
.folder--analysis .leaf img { object-fit: contain; }
.folder--concepts { max-width: 26rem; }
@media (max-width: 1100px) {
  .proj--p1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .proj--p1 .p1-left { grid-column: 1 / -1; order: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gut); align-items: start; }
  .proj--p1 .p1-left .folder { margin-top: 2.1rem; }
}
@media (max-width: 900px) {
  .proj--p1 { grid-template-columns: minmax(0, 1fr); }
  .proj--p1 .proj__side { order: -1; }
  .proj--p1 .p1-left { grid-template-columns: minmax(0, 1fr); }
  .proj--p1 .plate, .proj--p1 .edge, .proj--p1 .tabs { max-width: none; }
  .proj--p1 .table > * { max-width: none; }
  .proj--p1 .tabs { overflow-x: auto; scrollbar-width: none; }
  .proj--p1 .tabs button { flex: none; padding: .5rem .7rem .45rem; }
}
