/* Loop hero (Themen draft, "Anwendungen & Kreislaufwirtschaft", brief 16): one closed materials loop as a lit technical
   illustration on a bright ground. Markup from design/heroes/loop.php, drawing from loop.js. Everything is scoped to .lh.
   The text block repeats the measures of the process and microscope heroes (bright colours): left edge = the 1280px box
   with 64px padding (24px below 1024), eyebrow top 168px at 1024 and wider, h1 clamp(1.75rem, 3.65vw, 3.3rem)/1.05 900,
   lead clamp(1.02rem, 1.25vw, 1.18rem)/1.62, buttons 49.6px, radius 10; hero 672px from 1024px up. */
.lh {
  --lh-ink: #003e52; --lh-ink0: #00212c; --lh-p: #00abe3; --lh-pl: #7fd8f5; --lh-text: #0f172a; --lh-muted: #475569;
  --lh-pad: 64px; --lh-top: 168px; --lh-copy: calc((min(100cqw, 1280px) - 180px) * 7 / 12);
  container: lh / inline-size;
  position: relative; isolation: isolate; overflow: hidden; box-sizing: border-box; margin: 0; color: var(--lh-text);
  font-family: "Theme-Font", Inter, system-ui, sans-serif;
  background:
    radial-gradient(ellipse 46% 62% at 74% 56%, rgb(255 255 255 / .85), rgb(255 255 255 / 0) 70%),
    radial-gradient(ellipse 60% 70% at 100% 100%, rgb(127 216 245 / .22), transparent 70%),
    linear-gradient(160deg, #f6fbfe 0%, #eef8fc 42%, #e4f4fb 74%, #dff2fa 100%);
}
.lh *, .lh *::before, .lh *::after { box-sizing: border-box; }
/* placed as an html content element: its frame runs the full width with no outer spacing, as the Event Hero does */
#crm__widgets .frame:has(> .lh) { max-width: none; width: auto; margin: 0; padding: 0; }
.lh a { text-decoration: none; }

.lh__inner { position: relative; z-index: 3; width: 100%; max-width: 1280px; min-height: 672px; margin: 0 auto;
  padding: var(--lh-top) var(--lh-pad) 104px; pointer-events: none; }
.lh__copy { position: relative; z-index: 4; width: var(--lh-copy); max-width: 100%; pointer-events: auto; }
html.tm-fw .lh__copy { visibility: hidden; }

/* the eyebrow pill: the process hero's, in its bright variant */
.lh__eyebrow { display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1.2rem; padding: .4rem .85rem .4rem .7rem;
  border: 1px solid rgb(0 171 227 / .34); border-radius: 999px; background: rgb(255 255 255 / .72); color: #00475e;
  font: 800 .72rem/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 6px 18px -12px rgb(0 62 82 / .35); }
.lh__pulse { position: relative; display: inline-flex; width: .5rem; height: .5rem; border-radius: 999px; background: var(--lh-p);
  box-shadow: 0 0 14px rgb(0 171 227 / .55); }
.lh__pulse::after { content: ""; position: absolute; inset: -.45rem; border: 1px solid rgb(0 171 227 / .5); border-radius: 999px;
  animation: lh-pulse 2.4s ease-out infinite; }
@keyframes lh-pulse { 0% { opacity: .72; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.8); } }

.lh__h1 { max-width: 680px; margin: 0; color: var(--lh-ink); font-family: "Heading-Font", "Inter Tight", Inter, system-ui, sans-serif;
  font-size: clamp(1.75rem, 3.65vw, 3.3rem); font-weight: 900; line-height: 1.05; letter-spacing: -.015em; text-wrap: balance;
  hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 9 5 4; overflow-wrap: break-word; }
.lh__accent { display: block; margin-top: .12em; padding-bottom: .14em; line-height: 1.14;
  background: linear-gradient(90deg, #007aa8 0%, #00abe3 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent; }
.lh__lead { max-width: 540px; margin-top: 1.5rem; color: var(--lh-muted); font-size: clamp(1.02rem, 1.25vw, 1.18rem); line-height: 1.62; text-wrap: pretty; }
.lh__lead p { margin: 0; }
.lh__lead p + p { margin-top: .6em; }
.lh__buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 2rem; }
.lh__btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3.1rem; padding: .8rem 1.4rem;
  border-radius: 10px; font-size: 1rem; font-weight: 800; letter-spacing: .01em; line-height: 1.2; text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease; }
.lh__btn--primary { background: #00abe3; color: #fff; box-shadow: 0 16px 34px -14px rgb(0 171 227 / .6); }
.lh__btn--primary:hover, .lh__btn--primary:focus-visible { background: #007aa8; color: #fff; box-shadow: 0 18px 36px -14px rgb(0 122 168 / .6); }
.lh__btn--secondary { border: 1px solid rgb(0 62 82 / .26); background: rgb(255 255 255 / .74); color: var(--lh-ink); }
.lh__btn--secondary:hover, .lh__btn--secondary:focus-visible { border-color: #00abe3; background: #fff; color: var(--lh-ink); }
.lh__btn:focus-visible { outline: 2px solid var(--lh-ink); outline-offset: 3px; }
.lh__btn i { font-size: 1rem; }

/* ---------- the drawing (1200px and wider): a box right of the text ----------
   left: 40px clear of the text block (lead 540px; the longest h1 line is under 9.4em in both languages); right: 40px
   from the hero's edge; top: 40px under the site header (84px); bottom: 40px over the topic switch, which overlaps the
   hero by 30px. Whole pixels, so the canvases sit on the pixel grid. loop.js draws the 640 x 480 unit view centred in
   the box and places the callouts (fields) and the station words over it. */
.lh__art { position: absolute; z-index: 2; top: 124px; bottom: 70px; right: 40px;
  left: round(down, calc(max(0px, (100cqw - 1280px) / 2) + var(--lh-pad) + min(var(--lh-copy), max(540px, min(3.65vw, 3.3rem) * 9.4)) + 40px), 1px); }
.lh__stage { position: absolute; inset: 0; }
.lh__stage > canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.lh__words, .lh__fields, .lh__hits { position: absolute; inset: 0; pointer-events: none; }
.lh__hit { position: absolute; pointer-events: auto; cursor: pointer; }

/* station words: our own general terms, quieter than the fields: mono, small caps look, 12px, ink 72 % */
.lh__w { position: absolute; left: 0; top: 0; display: block; width: max-content; color: #2d5566; opacity: 0;
  font: 600 12px/14px ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; transition: opacity .2s ease, color .2s ease; }
.lh.is-placed .lh__w { opacity: 1; }
/* the inlet's word may take two lines (English "raw material"): it stands in the narrow room left of the crucible */
.lh__w[data-w="raw"] { width: min-content; white-space: normal; text-align: center; }

/* the field callouts: one size and weight (13/600), ink, names in full (no clamp); a fine leader from the label to its
   station, ending in the same 5px dot. JS sets left/top (the dot's centre), the side (--top: label above the dot,
   --bot: below) and --ll (the leader's length in px). */
.lh__f { --ll: 16px; --lx: 50%; position: absolute; left: 0; top: 0; display: block; width: max-content; max-width: 200px; color: var(--lh-ink);
  font-size: 13px; font-weight: 600; line-height: 16px; letter-spacing: 0; text-align: center; text-decoration: none;
  pointer-events: auto; opacity: 0; transition: opacity .2s ease, color .2s ease; }
.lh.is-placed .lh__f { opacity: 1; }
.lh__f-t { display: block; padding: 2px 0; text-decoration: underline 1px transparent; text-underline-offset: 3px; text-wrap: balance;
  transition: text-decoration-color .2s ease; }
.lh__f::before, .lh__f::after { content: ""; position: absolute; pointer-events: none; }
.lh__f::before { left: calc(var(--lx) - .5px); width: 1px; height: var(--ll); background: rgb(0 62 82 / .42); transition: background-color .2s ease; }
.lh__f::after { left: calc(var(--lx) - 2.5px); width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px var(--lh-ink); transition: background-color .2s ease; }
.lh__f--top { translate: 0 -100%; padding-bottom: calc(var(--ll) + 3px); }
.lh__f--top::before { bottom: 3px; }
.lh__f--top::after { bottom: -2.5px; }
.lh__f--bot { translate: 0 0; padding-top: calc(var(--ll) + 3px); }
.lh__f--bot::before { top: 3px; }
.lh__f--bot::after { top: -2.5px; }
/* hover or keyboard focus: the label gains an underline, its leader and dot darken, the others step back a little */
.lh__f:hover .lh__f-t, .lh__f:focus-visible .lh__f-t, .lh__f.is-hi .lh__f-t { text-decoration-color: currentColor; }
.lh__f:hover::before, .lh__f:focus-visible::before, .lh__f.is-hi::before { background: var(--lh-ink); }
.lh__f:hover::after, .lh__f:focus-visible::after, .lh__f.is-hi::after { background: var(--lh-p); box-shadow: inset 0 0 0 1px var(--lh-ink); }
/* the others step back by colour, not opacity: they keep 4.5:1 (labels 5.8:1, words 4.8:1) */
.lh.has-hi .lh__f:not(.is-hi) { color: #3b6577; }
.lh.has-hi .lh__f:not(.is-hi)::before { background: rgb(0 62 82 / .26); }
.lh.has-hi .lh__w { color: #4d717f; }
.lh__f:focus-visible { outline: 2px solid var(--lh-ink); outline-offset: 3px; border-radius: 4px; }

/* ---------- 900 to 1199: the drawing beside the text without callouts, the five fields as chips under it ---------- */
/* 1024 to 1279: the text column keeps the other heroes' left edge, h1 size and top; 480px (the process hero's 460 would
   wrap the two buttons into two rows here and the long lead would push the hero 2px past 672 at 1200) */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .lh { --lh-copy: min(calc((min(100cqw, 1280px) - 180px) * 7 / 12), 480px); }
}
@media (min-width: 900px) and (max-width: 1023.98px) {
  .lh { --lh-pad: 24px; --lh-top: 116px; --lh-copy: 420px; }
}
@media (max-width: 1199.98px) {
  .lh__w { display: none; }
  .lh__fields { position: static; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; pointer-events: auto; }
  .lh__f { position: relative; left: auto !important; top: auto !important; translate: none; display: inline-flex; align-items: center; gap: 8px;
    max-width: 100%; min-height: 34px; padding: 7px 14px 7px 12px; border: 1px solid rgb(0 62 82 / .2); border-radius: 17px;
    background: rgb(255 255 255 / .82); text-align: left; opacity: 1; transition: background-color .2s ease, border-color .2s ease; }
  .lh__f::before { display: none; }
  .lh__f::after { position: static; order: -1; flex: none; width: 5px; height: 5px; }
  .lh__f-t { padding: 0; }
  .lh__f:hover, .lh__f:focus-visible, .lh__f.is-hi { border-color: #00abe3; background: #fff; }
  .lh__f:focus-visible { outline-offset: 2px; border-radius: 17px; }
  .lh.has-hi .lh__f:not(.is-hi) { color: var(--lh-ink); }
}
/* the stage keeps the drawing's crop (600 x 384 units) and gives way to the chips when the box is short */
@media (min-width: 900px) and (max-width: 1199.98px) {
  .lh__art { display: flex; flex-direction: column; justify-content: center; gap: 20px; }
  .lh__stage { position: relative; inset: auto; flex: none; width: 100%; aspect-ratio: 600 / 384; max-height: 340px; }
}
/* ---------- under 900: text first, then the loop (about 260px), then the fields as chips that wrap ---------- */
@media (max-width: 899.98px) {
  .lh { --lh-pad: 24px; --lh-top: 104px; --lh-copy: 100%; }
  .lh__inner { min-height: 0; padding-bottom: 0; }
  .lh__copy { max-width: 620px; }
  .lh__art { position: relative; inset: auto; z-index: 2; max-width: 668px; margin: 28px auto 0; padding: 0 var(--lh-pad) 72px; }
  .lh__stage { position: relative; inset: auto; width: calc(100% + 2 * var(--lh-pad)); max-width: 100vw; margin: 0 calc(-1 * var(--lh-pad)); aspect-ratio: 600 / 384; max-height: 300px; }
  .lh__fields { margin-top: 16px; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .lh { --lh-pad: 20px; --lh-top: 84px; }
  .lh__eyebrow { gap: .45rem; margin-bottom: 1rem; padding: .28rem .7rem; font-size: .6875rem; letter-spacing: .1em; line-height: 1.45; }
  .lh__lead { margin-top: 1.25rem; font-size: .95rem; line-height: 1.55; }
  .lh__buttons { flex-direction: column; align-items: stretch; }
  .lh__btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .lh__pulse::after { animation: none; opacity: 0; }
  .lh__btn, .lh__f, .lh__w, .lh__f-t, .lh__f::before, .lh__f::after { transition: none; }
}

/* ---------- element dgm_section_hero_loop (Themen task 20, agent A, 2026-11-12): what the hero took from themen.css,
   so the element does not need the Themen template. Everything above is loop.css as deployed, unchanged. ---------- */
/* the sibling bar (pill menu) over the hero's lower edge (themen.css: body:has(.tm-b) …) */
body:has(.lh) #crm__widgets .frame-type-menu_subpages { margin-top: -30px; z-index: 41; }
/* bright hero (page field tx_dgm_fullscreen_hero = 2, the dark menu): pinned, the blue logo turns white on the blue bar;
   over the hero, search and language buttons with ink icons and a visible border (themen.css, scoped to this hero) */
body.dgm-page-has-fullscreen-hero-dark:has(.lh) .mainmenu.dgm-mainmenu--pinned #logo img { filter: brightness(0) invert(1); }
body.dgm-page-has-fullscreen-hero-dark:has(.lh) .mainmenu:not(.dgm-mainmenu--float) .dgm-mainmenu-overlay-actions :is(button[aria-label="Search"], #options-menu) { border: 1px solid rgb(15 23 42 / .28) !important; background: rgb(255 255 255 / .7) !important; color: #0f172a !important; }
body.dgm-page-has-fullscreen-hero-dark:has(.lh) .mainmenu:not(.dgm-mainmenu--float) .dgm-mainmenu-overlay-actions :is(button[aria-label="Search"], #options-menu) * { color: #0f172a !important; }
body.dgm-page-has-fullscreen-hero-dark:has(.lh) .mainmenu:not(.dgm-mainmenu--float) .dgm-mainmenu-overlay-actions :is(button[aria-label="Search"], #options-menu):hover { border-color: #00abe3 !important; }

/* 2026-11-13: under 1200px the fields are chips in the flow under the drawing. Painted in the fallback font they are wider
   and take one row more; when Inter 600 arrives they re-wrap and the drawing, centred above them, moves by 21px (layout
   shift 0.07 at 1024px). So the drawing and its chips wait for the fonts as the copy does (html.tm-fw, set by fontwait.js
   and cleared when the fonts are ready, at the latest after 1.2 s). The page template also preloads Inter 600
   (Tools/ThemenRedesign/design/publish.php), so on a normal connection nothing waits at all. */
@media (max-width: 1199.98px) {
  html.tm-fw .lh__art { visibility: hidden; }
}
