/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- theme ---------- */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --ink-soft: #555555;
  --pink: #ff2ea3;
  --pink-2: #ff5ab8;
  --pink-soft: #ffe6f3;
  --card-bg: #ffffff;
  --card-border: rgba(0,0,0,0.06);
  --card-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --radius-lg: 22px;
  --radius-md: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- page shell ---------- */
.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(12px, 3vw, 40px) clamp(16px, 2.5vw, 40px) clamp(24px, 4vw, 48px);
}

/* ---------- dachmarke ---------- */
.dachmarke {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 24px);
  margin: 0 auto clamp(4px, 1vw, 12px);
}

.dachmarke-line {
  flex: 1 1 auto;
  max-width: 260px;
  height: 1px;
  background: #000;
  opacity: 0.9;
}

.dachmarke-text {
  flex: 0 0 auto;
  letter-spacing: 0.18em;
  font-size: clamp(11px, 1.4vw, 14px);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- hero (kontroller-by-alion.png) ----------
   The source PNG is 9:16 with ~76% empty margins around the actual motif
   (motif bounding box: 941 × 405 within a 941 × 1672 canvas, vertically centered).
   The container is sized to the motif's true aspect ratio and crops the empty
   margins away using object-fit: cover — the source file itself is untouched. */
.hero {
  margin: clamp(6px, 1.5vw, 18px) auto clamp(14px, 3vw, 32px);
  text-align: center;
  max-width: 520px;
  aspect-ratio: 941 / 405;
  overflow: hidden;
}
.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* ---------- media grid ---------- */
.media {
  display: grid;
  /* audio card ~1.6x the width of a single video card on desktop */
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: clamp(16px, 2.5vw, 32px);
  align-items: start;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- video card ---------- */
.card--video {
  padding: 0;
  position: relative;
}
.card--video video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #111;
  border-radius: var(--radius-lg);
  display: block;
}
/* big centered pre-play button (desktop + mobile).
   Only the round button captures pointer events — the rest of the video is
   free for the seek bar and (on mobile) tap-to-pause. */
.video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  /* no transition: overlay disappears instantly on tap */
}
.video-overlay-icon {
  font-size: 30px;
  line-height: 1;
  margin-left: 4px;
  pointer-events: none;
}
.card--video.is-playing .video-overlay {
  display: none;
}

/* ---------- custom video control bar (desktop + mobile) ---------- */
.video-controls {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  z-index: 2;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.22s ease;
}
/* Auto-hide only fades the bar out — pointer-events stay active so a tap on
   the hidden seek area still seeks (and simultaneously reveals the bar). */
.card--video.controls-hidden .video-controls {
  opacity: 0;
}
.vc-btn {
  background: transparent;
  border: 0;
  color: #fff;
  padding: 4px;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex: 0 0 auto;
}
.vc-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 4px;
}
.vc-time {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  min-width: 30px;
  text-align: center;
  flex: 0 0 auto;
}
/* Seek row: 4px visible track inside a 22px-tall touch/click zone
   so it's easy to hit with a finger on mobile. */
.vc-seek {
  position: relative;
  flex: 1 1 auto;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  background: transparent;
}
.vc-seek::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  pointer-events: none;
}
.vc-seek-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  width: 0%;
  background: #fff;
  border-radius: 999px;
  pointer-events: none;
}
.vc-seek:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}
/* z-index: the initial mobile play overlay must sit ABOVE the bar visually
   but below it click-wise once playing. keep both in same layer, overlay wins
   only while visible (pointer-events: none after is-playing). */
.video-overlay { z-index: 3; }

/* No volume/mute button anywhere — device/OS handles volume. */
.vc-mute { display: none; }

/* ---------- audio card ---------- */
.card--audio {
  padding: clamp(18px, 2.5vw, 28px);
  gap: 14px;
  align-items: center;
  text-align: center;
  justify-content: flex-start;
  /* auto height (only as tall as content); vertically centered in the grid row */
  align-self: center;
}
/* full-width elements inside the audio card must span the card, not shrink to
   content, so they still work under align-items: center on the card itself */
.card--audio .audio-waveform,
.card--audio .audio-times,
.card--audio .audio-button {
  align-self: stretch;
}

.audio-cover {
  /* mobile default: ~60% wider than the previous 90px cap (aim ~140-165px) */
  width: clamp(140px, 44%, 170px);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: #f4f4f6;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-top: 4px;
}
.audio-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.audio-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2px;
}
.audio-title {
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.audio-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.audio-format {
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--ink-soft);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 999px;
  padding: 4px 10px;
  margin-top: 14px; /* keeps mobile spacing identical to previous layout */
  align-self: center;
}

/* waveform */
.audio-waveform {
  position: relative;
  width: 100%;
  height: 44px;
  margin-top: 6px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.audio-waveform-bars {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    var(--pink) 0 2px,
    transparent 2px 5px
  );
  -webkit-mask-image: linear-gradient(
    to top,
    transparent 0%,
    #000 30%,
    #000 70%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to top,
    transparent 0%,
    #000 30%,
    #000 70%,
    transparent 100%
  );
  opacity: 0.55;
}
.audio-waveform-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background-image: repeating-linear-gradient(
    to right,
    var(--pink) 0 2px,
    transparent 2px 5px
  );
  -webkit-mask-image: linear-gradient(
    to top,
    transparent 0%,
    #000 30%,
    #000 70%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to top,
    transparent 0%,
    #000 30%,
    #000 70%,
    transparent 100%
  );
  transition: width 0.1s linear;
}
.audio-waveform:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.audio-times {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  margin-top: -4px;
}

.audio-button {
  margin-top: 10px;
  width: 100%;
  padding: 14px 18px;
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s ease, transform 0.05s ease;
}
.audio-button:hover { background: var(--pink-2); }
.audio-button:active { transform: translateY(1px); }
.audio-button-icon { font-size: 12px; }

/* ---------- desktop-only: horizontal audio-card layout ---------- */
@media (min-width: 901px) {
  .card--audio {
    display: grid;
    /* Cover + Meta form a content-sized group centered inside the card via
       two 1fr buffer columns on the outside; wave/times/btn still span full width. */
    grid-template-columns: 1fr minmax(0, 280px) minmax(0, 220px) 1fr;
    grid-template-areas:
      ".    cover meta ."
      "wave wave  wave wave"
      "times times times times"
      "btn  btn   btn  btn";
    column-gap: clamp(10px, 1vw, 16px);
    row-gap: 16px;
    align-items: start;
    text-align: left;
  }
  .card--audio .audio-cover {
    grid-area: cover;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    margin: 0;
    border-radius: 18px;
  }
  .card--audio .audio-meta {
    grid-area: meta;
    align-self: center;
    align-items: flex-start;
    text-align: left;
    margin-top: 0;
    gap: 0;
  }
  .card--audio .audio-title  { font-size: clamp(22px, 1.9vw, 30px); }
  .card--audio .audio-sub    { font-size: 15px; margin-top: 4px; }
  .card--audio .audio-format { margin-top: 14px; align-self: flex-start; }
  .card--audio .audio-waveform { grid-area: wave; }
  .card--audio .audio-times    { grid-area: times; }
  .card--audio .audio-button   { grid-area: btn; }
}

/* ---------- responsive: tablet ---------- */
@media (max-width: 900px) {
  .media {
    grid-template-columns: 1fr 1fr;
  }
  .card--audio { grid-column: 1 / -1; max-width: 480px; margin: 0 auto; width: 100%; }
}

/* ---------- responsive: mobile ---------- */
@media (max-width: 640px) {
  .page {
    padding: 12px 16px 28px;
  }
  .dachmarke-line { max-width: 80px; }
  .dachmarke { margin: 0 auto 4px; }
  .hero {
    margin: 6px auto 14px;
    max-width: 86%;
  }
  .media {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .card--audio { max-width: 100%; }
  /* Cover ~72% of the card's inner (content-box) width on mobile, centered. */
  .card--audio .audio-cover {
    width: clamp(180px, 72%, 240px);
  }
  .card--video video {
    max-height: 80vh;
    width: 100%;
    margin: 0 auto;
  }
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: clamp(32px, 6vw, 72px);
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #000;
  opacity: 0.4;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .audio-waveform-fill { transition: none; }
}
