/* ==========================================================================
   yourfamily kiosk — Scroll-Showcase
   ========================================================================== */

:root {
  --ink: #101418;
  --paper: #f4f6f4;
  --accent: #3aa655;            /* wird per JS pro Sorte überschrieben */
  --bg: #eaf4ec;                /* wird per JS pro Sorte überschrieben */
  --radius: 18px;
  --header-h: 72px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);            /* wird per GSAP animiert */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Preloader
   ========================================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--paper);
  color: var(--ink);
  transition: opacity .6s var(--ease), visibility .6s;
}
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader__logo { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .75; } }

.preloader__bar {
  width: min(280px, 60vw);
  height: 3px;
  border-radius: 3px;
  background: rgba(16, 20, 24, .12);
  overflow: hidden;
}
.preloader__bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--ink);
  transition: width .2s linear;
}
.preloader__text { font-size: 13px; letter-spacing: .08em; opacity: .6; }

/* ==========================================================================
   Header / Logo
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 48px);
  mix-blend-mode: multiply;      /* Logo passt sich dezent dem Hintergrund an */
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.logo__word {
  font-size: 19px;
  font-weight: 300;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.logo__word strong { font-weight: 800; }

.site-nav { display: flex; gap: clamp(14px, 3vw, 34px); }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  opacity: .72;
  transition: opacity .25s;
}
.site-nav a:hover { opacity: 1; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--header-h) + 20px) 20px 60px;
  position: relative;
}
.hero__title {
  font-size: clamp(44px, 9vw, 118px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.02;
  display: flex;
  flex-direction: column;
}
.hero__title span { display: block; }
.hero__sub {
  margin-top: 26px;
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 400;
  opacity: .65;
  max-width: 42ch;
}
.hero__scrollhint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  width: 26px; height: 42px;
  transform: translateX(-50%);
  border: 2px solid var(--ink);
  border-radius: 14px;
  opacity: .5;
}
.hero__scrollhint span {
  position: absolute;
  top: 7px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--ink);
  animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel {
  0%   { transform: translateY(0);    opacity: 1; }
  70%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 0; }
}

/* ==========================================================================
   Showcase (Sticky-Bühne)
   ========================================================================== */
.showcase { position: relative; }          /* Höhe kommt per JS */

.showcase__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

/* Riesiger Sortenname im Hintergrund */
.showcase__bigword {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(90px, 22vw, 320px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  opacity: .06;
  user-select: none;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Bühne: Canvas + Licht + Schatten ---------- */
.stage {
  position: relative;
  width: min(46vh, 82vw);
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  z-index: 2;
}

.stage__canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

#productCanvas {
  width: 100%;
  height: 100%;
  display: block;
  /* --- Studio-Look / Farbkorrektur ---
     Feinschliff auf dem bereits gegradeten Material: hell, knackig, satt. */
  filter: brightness(1.06) contrast(1.05) saturate(1.12);
  will-change: transform;
}

/* Optionales Licht-Overlay: legt einen kühlen, weichen Studio-Glanz
   über das Produkt (per CONFIG.studioLight ein-/ausschaltbar). */
.stage__light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background:
    radial-gradient(60% 45% at 50% 12%, rgba(255,255,255,.9), rgba(255,255,255,0) 70%),
    linear-gradient(180deg, rgba(190,215,255,.25), rgba(255,255,255,0) 45%);
  opacity: 0;
  transition: opacity .4s;
}
.stage__light.is-on { opacity: 1; }

/* Weicher Bodenschatten — Breite/Deckkraft wird per JS an die Drehung gekoppelt */
.stage__shadow {
  position: absolute;
  bottom: 4%;
  left: 50%;
  width: 62%;
  height: 26px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(10, 14, 18, .38) 0%,
    rgba(10, 14, 18, .16) 45%,
    rgba(10, 14, 18, 0) 72%);
  filter: blur(6px);
  z-index: 1;
  will-change: transform, opacity;
}

/* ---------- Sorten-Info-Karte ---------- */
.flavor-card {
  position: absolute;
  z-index: 3;
  left: clamp(20px, 6vw, 90px);
  bottom: clamp(28px, 8vh, 90px);
  max-width: 300px;
  will-change: transform, opacity;
}
.flavor-card__kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .55;
  margin-bottom: 8px;
}
.flavor-card__name {
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.04;
}
.flavor-card__desc {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.55;
  opacity: .72;
}
.flavor-card__price {
  margin-top: 14px;
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}

/* ---------- Sorten-Zähler ---------- */
.counter {
  position: absolute;
  right: clamp(16px, 4vw, 44px);
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  z-index: 3;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .28em;
  opacity: .55;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 2;
  padding: 110px 24px 90px;
  text-align: center;
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.site-footer__name { font-size: 22px; font-weight: 300; letter-spacing: -.02em; }
.site-footer__name strong { font-weight: 800; }
.site-footer__meta { font-size: 14px; font-weight: 500; }
.site-footer__meta--dim { opacity: .55; font-weight: 400; }

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 760px) {
  .site-nav { display: none; }
  .stage { width: min(40vh, 78vw); }
  .flavor-card {
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    text-align: center;
    max-width: 88vw;
  }
  .counter { right: 6px; }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__scrollhint, .preloader__logo { animation: none; }
}
