/* Block 4 · Vom Bild zur Krone (V8-BLOCKS §4; L5; round 2, 2026-10-26: no stack, no pin). Mist ground (between paper
   block 3 and night block 5). Concept: a ledger of five plates. The giant word, the statement and the heartbeat line
   under it at cols 5–12; then five rows in normal flow, alternating sides: the plate (592 : 704, the step-tile aspect,
   radius 24, paper: the section's one box) in six columns, and in five columns beside it the numeral at display size
   on the plate's top edge, the title (link), the line and on 04 the CEREC note right under it.
   The plate never outgrows the window (--tk-ph): a reader sees a whole plate and its words at once at 1366 × 768.
   Motion (js): only a 3D plate moves, with the scroll; text rises in once (utility). P: text, then a 4:5 plate. */
.tk {
  /* the plate's height cap: never taller than the window, and 61 % of it, 500 px at least (V8-GAPS §2 C: the block
     went from 5.9 to about 4.5 screens at 1440 × 900; the Messwert fills the row the plate gave back) */
  --tk-ph: min(704px, calc(100svh - var(--nav-bottom) - 72px), max(61svh, 500px));
  --em: 4.09;                                                          /* „zur Krone" at −0.045em (metrics.em_width) */
  background: var(--mist);
}
:lang(en) .tk { --em: 4.98; }                                          /* „From image" */
:lang(ru) .tk { --em: 5.0; }                                           /* «до коронки» */

/* ---- head: the giant word, then the statement and the heartbeat line, hung at col 5 ---- */
.tk-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-grid); }
.tk-word {
  grid-column: 1 / -1;
  font-size: min(200px, calc((100vw - 2 * var(--side)) / var(--em) * .97));
  line-height: 1.05; letter-spacing: var(--ls-h1); font-weight: var(--fw-display);
}
.tk-w { display: block; white-space: nowrap; }
.tk-intro { grid-column: 5 / -1; margin-top: var(--gap-stack); min-width: 0; }
.tk-ecg { display: block; width: 100%; height: 32px; margin-top: 24px; overflow: visible; }
.tk-ecg path { fill: none; stroke: var(--blue); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }

/* ---- the rows ---- */
.tk-rows { list-style: none; margin-block: 80px 0; padding-block: 0; display: grid; gap: 64px; }   /* the sides alternate, so 64 px reads as a step */
.tk-step { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-grid); align-items: stretch; }
.tk-plate {
  position: relative; isolation: isolate; overflow: clip; border-radius: var(--r-lg); background: var(--paper);
  width: min(100%, calc(var(--tk-ph) * 592 / 704)); aspect-ratio: 592 / 704; grid-row: 1;
}
.tk-row--l .tk-plate { grid-column: 1 / 7; justify-self: start; }
.tk-row--r .tk-plate { grid-column: 7 / -1; justify-self: end; }
.tk-text { grid-row: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding-top: 8px; }
.tk-row--l .tk-text { grid-column: 8 / -1; }
.tk-row--r .tk-text { grid-column: 1 / 6; }
.tk-num {
  font-size: min(200px, calc(var(--tk-ph) * .24)); line-height: .8; letter-spacing: var(--ls-wordmark);
  font-weight: var(--fw-display); font-variant-numeric: tabular-nums; color: var(--ink); margin-top: -.02em;
}
.tk-h { font-size: var(--fs-h2); line-height: 1.12; letter-spacing: var(--ls-h2); font-weight: var(--fw-display); }
.tk-a { color: var(--ink); text-decoration: none; }
.tk-arr { display: inline-block; width: .5em; height: .5em; margin-left: .22em; vertical-align: .08em; color: var(--blue-deep); transition: transform var(--dur-ui) var(--ease-ui); }
.tk-arr svg { width: 100%; height: 100%; }
.tk-nb { white-space: nowrap; }                                       /* the title's last word keeps its arrow */
.tk-a:hover, .tk-a:focus-visible { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }
@media (hover: hover) { .tk-a:hover .tk-arr { transform: translateX(4px); } }   /* the link answers the pointer */
.tk-line { margin-top: 16px; max-width: 17em; font-size: clamp(20px, 1.9vw, 28px); line-height: 1.32; letter-spacing: var(--ls-statement); color: var(--ink-75); }
.tk-cerec { margin-top: 12px; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-64); }

/* ---- the Messwert (V8-GAPS §2 C): one per plate, the same device on all five, ink only. It sits on the plate's
   bottom edge as the numeral sits on its top edge, so the row reads top to bottom: step, title, line, measure. ---- */
.tk .tk-mw { margin-top: auto; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.tk .tk-mw-v {
  font-size: var(--fs-h2); line-height: 1.05; letter-spacing: var(--ls-h2); font-weight: var(--fw-display);
  white-space: nowrap;                                                 /* proportional figures: tabular ones gap the „1" in „120" */
}
.tk .tk-mw-q { font-size: var(--fs-body); letter-spacing: 0; color: var(--ink-64); }   /* „etwa", „bis zu": kept, small */
.tk .tk-mw-k { display: flex; align-items: baseline; gap: 12px; font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--ink-64); }
.tk .tk-mw-r { flex: 1 1 32px; border-bottom: 1px solid currentColor; }   /* the leader: it lies on the label's baseline */
.tk .tk-mw-l { flex: 0 1 auto; min-width: 0; }

/* ---- the picture inside a plate (also /technik/: .tk-vis--r2 composite, see css/pages/technik.css) ---- */
.tk-plate > .tk-vis { position: absolute; inset: 0; }
.tk-vis { position: relative; min-width: 0; overflow: clip; }
.tk-obj { position: absolute; inset: 0; transform-origin: 50% 55%; }
.tk-veil { position: absolute; inset: 0; background: var(--veil); opacity: 0; pointer-events: none; }
.tk-haze { position: absolute; inset: 0; }
.tk-haze img { width: 100%; height: 100%; object-fit: cover; max-width: none; }

/* 3D host (01 DVT, 04 milling) on the paper plate: js/core/three.js puts the page's one canvas in here once it has drawn */
.tk-host { position: absolute; inset: 0; overflow: clip; }
.tk .t3d-post, .tk .t3d-post picture { position: absolute; inset: 0; }
.tk .t3d-post img { width: 100%; height: 100%; object-fit: contain; max-width: none; }
.tk .t3d-post { transition: opacity .4s var(--ease-ui); }
.tk .tk-host[data-live] .t3d-post { opacity: 0; }
.tk .t3d-post picture:not(:last-child) { display: none; }                  /* one still: the end pose (never stepped in view) */
html[data-t3d="live"] .tk .tk-host:not([data-slow]) .t3d-post.is-wait picture { display: none; }   /* desktop live: no poster download; it returns if 3D falls back or is slow (data-slow) */

/* 02 · R2 composite: the X-ray card (tile02-foto-17, cut file of foto-17 x .30–.60, y .08–.42) on its haze, no face (V12) */
.tk-vis--r2 .tk-card {
  inset: auto; left: 50%; top: 52%; width: 82%; max-height: 86%; aspect-ratio: 480 / 306; translate: -50% -50%;
  border-radius: var(--r-sm); overflow: hidden; transform-origin: 50% 50%;
}
.tk-card picture { position: absolute; inset: 0; }
.tk-card img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }   /* cut files at the card's ratio */
/* 03 · the scanner in his hand as the R2 card: scan-card-700 (cut file, scan x .35–.70, y .50–1), no face */
.tk-vis--scan .tk-card { aspect-ratio: 700 / 667; width: 74%; max-height: 84%; }
/* placeholders (phone round C): each box shows its picture's own mean colour at its final size until it decodes */
.tk-vis--r2 { background: #98999e; }                 /* haze-02-foto-17 */
.tk-vis--scan { background: #b7c7c4; }               /* haze-03-scan */
.tk-vis--r2 .tk-card { background: #97a8ae; }        /* tile02-foto-17 */
.tk-vis--scan .tk-card { background: #91b2ae; }      /* scan-card-700 */
.tk-vis--photo { background: #a09f9e; }              /* tile05-foto-26 (its mean colour) */
/* 05 · Dr. Haimov at the microscope (tile05-foto-26, David 2026-11-10 overrules V15) covers the plate; cut at the plate's
   aspect; a shorter plate trims the knees first: his face sits at y .28–.45 of the file, so the cut favours the bottom */
.tk-vis--photo picture { position: absolute; inset: 0; }
.tk-vis--photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; max-width: none; }

/* ---- T 810–1199: the same ledger, narrower ---- */
@media (max-width: 1199.98px) {
  .tk-rows { gap: 56px; }
  .tk-intro { grid-column: 4 / -1; }
  .tk-num { font-size: min(160px, calc(var(--tk-ph) * .24), 13vw); }
  .tk-h { font-size: clamp(32px, 3.9vw, 44px); }
}

/* ---- P ≤ 809: one column; each step's words, then its plate (4:5) ---- */
@media (max-width: 809.98px) {
  .tk-word { font-size: min(72px, calc((100vw - 2 * var(--side)) / var(--em) * .97)); }
  :lang(ru) .tk-word { font-size: min(64px, calc((100vw - 2 * var(--side)) / var(--em) * .97)); }
  .tk-intro { grid-column: 1 / -1; margin-top: 24px; }
  .tk-ecg { margin-top: 16px; height: 24px; }
  .tk-rows { margin-top: 64px; gap: 72px; }
  .tk-step { display: flex; flex-direction: column; }
  .tk-text { gap: 12px; padding-top: 0; }
  .tk-num { font-size: 64px; line-height: .9; }
  .tk-h { font-size: 32px; }
  .tk-line { font-size: 20px; margin-top: 12px; }
  .tk .tk-mw { margin-top: 12px; gap: 4px; }
  .tk .tk-mw-v { font-size: 40px; }                                    /* under the step numeral (64), over the title (32) */
  .tk .tk-mw-q { font-size: var(--fs-ui); }
  .tk-plate, .tk-row--l .tk-plate, .tk-row--r .tk-plate { order: 2; width: 100%; aspect-ratio: 4 / 5; margin-top: 24px; border-radius: var(--r-md); }
  /* one still per 3D plate (data-phone in the markup: DVT jaw q 0, milling bridge q 1); the other poses are
     display: none, so phones never download them (phone round C) */
  .tk .tk-host .t3d-post picture:not([data-phone]) { display: none; }
  .tk .tk-host .t3d-post picture[data-phone] { display: block; }
}
