/* ==========================================================================
   vale-video.de — Handwerk: Objektiv (3D), Licht, Grade-Nodes
   ========================================================================== */

/* --- Objektiv ---------------------------------------------------------------- */
.objektiv { background: #000; color: #f3f3f3; }
.obj-strecke { position: relative; }
.obj-buehne { position: relative; overflow: hidden; background: #000; }
.obj-buehne > canvas { display: none; }
.obj-poster { display: block; width: 100%; height: auto; }
.obj-kopf { padding: clamp(3rem, 6vw, 5rem) 0 1.4rem; }
.obj-kopf h2 { font-size: clamp(2.3rem, 4.6vw, 4.5rem); letter-spacing: -.02em; line-height: 1; max-width: 9ch; }
.obj-kopf p { color: #b4b4b4; max-width: 34ch; margin-top: 1rem; }
.obj-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.4rem; padding: 1.5rem 0 3rem; }
.obj-teil b { display: block; font-size: 1.15rem; letter-spacing: -.015em; margin-bottom: .25rem; }
.obj-teil p { color: #b4b4b4; font-size: .96rem; max-width: 34ch; }
.obj-clip { display: block; width: 100%; aspect-ratio: 8 / 5; object-fit: cover; background: #111; border-radius: var(--r-md); margin-bottom: 1.1rem; }
.objektiv.ist-an .obj-clip { transform: scale(.86) translateY(14px); opacity: 0; transition: transform .7s cubic-bezier(.3, 1.4, .45, 1), opacity .25s; transform-origin: 0 100%; }
.objektiv.ist-an .obj-teil.ist-jetzt .obj-clip { transform: none; opacity: 1; }
.obj-weiter { display: inline-flex; align-items: center; gap: .6rem; margin-top: 1rem; padding: .7rem 1.15rem; border-radius: var(--r-pill); background: #fff; color: #000; font-weight: 660; pointer-events: none; }
.obj-teil.ist-jetzt .obj-weiter { pointer-events: auto; }
.obj-weiter svg { width: 1.1rem; height: 1.1rem; transition: transform .25s var(--ease); }
.obj-weiter:hover svg { transform: translateX(4px); }
/* Filmkorn ueber der Linse: feines Rauschen, das im 12-Bilder-Takt springt */
.obj-korn { display: none; }
.objektiv.ist-an .obj-korn { display: block; position: absolute; z-index: 3; inset: -40%; pointer-events: none; background: url(../assets/images/korn.webp) 0 0 / 190px; opacity: .55; }
@media (prefers-reduced-motion: no-preference) { html:not(.bewegung-aus) .objektiv.ist-an .obj-korn { animation: korn .66s steps(1) infinite; } }
@keyframes korn { 0% { transform: translate(0, 0); } 12% { transform: translate(-7%, 4%); } 25% { transform: translate(5%, -9%); } 37% { transform: translate(-4%, -6%); } 50% { transform: translate(8%, 7%); } 62% { transform: translate(-9%, 2%); } 75% { transform: translate(3%, 9%); } 87% { transform: translate(6%, -3%); } }
.obj-linie, .obj-punkt, .obj-balken { display: none; }

.objektiv.ist-an .obj-strecke { height: 820svh; }
.objektiv.ist-an .obj-buehne { position: sticky; top: 0; height: 100svh; }
.objektiv.ist-an .obj-buehne > canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.objektiv.ist-an .obj-poster { display: none; }
.objektiv.ist-an .obj-kopf { position: absolute; z-index: 4; left: 0; right: 0; top: 50%; transform: translateY(-50%); padding: 0; pointer-events: none; }
.objektiv.ist-an .obj-liste { position: absolute; z-index: 4; inset: 0; display: block; padding: 0; pointer-events: none; }
.objektiv.ist-an .obj-teil { position: absolute; left: 0; bottom: clamp(2.6rem, 7svh, 5rem); width: min(21.5rem, 25vw); opacity: 0; transform: translateY(12px); transition: opacity .3s, transform .5s var(--ease); }
.objektiv.ist-an .obj-teil.ist-jetzt { opacity: 1; transform: none; }
.objektiv.ist-an .obj-teil b { font-size: clamp(2rem, 4.4vw, 4rem); letter-spacing: -.02em; line-height: 1; margin-bottom: .7rem; }
.objektiv.ist-an .obj-teil p { font-size: 1.02rem; }
.objektiv.ist-an .obj-punkt { display: block; position: absolute; z-index: 3; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity .3s; pointer-events: none; }
.objektiv.ist-an .obj-punkt::before { content: ''; position: absolute; left: -1px; bottom: 6px; width: 2px; height: clamp(2.4rem, 7svh, 4.4rem); background: var(--rec); }
.objektiv.ist-an .obj-punkt::after { content: ''; position: absolute; left: -4px; top: -10px; width: 8px; height: 8px; border-radius: 50%; background: var(--rec); }
.objektiv.ist-an.mit-teil .obj-punkt { opacity: 1; }
.objektiv.ist-an .obj-balken { display: block; position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.12); pointer-events: none; }
.objektiv.ist-an .obj-balken i { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: 0 50%; }
.objektiv.ist-an .licht { position: absolute; inset: 0; z-index: 1; height: auto; visibility: hidden; }
.objektiv.ist-an .licht.ist-da { visibility: visible; }
.objektiv.ist-an .licht.ist-frei { z-index: 5; }
.objektiv.ist-an .licht-bedienung { opacity: 0; transform: translateY(14px); transition: opacity .4s, transform .6s var(--ease); }
.objektiv.ist-an .licht.ist-frei .licht-bedienung { opacity: 1; transform: none; }

/* --- Licht -------------------------------------------------------------------- */
.licht { position: relative; height: min(100svh, 62vw); min-height: 560px; background: #000; overflow: hidden; color: #fff; }
.licht canvas, .licht > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.licht canvas { cursor: ns-resize; touch-action: pan-y; opacity: 0; transition: opacity .3s; }
.licht.ist-bereit canvas { opacity: 1; }
.licht::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 62%; background: linear-gradient(to top, rgba(0,0,0,.86), rgba(0,0,0,.5) 45%, transparent); pointer-events: none; }
.licht-bedienung { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding-bottom: clamp(1.8rem, 5svh, 3.4rem); }
.licht-raster { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.4rem clamp(2rem, 6vw, 6rem); align-items: end; }
.licht h2 { font-size: clamp(2.1rem, 4.8vw, 4.4rem); letter-spacing: -.02em; line-height: 1; }
.licht-raster p { color: #d2d2d2; margin-top: .8rem; max-width: 46ch; }
.licht-regler { display: grid; gap: .9rem; }
.licht-regler label { display: grid; grid-template-columns: 4.6rem 1fr; align-items: center; gap: 1rem; font-size: .9rem; font-weight: 600; }
.licht-regler input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: none; cursor: pointer; }
.licht-regler input::-webkit-slider-runnable-track { height: 3px; background: rgba(255,255,255,.35); }
.licht-regler input::-moz-range-track { height: 3px; background: rgba(255,255,255,.35); }
.licht-regler input[data-licht="farbe"]::-webkit-slider-runnable-track { background: linear-gradient(90deg, #ffa14f, #ffe6cf 45%, #fff 62%, #bcd5ff); }
.licht-regler input[data-licht="farbe"]::-moz-range-track { background: linear-gradient(90deg, #ffa14f, #ffe6cf 45%, #fff 62%, #bcd5ff); }
.licht-regler input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8.5px; border-radius: 50%; background: #fff; border: 0; }
.licht-regler input::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; }
.licht-regler input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.licht-fuss { display: flex; align-items: center; gap: 1.1rem; }
.licht-fuss button { padding: .62rem 1.1rem; border-radius: var(--r-pill); background: #fff; color: #000; font-size: .9rem; font-weight: 680; min-width: 8.2rem; }
.licht-fuss button[aria-pressed="false"] { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
.licht-fuss output { font-family: var(--mono); font-size: .8rem; color: #d2d2d2; font-variant-numeric: tabular-nums; }
.licht-fuss [data-licht="kippen"] { min-width: 0; background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
.licht-fuss [data-licht="kippen"][aria-pressed="true"] { background: #fff; color: #000; }
.licht.ohne-gl .licht-regler { display: none; }
@media (max-width: 860px) {
  .licht-raster { grid-template-columns: 1fr; }
  .licht { height: 100svh; }
  .licht h2 { font-size: 2.5rem; }
  .licht-raster { gap: 1.1rem; }
  .licht-regler input[type="range"] { height: 40px; }
  .licht-regler input::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -12.5px; }
  .licht-regler { gap: .3rem; }
  .licht-fuss { flex-wrap: wrap; gap: .7rem 1rem; margin-top: .5rem; }
  .objektiv.ist-an .obj-strecke { height: 720svh; }
  .objektiv.ist-an .obj-kopf { top: auto; bottom: 12svh; transform: none; }
  .objektiv.ist-an .obj-teil { left: 0; right: 0; width: auto; bottom: 4.2svh; }
  .objektiv.ist-an .obj-teil b { font-size: 1.9rem; margin-bottom: .35rem; }
  .objektiv.ist-an .obj-clip { max-height: 30svh; width: auto; max-width: 100%; aspect-ratio: 8 / 5; margin-bottom: .9rem; }
  .objektiv.ist-an .obj-teil p { font-size: .98rem; }
}

/* --- Grade aufklappen ------------------------------------------------------------ */
.nodes { margin-top: 1.6rem; }
.nodes summary { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.3rem; cursor: pointer; list-style: none; width: fit-content; max-width: 100%; }
.nodes summary::-webkit-details-marker { display: none; }
.nodes summary b { display: inline-flex; align-items: center; gap: .9rem; padding: 1rem 1.7rem; border-radius: var(--r-pill); background: var(--fg); color: var(--bg); font-size: clamp(1.1rem, 1.5vw, 1.3rem); font-weight: 720; letter-spacing: -.015em; white-space: nowrap; }
.nodes summary b::after { content: ''; width: .58rem; height: .58rem; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: translateY(-.16rem) rotate(45deg); transition: transform .3s var(--ease); }
.nodes[open] summary b::after { transform: translateY(.16rem) rotate(225deg); }
.nodes summary span { color: var(--muted); font-size: .95rem; }
.nodes summary:focus-visible { outline: 2px solid var(--fg); outline-offset: 6px; border-radius: var(--r-pill); }
.nodes-inhalt { padding-top: 1.6rem; }
.nodes-inhalt ol { display: grid; gap: .5rem; padding-left: 1.2rem; list-style: decimal; color: var(--muted); }
/* huepft, bis man hinfasst: zwei Spruenge, kurz Ruhe */
@media (prefers-reduced-motion: no-preference) {
  html:not(.bewegung-aus) .nodes:not([open]) summary b, html:not(.bewegung-aus) .huepft:not(.laeuft) { animation: huepfen 2.6s cubic-bezier(.3, 0, .3, 1) infinite; transform-origin: 50% 100%; }
  html:not(.bewegung-aus) .nodes:not([open]) summary:is(:hover, :focus-visible) b, html:not(.bewegung-aus) .huepft:is(:hover, :focus-visible) { animation: none; }
}
@keyframes huepfen {
  0%, 52% { transform: none; animation-timing-function: cubic-bezier(.5, 0, .8, .4); }
  56% { transform: scale(1.06, .9); animation-timing-function: cubic-bezier(.1, .6, .4, 1); }
  66% { transform: translateY(-15px) scale(.97, 1.05); animation-timing-function: cubic-bezier(.6, 0, .9, .4); }
  75% { transform: scale(1.07, .89); animation-timing-function: cubic-bezier(.1, .6, .4, 1); }
  82% { transform: translateY(-7px) scale(.985, 1.02); animation-timing-function: cubic-bezier(.6, 0, .9, .4); }
  89% { transform: scale(1.03, .95); }
  94%, 100% { transform: none; }
}
.nodes-baum { overflow-x: auto; scrollbar-width: thin; background: #161616; color: #f1f1f1; padding: .5rem; }
.nodes-baum svg { display: block; width: 100%; min-width: 940px; max-width: 1080px; height: auto; }
@media (min-width: 861px) { .grade.ist-offen .grade-buehne { width: min(100%, 118svh); transition: width .4s var(--ease); } }
.n-reihe { font: 600 11px var(--mono, monospace); fill: #8d8d8d; }
.n-kabel { fill: none; stroke: #6b6b6b; stroke-width: 1.6; }
.n-key { fill: none; stroke: #5f86c4; stroke-width: 1.4; }
.n-keytext { font: 11px var(--mono, monospace); fill: #8fb0e6; }
.n-node { cursor: pointer; opacity: .34; transition: opacity .3s; outline: none; }
.n-node rect { fill: #262626; stroke: #3a3a3a; stroke-width: 1; }
.n-node circle { fill: #8d8d8d; }
.n-node text { font: 600 11px Inter, system-ui, sans-serif; fill: #e8e8e8; }
.n-node[data-schritt="-1"] { cursor: default; }
.n-node.ist-an, .n-node:hover { opacity: 1; }
.n-node.ist-an circle { fill: #6fd08c; }
.n-node.ist-jetzt rect { stroke: var(--rec); stroke-width: 2.5; }
.n-node:focus-visible rect { stroke: #fff; stroke-width: 2.5; }
.n-ende { opacity: .55; }
.n-ende rect:first-child, .n-ende.ist-jetzt rect:first-child { fill: #262626; stroke: var(--rec); stroke-width: 3; }
.n-ende .n-ende-band, .n-ende.ist-jetzt .n-ende-band { fill: #d1281e; stroke: none; }
.n-ende text { fill: #fff; font-weight: 760; letter-spacing: .06em; }
.n-ende-text { font: 600 11px Inter, system-ui, sans-serif; fill: #e8e8e8; }
.n-kabel--ende { stroke: var(--rec); stroke-width: 2.4; }
.grade-schild.ist-ende { background: #d1281e; }
.nodes-steuer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem clamp(1.4rem, 3vw, 2.6rem); align-items: center; margin-bottom: 1.3rem; }
.n-spiel { display: inline-flex; align-items: center; gap: .85rem; padding: 1.05rem 1.8rem 1.05rem 1.5rem; border-radius: var(--r-pill); background: var(--rec); color: #fff; font-size: clamp(1.2rem, 1.6vw, 1.35rem); font-weight: 740; letter-spacing: -.015em; white-space: nowrap; }
.n-spiel svg { width: 1.35rem; height: 1.35rem; flex: none; }
.n-spiel .ico-halt, .n-spiel.laeuft .ico-los { display: none; }
.n-spiel.laeuft .ico-halt { display: block; }
.n-spiel.laeuft { background: var(--fg); color: var(--bg); }
.n-schritte { display: flex; align-items: center; gap: .6rem; }
.n-pfeil { width: 2.8rem; height: 2.8rem; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; }
.n-pfeil:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.n-pfeil svg { width: 1.05rem; height: 1.05rem; }
.nodes-zahl { font-family: var(--mono); font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.2rem; text-align: center; }
.nodes-text { min-height: 3.6rem; max-width: 62ch; display: grid; align-content: center; }
.nodes-text b { display: block; font-size: 1.2rem; letter-spacing: -.015em; }
.nodes-text p { color: var(--muted); margin-top: .1rem; line-height: 1.4; }
.grade-mehr { margin-top: 1.4rem; }
@media (max-width: 860px) { .nodes-steuer { grid-template-columns: 1fr; gap: .9rem; } .n-spiel { justify-content: center; } .n-schritte { justify-content: space-between; } .nodes-text { min-height: 6rem; align-content: start; } .nodes-baum svg { min-width: 760px; } }

/* Licht im Hochformat: das Bild liegt quer, oben buendig; die Regler stehen darunter im Schwarz */
.licht-dreh { display: none; }
@media (max-width: 860px) and (orientation: portrait) {
  .licht::after { height: 46%; background: linear-gradient(to top, #000 34%, rgba(0, 0, 0, .72) 58%, transparent); }
  .licht-bedienung { padding-bottom: 1.1rem; }
  .licht h2 { font-size: 1.7rem; }
  .licht-raster { gap: .5rem; }
  .licht-raster p { font-size: .9rem; margin-top: .3rem; }
  .licht.ist-frei .licht-dreh, .objektiv:not(.ist-an) .licht-dreh { position: absolute; z-index: 3; left: 50%; top: 1.2rem; transform: translateX(-50%); display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .8rem .4rem .6rem; border-radius: var(--r-pill); background: rgba(0, 0, 0, .72); color: #fff; font-size: .86rem; font-weight: 620; animation: licht-dreh 5s .6s both; }
  .licht-dreh svg { width: 1.2rem; height: 1.2rem; animation: handy-dreh 2s cubic-bezier(.6, 0, .1, 1) infinite; }
}
@keyframes licht-dreh { 0%, 100% { opacity: 0; } 12%, 82% { opacity: 1; } }
@media (max-height: 520px) {
  .licht { min-height: 0; height: 100svh; }
  .licht h2 { font-size: 1.4rem; }
  .licht-raster { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 1rem; }
  .licht-raster p { display: none; }
  .licht-regler { gap: 0; }
  .licht-bedienung { padding-bottom: .6rem; }
}
