/* Glimmsaal Leuchten. Seitenstil.
   Kein Abschnitt hat eigene Farben: alle Farbwerte unten sind Startwerte für
   D = 0 und werden von licht.js pro Bild aus dem Dimmerstand neu gesetzt. */
:root {
  --sc-canvas:     #EEF0F2;
  --sc-surface:    #E3E5E8;
  --sc-ink:        #1B1510;
  --sc-ink-soft:   #4E4842;
  --sc-accent:     #8C4A12;
  --sc-accent-ink: #F6ECDF;
  --sc-font-display: "Gantari", system-ui, sans-serif;
  --sc-font-text:    "Afacad", system-ui, sans-serif;
  --sc-font-mono:    "Afacad", system-ui, sans-serif;
  --licht: rgb(255 180 107);
  --licht-rgb: 255 180 107;
  --grund-rgb: 238 240 242;
  --hell: 1; --d: 0; --dunkel: 0; --tag: 1; --glanz: .18;
  --foto-hell: 1; --foto-warm: 0;
  --raum2: 0; --raum3: 0; --kegel: 0; --still: 0;
  --text-gewicht: 400; --text-lauf: 0em;
  --schatten-farbe: 30 12% 22%;
  --sc-shadow-color: var(--schatten-farbe);
  --rund: 12px;
}
html { background: var(--sc-canvas); }
body { font-weight: var(--text-gewicht); letter-spacing: var(--text-lauf); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Schrift ---------- */
.sc-display { font-family: var(--sc-font-display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; color: var(--sc-ink); }
.anzeige-xl { font-size: clamp(2.5rem, 1.3rem + 4.4vw, 5.6rem); }
.anzeige-lg { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.6rem); line-height: 1.04; }
.anzeige-md { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.5rem); line-height: 1.08; }
.sc-body { color: var(--sc-ink-soft); font-size: var(--sc-t-lg); line-height: 1.55; }
@media (max-width: 700px) {
  .anzeige-xl { font-size: clamp(2.2rem, 1.3rem + 5vw, 3rem); }
  .anzeige-lg { font-size: clamp(1.75rem, 1.2rem + 3vw, 2.3rem); }
  .sc-body { font-size: 1.06rem; }
}
:where(.kelvin, [data-kelvin], [data-prozent], .stufen span) { font-variant-numeric: tabular-nums; }

/* ---------- Kopf und Dimmer ---------- */
.kopf {
  position: fixed; inset: 0 auto auto 0; z-index: var(--sc-z-chrome);
  padding: 22px var(--sc-gutter);
  opacity: calc(1 - var(--still) * .6); transition: opacity 300ms var(--sc-ease-out);
}
.wortmarke {
  font: 700 21px/1 var(--sc-font-display); letter-spacing: -0.035em;
  color: var(--sc-ink); text-decoration: none;
}
.dimmer {
  position: fixed; top: 0; left: 50%; translate: -50% 0; z-index: var(--sc-z-chrome);
  width: 150px; height: 104px;
  opacity: calc(1 - var(--still) * .55); transition: opacity 300ms var(--sc-ease-out);
}
.dimmer:hover, .dimmer:focus-within { opacity: 1; }
.dimmer__scheibe {
  position: absolute; left: 50%; top: 0; translate: -50% 0; width: 132px; height: 75px;
  cursor: grab; touch-action: none; border-radius: 0 0 70px 70px;
}
.dimmer__scheibe.ist-gezogen { cursor: grabbing; }
.dimmer__scheibe svg { width: 100%; height: 100%; overflow: visible; }
.dimmer__teller {
  fill: var(--sc-surface);
  stroke: color-mix(in oklab, var(--sc-ink) 18%, transparent); stroke-width: 1;
  filter: drop-shadow(0 4px 10px hsl(var(--schatten-farbe) / .22));
}
.dimmer__bahn { fill: none; stroke: color-mix(in oklab, var(--sc-ink) 16%, transparent); stroke-width: 3; stroke-linecap: round; }
.dimmer__bahn-voll { fill: none; stroke: var(--sc-accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; }
[data-dimmer-zeiger] line { stroke: var(--sc-ink); stroke-width: 3; stroke-linecap: round; }
.dimmer__nabe { fill: var(--licht); stroke: color-mix(in oklab, var(--sc-ink) 30%, transparent); stroke-width: 1; }
.dimmer__rasten { list-style: none; margin: 0; padding: 0; }
.dimmer__rasten li {
  position: absolute; left: 50%; top: 0;
  translate: calc(-50% + var(--x) * 62px) calc(-50% + var(--y) * 62px * 1.02);
}
.dimmer__rasten a {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  text-decoration: none; color: var(--sc-ink);
}
.dimmer__rasten a::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: color-mix(in oklab, var(--sc-ink) 35%, transparent);
  transition: background-color 160ms var(--sc-ease-out), scale 160ms var(--sc-ease-out);
}
.dimmer__rasten a.ist-hier::before { background: var(--sc-accent); scale: 1.4; }
.dimmer__rasten span {
  position: absolute; top: 100%; left: 50%; translate: -50% 2px; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--sc-ink); opacity: 0; pointer-events: none;
  transition: opacity 160ms var(--sc-ease-out);
}
.dimmer__rasten a:focus-visible span { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .dimmer__rasten a:hover span { opacity: 1; } .dimmer__rasten a:hover::before { scale: 1.4; } }
.dimmer__wert {
  position: absolute; left: 50%; top: 82px; translate: -50% 0; margin: 0; white-space: nowrap;
  font-size: 13px; font-weight: 500; color: var(--sc-ink-soft); font-variant-numeric: tabular-nums;
}
.dimmer__wert b { color: var(--sc-ink); font-weight: 700; }

@media (max-width: 420px) {
  .dimmer { scale: .84; transform-origin: 50% 0; }
  .wortmarke { font-size: 18px; }
  .kopf { padding-top: 18px; }
}

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 24px; border-radius: var(--rund);
  font: 700 1rem/1 var(--sc-font-text); text-decoration: none; white-space: nowrap; cursor: pointer;
  color: var(--sc-ink); background: transparent;
  border: 1.5px solid color-mix(in oklab, var(--sc-ink) 60%, transparent);
  transition: transform 140ms var(--sc-ease-out), border-color 160ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out);
}
.knopf:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) {
  .knopf:hover { border-color: var(--sc-accent); background: color-mix(in oklab, var(--sc-accent) 10%, transparent); }
}
.knopf--voll {
  position: relative; overflow: hidden; isolation: isolate;
  color: var(--sc-accent-ink); background: var(--sc-accent); border-color: var(--sc-accent);
}
.knopf--voll::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .3) 50%, transparent 65%) -200% 0 / 200% 100% no-repeat,
    repeating-linear-gradient(90deg, rgb(0 0 0 / .06) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(0deg, rgb(0 0 0 / .06) 0 1px, transparent 1px 6px);
  animation: streif 4.8s var(--sc-ease-in-out) infinite;
}
@keyframes streif { 0%, 55% { background-position: -200% 0, 0 0, 0 0; } 100% { background-position: 200% 0, 0 0, 0 0; } }
@media (hover: hover) and (pointer: fine) {
  .knopf--voll:hover { background: color-mix(in oklab, var(--sc-accent) 88%, var(--sc-ink)); }
}

/* ---------- Leuchte und Glimmen (überall gleich gebaut) ---------- */
.glimmen {
  position: absolute; left: 50%; top: 86%; width: 260%; aspect-ratio: 1; translate: -50% -50%;
  background: radial-gradient(closest-side, rgb(var(--licht-rgb) / calc(var(--glanz) * var(--hell) * .9 + var(--glanz) * .25)), rgb(var(--licht-rgb) / 0) 70%);
  pointer-events: none;
}
.leuchte-bild, .tag__leuchte img, .stufe__leuchte img {
  position: relative; width: 100%; height: auto;
  filter: brightness(calc(.72 + var(--hell) * .28));
}

/* Das Opalglas nimmt die Lichtfarbe an: eine Tönung genau in der Form der Leuchte. */
.tag__leuchte::after, .stufe__leuchte::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 900 / 1553;
  background: var(--licht); mix-blend-mode: multiply; opacity: calc(.12 + var(--d) * .6);
  -webkit-mask: url(assets/leuchte.webp) 0 0 / 100% 100% no-repeat; mask: url(assets/leuchte.webp) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}

/* ---------- 1 · Tageslicht ---------- */
.tag { background: transparent; }
.tag__wand { /* Fensterlicht von links, das mit dem Abend verschwindet */
  position: absolute; inset: -12% -5%;
  background:
    linear-gradient(100deg, rgb(255 255 255 / calc(var(--tag) * .55)) 0 18%, transparent 46%),
    radial-gradient(60% 50% at 70% 72%, rgb(var(--licht-rgb) / calc(var(--glanz) * .35)), transparent 70%);
}
.tag__wand::after { /* feiner Putz */
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(color-mix(in oklab, var(--sc-ink) 9%, transparent) 1px, transparent 1.3px);
  background-size: 5px 5px; mask-image: radial-gradient(80% 70% at 60% 40%, #000, transparent);
}
.tag__leuchte {
  position: absolute; top: 0; right: 13vw; width: min(33rem, 52vh); max-width: none;
}
.tag__leuchte img { max-width: none; }
.tag__text {
  position: absolute; left: var(--sc-gutter); bottom: clamp(3rem, 13vh, 8rem); z-index: var(--sc-z-copy);
  max-width: min(36rem, 46vw);
}
.tag__text h1 { max-width: 11ch; }
.tag__text .sc-body { margin-top: var(--sc-5); max-width: 34ch; }
.tag__text .knopf { margin-top: var(--sc-6); }
@media (max-width: 860px) {
  .tag__leuchte { right: auto; left: 50%; top: -14vh; margin-left: calc(min(12rem, 30vh) / -2); width: min(12rem, 30vh); }
  .tag__text { max-width: none; right: var(--sc-gutter); bottom: clamp(1.5rem, 6vh, 3rem); }
}

/* ---------- 2 · Kurve ---------- */
.kurve__raster {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sc-7) var(--sc-6); align-items: start;
}
.kurve__text { grid-column: 1 / span 6; }
.kurve__text .sc-body { max-width: 46ch; }
.kurve__bild { grid-column: 8 / span 5; grid-row: 1 / span 2; margin: 0; }
.kurve__bild img, .teil img {
  width: 100%; height: auto; border-radius: var(--rund);
  filter: brightness(var(--foto-hell)) sepia(var(--foto-warm)) saturate(calc(1 + var(--foto-warm) * .4));
  box-shadow: 0 calc(10px + var(--d) * 22px) calc(24px + var(--d) * 40px) hsl(var(--schatten-farbe) / .22);
}
.kurve__diagramm { grid-column: 1 / span 7; margin: 0; }
.kurve__diagramm svg { width: 100%; height: auto; overflow: visible; }
.achse line { stroke: color-mix(in oklab, var(--sc-ink) 30%, transparent); stroke-width: 1; }
.achse text, .linie__name { fill: var(--sc-ink-soft); font: 500 13px var(--sc-font-text); font-variant-numeric: tabular-nums; }
.linie { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.linie--led { stroke: color-mix(in oklab, var(--sc-ink) 40%, transparent); stroke-dasharray: 6 7; stroke-width: 2; }
.linie--glimm { stroke: var(--sc-accent); stroke-dasharray: 1; }
.linie__name--glimm { fill: var(--sc-ink); font-weight: 700; opacity: var(--zug, 1); }
.kurve__punkt { fill: var(--licht); stroke: var(--sc-ink); stroke-width: 2; opacity: var(--zug, 1); }
.kurve__diagramm figcaption { margin-top: var(--sc-3); font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
@media (max-width: 860px) {
  .kurve__raster { grid-template-columns: 1fr; }
  .kurve__text, .kurve__bild, .kurve__diagramm { grid-column: 1; grid-row: auto; }
  .kurve__bild { max-width: 22rem; }
}

/* ---------- 3 · Teile (pan) ---------- */
.teile { display: flex; align-items: center; }
.schiene {
  display: flex; align-items: flex-start; gap: clamp(1.5rem, 3vw, 3.5rem);
  padding: 0 var(--sc-gutter); width: max-content;
}
.teil { width: clamp(15rem, 22vw, 21rem); margin-top: 8vh; }
.teil:nth-child(odd) { margin-top: 15vh; }
.teil figure { margin: 0 0 var(--sc-4); }
.teil img { aspect-ratio: 4 / 5; object-fit: cover; }
.teil h3 { margin: 0 0 var(--sc-2); font: 700 1.35rem/1.15 var(--sc-font-display); letter-spacing: -0.02em; color: var(--sc-ink); }
.teil p:not(.sc-display) { margin: 0; color: var(--sc-ink-soft); font-size: 1rem; line-height: 1.55; max-width: 34ch; }
.teil--kopf { width: clamp(17rem, 30vw, 30rem); margin-top: 22vh; }
.teil--kopf .sc-body { margin-top: var(--sc-5); }
.teil--schluss { width: clamp(14rem, 22vw, 22rem); margin-top: 30vh; }
.teil--schluss .sc-display { margin: 0; }
@media (max-height: 760px) { .teil { margin-top: 10vh; } .teil:nth-child(odd) { margin-top: 13vh; } .teil img { aspect-ratio: 1; } .teil--kopf { margin-top: 18vh; } }
@media (max-width: 700px) {
  .teil, .teil:nth-child(odd) { width: 74vw; margin-top: 14vh; }
  .teil img { aspect-ratio: 5 / 4; }
  .teil--kopf { width: 80vw; margin-top: 18vh; }
}

/* ---------- 4 · Um neun ---------- */
.neun { padding-block: clamp(1.5rem, 4vw, 4rem) clamp(6rem, 18vw, 14rem); }
.neun__wrap h2 { max-width: 14ch; }
.neun__wrap .sc-body { margin-top: var(--sc-5); }

/* ---------- 5 · Abend (Höhepunkt) ---------- */
.abend { background: rgb(var(--grund-rgb)); }
.raum { position: absolute; inset: -5% 0; }
.raum__bild { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 45%; }
.raum__bild--2 { opacity: var(--raum2); }
.raum__bild--3 { opacity: var(--raum3); }
.raum__glimmen { /* das Licht der Leuchte, live in Kelvin über dem Bild */
  position: absolute; left: 50%; top: 24%; width: 60vmax; aspect-ratio: 1; translate: -50% -50%;
  background: radial-gradient(closest-side, rgb(var(--licht-rgb) / calc(.1 + var(--hell) * .12)), transparent 70%);
  mix-blend-mode: screen; pointer-events: none;
}
.kegel { /* zuletzt bleibt nur der Tisch im Licht */
  position: absolute; inset: 0; opacity: var(--kegel); pointer-events: none;
  background: radial-gradient(ellipse 34% 26% at 50% 62%, transparent 0 30%, rgb(var(--grund-rgb) / .88) 100%);
}
.abend__text { position: absolute; left: var(--sc-gutter); bottom: clamp(2rem, 9vh, 6rem); z-index: var(--sc-z-copy); width: min(32rem, 80vw); }
.abend__text .band { position: absolute; left: 0; bottom: 0; width: 100%; }
.band {
  padding: var(--sc-5) var(--sc-5) var(--sc-6);
  border-radius: var(--rund);
  background: rgb(var(--grund-rgb) / .9);
  box-shadow: inset 0 1px 0 color-mix(in oklab, var(--sc-ink) 8%, transparent);
}
.band .sc-body, .tischkarte .sc-body { margin-top: var(--sc-3); font-size: 1.1rem; }
.tischkarte {
  position: absolute; left: var(--sc-gutter); top: clamp(7rem, 18vh, 10rem); z-index: var(--sc-z-copy);
  width: min(26rem, 80vw);
}
@media (max-width: 860px) {
  .raum__bild { object-position: 50% 45%; }
  .abend__text { width: auto; right: var(--sc-gutter); }
  .tischkarte { top: auto; bottom: clamp(1.5rem, 5vh, 3rem); right: var(--sc-gutter); width: auto; }
  .kegel { background: radial-gradient(ellipse 60% 22% at 50% 60%, transparent 0 30%, rgb(var(--grund-rgb) / .9) 100%); }
}

/* ---------- 6 · Deine Stufe ---------- */
.stufe { position: relative; overflow: clip; min-height: 100svh; padding-bottom: 0; display: flex; flex-direction: column; }
.stufe__wrap { position: relative; flex: 1; display: grid; grid-template-columns: 7fr 5fr; gap: var(--sc-7); align-items: end; }
.stufe__inhalt { grid-column: 1; grid-row: 1; padding-bottom: var(--sc-6); }
.stufe__inhalt h2 { max-width: 12ch; }
.stufe__leuchte { grid-column: 2; grid-row: 1; position: relative; align-self: start; width: min(22rem, 100%); justify-self: center; margin-top: calc(var(--sc-section) * -1); }
.stufe__kegel {
  position: absolute; left: 50%; top: 96%; width: 240%; height: 70vh; translate: -50% 0;
  background: radial-gradient(ellipse 34% 60% at 50% 0%, rgb(var(--licht-rgb) / calc(.06 + var(--glanz) * .2 * (1 - var(--hell) * .4))), transparent 70%);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.stufen { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: var(--sc-6) !important; max-width: 50rem; }
.stufen button {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: 4px; justify-items: start; text-align: left;
  padding: 14px 12px 12px; min-height: 64px; border-radius: var(--rund); cursor: pointer;
  background: var(--sc-surface); color: var(--sc-ink);
  border: 1.5px solid color-mix(in oklab, var(--sc-ink) 14%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in oklab, var(--sc-ink) 6%, transparent);
  transition: transform 140ms var(--sc-ease-out), border-color 160ms var(--sc-ease-out);
}
.stufen button::before { /* feines Putzraster in jeder Fläche */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .6;
  background-image: radial-gradient(color-mix(in oklab, var(--sc-ink) 10%, transparent) 1px, transparent 1.3px);
  background-size: 6px 6px; mask-image: linear-gradient(160deg, #000, transparent 75%);
}
.stufen button:active { transform: translateY(1px); }
.stufen b { font: 700 1rem/1.1 var(--sc-font-display); letter-spacing: -0.01em; }
.stufen span { font-size: 12px; white-space: nowrap; color: var(--sc-ink-soft); }
.stufen button[aria-checked="true"] { border-color: var(--sc-accent); box-shadow: inset 0 0 0 1px var(--sc-accent); }
.stufen button[aria-checked="true"] b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--sc-accent); vertical-align: middle; }
@media (hover: hover) and (pointer: fine) { .stufen button:hover { border-color: color-mix(in oklab, var(--sc-accent) 70%, transparent); } }
.stufe__angebot { max-width: 44ch; color: var(--sc-ink); font-size: var(--sc-t-lg); line-height: 1.5; margin-top: var(--sc-6) !important; }
.stufe__inhalt .knopf { margin-top: var(--sc-5); }
.stufe__hinweis { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); max-width: 50ch; }
.fuss {
  display: flex; justify-content: space-between; gap: var(--sc-5); flex-wrap: wrap; align-items: baseline;
  padding: var(--sc-5) var(--sc-gutter) var(--sc-6); max-width: var(--sc-maxw); width: 100%; margin-inline: auto;
  border-top: 1px solid color-mix(in oklab, var(--sc-ink) 12%, transparent);
  font-size: var(--sc-t-sm); color: var(--sc-ink-soft);
}
.fuss .wortmarke { font-size: 17px; }
@media (max-width: 860px) {
  .stufe__wrap { grid-template-columns: 1fr; gap: 0; }
  .stufe__leuchte { grid-column: 1; grid-row: 1; width: 9.5rem; margin-top: calc(var(--sc-section) * -1); }
  .stufe__inhalt { grid-row: 2; }
  .stufen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stufen button:last-child { grid-column: span 2; }
}

/* ---------- Ruhige Fassung ---------- */
@media (prefers-reduced-motion: reduce) {
  .knopf--voll::before { animation: none; }
  .kopf, .dimmer { transition: none; }
}
