/* HOLVEM R13 · application pages (brief B): section 01 redesign (both variants), 02 record tidy.
   Every selector is scoped under a class the transform adds (.r13-s01, .r13-s01a, .r13-rec).
   Hero: the proof line is a markup deletion; no CSS. Tokens are the page's own custom properties. */

/* ===================================================================================
   The plate: one tonal, finely grained band that holds the whole instrument on one frame.
   Fine grain = 1 px ink dots at 7.5% on a 6 px grid (CSS only), on a half-sunken tone.
   =================================================================================== */
.r13-s01.r12-s01 .stagebox,
.r13-s01a .r13-plate {
  position:relative; margin-top:28px; padding:24px 24px 24px;
  background:#EFEEE8;
  background-color:color-mix(in srgb, var(--surface-sunken) 48%, var(--surface-raised));
  background-image:radial-gradient(circle at 1px 1px, rgba(20,24,27,.075) 1px, transparent 1.7px);
  background-size:6px 6px;
  border:1px solid var(--border-hairline); border-radius:var(--r);
}

/* ---------- the head: fully centred, one measure, kicker · H2 · lede ---------- */
.r13-s01.r12-s01 .sec-head,
.r13-s01a .sec-head { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; max-width:800px; margin:0 auto; }
.r13-s01.r12-s01 .sec-head .lede,
.r13-s01a .sec-head .lede { max-width:66ch; margin:0; }
@media (min-width:720px) {
  .r13-s01.r12-s01 .sec-head,
  .r13-s01a .sec-head { justify-items:center; text-align:center; gap:16px; }
  .r13-s01.r12-s01 .sec-head > div,
  .r13-s01a .sec-head > div { display:grid; justify-items:center; }
  .r13-s01.r12-s01 .kicker,
  .r13-s01a .kicker { justify-content:center; }
  .r13-s01.r12-s01 .sec-head .h2,
  .r13-s01a .sec-head .h2 { max-width:21ch; margin:14px auto 0; }
  .r13-s01.r12-s01 .sec-head .lede,
  .r13-s01a .sec-head .lede { margin:0 auto; }
}

/* ===================================================================================
   01 · the state stage (flat-roofs, floors, piles, pipework, roof-coatings, tanks, walls)
   Markup untouched (the beh bundle binds to it); the stagebox is the plate.
   =================================================================================== */
/* the two-state control, centred on the plate's axis, as a pair of equal tiles */
.r13-s01.r12-s01 .stage-head { margin:0; display:grid; grid-template-columns:minmax(0,1fr); justify-items:center; gap:10px; }
.r13-s01.r12-s01 .seg { display:grid; grid-template-columns:repeat(2, minmax(150px, 230px)); gap:10px; padding:0; background:transparent; width:100%; justify-content:center; }
.r13-s01.r12-s01 .seg button { position:relative; justify-content:center; min-height:48px; padding:10px 18px; border:1.5px solid var(--border); border-radius:var(--r); background:var(--surface-raised); font-size:14.5px; overflow:hidden; }
.r13-s01.r12-s01 .seg button::after { content:""; position:absolute; top:0; right:0; width:18px; height:11px; background:var(--c); clip-path:polygon(100% 0, 100% 100%, 0 0); opacity:0; }
.r13-s01.r12-s01 .seg button:hover { border-color:var(--border-strong); }
.r13-s01.r12-s01 .seg button[aria-pressed="true"] { border-color:var(--c); background:var(--soft); box-shadow:none; }
.r13-s01.r12-s01 .seg button[aria-pressed="true"]::after { opacity:1; }
.r13-s01.r12-s01 .seg .sb { --soft:var(--accent-soft); }
.r13-s01.r12-s01 .seg .sl { --soft:#EEF4DF; }
.r13-s01.r12-s01 .seg-note { justify-content:center; text-align:center; margin:0; }

/* the drawing sheet: one raised sheet that carries the drawing and its own foot line */
.r13-s01.r12-s01 .stage-wrap { margin-top:18px; background:var(--surface-raised); border:1px solid var(--border-hairline); border-radius:var(--r); overflow:hidden; box-shadow:0 1px 2px rgba(20,24,27,.05), 0 10px 26px -18px rgba(20,24,27,.28); }
.r13-s01.r12-s01 .stage { border:0; background:transparent; border-radius:0; padding:34px 18px 26px; }
.r13-s01.r12-s01 .stage::after { top:0; right:0; border-radius:0; }
.r13-s01.r12-s01 .stage-foot { margin:0; padding:12px 18px 13px; border-top:1px solid var(--border-hairline); background:var(--surface); }

@media (min-width:1000px) { .r13-s01.r12-s01 .stage-box { max-width:1040px; margin:0 auto; } }
/* the reading and the ledger, on the same gutters as the sheet */
.r13-s01.r12-s01 .runbox { margin-top:12px; padding:16px 20px 12px; background:var(--surface-raised); border:1px solid var(--border-hairline); }
.r13-s01.r12-s01 .ledger3 { margin-top:12px; box-shadow:0 1px 2px rgba(20,24,27,.05); }

/* the sign-off: a centred note on the head's measure */
.r13-s01.r12-s01 .sign { max-width:760px; margin:26px auto 0; padding:0; }
@media (min-width:720px) {
  .r13-s01.r12-s01 .sign { grid-template-columns:12px minmax(0,1fr); justify-content:center; width:max-content; max-width:min(760px, 100%); }
}

/* below 1000 the drawing is too narrow for label plates: discs only (the ledger beneath carries the words) */
@media (max-width:999px) {
  .r13-s01.r12-s01 .mark span { display:none; }
  .r13-s01.r12-s01 .mark, .r13-s01.r12-s01 .mark.flip { transform:translate(-14px,-22px); }
}
/* phones: the plate runs edge to edge; the control is two equal tiles across */
@media (max-width:719px) {
  .r13-s01.r12-s01 .stagebox { margin:22px calc(-1 * var(--gutter)) 0; padding:18px var(--gutter) 20px; border-left:0; border-right:0; border-radius:0; }
  .r13-s01.r12-s01 .seg { grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
  .r13-s01.r12-s01 .seg button { padding:10px 10px; font-size:14px; }
  .r13-s01.r12-s01 .stage { padding:22px 8px 18px; }
  .r13-s01.r12-s01 .stage-foot { padding:10px 12px 11px; }
  .r13-s01.r12-s01 .runbox { padding:14px 14px 10px; }
}

/* ===================================================================================
   01 · the drawn section (concrete-soffit, fibre-cement): drawing plate + record plate as a 7/5 pair
   of equal height on the plate; the key beneath on the same gutters; the handoff centred.
   =================================================================================== */
.r13-s01a .applied-grid { margin-top:0; align-items:stretch; gap:16px; }
.r13-s01a .drawing-card { display:grid; grid-template-rows:minmax(0,1fr) auto; align-items:center; padding:18px 18px 14px; background:var(--surface-raised); border:1px solid var(--border-hairline); box-shadow:0 1px 2px rgba(20,24,27,.05), 0 10px 26px -18px rgba(20,24,27,.28); }
.r13-s01a .drawing-card .drawing { display:block; width:100%; height:auto; }
.r13-s01a .drawing-card .fignote { align-self:end; margin-top:12px; padding-top:10px; border-top:1px solid var(--border-hairline); justify-content:space-between; }
/* the record plate (the st-card on concrete, the project-record figure on fibre-cement) */
.r13-s01a .st-card { border:1px solid var(--border-hairline); background:var(--surface-raised); box-shadow:0 1px 2px rgba(20,24,27,.05); }
.r13-s01a .st-card .tight { margin-top:auto; padding-top:16px; }
.r13-s01a .applied-grid .fig { margin-top:0; display:grid; grid-template-rows:minmax(0,1fr) auto; box-shadow:0 1px 2px rgba(20,24,27,.05); background:var(--surface-raised); }
.r13-s01a .applied-grid .fig .cap { align-self:end; }
@media (min-width:1000px) {
  .r13-s01a .applied-grid { grid-template-columns:minmax(0,7fr) minmax(0,5fr); gap:20px; }
  .r13-s01a .applied-grid .fig-media { aspect-ratio:auto; height:100%; min-height:260px; }
}
/* the key: one sheet; five columns wide, labelled rows on tablets, stacked on phones */
.r13-s01a .key { margin-top:16px; box-shadow:0 1px 2px rgba(20,24,27,.05); }
@media (min-width:560px) and (max-width:999px) {
  .r13-s01a .key { grid-template-columns:minmax(0,1fr); }
  .r13-s01a .key > div { display:grid; grid-template-columns:minmax(0,220px) minmax(0,1fr); gap:4px 22px; align-items:start; border-left:0; }
  .r13-s01a .key > div:nth-child(n+2) { border-top:1px solid var(--border-hairline); }
  .r13-s01a .key p { margin-top:0; }
}
@media (min-width:720px) {
  .r13-s01a .handoff { justify-content:center; margin-top:28px; }
}
@media (max-width:719px) {
  .r13-s01a .r13-plate { margin:22px calc(-1 * var(--gutter)) 0; padding:18px var(--gutter) 20px; border-left:0; border-right:0; border-radius:0; }
}

/* ===================================================================================
   02 · project record sections: the play control sits on the poster, centred, and steps aside while playing
   =================================================================================== */
.r13-rec .rec-play,
.r13-s01a .fig-record .rec-play { left:50%; top:50%; right:auto; transform:translate(-50%,-50%); width:58px; height:58px; border-radius:50%; background:rgba(251,250,248,.94); border:1.5px solid var(--heading); box-shadow:0 2px 10px rgba(20,24,27,.22); }
.r13-rec .rec-play svg,
.r13-s01a .fig-record .rec-play svg { width:18px; height:18px; }
.r13-rec .rec-play .play,
.r13-s01a .fig-record .rec-play .play { margin-left:3px; }
.r13-rec .is-playing .rec-play,
.r13-s01a .fig-record.is-playing .rec-play { left:auto; right:12px; top:12px; transform:none; width:44px; height:44px; border-radius:var(--r); box-shadow:none; }
.r13-rec .is-playing .rec-play .pause { margin:0; }
.r13-rec video,
.r13-s01a .fig-record video { background:var(--surface-sunken); }

/* ---------- motion: nothing moves under reduced motion; R13 adds no animation ---------- */
@media (prefers-reduced-motion:reduce) {
  .r13-s01.r12-s01 *, .r13-s01a *, .r13-rec * { transition:none !important; animation:none !important; }
}
