/* ================================
   Project Page Styles
   ================================ */

/* Navigation */
.project-nav {
  padding: var(--space-lg);
  position: relative;
  z-index: var(--z-above);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-out);
}

.back-link:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
  background: rgba(99, 102, 241, 0.1);
}

/* Hero Section */
.project-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-4xl);
}

.project-hero__image {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-2xl);
  box-shadow: var(--shadow-lg);
}

.project-hero__image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Badge - matches main page style */
.project-hero__badges {
  position: absolute;
  bottom: var(--space-lg);
  left: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  z-index: 10;
}

.project-hero__award {
  padding: var(--space-xs) var(--space-sm);
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  color: #000;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* ===== CRT Glitch-In Effect ===== */
.crt-glitch {
  position: relative;
}

.crt-glitch img {
  /* Start glitchy, then settle to normal with subtle flicker */
  animation: glitch-in 1.2s steps(1) forwards,
    crt-flicker 8s infinite 1.2s;
}

/* Glitch-in animation - digital corruption style */
@keyframes glitch-in {
  0% {
    opacity: 0;
    filter: brightness(0) contrast(1);
  }

  5% {
    opacity: 1;
    filter: brightness(2) contrast(0.5) saturate(0);
    clip-path: inset(0 0 80% 0);
  }

  10% {
    filter: brightness(0.3) contrast(2);
    clip-path: inset(40% 0 20% 0);
  }

  15% {
    filter: brightness(1.5) contrast(1.5) hue-rotate(180deg);
    clip-path: inset(0 0 0 0);
  }

  20% {
    filter: brightness(0.6) contrast(1.8);
    clip-path: inset(60% 0 10% 0);
  }

  25% {
    filter: brightness(1.8) contrast(0.8) hue-rotate(-90deg);
    clip-path: inset(10% 0 70% 0);
  }

  30% {
    filter: brightness(0.4) contrast(2) saturate(2);
    clip-path: inset(0 0 0 0);
  }

  40% {
    filter: brightness(1.4) contrast(1.3) hue-rotate(45deg);
    clip-path: inset(30% 0 30% 0);
  }

  50% {
    filter: brightness(1.2) contrast(1.2);
    clip-path: inset(0 0 0 0);
  }

  60% {
    filter: brightness(0.9) contrast(1.3) hue-rotate(15deg);
  }

  75% {
    filter: brightness(1.1) contrast(1.15);
  }

  100% {
    filter: brightness(1) contrast(1.1);
    clip-path: inset(0 0 0 0);
  }
}

/* Scanlines */
.crt-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.2) 0px,
      rgba(0, 0, 0, 0.2) 2px,
      transparent 2px,
      transparent 5px);
  z-index: 2;
}

/* CRT Overlay with RGB shift */
.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
  opacity: 0;
  animation: crt-rgb-intro 1.5s ease-out forwards,
    crt-rgb-glitch 6s infinite 1.5s;
}

/* RGB glitch during intro */
@keyframes crt-rgb-intro {
  0% {
    opacity: 0.9;
    background: linear-gradient(90deg,
        rgba(255, 0, 0, 0.6) 0%,
        transparent 33%,
        rgba(0, 255, 0, 0.6) 33%,
        transparent 66%,
        rgba(0, 0, 255, 0.6) 66%);
    clip-path: inset(0 0 0 0);
  }

  10% {
    opacity: 0.8;
    clip-path: inset(20% 0 60% 0);
  }

  20% {
    opacity: 0.7;
    clip-path: inset(50% 0 30% 0);
  }

  30% {
    opacity: 0.6;
    clip-path: inset(10% 0 70% 0);
  }

  45% {
    opacity: 0.4;
    clip-path: inset(40% 0 40% 0);
  }

  60% {
    opacity: 0.25;
    clip-path: inset(0 0 0 0);
  }

  100% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
  }
}

.crt-overlay::before,
.crt-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
}

/* Vignette effect */
.crt-glitch::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
  border-radius: inherit;
}

/* Subtle Flicker Animation - runs after glitch-in settles */
@keyframes crt-flicker {

  0%,
  100% {
    filter: brightness(1) contrast(1.1);
  }

  2% {
    filter: brightness(1.05) contrast(1.15);
  }

  4% {
    filter: brightness(0.97) contrast(1.1);
  }

  41% {
    filter: brightness(1) contrast(1.1);
  }

  42% {
    filter: brightness(1.15) contrast(1.2);
  }

  43% {
    filter: brightness(0.9) contrast(1.1);
  }

  44% {
    filter: brightness(1) contrast(1.1);
  }

  92% {
    filter: brightness(1) contrast(1.1);
  }

  93% {
    filter: brightness(0.85) contrast(1.05);
  }

  94% {
    filter: brightness(1.15) contrast(1.2);
  }

  95% {
    filter: brightness(1) contrast(1.1);
  }
}

/* RGB Glitch - subtle, runs periodically */
@keyframes crt-rgb-glitch {

  0%,
  90%,
  100% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
  }

  91% {
    opacity: 0.6;
    clip-path: inset(30% 0 50% 0);
    background: linear-gradient(90deg,
        rgba(255, 0, 0, 0.4) 0%,
        transparent 50%,
        rgba(0, 255, 255, 0.4) 100%);
  }

  92% {
    opacity: 0.5;
    clip-path: inset(55% 0 25% 0);
  }

  93% {
    opacity: 0.7;
    clip-path: inset(15% 0 65% 0);
  }

  94% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
  }
}

/* Horizontal corruption lines - during intro */
.crt-glitch::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.8) 20%,
      rgba(0, 255, 255, 0.6) 50%,
      rgba(255, 255, 255, 0.8) 80%,
      transparent 100%);
  z-index: 5;
  opacity: 0;
  animation: scan-line-intro 1.2s steps(1) forwards,
    scan-line 6s steps(1) infinite 1.2s;
}

/* Scan line during intro */
@keyframes scan-line-intro {

  0%,
  5% {
    opacity: 0.9;
    top: 5%;
  }

  10% {
    opacity: 0.8;
    top: 25%;
  }

  15% {
    opacity: 0;
    top: 25%;
  }

  20% {
    opacity: 0.9;
    top: 45%;
  }

  25% {
    opacity: 0;
    top: 45%;
  }

  30% {
    opacity: 0.7;
    top: 65%;
  }

  40% {
    opacity: 0;
    top: 65%;
  }

  50% {
    opacity: 0.6;
    top: 80%;
  }

  60% {
    opacity: 0;
  }

  100% {
    opacity: 0;
    top: 0;
  }
}

@keyframes scan-line {

  0%,
  94%,
  100% {
    opacity: 0;
    top: 0;
  }

  95% {
    opacity: 0.5;
    top: 35%;
  }

  96% {
    opacity: 0;
  }

  97% {
    opacity: 0.4;
    top: 70%;
  }

  98% {
    opacity: 0;
  }
}

.project-hero__content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.project-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.tag {
  padding: var(--space-xs) var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.tag--accent {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.project-hero__title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-sm);
  line-height: 1.1;
}

.project-hero__subtitle {
  font-size: var(--text-xl);
  color: var(--color-accent-secondary);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.project-hero__role {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  text-align: center;
  display: block;
  width: 100%;
}

/* Sections */
.project-section {
  width: 100%;
  max-width: 900px;
  margin: 0 auto var(--space-4xl);
  padding: 0 var(--space-lg);
  box-sizing: border-box;
}

.project-section h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}

.project-section p {
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.project-section .lead {
  font-size: var(--text-lg);
  color: var(--color-text);
  line-height: 1.7;
}

.note {
  font-size: var(--text-sm);
  font-style: italic;
  margin-top: var(--space-lg);
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.feature-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.feature-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
  .feature-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .feature-grid--4 {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  background: var(--color-bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--duration-normal) var(--ease-out);
}

.feature-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
}

.feature-card__icon {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
}

.feature-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.feature-card p {
  font-size: var(--text-sm);
  margin-bottom: 0;
}

/* Feature List */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.feature-item {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
  padding: var(--space-lg);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-item__icon {
  font-size: var(--text-2xl);
  flex-shrink: 0;
}

.feature-item h4 {
  font-size: var(--text-base);
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.feature-item p {
  font-size: var(--text-sm);
  margin-bottom: 0;
}

/* Themes Section */
.themes-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
}

.themes-group__title {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-lg);
  background: var(--color-bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-out);
}

.theme-card__icon {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-xs);
}

.theme-card__name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.theme-card__subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Available themes - glowing green */
.theme-card--available {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

.theme-card--available:hover {
  border-color: rgba(34, 197, 94, 0.8);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
  transform: translateY(-4px);
}

.theme-card--available .theme-card__name {
  color: #22c55e;
}

/* Planned themes - subtle */
.theme-card--planned {
  opacity: 0.7;
}

.theme-card--planned:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Custom theme - accent color */
.theme-card--custom {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.08);
  border-style: dashed;
}

.theme-card--custom:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
  transform: translateY(-4px);
}

.theme-card--custom .theme-card__name {
  color: var(--color-accent);
}

/* CTA */
.project-cta {
  margin-top: var(--space-4xl);
}

.cta-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(34, 211, 238, 0.1) 100%);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  text-align: center;
}

.cta-box h2 {
  color: var(--color-text);
}

.cta-box p {
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.cta-button {
  display: inline-block;
  padding: var(--space-md) var(--space-2xl);
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-out);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: #fff;
}

/* Footer */
.project-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.project-footer a {
  color: var(--color-text-muted);
}

.project-footer a:hover {
  color: var(--color-accent);
}

.project-footer .footer-impressum {
  opacity: 0.6;
}

.project-footer .footer-impressum:hover {
  opacity: 1;
}

/* ===== Image Gallery ===== */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

@media (max-width: 600px) {
  .image-gallery {
    grid-template-columns: 1fr;
  }
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all var(--duration-normal) var(--ease-out);
  aspect-ratio: 16 / 9;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* ===== Video Container ===== */
.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  /* 16:9 aspect ratio */
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== Video Showcase ===== */
.video-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-xl);
}

/* Dual video layout */
.video-showcase--dual {
  flex-direction: row;
  justify-content: center;
  gap: var(--space-2xl);
  flex-wrap: wrap;
}

.video-showcase__item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.video-frame {
  position: relative;
  width: 100%;
  max-width: 350px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 2px rgba(99, 102, 241, 0.3),
    0 0 30px rgba(99, 102, 241, 0.2),
    0 0 60px rgba(34, 211, 238, 0.1);
}

/* Smaller videos in dual layout */
.video-showcase--dual .video-frame {
  max-width: 300px;
}

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

/* CRT effect on video */
.crt-video {
  border: 3px solid rgba(99, 102, 241, 0.4);
}

.crt-video::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
  z-index: 3;
}

.crt-video .crt-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.15) 0px,
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 3px);
  z-index: 2;
}

/* Corner brackets - retro frame style */
.video-frame__corner {
  position: absolute;
  width: 20px;
  height: 20px;
  z-index: 4;
  pointer-events: none;
}

.video-frame__corner::before,
.video-frame__corner::after {
  content: '';
  position: absolute;
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
}

.video-frame__corner--tl {
  top: 8px;
  left: 8px;
}

.video-frame__corner--tl::before {
  top: 0;
  left: 0;
  width: 20px;
  height: 2px;
}

.video-frame__corner--tl::after {
  top: 0;
  left: 0;
  width: 2px;
  height: 20px;
}

.video-frame__corner--tr {
  top: 8px;
  right: 8px;
}

.video-frame__corner--tr::before {
  top: 0;
  right: 0;
  width: 20px;
  height: 2px;
}

.video-frame__corner--tr::after {
  top: 0;
  right: 0;
  width: 2px;
  height: 20px;
}

.video-frame__corner--bl {
  bottom: 8px;
  left: 8px;
}

.video-frame__corner--bl::before {
  bottom: 0;
  left: 0;
  width: 20px;
  height: 2px;
}

.video-frame__corner--bl::after {
  bottom: 0;
  left: 0;
  width: 2px;
  height: 20px;
}

.video-frame__corner--br {
  bottom: 8px;
  right: 8px;
}

.video-frame__corner--br::before {
  bottom: 0;
  right: 0;
  width: 20px;
  height: 2px;
}

.video-frame__corner--br::after {
  bottom: 0;
  right: 0;
  width: 2px;
  height: 20px;
}

.video-caption {
  margin-top: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .project-hero__title {
    font-size: var(--text-3xl);
  }

  .season-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-footer {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .video-frame {
    max-width: 300px;
  }

  .video-showcase--dual {
    flex-direction: column;
    gap: var(--space-xl);
  }

  .video-showcase--dual .video-frame {
    max-width: 280px;
  }
}