/* ==========================================================================
   SCENE AFFAIRS – Projektseiten
   Baut auf styles.css auf (Farben, Schrift, Header, Buttons, Footer).
   ========================================================================== */

:root {
  color-scheme: dark;
}

body {
  min-width: 320px;
}

[data-project-page] {
  padding: 0 var(--page-pad);
}

/* ---------- Kopfbereich: Text links, Titelbild rechts ---------- */

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(36px, 6vw, 110px);
  min-height: min(100svh, 980px);
  padding: clamp(120px, 12vw, 170px) 0 clamp(64px, 7vw, 110px);
}

.project-hero-text {
  display: grid;
  justify-items: start;
  min-width: 0;
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(28px, 4vw, 48px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 200ms ease;
}

.project-back span {
  transition: transform 300ms var(--ease-out);
}

.project-back:hover,
.project-back:focus-visible {
  color: var(--ink);
}

.project-back:hover span,
.project-back:focus-visible span {
  transform: translateX(-4px);
}

.project-hero h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(54px, 7.4vw, 124px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.project-meta {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.project-intro {
  max-width: 54ch;
  margin: clamp(26px, 3vw, 40px) 0 0;
  color: rgba(245, 244, 241, 0.84);
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.65;
}

.project-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(30px, 3.4vw, 44px);
}

.project-hero-actions .button[hidden] {
  display: none;
}

.project-hero-actions .button-primary:hover > span:last-child,
.project-hero-actions .button-primary:focus-visible > span:last-child {
  transform: translateY(3px);
}

/* Titelbild: vollständig sichtbar, nicht beschnitten */

.project-cover {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 4 / 5;
  justify-self: end;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-cover img[hidden] {
  display: none;
}

.project-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.project-placeholder[hidden] {
  display: none;
}

.project-placeholder strong {
  color: var(--ink);
  font-size: 24px;
}

/* ---------- Text "Die Idee dahinter" ---------- */

.project-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 24px clamp(32px, 5vw, 90px);
  padding: clamp(56px, 6vw, 96px) 0;
  border-top: 1px solid var(--line);
}

.project-story[hidden] {
  display: none;
}

.project-story h2,
.project-story p {
  margin: 0;
}

.project-story h2 {
  font-size: clamp(32px, 3.4vw, 52px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.project-story p {
  max-width: 60ch;
  color: rgba(245, 244, 241, 0.84);
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.65;
}

[data-project-missing] {
  min-height: 70svh;
  align-content: center;
  padding: 160px var(--page-pad) 80px;
}

/* ---------- Abschnittsüberschriften ---------- */

.project-section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
  margin-bottom: clamp(28px, 3vw, 44px);
}

.project-section-heading h2 {
  margin: 0;
  font-size: clamp(36px, 4vw, 64px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.project-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Videos & Bilder ---------- */

.project-media {
  padding: clamp(56px, 6vw, 96px) 0;
  border-top: 1px solid var(--line);
}

.project-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: clamp(14px, 1.6vw, 24px);
  align-items: start;
}

.project-media-item {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
}

.project-media-item.is-landscape {
  grid-column: span 2;
}

.project-media-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  overflow: hidden;
}

.project-media-item.is-landscape .project-media-frame {
  aspect-ratio: 16 / 9;
}

.project-media-item.is-square .project-media-frame {
  aspect-ratio: 1 / 1;
}

.project-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 800ms var(--ease-out);
}

.project-video-link {
  position: absolute;
  inset: 0;
  display: block;
}

.project-video-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.5) 100%);
}

.project-video-play {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: var(--accent-action);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  transition: transform 420ms var(--ease-out), background 300ms ease;
}

.project-video-play span {
  position: absolute;
  left: 26px;
  top: 21px;
  border-left: 16px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}

.project-video-link:hover img,
.project-video-link:focus-visible img {
  transform: scale(1.04);
}

.project-video-link:hover .project-video-play,
.project-video-link:focus-visible .project-video-play {
  transform: scale(1.1);
}

.project-video-link:focus-visible {
  outline: none;
}

.project-media-item:focus-within .project-media-frame {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.project-media-item figcaption {
  display: grid;
  gap: 6px;
  padding: 0 2px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-media-title {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.project-media-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.project-media-views {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.project-media-views::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(253, 7, 26, 0.6);
}

.project-media-empty .project-media-frame {
  aspect-ratio: 16 / 9;
}

.project-media-empty figcaption {
  color: var(--muted);
  font-weight: 400;
}

/* ---------- Weitere Projekte ---------- */

.project-more {
  padding: clamp(56px, 6vw, 96px) 0 clamp(72px, 8vw, 120px);
  border-top: 1px solid var(--line);
}

.project-more[hidden] {
  display: none;
}

.project-more-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: background 220ms ease, color 220ms ease;
}

.project-more-all:hover,
.project-more-all:focus-visible {
  background: var(--ink);
  color: var(--bg);
}

.project-more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
}

.project-more-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  color: var(--ink);
}

.project-more-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: var(--surface-strong);
  overflow: hidden;
}

.project-more-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease-out);
}

.project-more-arrow {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 17px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform 520ms var(--ease-out), background 300ms ease;
}

.project-more-text {
  display: grid;
  gap: 4px;
  padding: 0 2px;
}

.project-more-text strong {
  font-size: clamp(22px, 2vw, 30px);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.project-more-text small {
  color: var(--muted);
  font-size: 14px;
}

.project-more-card:hover .project-more-media img,
.project-more-card:focus-visible .project-more-media img {
  transform: scale(1.04);
}

.project-more-card:hover .project-more-arrow,
.project-more-card:focus-visible .project-more-arrow {
  background: var(--accent-action);
  transform: rotate(45deg);
}

.project-more-card:focus-visible {
  outline: none;
}

.project-more-card:focus-visible .project-more-media {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- Einblenden ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .project-hero-text > *,
  .js .project-hero .project-cover {
    animation: project-enter 900ms var(--ease-out) both;
  }

  .js .project-hero-text > :nth-child(2) { animation-delay: 60ms; }
  .js .project-hero-text > :nth-child(3) { animation-delay: 120ms; }
  .js .project-hero-text > :nth-child(4) { animation-delay: 180ms; }
  .js .project-hero-text > :nth-child(5) { animation-delay: 240ms; }
  .js .project-hero .project-cover { animation-delay: 160ms; }

  .js .project-reveal:not(.project-cover) {
    opacity: 0;
    transform: translateY(24px);
  }

  .js .project-reveal.is-visible:not(.project-cover) {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
  }
}

@keyframes project-enter {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Tablet ---------- */

@media (max-width: 980px) {
  .project-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 48px;
  }

  .project-cover {
    justify-self: start;
    max-width: 520px;
  }

  .project-story {
    grid-template-columns: 1fr;
  }
}

/* ---------- Handy ---------- */

@media (max-width: 680px) {
  .project-hero {
    padding-top: 104px;
    gap: 36px;
  }

  .project-hero h1 {
    font-size: clamp(46px, 14vw, 64px);
  }

  .project-hero-actions {
    display: grid;
    width: 100%;
  }

  .project-hero-actions .button {
    width: 100%;
  }

  .project-cover {
    max-width: none;
  }

  .project-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .project-media-item.is-landscape {
    grid-column: 1 / -1;
  }

  .project-video-play {
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
  }

  .project-video-play span {
    left: 21px;
    top: 17px;
    border-left-width: 13px;
    border-top-width: 9px;
    border-bottom-width: 9px;
  }

  .project-media-item figcaption {
    font-size: 14px;
  }

  .project-more-grid {
    display: flex;
    margin-inline: calc(0px - var(--page-pad));
    padding: 0 var(--page-pad) 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--page-pad);
    scrollbar-width: none;
  }

  .project-more-grid::-webkit-scrollbar {
    display: none;
  }

  .project-more-card {
    flex: 0 0 72%;
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
