/* Everholt & Co. · V2 · 05 figures — drawn figures (one grammar, landscape and portrait copies), the video frame, the plate map. */
@layer components {
  /* ---------- figure frame: the drawing in its paper plate, the data table under a disclosure ---------- */
  .eh-fig { display: flex; flex-direction: column; gap: var(--s-4); margin-inline: auto; max-width: 1100px; width: 100%; align-self: stretch; }   /* an explicit width: size containment would otherwise let a flex parent collapse it */
  .eh-fig__frame { background: var(--g-frame); border: 1px solid var(--r-2); border-radius: var(--radius-plate); padding: clamp(var(--s-4), 3vw, var(--s-7)); }
  .eh-fig__frame svg { width: 100%; height: auto; display: block; }
  .eh-fig__frame .eh-fig__portrait { display: none; }
  .eh-fig { container-type: inline-size; }
  /* the portrait copy below 900 px of figure width, so drawn text never falls under 11 px */
  @container (max-width: 899.98px) { .eh-fig__frame .eh-fig__landscape { display: none; } .eh-fig__frame .eh-fig__portrait { display: block; margin-inline: auto; max-width: 440px; } }
  @container (max-width: 479.98px) { .eh-fig__frame { padding: 10px; } }   /* a phone gives the drawing the frame's width, so drawn text stays at or above 11 px */
  .eh-fig__caption { font-size: var(--fs-small); color: var(--t-soft); max-width: 72ch; }
  .eh-illustrative-label { display: block; color: var(--t-muted); }

  /* drawn text: the page's own faces at drawn sizes; every colour a token class */
  .eh-fig__frame svg text { font-family: var(--font-text); }
  .eh-fig__frame svg .fx-mono { font-family: var(--font-mono); letter-spacing: .02em; }
  .eh-fig__frame svg .fx-display { font-family: var(--font-display); }
  .eh-fig__frame svg .fx-bold { font-weight: 600; }
  .fx-ink { fill: var(--t-head); } .fx-body { fill: var(--t-body); } .fx-soft { fill: var(--t-soft); } .fx-muted { fill: var(--t-muted); }
  .fx-accent { fill: var(--accent); } .fx-on-accent { fill: var(--call-text); } .fx-paper { fill: var(--g-frame); } .fx-wash { fill: var(--fig-wash); }
  .fx-tint { fill: var(--accent-tint); } .fx-none { fill: none; }
  .sx-line { stroke: var(--fig-line); } .sx-rule { stroke: var(--r-2); } .sx-ink { stroke: var(--t-head); } .sx-accent { stroke: var(--accent); }
  .sx-strong { stroke: var(--r-3); }
  .fx-deep { fill: var(--accent-strong); } .fx-line { fill: var(--fig-line-fill); } .fx-faint { fill: var(--r-1); } .fx-softfill { fill: var(--t-soft); }
  .sx-deep { stroke: var(--accent-strong); } .sx-soft { stroke: var(--t-soft); } .sx-on-accent { stroke: var(--call-text); } .sx-paper { stroke: var(--g-frame); }

  /* ---------- video: a 16:9 plate; the embed loads only on a click ---------- */
  .eh-video { position: relative; aspect-ratio: 16 / 9; width: 100%; background: var(--g-frame); border: 1px solid var(--r-2); border-radius: var(--radius-plate);
    overflow: hidden; box-shadow: var(--shadow-plate); container-type: inline-size; }
  .eh-video__facade { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(var(--s-4), 4cqw, var(--s-7));
    color: var(--t-head); text-decoration: none; background: var(--g-page); }
  .eh-video__facade::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 100% 100%, var(--accent-tint), transparent 60%); }
  .eh-video__kind { position: relative; font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--accent); }
  .eh-video__title { position: relative; align-self: center; font-family: var(--font-display); font-size: clamp(1.25rem, 5cqw, 2.1rem); line-height: 1.12;
    letter-spacing: -0.012em; font-weight: 430; max-width: 18ch; text-wrap: balance; }
  .eh-video__meta { position: relative; display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-small); color: var(--t-soft); }
  .eh-video__play { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--call); color: var(--call-text);
    flex: none; transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
  .eh-video__play svg { width: 22px; height: 22px; margin-inline-start: 3px; }
  .eh-video__facade:hover .eh-video__play { background: var(--call-hover); transform: scale(1.04); }
  .eh-video__facade:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
  .eh-video .eh-device { position: absolute; right: -6%; bottom: -18%; width: 46%; color: var(--accent); opacity: 0.08; pointer-events: none; }
  .eh-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
  .eh-video[data-state="playing"] .eh-video__facade { display: none; }
  /* half width beside its text from 900 px; full width below */
  .eh-media { display: grid; gap: var(--s-8); align-items: center; }
  @container (min-width: 900px) { .eh-media { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-10); } .eh-media--video-right .eh-video { order: 2; } }
  @media (prefers-reduced-motion: reduce) { .eh-video__play { transition: none; } .eh-video__facade:hover .eh-video__play { transform: none; } }
}
