/* =========================================================================
   Lignum 03 — Intellectual Sculpture
   Studio Zakmes design tokens, no parallel system.
   Palette + type transcribed from 01_BRAND_CORE/design-tokens/.
   ========================================================================= */

/* --- typefaces -------------------------------------------------------- */
/* Calibre is licensed from Klim and must never leave this machine.
   DejaVu Sans Mono is free; LICENSE.txt travels with it.
   Only the weights actually used are shipped: Calibre 400/500, mono 400. */

/* Calibre is licensed from Klim (order 25090842, studiozakmes.nl) and is not
   redistributable, so its @font-face rules are removed from this export and the
   files are absent. Headings and body copy fall back to the system sans in
   --sans. This export therefore does NOT show the studio's typography.
   To see it as designed, run the prototype locally: npm run fonts && npm run dev
   See docs/DEPLOY.md. */

@font-face {
  font-family: "DejaVu Sans Mono";
  src: url("../fonts/dejavu-sans-mono/dejavu-sans-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  /* palette — 01_BRAND_CORE/design-tokens/colors.json, Approved */
  --canvas:  #F8F7F6;
  --surface: #EBEEED;
  --ink:     #181A21;
  --line:    #E0DBC8;
  --signal:  #FF6A00;

  /* Text tints, tuned to WCAG 2.2 AA and named for the job rather than the
     mix. The previous 45% muted tone measured 2.85:1 on canvas — the same
     failure the figurine configurator hit. Measured ratios, canvas / surface:
       --text-secondary  8.78 : 8.30      --text-muted  4.76 : 4.61
       --on-ink-secondary 8.88            --on-ink-muted 5.24              */
  --text-secondary: color-mix(in srgb, var(--ink) 80%, transparent);
  --text-muted:     color-mix(in srgb, var(--ink) 62%, transparent);
  --on-ink-secondary: color-mix(in srgb, var(--canvas) 72%, transparent);
  --on-ink-muted:     color-mix(in srgb, var(--canvas) 52%, transparent);
  /* not text: a wash behind the column comparison */
  --ink-wash: color-mix(in srgb, var(--ink) 12%, transparent);

  --sans: "Calibre", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DejaVu Sans Mono", ui-monospace, Menlo, Consolas, monospace;

  /* grid */
  --max: 1680px;
  --gutter: clamp(20px, 2.6vw, 36px);
  --gap: clamp(14px, 1.5vw, 24px);
  --header-h: 60px;

  /* vertical rhythm — every section shares it */
  --sec-top: clamp(72px, 7.5vw, 110px);
  --sec-bottom: clamp(84px, 8.5vw, 130px);

  /* type */
  --t-mono: 0.6875rem;
  --t-mono-lg: 0.8125rem;
  --t-body: clamp(1rem, 0.95rem + 0.22vw, 1.1875rem);
  --t-lead: clamp(1.125rem, 1.02rem + 0.45vw, 1.4375rem);
  --t-h3: clamp(1.25rem, 1.1rem + 0.7vw, 1.75rem);
  --t-h2: clamp(1.875rem, 1.15rem + 3vw, 3.5rem);
  --t-h1: clamp(2.625rem, 1.3rem + 5.4vw, 6rem);
  --t-huge: clamp(3.25rem, 1.4rem + 7.4vw, 7.5rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 620ms;
}

@media (min-width: 900px) { :root { --header-h: 72px; } }

/* --- reset ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.55;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, figure, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 1px;
}
.lg-ink :focus-visible { outline-color: var(--canvas); }

::selection { background: var(--signal); color: var(--canvas); }

/* --- shared primitives ------------------------------------------------ */

.lg-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.lg-skip {
  position: absolute; left: var(--gutter); top: 8px; z-index: 100;
  transform: translateY(-200%);
  background: var(--ink); color: var(--canvas);
  padding: 14px 18px; font-family: var(--mono); font-size: var(--t-mono);
  letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
}
.lg-skip:focus { transform: translateY(0); }

.lg-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* construction lines: real grid items, so they sit exactly on the axes */
.lg-rules {
  position: absolute; inset: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter);
  left: 0; right: 0;
}
.lg-rules i { border-left: 1px solid var(--line); opacity: 0.65; }
@media (max-width: 899px) { .lg-rules { display: none; } }

.lg-mono {
  font-family: var(--mono);
  font-size: var(--t-mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  line-height: 1.4;
}

.lg-measure { max-width: 34em; }

/* --- provisional / draft marking -------------------------------------- */
/* Never colour alone: a dotted rule plus a mark, both legible in greyscale,
   and every marked value points at the legend for assistive technology. */

.lg-fact[data-status="provisional"],
.lg-fact[data-status="draft"],
.lg-fact[data-status="unresolved"] {
  border-bottom: 1px dotted currentColor;
  padding-bottom: 0.05em;
}
.lg-fact[data-status="provisional"]::after { content: "\00A0◦"; }
.lg-fact[data-status="draft"]::after { content: "\00A0△"; font-size: 0.8em; }
.lg-fact[data-status="unresolved"]::after { content: "\00A0?"; }

.lg-legend {
  display: flex; flex-wrap: wrap; gap: 2px 20px;
  font-size: 0.8125rem; line-height: 1.45; color: var(--text-muted);
}
.lg-legend span { display: flex; gap: 8px; align-items: baseline; }
.lg-legend b { font-weight: 400; color: var(--text-secondary); white-space: nowrap; }

/* a marked caveat is prose, not a label — mono uppercase is for measuring */
.lg-note {
  font-size: 0.9375rem; line-height: 1.5; color: var(--text-muted);
  max-width: 68ch; margin-top: clamp(16px, 2vw, 22px);
}
.lg-note--ink { color: var(--on-ink-muted); }

/* --- header ----------------------------------------------------------- */

.lg-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.lg-header__grid {
  height: var(--header-h);
  align-items: center;
  grid-template-columns: 1fr auto 1fr;
}
.lg-header__mark { grid-column: 1; display: flex; align-items: baseline; gap: 12px; }
.lg-header__mark a {
  text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px;
}
.lg-header__mark strong { font-weight: 500; letter-spacing: 0.01em; }
.lg-header__back { color: var(--text-muted); text-decoration: none; }
.lg-header__back:hover { color: var(--ink); }

.lg-header__nav { grid-column: 2; display: none; }
.lg-header__nav ul { display: flex; gap: clamp(14px, 2vw, 30px); }
.lg-header__nav a {
  text-decoration: none; color: var(--text-muted);
  display: inline-flex; align-items: center; min-height: 44px;
  transition: color 200ms var(--ease);
}
.lg-header__nav a:hover, .lg-header__nav a[aria-current="true"] { color: var(--ink); }

.lg-header__status { grid-column: 3; justify-self: end; color: var(--text-muted); text-align: right; }
.lg-header__index {
  grid-column: 3; justify-self: end;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding-inline: 4px;
}
.lg-header__index[hidden] { display: none; }

@media (min-width: 900px) {
  .lg-header__nav { display: block; }
  .lg-header__index { display: none !important; }
}
@media (max-width: 899px) { .lg-header__status { display: none; } }

/* --- hero ------------------------------------------------------------- */

.lg-hero { position: relative; border-bottom: 1px solid var(--line); }
.lg-hero__grid { position: relative; align-items: stretch; }

.lg-hero__text {
  grid-column: 1 / -1;
  padding-block: clamp(40px, 7vw, 92px) clamp(32px, 4vw, 56px);
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(20px, 2.4vw, 34px);
}
.lg-hero__kicker { color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.lg-hero__title {
  font-size: var(--t-h1); font-weight: 500;
  line-height: 0.92; letter-spacing: -0.05em;
  text-wrap: balance;
}
.lg-hero__title > span { display: block; }
.lg-hero__title .lg-hero__object {
  font-family: var(--mono); font-size: var(--t-mono-lg);
  letter-spacing: 0.18em; text-transform: uppercase;
  line-height: 1; margin-bottom: clamp(14px, 1.8vw, 26px);
  color: var(--text-secondary);
}
.lg-hero__lead { font-size: var(--t-lead); line-height: 1.42; max-width: 30ch; text-wrap: pretty; }
.lg-hero__link {
  display: inline-flex; align-items: center; gap: 10px;
  align-self: flex-start; min-height: 44px;
  text-decoration: none; border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}
.lg-hero__link svg { width: 22px; height: 8px; transition: transform 300ms var(--ease); }
.lg-hero__link:hover svg { transform: translateX(5px); }

.lg-hero__figure {
  grid-column: 1 / -1;
  position: relative;
  margin-inline: calc(var(--gutter) * -1);
  background: var(--surface);
}
.lg-hero__figure img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }

/* the annotations sit in the margins of the plate, never over the legs */
.lg-hero__callouts { display: none; }

@media (min-width: 900px) {
  .lg-hero__grid { min-height: calc(100svh - var(--header-h)); }
  /* the split falls exactly on the axis between column 6 and 7; the image
     bleeds past the right gutter, which is what makes it read as 52 / 48 */
  .lg-hero__text {
    grid-column: 1 / 7;
    padding-right: clamp(24px, 3vw, 56px);
    padding-block: clamp(56px, 6vw, 104px) clamp(48px, 5vw, 84px);
  }
  .lg-hero__figure {
    grid-column: 7 / -1;
    margin-inline: 0 calc((100vw - min(100vw, var(--max))) / -2 - var(--gutter));
    border-left: 1px solid var(--line);
  }
  .lg-hero__figure img { position: absolute; inset: 0; }
  .lg-hero__callouts {
    display: block; position: absolute; inset: 0; pointer-events: none;
  }
  /* Annotation chips, not free-floating text: the plate runs from a dark wall
     to a pale floor, so the label carries its own field and stays legible
     wherever it lands. The leader line is what ties it to the object. */
  .lg-hero__callout {
    position: absolute; right: clamp(18px, 2.4vw, 40px);
    max-width: min(15rem, 34%);
    display: grid; gap: 2px; justify-items: end; text-align: right;
    padding: 7px 10px;
    background: color-mix(in srgb, var(--canvas) 84%, transparent);
    backdrop-filter: blur(3px);
    color: var(--text-secondary);
    text-wrap: balance;
  }
  .lg-hero__callout b { font-weight: 400; color: var(--ink); }
  .lg-hero__callout::before {
    content: ""; position: absolute; right: 100%; top: 14px;
    width: clamp(18px, 2.6vw, 44px); height: 1px; background: var(--text-muted);
  }
}

/* --- metadata rail ---------------------------------------------------- */

.lg-rail { border-bottom: 1px solid var(--line); }
.lg-rail__grid { grid-template-columns: 1fr auto; align-items: stretch; }
.lg-rail__cells {
  grid-column: 1; display: grid; gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.lg-rail__cell {
  padding: clamp(14px, 1.6vw, 22px) 0;
  padding-right: var(--gap);
  display: grid; gap: 5px; align-content: start;
}
.lg-rail__cell dt { color: var(--text-muted); font-family: var(--mono);
  font-size: var(--t-mono); letter-spacing: 0.13em; text-transform: uppercase; }
.lg-rail__cell dd { font-size: 1rem; }
.lg-rail__chapter {
  grid-column: 2; align-self: stretch;
  background: var(--ink); color: var(--canvas);
  display: grid; place-content: center; gap: 2px;
  padding-inline: clamp(16px, 2.4vw, 30px);
  margin-right: calc(var(--gutter) * -1);
  font-family: var(--mono); text-align: center;
}
.lg-rail__chapter b { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 400; line-height: 1; }
.lg-rail__chapter span { font-size: var(--t-mono); letter-spacing: 0.13em; color: var(--on-ink-secondary); }
.lg-rail__legend { grid-column: 1 / -1; padding-bottom: 14px; }

/* On a phone the rail is a summary, not a spec sheet: OBJECT, STATUS and the
   chapter mark stay; METHOD and SCALE move into the structural record. */
@media (max-width: 699px) {
  .lg-rail__cell--secondary { display: none; }
  .lg-rail__cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-legend { font-size: 0.75rem; gap: 6px 0; }
  .lg-legend span { flex-basis: 100%; }
}
@media (min-width: 700px) {
  .lg-rail__cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .lg-rail__chapter { margin-right: calc((100vw - min(100vw, var(--max))) / -2 - var(--gutter)); }
}

/* --- section frame ---------------------------------------------------- */

.lg-section { position: relative; padding-block: var(--sec-top) var(--sec-bottom); }
.lg-section + .lg-section { border-top: 1px solid var(--line); }
.lg-section--surface { background: var(--surface); }
.lg-section--surface + .lg-section, .lg-section--ink + .lg-section { border-top: 0; }

.lg-ink { background: var(--ink); color: var(--canvas); }
.lg-ink .lg-head__num, .lg-ink .lg-head__label { color: var(--on-ink-muted); }
.lg-ink .lg-head__note { color: var(--on-ink-secondary); }
.lg-ink .lg-rules i { border-color: color-mix(in srgb, var(--canvas) 16%, transparent); }

/* the shared section header: same three rows in every section */
.lg-head { row-gap: clamp(18px, 2.2vw, 30px); }
.lg-head__id {
  grid-column: 1 / -1; display: flex; gap: 16px; align-items: baseline;
  padding-bottom: clamp(14px, 1.8vw, 24px);
  border-bottom: 1px solid var(--line);
}
.lg-ink .lg-head__id { border-color: color-mix(in srgb, var(--canvas) 18%, transparent); }
.lg-head__num { color: var(--text-muted); }
.lg-head__label { color: var(--text-secondary); }
.lg-head__title {
  grid-column: 1 / -1;
  font-size: var(--t-h2); font-weight: 500;
  line-height: 1.02; letter-spacing: -0.05em;
  text-wrap: balance;
}
.lg-head__note { grid-column: 1 / -1; color: var(--text-secondary); }
.lg-head__note p + p { margin-top: 0.9em; }

@media (min-width: 900px) {
  .lg-head__title { grid-column: 1 / 8; }
  .lg-head__note { grid-column: 9 / -1; align-self: end; font-size: 1rem; }
}

.lg-body { margin-top: clamp(36px, 4.5vw, 72px); row-gap: clamp(28px, 3.4vw, 52px); }

/* --- figures ---------------------------------------------------------- */

.lg-fig { display: grid; gap: 14px; margin: 0; }
.lg-fig img { width: 100%; background: var(--surface); }
.lg-fig figcaption { color: var(--text-muted); }
.lg-ink .lg-fig figcaption { color: var(--on-ink-muted); }
.lg-fig--bleed { margin-inline: calc(var(--gutter) * -1); }

/* --- measured drawings ------------------------------------------------ */

.lg-draw { width: 100%; height: auto; }
.lg-draw .lg-draw__solid { fill: var(--ink); }
.lg-draw .lg-draw__ghost { fill: var(--line); }
.lg-draw .lg-draw__column { fill: var(--ink-wash); }
.lg-draw .lg-draw__trace { stroke: var(--signal); stroke-width: 3.5; }
.lg-draw .lg-draw__nodes { fill: var(--signal); }
.lg-ink .lg-draw .lg-draw__solid { fill: var(--canvas); }
.lg-ink .lg-draw .lg-draw__ghost { fill: color-mix(in srgb, var(--canvas) 26%, transparent); }

/* M01 — the column comparison */
.lg-column { display: grid; gap: clamp(20px, 3vw, 40px); align-items: end; }
.lg-column__plate { position: relative; }
.lg-column__plate .lg-draw { max-height: min(62svh, 560px); width: auto; margin-inline: auto; }
.lg-column__figures { display: grid; gap: clamp(18px, 2.4vw, 30px); }
.lg-column__stat { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.lg-column__stat b {
  font-family: var(--mono); font-weight: 400;
  font-size: clamp(1.375rem, 0.9rem + 1.5vw, 2.125rem); line-height: 1.05;
}
.lg-column__stat span { color: var(--text-muted); }

@media (min-width: 900px) {
  .lg-column { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(30px, 4vw, 70px); }
  .lg-column__figures { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* TRACE: the solid column recedes, the measured outline arrives.
   Both end states are the default; only `.lg-anim` introduces the start state. */
.lg-column__plate .lg-draw__column { opacity: 0.35; }
.lg-column__plate .lg-draw__solid { opacity: 1; }
.lg-reveal-on .lg-column__plate .lg-draw__column {
  opacity: 1; transition: opacity var(--dur) var(--ease);
}
.lg-reveal-on .lg-column__plate .lg-draw__solid {
  opacity: 0.15; transition: opacity var(--dur) var(--ease);
}
.lg-reveal-on .lg-column__plate.is-seen .lg-draw__column { opacity: 0.35; }
.lg-reveal-on .lg-column__plate.is-seen .lg-draw__solid { opacity: 1; }

/* --- M02 principle ---------------------------------------------------- */

.lg-principle { display: grid; gap: clamp(28px, 3.6vw, 56px); }
.lg-principle__plate { position: relative; }
.lg-principle__plate .lg-draw { max-height: min(74svh, 720px); width: auto; margin-inline: auto; }

.lg-steps { display: grid; gap: 1px; background: color-mix(in srgb, var(--canvas) 18%, transparent); }
.lg-steps li { background: var(--ink); padding: clamp(18px, 2.2vw, 28px) 0; display: grid; gap: 8px; }
.lg-steps__k { color: var(--on-ink-muted); }
.lg-steps__t { font-size: var(--t-h3); font-weight: 500; line-height: 1.1; }
.lg-steps__d { color: var(--on-ink-secondary); font-size: 1rem; }

@media (min-width: 760px) {
  .lg-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; }
  .lg-steps li { padding-inline: clamp(16px, 2vw, 26px); }
  .lg-steps li:first-child { padding-left: 0; }
}
@media (min-width: 1000px) {
  .lg-principle { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
}

/* the load-path trace draws itself once, when it is looked at */
.lg-trace-path {
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
}
.lg-reveal-on .is-traced .lg-trace-path {
  animation: lg-draw 2.2s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 110ms);
}
@keyframes lg-draw { to { stroke-dashoffset: 0; } }
.lg-draw__nodes circle { transform-box: fill-box; transform-origin: center; }
.lg-reveal-on .lg-draw__nodes circle { opacity: 0; }
.lg-reveal-on .is-traced .lg-draw__nodes circle {
  animation: lg-node 500ms var(--ease) forwards;
  animation-delay: calc(900ms + var(--i, 0) * 180ms);
}
@keyframes lg-node { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }

/* --- M03 viewer ------------------------------------------------------- */
/* At rest this section is a render with a button on it. Nothing 3D is fetched,
   nothing can half-work, and there are no controls floating around a still
   image pretending to drive it. The whole viewer lives in the sheet below. */

.lg-viewer { display: grid; gap: clamp(20px, 2.6vw, 34px); }
/* Height, not aspect ratio: the plate has to fit a viewport, otherwise its
   centre — where the way in sits — lands below the fold. */
.lg-viewer__stage {
  position: relative; margin: 0; background: var(--surface);
  height: clamp(380px, 60svh, 560px); overflow: hidden;
}
.lg-viewer__poster { position: absolute; inset: 0; }
.lg-viewer__poster picture { display: block; width: 100%; height: 100%; }
.lg-viewer__poster img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }

/* An instrument's target, not a button on a plate. It sits over the middle of
   the object so it is the first thing the eye lands on, and it is drawn rather
   than filled — the render stays visible through it. */
.lg-viewer__enter {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: none; flex-direction: column; align-items: center; gap: 14px;
  padding: 18px 26px 20px; background: none;
  color: var(--ink);
}
.lg-anim .lg-viewer__enter { display: inline-flex; }

.lg-viewer__reticle {
  width: clamp(96px, 12vw, 132px); height: auto;
  fill: none; stroke: var(--ink); stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}
.lg-viewer__brackets, .lg-viewer__cross, .lg-viewer__ticks { transition: opacity 260ms var(--ease); }
.lg-viewer__brackets { transform-origin: center; transition: transform 320ms var(--ease); }
.lg-viewer__ticks { opacity: 0.45; }
.lg-viewer__cross circle { opacity: 0.75; }
.lg-viewer__pip { fill: var(--ink); stroke: none; transition: fill 220ms var(--ease); }

.lg-viewer__enter-label {
  font-family: var(--mono); font-size: var(--t-mono-lg);
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 6px 12px; white-space: nowrap;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: blur(3px);
}
.lg-viewer__enter-note {
  color: var(--text-muted); white-space: nowrap;
  padding: 3px 10px;
  background: color-mix(in srgb, var(--canvas) 78%, transparent);
}
/* the weight is already named in the sheet's loading state; on a phone the
   reticle and the verb are enough */
@media (max-width: 560px) {
  .lg-viewer__enter-note { display: none; }
  .lg-viewer__enter-label { letter-spacing: 0.12em; }
}

.lg-viewer__enter:hover .lg-viewer__brackets { transform: scale(1.08); }
.lg-viewer__enter:hover .lg-viewer__reticle { stroke: var(--signal); }
.lg-viewer__enter:hover .lg-viewer__pip { fill: var(--signal); }
.lg-viewer__enter:hover .lg-viewer__ticks { opacity: 1; }
.lg-viewer__enter:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }

.lg-viewer__caption {
  position: absolute; left: 14px; top: 12px; color: var(--text-muted);
  max-width: 60%;
}

.lg-viewer__fallback { display: grid; gap: 18px; }
.lg-viewer__views { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.lg-viewer__views figure { display: grid; gap: 8px; }
.lg-viewer__views .lg-draw { max-height: 260px; width: auto; margin-inline: auto; }
.lg-viewer__views figcaption { color: var(--text-muted); text-align: center; }

@media (min-width: 1000px) {
  .lg-viewer { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; gap: clamp(28px, 3.4vw, 56px); }
  .lg-viewer__stage { height: clamp(460px, 68svh, 760px); }
  .lg-viewer__aside { display: grid; gap: clamp(22px, 2.6vw, 34px); position: sticky; top: calc(var(--header-h) + 24px); }
}

/* --- the 3D sheet ------------------------------------------------------ */

dialog.lg-3d {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none;
  width: 100%; height: 100%; background: var(--canvas); color: var(--ink);
  overscroll-behavior: contain;
}
/* while the sheet is open the page underneath does not move at all */
html:has(dialog.lg-3d[open]) { overflow: hidden; }
dialog.lg-3d::backdrop { background: var(--ink); }
.lg-3d__inner {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%; height: 100dvh;
}
.lg-3d__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px var(--gutter); border-bottom: 1px solid var(--line);
  background: var(--canvas);
}
.lg-3d__bar h2 { font-weight: 400; color: var(--text-secondary); }
/* The way out has to be the most findable thing on the screen. Orange fill with
   ink type: 6.05:1, which passes AA — canvas on orange would be 2.68:1 and does
   not, so the one place the signal colour carries text it carries dark text. */
.lg-3d__close {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  background: var(--signal); color: var(--ink);
  font-family: var(--mono); font-size: var(--t-mono-lg);
  letter-spacing: 0.13em; text-transform: uppercase;
  transition: background 200ms var(--ease), transform 200ms var(--ease);
}
.lg-3d__close:hover { background: var(--ink); color: var(--canvas); }
.lg-3d__close:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.lg-3d__close b { font-weight: 400; font-size: 1.15em; line-height: 1; }
@media (max-width: 620px) {
  .lg-3d__close { padding: 0 14px; font-size: var(--t-mono); white-space: nowrap; }
  .lg-3d__bar h2 { font-size: var(--t-mono); }
}
.lg-3d__stage { position: relative; background: var(--surface); overflow: hidden; }
.lg-3d__stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  /* every gesture that starts here stays here: the sheet owns the screen */
  touch-action: none;
}
.lg-3d__loading {
  position: absolute; inset: 0; display: grid; place-content: center;
  color: var(--text-muted); gap: 10px; text-align: center;
}
.lg-3d__stage[data-live="true"] .lg-3d__loading { display: none; }
/* The panel reads like an instrument, not a toolbar: a labelled column per
   job, hairlines between them, and orange only where something is live. */
.lg-3d__controls {
  display: grid; gap: 18px; padding: clamp(14px, 2vw, 22px) var(--gutter);
  border-top: 1px solid var(--line); background: var(--canvas);
}
.lg-3d__group { display: grid; gap: 8px; align-content: start; }
.lg-3d__label { color: var(--text-muted); }
/* One control left in the panel. Everything else moved into the frame. */

/* Two controls, both large enough to be the point of the panel rather than a
   toolbar under it. One segmented control for what you are looking at, one
   slider for where you cut. Nothing else. */
.lg-3d__segments { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.lg-3d__seg {
  min-height: 64px; padding: 0 12px;
  border: 1px solid var(--line); border-left-width: 0;
  background: var(--canvas); color: var(--text-secondary);
  font-family: var(--mono); font-size: clamp(0.8125rem, 0.6rem + 0.55vw, 1.0625rem);
  letter-spacing: 0.1em; text-transform: uppercase;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.lg-3d__seg:first-child { border-left-width: 1px; }
.lg-3d__seg:hover { color: var(--ink); }
.lg-3d__seg[aria-pressed="true"] { background: var(--ink); color: var(--canvas); border-color: var(--ink); }

@media (max-width: 899px) {
  .lg-3d__seg { min-height: 56px; }
}

/* the control lives in the frame now, not under it */
.lg-viewer__hint {
  left: 50%; right: auto; transform: translateX(-50%);
  text-align: center; opacity: 0.7;
}
/* On a phone the readout already owns the bottom edge and there is no wheel to
   hint at; the panel below says the rest. */
@media (max-width: 640px) { .lg-viewer__hint { display: none; } }

/* --- instrument controls, inside the frame ---------------------------- */

.lg-3d__zoom {
  position: absolute; top: 20px; left: 20px; z-index: 3;
  display: grid; gap: 6px;
}
.lg-3d__zoombtn {
  width: 44px; height: 44px;
  display: grid; place-content: center;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: blur(4px);
  color: var(--text-secondary);
  font-family: var(--mono); font-size: 1rem; line-height: 1;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}
.lg-3d__zoombtn:hover { color: var(--ink); border-color: var(--text-muted); }
.lg-3d__zoombtn--reset { font-size: 0.75rem; letter-spacing: 0.08em; margin-top: 4px; }

/* The cut runs up the axis it controls, on the edge of the frame — a scale on
   an instrument rather than a form control under a drawing. */
.lg-3d__cut {
  position: absolute; top: 20px; right: 20px; bottom: 20px; z-index: 3;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center; gap: 12px; pointer-events: none;
}
.lg-3d__cut-label, .lg-3d__cut-out { color: var(--text-muted); }
.lg-3d__cut-label { display: grid; justify-items: end; gap: 2px; text-align: right; }
.lg-3d__cut-label span {
  color: var(--ink); font-size: 0.625rem; letter-spacing: 0.14em;
}
.lg-3d__cut-label span::before { content: "\2195\00A0"; }
.lg-3d__cut-out {
  writing-mode: horizontal-tb; text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums; color: var(--ink);
  position: absolute; bottom: -4px; right: 28px;
}
.lg-3d__cut input {
  pointer-events: auto;
  writing-mode: vertical-rl; direction: rtl;   /* up increases */
  width: 44px; height: 100%;
  -webkit-appearance: none; appearance: none; background: none;
}
.lg-3d__cut input::-webkit-slider-runnable-track {
  width: 1px; background: var(--text-muted); opacity: 0.55;
}
.lg-3d__cut input::-moz-range-track { width: 1px; background: var(--text-muted); }
/* The handle has to say "drag me" before anyone tries. A grip wide enough to
   aim at, a hairline through it so it still reads as a cut, and two arrows. */
.lg-3d__cut input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 26px; margin-left: -15px;
  background: color-mix(in srgb, var(--canvas) 92%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='16'%3E%3Cpath d='M13 3.2 9.6 6.8h6.8L13 3.2Z' fill='%23181A21'/%3E%3Cpath d='M13 12.8 9.6 9.2h6.8L13 12.8Z' fill='%23181A21'/%3E%3C/svg%3E") center / 26px 16px no-repeat;
  border: 1px solid var(--ink); border-radius: 2px;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 16%, transparent);
  cursor: grab;
}
.lg-3d__cut input::-moz-range-thumb {
  width: 30px; height: 26px;
  background: color-mix(in srgb, var(--canvas) 92%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='16'%3E%3Cpath d='M13 3.2 9.6 6.8h6.8L13 3.2Z' fill='%23181A21'/%3E%3Cpath d='M13 12.8 9.6 9.2h6.8L13 12.8Z' fill='%23181A21'/%3E%3C/svg%3E") center / 26px 16px no-repeat;
  border: 1px solid var(--ink); border-radius: 2px; cursor: grab;
}
.lg-3d__cut input:active::-webkit-slider-thumb { cursor: grabbing; background-color: var(--canvas); }
.lg-3d__cut input:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.lg-3d__cut[data-live="true"] .lg-3d__cut-label { color: var(--ink); }

@media (max-width: 640px) {
  .lg-3d__zoom { top: 14px; left: 14px; }
  .lg-3d__cut { top: 14px; right: 14px; bottom: 44px; }
  .lg-3d__cut-out { font-size: 0.625rem; }
}

/* stage chrome — corner brackets */
.lg-3d__chrome { position: absolute; inset: 14px; pointer-events: none; }
.lg-3d__corner { position: absolute; width: 16px; height: 16px; border: 1px solid var(--text-muted); opacity: 0.5; }
.lg-3d__corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.lg-3d__corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.lg-3d__corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.lg-3d__corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; }


.lg-viewer__readout { position: absolute; left: 14px; bottom: 12px; z-index: 2; color: var(--text-muted); }
.lg-viewer__hint { position: absolute; right: 14px; bottom: 12px; z-index: 2; color: var(--text-muted); }
/* the two readouts share one edge; on a narrow screen the instruction loses,
   because the control panel below already carries it in full */
@media (max-width: 640px) { .lg-viewer__hint { display: none; } }
.lg-viewer__mode { display: grid; gap: 8px; align-content: start; }
.lg-viewer__set { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-viewer__btn {
  min-height: 44px; padding: 10px 16px;
  border: 1px solid var(--line); background: var(--canvas);
  font-family: var(--mono); font-size: var(--t-mono);
  letter-spacing: 0.13em; text-transform: uppercase;
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}
.lg-viewer__btn:hover { border-color: var(--text-muted); }
.lg-viewer__btn[aria-pressed="true"] { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.lg-viewer__desc { color: var(--text-muted); min-height: 2.6em; }

/* --- M04 match -------------------------------------------------------- */

.lg-match { display: grid; gap: clamp(20px, 2.6vw, 40px); }
.lg-match__pair { display: grid; gap: clamp(14px, 1.8vw, 22px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lg-match__pair figure { position: relative; display: grid; gap: 10px; }
.lg-match__ring {
  position: absolute; width: 17%; aspect-ratio: 1; border: 2px solid var(--signal);
  border-radius: 50%; opacity: 0; transition: opacity 300ms var(--ease);
  pointer-events: none;
}
.lg-match.is-matched .lg-match__ring { opacity: 1; }
.lg-match__toggle { justify-self: start; }
.lg-steps--strip { background: var(--line); }
.lg-steps--strip li { background: var(--canvas); }
.lg-steps--strip .lg-steps__k { color: var(--text-muted); }
.lg-steps--strip .lg-steps__d { color: var(--text-secondary); }
@media (min-width: 760px) { .lg-steps--strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* --- M05 assembly ----------------------------------------------------- */

.lg-assembly { display: grid; gap: clamp(24px, 3vw, 44px); }
.lg-assembly__list { display: grid; gap: 1px; background: var(--line); }
.lg-assembly__list li { background: var(--canvas); padding: clamp(14px, 1.8vw, 22px) 0; display: grid; gap: 6px; }
.lg-assembly__list b { font-weight: 500; }
.lg-assembly__list span { color: var(--text-secondary); font-size: 1rem; }
.lg-assembly__list .lg-mono { display: block; margin-top: 4px; color: var(--text-muted); }
.lg-assembly__list li[aria-current="true"] { background: var(--surface); }
.lg-assembly__stage { position: relative; }
.lg-assembly__stage .lg-draw { max-height: min(70svh, 640px); width: auto; margin-inline: auto; }
.lg-assembly__group { transition: transform 900ms var(--ease), opacity 700ms var(--ease); }

@media (min-width: 1000px) {
  .lg-assembly { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
  .lg-assembly__list li { padding-inline: clamp(14px, 1.6vw, 22px); }
}

/* --- protocol --------------------------------------------------------- */

.lg-protocol { display: grid; gap: 1px; background: var(--line); }
.lg-protocol li { background: var(--canvas); padding: clamp(20px, 2.4vw, 30px) 0; display: grid; gap: 10px; align-content: start; }
.lg-protocol__k { color: var(--text-muted); }
.lg-protocol__t { font-size: var(--t-h3); font-weight: 500; line-height: 1.12; }
.lg-protocol__d { color: var(--text-secondary); font-size: 1rem; }
.lg-protocol__mark { width: 34px; height: 34px; margin-bottom: 4px; }
.lg-protocol__mark path, .lg-protocol__mark circle, .lg-protocol__mark line {
  stroke: var(--ink); stroke-width: 1.25; fill: none;
}
@media (min-width: 760px) {
  .lg-protocol { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg-protocol li { padding-inline: clamp(14px, 1.8vw, 24px); }
  .lg-protocol li:first-child { padding-left: 0; }
}

/* --- archive table ---------------------------------------------------- */

.lg-archive { width: 100%; }
.lg-archive caption { text-align: left; color: var(--text-muted); padding-bottom: 14px; }
.lg-archive th {
  text-align: left; font-weight: 400; color: var(--text-muted);
  font-family: var(--mono); font-size: var(--t-mono);
  letter-spacing: 0.13em; text-transform: uppercase;
  padding: 10px 16px 10px 0; border-bottom: 1px solid var(--ink);
}
.lg-archive td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.lg-archive tbody tr { transition: background 180ms var(--ease); }
.lg-archive tbody tr:hover { background: var(--surface); }
.lg-archive__code, .lg-archive__type { font-family: var(--mono); font-size: var(--t-mono); letter-spacing: 0.1em; }
.lg-archive__verify { color: var(--text-secondary); font-size: 0.9375rem; }
.lg-archive__go { text-align: right; }
.lg-archive__go button { min-height: 44px; padding: 0 2px; text-decoration: underline; text-underline-offset: 3px; }
.lg-archive__go button[disabled] { color: var(--text-muted); text-decoration: none; cursor: default; }

@media (max-width: 759px) {
  .lg-archive thead { display: none; }
  .lg-archive tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding-block: 14px; border-bottom: 1px solid var(--line); }
  .lg-archive td { border: 0; padding: 0; }
  .lg-archive__code { grid-column: 1; }
  .lg-archive__title { grid-column: 1; }
  .lg-archive__type, .lg-archive__verify { display: none; }
  .lg-archive__go { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

/* --- M07 scale + illuminate ------------------------------------------- */

.lg-scale { display: grid; gap: clamp(26px, 3.4vw, 52px); }
@media (min-width: 900px) { .lg-scale { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; } }

.lg-illuminate { position: relative; }
.lg-illuminate__frames { position: relative; }
.lg-illuminate__frames picture { display: block; }
.lg-illuminate__frames img { width: 100%; }
.lg-illuminate__frames picture + picture {
  position: absolute; inset: 0;
  opacity: var(--dusk, 0); transition: opacity 900ms var(--ease);
}
.lg-illuminate__frames picture + picture img {
  height: 100%; object-fit: cover;
}
.lg-illuminate__scrub { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.lg-illuminate__scrub input {
  flex: 1; min-height: 44px; -webkit-appearance: none; appearance: none;
  background: none;
}
.lg-illuminate__scrub input::-webkit-slider-runnable-track {
  height: 3px; background: var(--line); border-top: 1px solid var(--text-muted);
}
.lg-illuminate__scrub input::-moz-range-track {
  height: 3px; background: var(--line); border-top: 1px solid var(--text-muted);
}
.lg-illuminate__scrub input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -9px; border-radius: 50%;
  background: var(--signal); border: 2px solid var(--ink);
}
.lg-illuminate__scrub input::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--signal); border: 2px solid var(--ink);
}

.lg-closing { padding-block: clamp(60px, 7vw, 100px); }
.lg-closing__plate { margin-inline: calc(var(--gutter) * -1); }
.lg-closing__plate img { width: 100%; }
.lg-closing__title {
  font-size: var(--t-huge); font-weight: 500; line-height: 0.94;
  letter-spacing: -0.05em; text-wrap: balance;
  margin-top: clamp(36px, 5vw, 76px);
}
.lg-closing__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(28px, 3.4vw, 44px); }
.lg-btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 24px;
  border: 1px solid currentColor; text-decoration: none;
  font-family: var(--mono); font-size: var(--t-mono);
  letter-spacing: 0.13em; text-transform: uppercase;
  transition: background 220ms var(--ease), color 220ms var(--ease);
}
.lg-btn--ghost:hover { background: color-mix(in srgb, var(--canvas) 12%, transparent); }

/* --- footer ----------------------------------------------------------- */

.lg-footer { background: var(--canvas); color: var(--ink); padding-block: clamp(44px, 5vw, 72px); border-top: 1px solid var(--line); }
.lg-footer__grid { row-gap: clamp(28px, 3vw, 40px); }
.lg-footer__col { grid-column: 1 / -1; display: grid; gap: 10px; align-content: start; }
.lg-footer__col h2 { color: var(--text-muted); font-family: var(--mono); font-size: var(--t-mono);
  letter-spacing: 0.13em; text-transform: uppercase; font-weight: 400; }
.lg-footer__col a {
  text-decoration: none; color: var(--text-secondary);
  display: inline-flex; align-items: center; min-height: 44px;
}
.lg-footer__col a:hover { color: var(--ink); }
.lg-footer__note { grid-column: 1 / -1; color: var(--text-muted); border-top: 1px solid var(--line); padding-top: 18px; }
@media (min-width: 760px) {
  .lg-footer__col { grid-column: span 4; }
  .lg-footer__col + .lg-footer__col { grid-column: span 4; }
}

/* --- dialogs ---------------------------------------------------------- */

dialog.lg-sheet {
  border: 0; padding: 0; max-width: min(920px, 100vw); width: 100%;
  max-height: 100svh; height: 100svh;
  margin: 0 0 0 auto; background: var(--canvas); color: var(--ink);
}
dialog.lg-sheet::backdrop { background: color-mix(in srgb, #181A21 62%, transparent); }
.lg-sheet__inner { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.lg-sheet__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--canvas); z-index: 2;
}
.lg-sheet__close { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; gap: 8px; }
.lg-sheet__body { overflow-y: auto; padding: clamp(24px, 3vw, 42px) var(--gutter) clamp(48px, 6vw, 80px); display: grid; gap: clamp(22px, 2.6vw, 34px); }
.lg-sheet__body h3 { font-size: var(--t-h3); font-weight: 500; }
.lg-sheet__body dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.lg-sheet__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 20px;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.lg-sheet__row dt { color: var(--text-muted); font-family: var(--mono); font-size: var(--t-mono);
  letter-spacing: 0.12em; text-transform: uppercase; }
.lg-sheet__row dd { margin: 0; }
.lg-sheet__row dd small { display: block; color: var(--text-muted); font-size: 0.8125rem; line-height: 1.45; margin-top: 4px; }
.lg-sheet__gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.lg-sheet__gallery figure { display: grid; gap: 8px; margin: 0; }
.lg-sheet__gallery figcaption { color: var(--text-muted); }

@media (min-width: 760px) {
  dialog.lg-sheet { max-height: 88svh; height: auto; margin: auto; border: 1px solid var(--line); }
}

/* --- index sheet (mobile nav) ----------------------------------------- */

.lg-index__list { display: grid; gap: 1px; background: var(--line); }
.lg-index__list a {
  display: grid; gap: 4px; background: var(--canvas);
  padding: 16px var(--gutter); text-decoration: none; min-height: 60px; align-content: center;
}
.lg-index__list span { color: var(--text-muted); }

/* --- utilities -------------------------------------------------------- */

/* Motion is opt-in, never opt-out, and it gives up rather than hides.
   Two separate signals, because they answer different questions:
     `.lg-anim`       the module is running, so the controls it drives are real
     `.lg-reveal-on`  the reveal machinery is trusted to fire
   Only the second one is allowed to hide anything, and lignum.js withdraws it
   if the observer has reported nothing shortly after load — a page that cannot
   scroll, or an engine that never delivers the callback, must not be able to
   leave the case invisible. */
.lg-reveal { opacity: 1; transform: none; }
.lg-reveal-on .lg-reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.lg-reveal-on .lg-reveal.is-seen { opacity: 1; transform: none; }
.lg-span-full { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .lg-span-8 { grid-column: 1 / 9; }
  .lg-span-6 { grid-column: 1 / 7; }
  .lg-span-right { grid-column: 8 / -1; }
}

/* --- motion and contrast preferences ---------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-delay: 0ms !important;
    animation-iteration-count: 1 !important; transition-duration: 1ms !important;
  }
  .lg-reveal { opacity: 1; transform: none; }
  .lg-trace-path { stroke-dashoffset: 0; }
  .lg-draw__nodes circle { opacity: 1; }
  .lg-column__plate .lg-draw__solid { opacity: 1; }
  .lg-column__plate .lg-draw__column { opacity: 0.35; }
}

/* A control the module drives is hidden until the module is actually running.
   `.no-js` alone is not enough: the inline head script clears it the moment any
   script runs, which is exactly the case where lignum.js may still have failed. */
.lg-illuminate__scrub,
.lg-match__toggle,
[data-open-3d],
.lg-header__index,
[data-open-sheet] { display: none; }
.lg-anim .lg-illuminate__scrub { display: flex; }
.lg-anim .lg-match__toggle { display: inline-flex; }
.lg-anim [data-open-sheet] { display: inline-flex; }
.lg-anim [data-open-3d] { display: inline-flex; }
.lg-anim .lg-archive__go [data-open-sheet] { display: inline-block; }
@media (max-width: 899px) { .lg-anim .lg-header__index { display: inline-flex; } }

@media print {
  .lg-header, .lg-viewer__controls, .lg-illuminate__scrub { display: none; }
  body { background: #fff; }
}
