/* =============================================================================
   METRIK · AR-Erlebnis — Stylesheet
   =============================================================================
   Aufbau (zum schnellen Springen per Suche nach der Nummer):

     1  Design-Tokens .......... zentrale Farben (hier zuerst ändern)
     2  Basis / Reset .......... html, body, Grundeinstellungen
     3  Lade-Spinner ........... #loader / .spinner (bis Seite geladen)
     4  Start-Overlay .......... #start (Logo, Text, „Kamera aktivieren“)
     5  Hinweis-Banner ......... #hint (oben: „Kamera aufs Plakat …“)
     6  Button-Leiste .......... #ui + .btn (Showreel, Leistungen, Termin)
     7  Fehlermeldung .......... #err (helle Hinweiskarte)
     8  MindAR-Overrides ....... Scanning-Rahmen einfärben
     9  Interaktive Ebene ...... Overlays über dem Video (Claim, Hotspots,
                                 FAB-Menü, Video-Controls, End-CTA)

   Farben werden ausschließlich über die Tokens in Abschnitt 1 gesetzt —
   eine Änderung dort wirkt überall.
   ========================================================================== */


/* 1 — DESIGN-TOKENS ========================================================= */
:root{
  --ink:      #1d1d1d;              /* Text (METRIK-Schwarz)        */
  --mute:     #737373;              /* Sekundärtext                 */
  --accent:   #AFCB26;              /* METRIK-Grün (Logo-Stern)     */
  --accent-2: #5DBD3A;              /* Sekundär-Grün                */
  --panel:    rgba(255,255,255,.86);/* helles Glas-Panel (Buttons)  */
  --line:     rgba(0,0,0,.12);      /* dezente Kontur / Trennlinie  */
}


/* 2 — BASIS / RESET ========================================================= */
*{
  box-sizing: border-box;
}

html, body{
  margin: 0;
  height: 100%;
  background: transparent;         /* Hintergrund transparent      */
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}


/* 3 — LADE-SPINNER ========================================================== */
/* Liegt über allem, bis die Seite vollständig geladen ist (JS entfernt ihn). */
#loader{
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: opacity .45s ease;
}
#loader.hide{
  opacity: 0;
  pointer-events: none;
}

.spinner{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin{
  to{ transform: rotate(360deg); }
}


/* 4 — START-OVERLAY ========================================================= */
/* Wird erst nach dem Laden eingeblendet (.ready) und beim Start ausgeblendet. */
#start{
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 2rem;
  text-align: center;
  background: transparent;
  opacity: 0;                       /* Start: unsichtbar …          */
  transition: opacity .4s ease;
}
#start.ready{
  opacity: 1;                       /* … nach dem Laden sichtbar    */
}
#start .mark{
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.15rem;
}
#start .mark i{
  width: 14px;
  height: 36px;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
}
#start h1{
  margin: .2rem 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--ink);
}
#start p{
  margin: 0;
  max-width: 26rem;
  line-height: 1.5;
  color: var(--mute);
}
#startBtn{
  font-size: 1.05rem;
  padding: 1rem 1.6rem;
}


/* 5 — HINWEIS-BANNER (oben) ================================================= */
#hint{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  padding: .7rem 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,0));
  font-size: .9rem;
  color: var(--ink);
  text-align: center;
  pointer-events: none;
  transition: opacity .4s;
}
#hint .dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s infinite;
}
@keyframes pulse{
  0%, 100%{ opacity: .35; transform: scale(.8); }
  50%     { opacity: 1;   transform: scale(1.15); }
}


/* 6 — BUTTON-LEISTE (unten) ================================================= */
/* Fährt bei erkanntem Plakat von unten ein (.show). */
#ui{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  background: linear-gradient(0deg, rgba(255,255,255,.92), rgba(255,255,255,0));
  transform: translateY(120%);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
#ui.show{
  transform: translateY(0);
}

.btn{
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .8rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, background .2s;
}
.btn:active{
  transform: scale(.96);
}
.btn.primary{                       /* Haupt-Button: METRIK-Grün    */
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
.btn svg{
  width: 16px;
  height: 16px;
  fill: currentColor;
}


/* 7 — FEHLERMELDUNG ========================================================= */
/* Helle Karte oben; erscheint nur bei Kamera-/Ladeproblemen (JS steuert das). */
#err{
  position: fixed;
  left: 1rem; right: 1rem; top: 1rem;
  z-index: 50;
  display: none;
  padding: .9rem 1rem;
  border: 1px solid #ffbfb0;
  border-radius: 12px;
  background: #fff5f4;
  color: #8a2b1a;
  font-size: .88rem;
  line-height: 1.45;
  max-height: 70vh;
  overflow: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
}
#err b{
  color: #b3341c;
}
#err small{
  opacity: .7;
  font-size: .78rem;
}


/* 8 — MINDAR-OVERRIDES ====================================================== */
/* Scanning-Rahmen der MindAR-Bibliothek in METRIK-Grün einfärben. */
.mindar-ui-scanning .scanning .inner{
  border-color: var(--accent) !important;
}


/* 9 — INTERAKTIVE EBENE (über dem Video) ==================================== */
/* Gesamter Layer: liegt über der AR-Szene, wird bei erkanntem Plakat sichtbar.
   Container selbst „durchlässig“ — nur die Bedienelemente fangen Taps ab.      */
.ar-ui{
  position: fixed;
  inset: 0;
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.ar-ui.active{ opacity: 1; }
.ar-ui.active .fab,
.ar-ui.active .vcontrols,
.ar-ui.active .hotspot{ pointer-events: auto; }

/* 9.1 — Fortschrittsbalken (oben) */
.progress{
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(0,0,0,.08);
  z-index: 30;
}
.progress > span{
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .12s linear;
}

/* 9.2 — Lower-Third-Claim (wechselt im Takt) */
.claim{
  position: fixed;
  left: 50%;
  bottom: 24%;
  transform: translateX(-50%);
  z-index: 26;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: 86vw;
  padding: .6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
  transition: opacity .4s ease, transform .4s ease;
}
.claim.hide{
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}
.claim .star{ color: var(--accent); font-size: 1.1em; line-height: 0; }

/* 9.3 — Hotspots (pulsierende Punkte) */
.hotspot{
  position: fixed;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: #fff;
  cursor: pointer;
  z-index: 26;
  animation: hotspotPulse 1.8s ease-out infinite;
}
@keyframes hotspotPulse{
  0%  { box-shadow: 0 0 0 0 rgba(175,203,38,.55); }
  70% { box-shadow: 0 0 0 16px rgba(175,203,38,0); }
  100%{ box-shadow: 0 0 0 0 rgba(175,203,38,0); }
}

/* 9.4 — Info-Karte (Bottom-Sheet für Hotspots) */
.sheet{
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,.35);
  pointer-events: auto;   /* modaler Layer fängt Taps ab */
}
.sheet.open{ display: flex; }
.sheet-card{
  width: 100%;
  max-width: 520px;
  padding: 1.4rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 -10px 40px rgba(0,0,0,.2);
  transform: translateY(100%);
  transition: transform .35s ease;
}
.sheet.open .sheet-card{ transform: translateY(0); }
.sheet-card h2{ margin: 0 0 .5rem; font-size: 1.15rem; color: var(--ink); }
.sheet-card p{ margin: 0 0 1rem; color: var(--mute); line-height: 1.5; }
.sheet-close{
  float: right;
  width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: #f1f1f2; color: var(--ink);
  font-size: 1.1rem; cursor: pointer;
}

/* 9.5 — Video-Controls (unten links) */
.vcontrols{
  position: fixed;
  left: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 27;
  display: flex;
  gap: .5rem;
}
.vbtn{
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
}
.vbtn svg{ width: 20px; height: 20px; fill: currentColor; }

/* 9.6 — FAB-Menü (unten rechts) */
.fab{
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 28;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: .6rem;
}
.fab-toggle{
  width: 56px; height: 56px;
  border: 0; border-radius: 50%;
  background: var(--accent); color: var(--ink);
  font-size: 1.7rem; line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  transition: transform .3s ease;
}
.fab.open .fab-toggle{ transform: rotate(45deg); }
.fab-item{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  opacity: 0;
  transform: translateY(10px) scale(.92);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.fab.open .fab-item{
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.fab.open .fab-item:nth-child(1){ transition-delay: .02s; }
.fab.open .fab-item:nth-child(2){ transition-delay: .06s; }
.fab.open .fab-item:nth-child(3){ transition-delay: .10s; }
.fab-item svg{ width: 16px; height: 16px; fill: currentColor; }

/* 9.7 — End-CTA (nach dem Film) */
.endcta{
  position: fixed;
  inset: 0;
  z-index: 36;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(6px);
  pointer-events: auto;   /* modaler Layer fängt Taps ab */
}
.endcta.open{ display: flex; }
.endcta h2{ margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.endcta p{ margin: 0; color: var(--mute); max-width: 24rem; line-height: 1.5; }
.endcta .link{
  background: none; border: 0;
  color: var(--ink); text-decoration: underline;
  font-size: .95rem; cursor: pointer;
}
