/* ============================================================
   EINBLICKE PAGE — "The Reel" · filmstrip-as-hero
   ============================================================ */

:root {
  --color-page: oklch(78% 0.11 75);
  --reel-strip-bg: #05080d;
  /* "fixed light" — never flips in [data-theme="light"]. Used for text
     and icons that always sit over the always-dark filmstrip surface. */
  --color-fixed-light: #f2f6f8;
}

/* Marquee accent */
.marquee-track span { color: color-mix(in srgb, var(--color-page) 60%, transparent); }
.marquee-track span::after { color: var(--color-teal-lt); }

/* ============================================================
   1 · HERO STAGE — full viewport with background image
   ============================================================ */
.reel-scroll-space {
  position: relative;
}
.reel-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--space-md) + 80px) 0 var(--space-lg);
  background: var(--color-bg);
  overflow: hidden;
  isolation: isolate;
  color: var(--color-white);
}

/* background image — full-bleed, dimmed, atmospheric */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.32) saturate(0.6) contrast(1.05);
  transform: scale(1.02);  /* hide filter edges */
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 55% at 50% 50%, transparent 0%, color-mix(in srgb, var(--color-bg) 45%, transparent) 60%, color-mix(in srgb, var(--color-bg) 85%, transparent) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-bg) 55%, transparent) 0%, color-mix(in srgb, var(--color-bg) 25%, transparent) 45%, color-mix(in srgb, var(--color-bg) 75%, transparent) 100%);
  pointer-events: none;
}

/* ambient noise overlay */
.reel-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   2 · MAIN COLUMN — strip + intro centered vertically
   ============================================================ */
.reel-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(28px, 4.5vw, 64px);
  position: relative;
  z-index: 2;
}

/* ============================================================
   3 · THE RAIL — clean dark stage + side arrows
   ============================================================ */
.reel-rail-wrap {
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--reel-strip-bg) 30%, transparent);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-block: 1px solid color-mix(in srgb, var(--color-white) 6%, transparent);
  padding-block: clamp(24px, 3.6vw, 48px);
  box-shadow: 0 40px 100px -30px color-mix(in srgb, var(--reel-strip-bg) 85%, transparent),
              0 -20px 60px -40px color-mix(in srgb, var(--reel-strip-bg) 70%, transparent),
              inset 0 1px 0 color-mix(in srgb, var(--color-white) 4%, transparent);
}

/* vignette gutters so clips fade into darkness at the edges */
.reel-rail-wrap::before,
.reel-rail-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(80px, 12vw, 160px);
  pointer-events: none;
  z-index: 3;
}
.reel-rail-wrap::before {
  left: 0;
  background: linear-gradient(to right, color-mix(in srgb, var(--reel-strip-bg) 35%, transparent) 0%, color-mix(in srgb, var(--reel-strip-bg) 35%, transparent) 15%, transparent 100%);
}
.reel-rail-wrap::after {
  right: 0;
  background: linear-gradient(to left, color-mix(in srgb, var(--reel-strip-bg) 35%, transparent) 0%, color-mix(in srgb, var(--reel-strip-bg) 35%, transparent) 15%, transparent 100%);
}

/* side arrows — pinned to the edges, floating in the vignette */
.reel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(44px, 4vw, 56px);
  height: clamp(44px, 4vw, 56px);
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--color-bg) 72%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-white);
  cursor: pointer;
  z-index: 5;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}
.reel-arrow.prev { left: clamp(16px, 3vw, 48px); }
.reel-arrow.next { right: clamp(16px, 3vw, 48px); }
.reel-arrow:hover {
  background: var(--color-page);
  border-color: var(--color-page);
  color: var(--reel-strip-bg);
  transform: translateY(-50%) scale(1.06);
}
.reel-arrow:active { transform: translateY(-50%) scale(0.96); }
.reel-arrow:focus-visible {
  outline: 2px dashed var(--color-page);
  outline-offset: 3px;
}
.reel-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}
.reel-arrow i,
.reel-arrow svg { width: 22px; height: 22px; }

/* horizontal scrolling rail */
.reel-rail {
  display: flex;
  gap: clamp(18px, 2.2vw, 32px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding-inline: max(var(--page-padding), calc(50% - min(22vw, 280px)));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  outline: none;
}
.reel-rail::-webkit-scrollbar { display: none; }
/* JS owns scrolling on desktop (lerp) and mobile (sticky-mapped) — turn snap off so it doesn't fight */
.reel-rail.js-active { scroll-snap-type: none; }
.reel-rail:focus-visible {
  outline: 2px solid var(--color-page);
  outline-offset: 4px;
  border-radius: 2px;
}

/* clip — the film cel */
.reel-clip {
  flex: 0 0 auto;
  width: clamp(220px, 24vw, 340px);
  scroll-snap-align: center;
  opacity: 0.32;
  transform: scale(0.9);
  /* filter is applied as a steady state, not transitioned: forcing <video>
     off the GPU video plane mid-transition causes paint jank */
  transition: opacity 0.25s var(--ease-out),
              transform 0.35s var(--ease-out);
  filter: saturate(0.5) brightness(0.75);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.reel-clip.is-focused {
  opacity: 1;
  transform: scale(1);
  filter: none;
  cursor: default;
  transition: opacity var(--t-med) var(--ease-out),
              transform 0.5s var(--ease-out);
}

.clip-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--reel-strip-bg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  border-radius: 2px;
  transition: border-color 0.35s var(--ease-out),
              box-shadow 0.5s var(--ease-out);
}
.reel-clip.is-focused .clip-frame {
  border-color: var(--color-page);
  box-shadow: 0 18px 60px -24px color-mix(in srgb, var(--reel-strip-bg) 90%, transparent);
}
.clip-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--reel-strip-bg);
  display: block;
}
/* Native fullscreen: the inline cels use object-fit:cover for the 9:16 frame,
   but Chromium/Safari carry that into fullscreen — a portrait clip on a
   landscape screen then gets magnified ~2.7× and cropped to a center band.
   Reset to contain so the whole frame letterboxes cleanly on a black field.
   Separate rules (not a list): an unknown pseudo would void the whole group. */
.clip-frame video:fullscreen { object-fit: contain; background: #000; }
.clip-frame video:-webkit-full-screen { object-fit: contain; background: #000; }
.clip-frame video:-moz-full-screen { object-fit: contain; background: #000; }

/* ── TITLE CARD ── TikTok-style bottom caption over the video ── */
.clip-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: clamp(12px, 1.8vw, 20px);
  background: linear-gradient(
    0deg,
    transparent 0%,
    transparent 40%,
    color-mix(in srgb, var(--reel-strip-bg) 35%, transparent) 65%,
    color-mix(in srgb, var(--reel-strip-bg) 88%, transparent) 100%
  );
  color: var(--color-fixed-light);
  text-align: left;
  z-index: 2;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out),
              transform 0.2s var(--ease-out);
}
.reel-clip.is-focused .clip-card {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s 0.15s var(--ease-out),
              transform 0.45s 0.15s var(--ease-out);
}
.reel-clip.is-playing .clip-card { opacity: 0; transform: translateY(-4px); }

.card-meta-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px color-mix(in srgb, var(--reel-strip-bg) 60%, transparent);
}
.card-tag {
  color: var(--color-fixed-light);
}
.card-tag::before {
  content: "#";
  color: var(--color-page);
  margin-right: 1px;
}

.card-quote {
  margin: 0 0 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-style: normal;
  font-size: clamp(0.88rem, 1.25vw, 1.02rem);
  line-height: 1.4;
  color: var(--color-fixed-light);
  letter-spacing: 0;
  text-shadow: 0 1px 3px color-mix(in srgb, var(--reel-strip-bg) 75%, transparent);
  max-width: 100%;
  overflow-wrap: break-word;
}

.card-meta-bot {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-fixed-light) 88%, transparent);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px color-mix(in srgb, var(--reel-strip-bg) 60%, transparent);
}

/* play glyph — minimal TikTok-style icon centered over the video */
.clip-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--color-fixed-light);
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  transform: scale(0.85);
  filter: drop-shadow(0 2px 10px color-mix(in srgb, var(--reel-strip-bg) 55%, transparent));
  transition: opacity 0.15s var(--ease-out),
              transform 0.15s var(--ease-out),
              color 0.2s var(--ease-out);
  pointer-events: none;
}
.clip-play i,
.clip-play svg { width: 44px; height: 44px; fill: currentColor; }
.reel-clip.is-focused .clip-play {
  opacity: 0.92;
  transform: scale(1);
  pointer-events: auto;
  transition: opacity var(--t-med) 0.2s var(--ease-out),
              transform var(--t-med) 0.2s var(--ease-out),
              color 0.2s var(--ease-out);
}
.reel-clip.is-focused .clip-play:hover,
.reel-clip.is-focused .clip-play:focus-visible {
  color: var(--color-page);
  opacity: 1;
}
.clip-play:focus-visible {
  outline: 2px dashed var(--color-page);
  outline-offset: 4px;
  border-radius: 50%;
}
.reel-clip.is-playing .clip-play,
.reel-clip.is-playing .clip-play:hover { opacity: 0; pointer-events: none; }

/* ── END-OF-STRIP CTA ── links to kontakt ── */
.reel-cta {
  flex: 0 0 auto;
  width: clamp(220px, 24vw, 340px);
  aspect-ratio: 9 / 16;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  background: color-mix(in srgb, var(--color-page) 6%, transparent);
  transition: background 0.35s var(--ease-out),
              border-color 0.35s var(--ease-out);
  scroll-snap-align: center;
}
.reel-cta:hover {
  background: color-mix(in srgb, var(--color-page) 12%, transparent);
  border-color: var(--color-page);
}
.reel-cta:focus-visible {
  outline: 2px dashed var(--color-page);
  outline-offset: 3px;
}
.reel-cta-tag {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-page);
}
.reel-cta-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.1;
  color: var(--color-fixed-light);
}
.reel-cta-arrow {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-page);
  transition: background 0.25s var(--ease-out),
              border-color 0.25s var(--ease-out),
              transform 0.25s var(--ease-out);
}
.reel-cta:hover .reel-cta-arrow {
  background: var(--color-page);
  border-color: var(--color-page);
  color: var(--reel-strip-bg);
  transform: translateX(4px);
}
.reel-cta-arrow i,
.reel-cta-arrow svg { width: 18px; height: 18px; }

/* ============================================================
   4 · PROGRESS BAR — slim indicator at the bottom of the strip
   ============================================================ */
.reel-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  overflow: hidden;
  z-index: 4;
}
.reel-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--color-page);
  box-shadow: 0 0 8px 0 color-mix(in srgb, var(--color-page) 40%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease-out);
}

/* ── SCROLL HINT — sits as a flow element inside .reel-intro, after the counter ── */
.reel-scroll-hint {
  margin-top: clamp(4px, 0.6vw, 10px);
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  color: color-mix(in srgb, var(--color-fixed-light) 55%, transparent);
  pointer-events: none;
  opacity: 0;
  animation: scrollHintFadeIn 0.6s 1.2s var(--ease-out) forwards;
  transition: opacity 0.45s var(--ease-out);
}
.reel-scroll-hint.is-dismissed {
  opacity: 0 !important;
  animation: none;
}
@keyframes scrollHintFadeIn {
  to { opacity: 1; }
}
@media (min-width: 769px) {
  /* desktop: pull the hint out of the intro flow and place it centered
     in the gap between the rail-wrap and the intro */
  .reel-scroll-hint {
    position: absolute;
    bottom: calc(100% + clamp(10px, 2.2vw, 24px));
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
  }
}
@media (max-width: 768px) {
  .reel-scroll-hint { font-size: 0.58rem; letter-spacing: 0.2em; }
}
@media (prefers-reduced-motion: reduce) {
  .reel-scroll-hint { animation: none; opacity: 0.7; transition: none; }
}

/* ============================================================
   5 · CLAIM + INTRO — title in rail, meta below strip
   ============================================================ */
.reel-claim {
  flex: 0 0 auto;
  width: clamp(260px, 30vw, 420px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-right: clamp(24px, 4vw, 64px);
  scroll-snap-align: start;
}
.reel-intro {
  position: relative;
  z-index: 2;
  padding: 0 var(--page-padding);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reel-spacer {
  opacity: 0;
  pointer-events: none;
}
.reel-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-page);
}
.reel-tag::before {
  content: "";
  width: 36px;
  height: 1px;
  background: currentColor;
}
.reel-counter {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}
.reel-counter .current { color: var(--color-page); font-weight: 600; }

.reel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 5.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--color-fixed-light);
  max-width: 16ch;
  margin: 0;
}
.reel-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--color-page);
}

/* ============================================================
   6 · LIGHT-THEME OVERRIDES
   ============================================================ */
[data-theme="light"] .reel-hero { color: var(--color-white); }
[data-theme="light"] .hero-bg img { filter: brightness(0.68) saturate(0.82) contrast(1.05); }
[data-theme="light"] .hero-bg::after {
  background:
    radial-gradient(ellipse 75% 55% at 50% 50%, transparent 0%, #1a181422 60%, #1a181440 100%),
    linear-gradient(180deg, #1a181435 0%, #1a181415 45%, #1a181448 100%);
}
[data-theme="light"] .reel-counter        { color: color-mix(in srgb, var(--color-fixed-light) 70%, transparent); }
[data-theme="light"] .reel-noise          { opacity: 0.03; mix-blend-mode: overlay; }

/* filmstrip glassmorphism in light mode — frosted, not dark */
[data-theme="light"] .reel-rail-wrap {
  background: #1a181418;
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border-block-color: #f2f6f828;
  box-shadow: 0 30px 80px -30px #1a181425,
              inset 0 1px 0 #f2f6f818;
}
[data-theme="light"] .reel-rail-wrap::before {
  background: linear-gradient(to right, #1a181418 0%, #1a181418 15%, transparent 100%);
}
[data-theme="light"] .reel-rail-wrap::after {
  background: linear-gradient(to left, #1a181418 0%, #1a181418 15%, transparent 100%);
}

/* ============================================================
   8 · RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .reel-clip { width: clamp(220px, 34vw, 300px); }
}

@media (max-width: 768px) {
  .reel-hero { padding: calc(var(--space-md) + 72px) 0 var(--space-md); }
  .reel-main { gap: clamp(22px, 4vw, 40px); }
  .reel-title { font-size: clamp(1.8rem, 7vw, 2.6rem); }
  .reel-claim {
    width: 85vw;
    min-height: 50vh;
    margin-right: 0;
    scroll-snap-align: center;
    align-items: center;
    text-align: center;
  }
  .reel-claim .reel-title { max-width: none; }
  .reel-clip { width: min(72vw, 280px); }
  .reel-rail {
    padding-inline: calc(50vw - min(36vw, 140px));
    scroll-snap-type: x mandatory;
  }
  .reel-cta { width: min(72vw, 280px); }
  .reel-arrow { width: 40px; height: 40px; }
  .reel-arrow.prev { left: 8px; }
  .reel-arrow.next { right: 8px; }
  .reel-rail-wrap::before,
  .reel-rail-wrap::after { width: 60px; }
  .card-quote { font-size: 0.92rem; }
}

/* ============================================================
   9 · MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reel-clip,
  .clip-frame,
  .clip-card,
  .clip-play,
  .reel-arrow,
  .reel-progress-bar { transition: none; }
}
