/* ============================================================
   COMPONENTS.CSS — Navigation, Cursor Bubble, Toggle Button
   Luis Praxmarer Portfolio 2026
   ============================================================ */

/* ── Web-Component-Wrapper neutralisieren ────────────────── */
site-nav,
site-footer {
  display: contents;
}

/* ── Navigation ──────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-20) var(--grid-margin);
  z-index: 100;
  pointer-events: none; /* allow click-through on hero */
}

.nav__logo,
.nav__link {
  pointer-events: all;
  cursor: default;
  font-size: var(--text-body-medium-size);
  font-weight: var(--text-body-medium-weight);
  line-height: var(--text-body-medium-line-height);
  letter-spacing: var(--text-body-medium-letter-spacing);
  font-variation-settings: var(--font-opsz);
  color: var(--color-white);
  mix-blend-mode: difference;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  align-items: flex-end;
  gap: var(--space-40);
}

.nav__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Underline: right-to-left on hover, stays on active */
.nav__link {
  position: relative;
  display: inline-block;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--color-white);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--duration-med) var(--ease-smooth);
}

.nav__link:hover::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.nav__link.active::after {
  transform: scaleX(1);
  transform-origin: left center;
}

/* ── Toggle Button (Visuals / Projects) ──────────────────── */
.toggle-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  /* visual footprint after rotation: 40px wide × 96px tall */
  width: var(--toggle-btn-h);
  height: var(--toggle-btn-w);
  pointer-events: all;
  cursor: default;
  transition: right var(--duration-slide) var(--ease-smooth),
              left  var(--duration-slide) var(--ease-smooth);
}

/* Projects view: Visuals-Button bündig am RECHTEN Rand */
.toggle-btn.side--right {
  right: 0;
  left: auto;
}

/* Visuals view: Projects-Button bündig am LINKEN Rand */
.toggle-btn.side--left {
  left: 0;
  right: auto;
}

.toggle-btn__inner {
  /* pre-rotation size: 96×40 → after -90deg: 40×96 visually (vertikale Pille) */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  width: var(--toggle-btn-w);
  height: var(--toggle-btn-h);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Schwarzes rechteckiges Tab am Rand — Kontur bleibt auf Schwarz sichtbar */
  border-radius: 0;
  background: var(--color-black);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Nur die inneren (zur Seitenmitte zeigenden) Ecken leicht runden → Tab sitzt
   bündig am Rand. Ecken-Mapping beachtet die -90°-Rotation des Inner-Elements:
   pre-rotation TOP-Ecken → Bildschirm-LINKS, BOTTOM-Ecken → Bildschirm-RECHTS. */
.toggle-btn.side--right .toggle-btn__inner { border-radius: 6px 6px 0 0; }
.toggle-btn.side--left  .toggle-btn__inner { border-radius: 0 0 6px 6px; }

.toggle-btn__text {
  font-size: var(--text-body-medium-size);
  font-weight: var(--text-body-medium-weight);
  letter-spacing: var(--text-body-medium-letter-spacing);
  font-variation-settings: var(--font-opsz);
  color: var(--color-white);
  white-space: nowrap;
  position: relative;
  z-index: 1;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.toggle-btn:hover .toggle-btn__text {
  opacity: 0.7;
}

/* ── Cursor Bubble (Liquid Glass) ────────────────────────── */
.cursor-bubble {
  position: fixed;
  width: var(--bubble-size);
  height: var(--bubble-size);
  border-radius: var(--radius-round);
  pointer-events: none;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) scale(0);
  transition: transform var(--duration-med) var(--ease-smooth),
              opacity  var(--duration-med) var(--ease-smooth);
  opacity: 0;

  /* Liquid Glass effect */
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.1);
}


.cursor-bubble.is-visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.cursor-bubble__text {
  font-size: var(--text-body-medium-size);
  font-weight: var(--text-body-medium-weight);
  letter-spacing: var(--text-body-medium-letter-spacing);
  font-variation-settings: var(--font-opsz);
  color: var(--color-white);
  text-align: center;
  line-height: 1.3;
  padding: 0 10px;
  position: relative;
  z-index: 1;
}

/* ── Home Title (fixed, bottom-left) ─────────────────────── */
/* padding-bottom + ausgeglichenes `bottom`: erweitert den overflow-Clip
   nach unten, damit Unterlängen (z.B. tiefgestellte ₂ in „CO₂") NICHT
   abgeschnitten werden — Titel bleibt optisch an gleicher Position. */
.home-title {
  position: fixed;
  bottom: calc(var(--grid-margin) - 8px);
  left: var(--grid-margin);
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
  padding-bottom: 8px;
}

.home-title__text {
  display: block;
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  line-height: var(--text-h2-line-height);
  letter-spacing: var(--text-h2-letter-spacing);
  font-variation-settings: var(--font-opsz);
  color: var(--color-white);
  mix-blend-mode: difference;
  white-space: nowrap;
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.home-title__text.is-changing {
  opacity: 0;
  transform: translateY(6px);
}

/* ─── Project Card (global — Work + künftige Projektseiten) ─ */

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-card__image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #2a2a2a;
  margin-bottom: var(--space-16);
}

.project-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card__title {
  font-family: var(--font-primary);
  font-size: var(--text-lead-size);
  font-weight: var(--text-lead-weight);
  line-height: var(--text-lead-line-height);
  letter-spacing: var(--text-lead-letter-spacing);
  font-variation-settings: var(--font-opsz);
  color: var(--color-white);
  margin-bottom: 2px;
}

.project-card__sub {
  font-family: var(--font-primary);
  font-size: var(--text-lead-size);
  font-weight: var(--text-lead-weight);
  line-height: var(--text-lead-line-height);
  letter-spacing: var(--text-lead-letter-spacing);
  font-variation-settings: var(--font-opsz);
  color: rgba(255, 255, 255, 0.35);
  transition: color var(--duration-fast) var(--ease-out);
}

/* Hover: Subline (Function and Work) wird weiss — global, überall gleich */
.project-card:hover .project-card__sub {
  color: var(--color-white);
}

/* ─── Footer (global — alle Seiten ausser Home) ──────────── */

.site-footer {
  height: 144px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 var(--grid-margin);
  border-top: 1px solid var(--color-dark-gray-border);
}

.site-footer__text {
  font-family: var(--font-primary);
  font-size: var(--text-small-size);
  font-weight: var(--text-small-weight);
  line-height: var(--text-small-line-height);
  letter-spacing: var(--text-small-letter-spacing);
  font-variation-settings: var(--font-opsz);
  color: rgba(255, 255, 255, 0.35);
}


/* ─── Burger + Overlay-Menü (nur Mobile) ─────────────────── */

.nav__burger {
  display: none;            /* Desktop: versteckt */
  position: relative;
  pointer-events: all;
  width: 28px;
  height: 16px;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-white);
  mix-blend-mode: difference;   /* sichtbar über Hero + auf schwarzen Seiten */
}

/* Zwei Striche — gleiche Dicke wie das X (1.5px). Morphen zum X. */
.nav__burger-bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: top var(--duration-med) var(--ease-smooth),
              transform var(--duration-med) var(--ease-smooth);
}

.nav__burger-bar:nth-child(1) { top: 0; }
.nav__burger-bar:nth-child(2) { top: calc(100% - 1.5px); }

.nav-menu {
  display: none;            /* Desktop: versteckt */
}


/* ─── Mobile-Layout (≤768px) ─────────────────────────────── */

@media (max-width: 768px) {
  /* Nav: Inline-Links weg, Burger zeigen */
  .nav__links { display: none; }
  .nav__burger { display: flex; }

  /* Vollbild-Overlay-Menü */
  .nav-menu {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--color-black);
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--duration-med) var(--ease-smooth),
                visibility 0s linear var(--duration-med);
  }

  .nav-menu.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity var(--duration-med) var(--ease-smooth),
                visibility 0s linear 0s;
  }

  /* Nav (Logo + Burger) bleibt über dem Overlay sichtbar + klickbar */
  body.menu-open .nav { z-index: 400; }

  /* Burger morpht zum X: Striche fahren zur Mitte + rotieren */
  body.menu-open .nav__burger-bar:nth-child(1) {
    top: calc(50% - 0.75px);
    transform: rotate(45deg);
  }
  body.menu-open .nav__burger-bar:nth-child(2) {
    top: calc(50% - 0.75px);
    transform: rotate(-45deg);
  }

  /* grosse Menü-Liste unten links (wie Referenz) */
  .nav-menu__list {
    position: absolute;
    left: var(--grid-margin);
    bottom: var(--space-normal);
    display: flex;
    flex-direction: column;
  }

  .nav-menu__list a {
    font-family: var(--font-primary);
    font-size: var(--text-h1-size);
    font-weight: var(--text-h1-weight);
    line-height: 1.12;
    letter-spacing: var(--text-h1-letter-spacing);
    font-variation-settings: var(--font-opsz);
    color: var(--color-white);
  }

  /* Cursor-Bubble (Desktop-Hover) auf Touch ausblenden */
  .cursor-bubble { display: none !important; }

  /* Toggle-Button bleibt auch auf Mobile das seitliche Tab (rechts = Visuals,
     links = Projects), vertikal zentriert am Rand — NICHT mehr unten zentriert.
     Erbt Desktop-Styling (schwarzes Tab, Seiten-Position, Rotation). */
}


/* ── <project-video> — Custom Player (Schwarz/Weiss) ───────── */

project-video { display: block; }

.vplayer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-black);
  overflow: hidden;
}

.vplayer__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vplayer:fullscreen .vplayer__video { object-fit: contain; }

/* Loop-Variante (Visuals): nur Video, kein UI */
.vplayer--loop { cursor: pointer; }

/* Grosse Play-Taste in der Mitte (nur wenn pausiert) */
.vplayer__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.vplayer__overlay-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: var(--radius-round);
  background: var(--color-black);
  color: var(--color-white);
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.vplayer__overlay-circle svg { width: 34px; height: 34px; margin-left: 3px; }

.vplayer__overlay:hover .vplayer__overlay-circle { transform: scale(1.06); }

/* Beim Abspielen: grosse Taste weg, Overlay bleibt klickbar (Pause) */
.vplayer[data-state="playing"] .vplayer__overlay-circle {
  opacity: 0;
  pointer-events: none;
}

/* Control-Leiste unten */
.vplayer__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  color: var(--color-white);
  opacity: 1;
  transition: opacity var(--duration-med) var(--ease-smooth);
  z-index: 2;
}

/* Auto-Hide während Wiedergabe (idle) */
.vplayer--idle .vplayer__controls { opacity: 0; }
.vplayer--idle { cursor: none; }

/* Fortschrittsbalken (dünne Linie, volle Breite) */
.vplayer__progress {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  touch-action: none;
}
.vplayer__progress-filled {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--color-white);
}
.vplayer__progress-filled::after {     /* Drag-Punkt am Playhead */
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-round);
  background: var(--color-white);
  transform: translate(50%, -50%) scale(0);
  transition: transform var(--duration-fast) var(--ease-out);
}
.vplayer__progress:hover .vplayer__progress-filled::after {
  transform: translate(50%, -50%) scale(1);
}

/* Untere Button-Reihe */
.vplayer__bar {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.vplayer__spacer { flex: 1; }

.vplayer__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--color-white);
  cursor: pointer;
  opacity: 0.9;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.vplayer__btn:hover { opacity: 1; }
.vplayer__btn svg { width: 22px; height: 22px; }

.vplayer__time {
  font-size: var(--text-xsmall-size);
  font-variation-settings: var(--font-opsz);
  color: var(--color-white);
  opacity: 0.85;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Volume-Slider (Schwarz/Weiss) */
.vplayer__volume {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}
.vplayer__volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-round);
  background: var(--color-white);
  border: 0;
}
.vplayer__volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: var(--radius-round);
  background: var(--color-white);
}

@media (max-width: 768px) {
  .vplayer__overlay-circle { width: 64px; height: 64px; }
  .vplayer__overlay-circle svg { width: 26px; height: 26px; }
  .vplayer__time { display: none; }     /* Platz sparen auf Mobile */
  .vplayer__volume { width: 56px; }
}


/* ── <video-slider> — Player-Slider mit Chevron-Navigation ──── */
/* Gleicher vplayer wie <project-video>, mehrere Slides hintereinander.
   Statischer Titel oben, statische Bildlegende + Zähler unten. */

video-slider { display: block; }

.vslider { width: 100%; }

/* Titel oberhalb — gleicher linker Einzug wie Text-Module (grid-margin) */
.vslider__title {
  color: var(--color-white);
  padding: 0 var(--grid-margin);
  margin-bottom: var(--space-16);
}

/* Bühne: zeigt genau einen Player, Rest liegt horizontal daneben */
.vslider__stage {
  position: relative;
  overflow: hidden;
}

.vslider__track {
  display: flex;
  transform: translateX(0);
  transition: transform var(--duration-slide) var(--ease-smooth);
}

.vslider__slide {
  flex: 0 0 100%;
  min-width: 0;
}

/* Chevron-Buttons (schwarzer Kreis, weisses Icon — wie Play-Taste) */
.vslider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-round);
  background: var(--color-black);
  color: var(--color-white);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.vslider__nav:hover { opacity: 1; transform: translateY(-50%) scale(1.06); }
.vslider__nav svg { width: 26px; height: 26px; }
.vslider__nav--prev { left: var(--space-16); }
.vslider__nav--next { right: var(--space-16); }

/* Inaktive Slides werden vom overflow:hidden der Bühne geclippt;
   Interaktion mit den Off-Screen-Playern unterbinden */
.vslider__slide[aria-hidden="true"] * { pointer-events: none; }

/* Legende-Zeile (Bildlegende links, Zähler rechts) — gleicher Einzug wie
   Text-Module (grid-margin). Mehr Abstand zum Video oben (space-small),
   UNTEN bewusst mehr (space-padding-1) → grenzt sich klar vom Content ab. */
.vslider__legend {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-small) var(--grid-margin) var(--space-basic);
}

.vslider__caption {
  color: var(--color-white);
  max-width: var(--grid-text-width-2);
}

.vslider__counter {
  flex-shrink: 0;
  color: var(--color-bright-font);
  font-variant-numeric: tabular-nums;
}

/* Bild-Rahmen im <image-slider> — 16:9-Bühne, Bild wird NICHT beschnitten
   (contain); 16:9-Quellen füllen randlos, abweichende bekommen schmale Ränder. */
image-slider { display: block; }

.vslider__frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-black);
}
.vslider__frame > picture { display: block; width: 100%; height: 100%; }
.vslider__frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 768px) {
  .vslider__nav { width: 44px; height: 44px; }
  .vslider__nav svg { width: 22px; height: 22px; }
  .vslider__nav--prev { left: var(--space-8); }
  .vslider__nav--next { right: var(--space-8); }
}


/* ── <loop-video> — Video als „bewegtes Bild" ────────────────
   Füllt seine Zelle wie ein <img> (in .media-row / .media-item).
   Kein UI, keine Interaktion. */
loop-video {
  display: block;
  width: 100%;
  height: 100%;
}

loop-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
