/* ---------------------------------------------------------------------------
   KLANGZEIT — Warteseite

   Eigenständig, ohne Tailwind und ohne Next. Die Werte sind dieselben wie in
   `styles/tokens.css` (Ebene 1, dort in OKLCH mit Messbelegen), hier als Hex,
   weil diese Datei auf einem schlichten Webserver ohne Bauschritt liegt.
--------------------------------------------------------------------------- */

@font-face {
  font-family: "Jost";
  src: url("/schrift/jost.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/schrift/newsreader.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --onyx-950: #0f0f11;
  --onyx-900: #16161a;
  --onyx-800: #26262c;
  --gold: #d6c79e;
  --gold-quiet: #b99b63;
  --parchment: #f5f1e8;
  --mute: #a8a29a;
  --linie: rgb(214 199 158 / 0.22);

  --display: "Jost", "Century Gothic", Futura, ui-sans-serif, system-ui, sans-serif;
  --body: "Newsreader", "Iowan Old Style", Georgia, serif;

  --rand: clamp(1.25rem, 4vw, 3rem);
  --kopf: 4.5rem;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--onyx-950);
  color: var(--parchment);
  font-family: var(--body);
  font-size: clamp(1rem, 0.97rem + 0.16vw, 1.1rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.label {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 450;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ Kopf -- */

.seite {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.kopf {
  position: relative;
  z-index: 3;
  min-height: var(--kopf);
  padding: 1.1rem var(--rand) 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

/* Das ganze Siegel — Ring, Mandala, Schrift. Lesbar ab rund 110 px
   (gemessen, siehe `.kz-fuss-siegel` in globals.css), deshalb nie kleiner.
   Die Fläche ist ein Verlauf statt einer Farbe: so liegt Licht auf dem
   Gold wie auf getriebenem Messing. */
.siegel {
  display: block;
  flex: none;
  width: 8.75rem;
  aspect-ratio: 1;
  /* Der Verlauf ist dreimal so breit wie das Siegel; `--licht` schiebt ihn
     — so wandert beim Anschlagen und Kreisen Licht über das Gold. */
  background: linear-gradient(115deg, #a88a52 0%, #d6c79e 18%, #f3ead2 26%, #c9b07a 36%, #a88a52 50%, #d6c79e 68%, #f3ead2 76%, #c9b07a 86%, #a88a52 100%) var(--licht, 0%) 50% / 300% 100%;
  -webkit-mask: url("/marke/wortmarke.svg") center / contain no-repeat;
  mask: url("/marke/wortmarke.svg") center / contain no-repeat;
  filter: drop-shadow(0 2px 14px rgb(0 0 0 / 0.5));
}

.signet {
  display: block;
  width: 2.9rem;
  aspect-ratio: 1909 / 1146;
  background-color: currentColor;
  -webkit-mask: url("/marke/signet.svg") center / contain no-repeat;
  mask: url("/marke/signet.svg") center / contain no-repeat;
}

.ton {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--linie);
  border-radius: 999px;
  background: rgb(15 15 17 / 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--mute);
  font: inherit;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}
.ton:hover {
  color: var(--parchment);
  border-color: rgb(214 199 158 / 0.5);
}
.ton svg {
  width: 1.05rem;
  height: 1.05rem;
}
.ton[aria-pressed="false"] .welle {
  opacity: 0;
}
.ton .welle {
  transition: opacity 0.3s;
}

/* ------------------------------------------------------------------ Raum -- */

/* Das Dach der Jurte, stark abgedunkelt — man liegt darunter und schaut
   hinauf. Der Dachkranz steht über der Schale (Lage in main.js gerechnet);
   die Stangen laufen von dort aus wie die Ringe. Schlägt man die Schale an,
   glimmt der Raum kurz auf (`--glut`). */
.raum {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--onyx-950);
}
.raum-bild {
  position: absolute;
  inset: 0;
  background: url("/bilder/raum-900.webp") var(--raum-pos, 39% 48%) / var(--raum-groesse, cover) no-repeat;
  filter: saturate(0.6) sepia(0.18) brightness(0.36) contrast(1.08);
  transform-origin: var(--raum-mitte, 39% 48%);
  animation: atmen 48s ease-in-out infinite alternate;
}
@media (min-width: 900px) {
  .raum-bild {
    background-image: url("/bilder/raum-1600.webp");
  }
}
@keyframes atmen {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.045);
  }
}
/* Schleier: unten und zum Text hin dunkler, damit Schrift auf dem Bild
   immer auf ruhigem Grund steht. */
.raum::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at var(--raum-mitte, 50% 30%), rgb(15 15 17 / 0.3) 0%, rgb(15 15 17 / 0.6) 100%),
    linear-gradient(to bottom, rgb(15 15 17 / 0.35) 0%, rgb(15 15 17 / 0.2) 30%, rgb(15 15 17 / 0.88) 62%, rgb(15 15 17 / 0.96) 100%);
}
.raum-glut {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse 55% 45% at var(--raum-mitte, 50% 30%), rgb(255 190 120 / 0.2), transparent 70%);
  opacity: var(--glut, 0);
  mix-blend-mode: screen;
}
.recht-seite .raum::after {
  background: rgb(15 15 17 / 0.9);
}

/* Korn: ein feines Rauschen über allem, wie auf Film. */
.korn {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.rahmen {
  display: none;
}

/* ----------------------------------------------------------------- Bühne -- */

.haupt {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.buehne {
  position: relative;
  height: max(64svh, 420px);
  margin-top: calc(var(--kopf) * -1);
  isolation: isolate;
}

/* Ein warmer Lichthof dort, wo die Schale steht — auch schon vor dem Laden. */
.spalte {
  display: none;
}

.buehne::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    ellipse 46% 48% at var(--siegel-x, 50%) var(--siegel-y, 54%),
    rgb(214 170 110 / 0.11),
    transparent 70%
  );
}

.buehne canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  pointer-events: none;
}

/* Das Siegel als Klangquelle. Der Knopf ist größer als das Siegel, damit
   das Kreisen Platz hat; außerhalb davon scrollt die Seite normal. */
.buehne {
  --siegel-gr: min(64vw, 17.5rem);
  --siegel-y: 54%;
}
.schale {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: var(--siegel-y);
  translate: -50% -50%;
  width: calc(var(--siegel-gr) * 1.4);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.schale:focus-visible {
  outline-offset: -10px;
}
.siegel-gross {
  width: var(--siegel-gr);
  filter: drop-shadow(0 4px 24px rgb(0 0 0 / 0.65)) drop-shadow(0 0 1px rgb(0 0 0 / 0.8));
  will-change: transform;
}
.schale:hover .siegel-gross {
  --licht: 18%;
}

.hinweis {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: calc(var(--siegel-y) + var(--siegel-gr) * 0.62);
  translate: -50% 0;
  width: max-content;
  max-width: calc(100% - 2 * var(--rand));
  margin: 0;
  color: var(--mute);
  font-size: 0.92rem;
  font-style: italic;
  text-align: center;
  text-wrap: balance;
  transition: opacity 1.2s;
  pointer-events: none;
}
.hinweis .fein {
  display: none;
}
@media (pointer: fine) {
  .hinweis .grob {
    display: none;
  }
  .hinweis .fein {
    display: inline;
  }
}
.beruehrt .hinweis {
  opacity: 0.45;
}

/* ------------------------------------------------------------------ Text -- */

.text {
  position: relative;
  z-index: 1;
  padding: 2.5rem var(--rand) 3rem;
  max-width: 40rem;
}

.eyebrow {
  margin: 0 0 1.1rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.3rem, 1.5rem + 3.6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.satz {
  margin: 1.25rem 0 0;
  max-width: 34ch;
  color: rgb(245 241 232 / 0.82);
  font-size: 1.12em;
  text-wrap: pretty;
}

.kontakt {
  margin: 2.75rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.25rem;
}
.kontakt > div {
  padding-top: 0.9rem;
  border-top: 1px solid var(--linie);
}
.kontakt dt {
  color: var(--mute);
  margin-bottom: 0.3rem;
}
.kontakt dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.kontakt a {
  text-decoration: none;
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat;
  transition: background-size 0.35s ease-out, color 0.3s;
  padding-bottom: 1px;
}
.kontakt a:hover {
  color: var(--gold);
  background-size: 100% 1px;
}
@media (max-width: 359.98px) {
  .kontakt {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------- Fuß -- */

.fuss {
  padding: 1.5rem var(--rand) 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  color: var(--mute);
  font-size: 0.85rem;
}
.fuss nav {
  display: flex;
  gap: 1.25rem;
}
.fuss a {
  text-decoration: none;
}
.fuss a:hover {
  color: var(--parchment);
}
.fuss .lizenz {
  flex-basis: 100%;
  font-size: 0.78rem;
  opacity: 0.8;
}
.fuss .lizenz a {
  text-decoration: underline;
  text-decoration-color: var(--linie);
  text-underline-offset: 2px;
}

/* -------------------------------------------------- Breit: zwei Spalten -- */

@media (min-width: 1024px) {
  :root {
    --kopf: 5.5rem;
  }
  .kopf {
    padding-top: 1.75rem;
  }
  .fuss {
    padding-bottom: 2.75rem;
  }
  /* Ein Haarlinienrahmen um die ganze Seite — wie ein Passepartout. */
  .rahmen {
    display: block;
    position: fixed;
    inset: 0.9rem;
    z-index: 40;
    pointer-events: none;
    border: 1px solid rgb(214 199 158 / 0.14);
  }
  .raum::after {
    background:
      radial-gradient(ellipse 45% 60% at var(--raum-mitte, 30% 45%), rgb(15 15 17 / 0.3) 0%, rgb(15 15 17 / 0.55) 100%),
      linear-gradient(to right, rgb(15 15 17 / 0.1) 0%, rgb(15 15 17 / 0.25) 40%, rgb(15 15 17 / 0.86) 62%, rgb(15 15 17 / 0.93) 100%),
      linear-gradient(to bottom, transparent 70%, rgb(15 15 17 / 0.7) 100%);
  }
  .haupt {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    min-height: calc(100svh - var(--kopf) - 5rem);
  }
  /* Die Bühne liegt unter der ganzen Breite; die Schale steht über der
     linken Spalte (Kameraversatz in main.js). */
  .buehne {
    position: absolute;
    inset: calc(var(--kopf) * -1) 0 0 0;
    margin: 0;
    height: auto;
    margin: 0;
    z-index: 0;
  }
  .spalte {
    display: block;
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    min-height: 32rem;
  }
  .text {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 1;
    padding: 0 var(--rand) 0 0;
  }
  /* Das Siegel steht über der Mitte der linken Spalte (1,25 von 2,25). */
  .buehne {
    --siegel-gr: min(30vw, 26rem, 52svh);
    --siegel-x: calc(100% * 1.25 / 2.25 / 2);
    --siegel-y: 50%;
  }
  .schale,
  .hinweis {
    left: var(--siegel-x);
  }
}

/* ------------------------------------------------------- Rechtliches -- */

.recht {
  flex: 1;
  padding: 2rem var(--rand) 4rem;
  max-width: 46rem;
}
.recht h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
}
.recht section {
  margin-top: 2.5rem;
}
.recht h2 {
  margin: 0 0 0.75rem;
  color: var(--gold);
}
.recht p {
  margin: 0 0 0.9rem;
  color: rgb(245 241 232 / 0.85);
}
.recht address {
  font-style: normal;
}
.recht .leise {
  color: var(--mute);
  font-size: 0.9rem;
}
.zurueck {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--mute);
  text-decoration: none;
}
.zurueck:hover {
  color: var(--parchment);
}

@media (prefers-reduced-motion: reduce) {
  .raum-bild {
    animation: none;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
