:root {
  --bg: #0b0b0c;
  --bg-2: #101113;
  --bg-3: #14161a;
  --text: #e8eaed;
  --muted: #a7abb2;
  --accent: #79ffe1;
  --brand: #8a5cff;
  --brand-2: #ff5cf0;
  --danger: #ff4d4d;
  --card: #121317;
  --border: #23252a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: 
    radial-gradient(1200px 800px at 80% -10%, rgba(138,92,255,0.12), transparent 88%),
    radial-gradient(1400px 900px at 10% 10%, rgba(121,255,225,0.10), transparent 92%),
    radial-gradient(1200px 800px at 50% 120%, rgba(138,92,255,0.08), transparent 96%),
    var(--bg);
  background-attachment: fixed, fixed, fixed, scroll;
  line-height: 1.5;
}

/* Three.js background canvas */
#bg3d { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
/* Overlay to ensure readability over 3D background */
#bgOverlay { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(60% 40% at 50% 20%, rgba(11,12,14,0.0), rgba(11,12,14,0.25) 55%, rgba(11,12,14,0.45) 100%); }

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 16px; top: 8px;
  background: var(--brand);
  color: #000; padding: 8px 12px; border-radius: 8px;
}

.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(11,11,12,0.9), rgba(11,11,12,0.6), transparent);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.logo { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: 0.3px; }
.nav-toggle { display: none; }
.nav-list { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.nav-list a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.nav-list a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-list .cta { color: #000; background: var(--accent); font-weight: 600; }

/* Language switch */
.lang-switch { display: inline-flex; gap: 6px; align-items: center; }
.lang-btn { background: #17181c; color: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.lang-btn.active, .lang-btn:hover { color: var(--text); border-color: rgba(121,255,225,0.35); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; background: #1a1c20; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
  .nav-list { position: absolute; right: 4%; top: 60px; flex-direction: column; background: #0f1013; border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: none; width: min(280px, 92vw); }
  .nav-list.open { display: flex; }
}

.section { padding: 80px 0; }
.section h2 { font-size: clamp(24px, 2.6vw, 36px); margin: 0 0 8px; letter-spacing: 0.2px; }
.section-intro { color: var(--muted); margin: 0 0 24px; max-width: 72ch; }

.hero { padding: 160px 0 100px; /* Increased top padding */ }
.grid-hero { max-width: 1200px; margin: 0 auto; }
.hero-content { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: center; }
.hero-copy { margin-top: 0; /* Removed negative margin */ }
.badge-row { display: none; /* Hide badge row completely if not removed from HTML */ }
.badge { display: none; /* Hide badges completely if not removed from HTML */ }
.badge-accent { display: none; /* Hide accent badge completely if not removed from HTML */ }
.hero h1 { font-size: clamp(28px, 4.2vw, 56px); line-height: 1.08; margin: 0 0 12px; }
.accent { color: var(--accent); }
.name { display: inline-block; color: var(--brand); font-weight: 800; margin-right: 8px; }

/* Hero Brands Section */
.hero-brands {
  display: flex;
  gap: 24px;
  align-items: center;
  margin: 28px 0 22px;
  flex-wrap: wrap;
}
.hero-brands .brand-logo {
  height: 44px;
  max-width: 160px;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.hero-brands .brand-logo:hover { opacity: 1; filter: drop-shadow(0 2px 10px rgba(121,255,225,0.25)); }
@media (max-width: 640px) {
  .hero-brands .brand-logo { height: 36px; max-width: 140px; }
}
.lead { color: var(--muted); font-size: 18px; margin-bottom: 36px; /* Increased margin */ }
.hero-ctas { display: flex; gap: 12px; margin: 24px 0 40px; /* Increased margin */ flex-wrap: wrap; }

.button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; text-decoration: none; cursor: pointer; border: 1px solid var(--border); background: #17181c; color: var(--text); transition: transform .2s ease, box-shadow .2s ease; }
.button.primary { background: linear-gradient(180deg, var(--accent), #54e6cc); color: #00130f; border-color: transparent; font-weight: 700; }
.button.ghost { background: transparent; }
.button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }

.hero-stats { list-style: none; display: flex; gap: 24px; margin: 8px 0 0; padding: 0; flex-wrap: wrap; }
.hero-stats li { display: grid; gap: 2px; }
.hero-stats strong { font-size: 14px; }
.hero-stats span { color: var(--muted); font-size: 13px; }

/* Hero Visual Grid */
.hero-visual { position: relative; }
.hero-image-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column */
  grid-template-rows: auto; /* Auto height */
  grid-template-areas:
    "wide"; /* Only the wide tile remains */
  gap: 0; /* No gap needed for single item */
  place-items: center; /* Center the single image */
  max-height: none; /* No max height needed here, let content dictate */
  margin-bottom: 2rem; /* Add some space below the image */
}
.hero-img { width: 100%; height: 100%; border-radius: 16px; border: 1px solid var(--border); background: #0f1013; object-fit: cover; display: block; }
.hero-img.tile-wide {
  grid-area: wide;
  aspect-ratio: 1 / 1; /* Make it square */
  object-position: center 30%;
  max-width: 400px; /* Limit the max width of the single image */
}
/* Removed .tile-tall and .tile-landscape as they are no longer needed */

@media (max-width: 1100px) {
  .hero-content { grid-template-columns: 1fr; gap: 40px; text-align: left; /* Changed to left-aligned */ }
  .hero-copy { max-width: none; }
  .hero-image-grid { max-width: 100%; /* Make it full width */ margin: 0; /* Remove auto margin */ grid-auto-rows: auto; max-height: none; }
  .hero-img.tile-wide { max-width: 100%; /* Ensure full width within grid cell */ }
}
@media (max-width: 600px) {
  .hero { padding: 100px 0 80px; }
  .hero-content { gap: 32px; }
  .hero-image-grid { max-width: 100%; /* Full width on smaller mobile */ }
}

.services .card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-2px); border-color: rgba(121,255,225,0.35); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.card .card-media {
  position: relative;
  overflow: hidden;
  height: 200px; /* Use a fixed height instead of aspect-ratio */
}

.services .card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Fill the container, may crop */
  object-position: center; /* Center the image content */
  position: absolute;
  top: 0;
  left: 0;
}

.services .card .card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 11, 12, 0.9), rgba(11, 11, 12, 0.5));
  transition: background 0.3s ease;
}

.services .card:hover .card-media::after {
  background: linear-gradient(to top, rgba(11, 11, 12, 0.8), rgba(11, 11, 12, 0.3));
}

.services .card .card-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.services .card:hover .card-icon {
  transform: translate(-50%, -50%) scale(1.1);
  color: #fff;
}

.services .card .card-icon svg {
  width: 64px;
  height: 64px;
  stroke-width: 1px;
}

.card h3 {
  margin: 1.25rem 1.5rem 0.5rem;
  font-size: 1.125rem;
}

.services .card h3 svg {
  display: none; /* Hide the old small icons */
}

.services .card p {
  margin: 0 1.5rem 1.5rem;
  font-size: 0.95rem;
}

@media (max-width: 980px) {
  .services .card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .services .card-grid { grid-template-columns: 1fr; }
}

.cases .case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.case { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.case-media { width: 100%; background: #0f1013; border-radius: 0; aspect-ratio: 16/10; border-bottom: 1px solid var(--border); }
.case-media img { width: 100%; height: 100%; object-fit: cover; }
.case-body { padding: 16px; display: flex; flex-direction: column; flex-grow: 1; }
.case h3 { margin: 0 0 8px; font-size: 18px; }
.case p { margin: 0 0 16px; color: var(--muted); flex-grow: 1; }
.tags { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; flex-wrap: wrap; }
.tags li { font-size: 12px; color: var(--muted); background: rgba(255,255,255,0.05); border: 1px solid var(--border); padding: 4px 8px; border-radius: 999px; }

@media (max-width: 980px) {
  .cases .case-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .cases .case-grid { grid-template-columns: 1fr; }
}

.about .grid-about { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: center; }
.bio-list { list-style: none; padding: 0; margin: 12px 0 0; color: var(--muted); display: grid; gap: 8px; }
@media (max-width: 980px) {
  .about .grid-about { grid-template-columns: 1fr; }
}

.about-copy h2 { font-size: clamp(22px, 2.5vw, 32px); }

.about-visual {
  display: grid;
  place-items: center;
}
.about .portrait {
  width: 100%;
  max-width: 380px;
  height: 520px;
  border-radius: 18px;
  border: 1px solid var(--border);
  object-fit: cover;
  object-position: top center;
  background: #0f1013;
}

@media (max-width: 640px) {
  .about-visual { display: none; }
}

.format-grid {
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping */
  gap: 1rem;
  margin-bottom: 3rem;
  align-items: stretch; /* Ensure cards have equal height */
  justify-content: center; /* Center the cards if there's extra space */
}

@media (max-width: 780px) {
  .format-grid {
    flex-wrap: wrap; /* Allow cards to wrap and stack */
  }
  .format-grid .card {
    flex: 1 1 100%; /* Take full width on small screens */
    max-width: 400px; /* Limit max width of stacked cards */
  }
}

.format-grid .card {
  flex: 1 1 48%; /* Grow, shrink, and take up roughly half the space */
  max-width: 550px; /* Limit max width for each card */
}

.format-grid .card .card-media {
  aspect-ratio: 1 / 1; /* Make it square */
  height: auto; /* Override fixed height from general .card-media */
  overflow: hidden; /* Ensure content outside is clipped */
  width: 100%; /* Ensure it takes full width of its parent */
}

.format-grid .card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensure the image covers the entire square area */
  object-position: center; /* Center the image within the area */
}

.format-grid .card .card-content {
  padding: 1.25rem 1.5rem 1.5rem; /* Add consistent padding */
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Allow content to grow */
  text-align: left; /* Ensure text is left-aligned */
}

.format-grid .card h3 {
  margin-top: 0; /* Remove top margin from h3 */
  margin-bottom: 0.5rem; /* Consistent bottom margin */
  margin-left: 0; /* Remove left margin */
  margin-right: 0; /* Remove right margin */
}

.format-grid .card p {
  margin-bottom: 1rem; /* Adjust paragraph margin */
  flex-grow: 1; /* Allow paragraph to grow and push link to bottom */
  margin-left: 0; /* Remove left margin */
  margin-right: 0; /* Remove right margin */
}

.format-grid .card .text-link {
  margin-top: auto; /* Push the link to the bottom */
  display: inline-block;
  font-weight: 500;
  width: max-content; /* Ensure button only takes content width */
  margin-left: 0; /* Ensure no left margin */
  margin-right: 0; /* Ensure no right margin */
}

/* Ensure images in card-media are correctly styled */
.card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This makes sure the image covers the entire area */
  object-position: center; /* This centers the image in the frame */
}

/* --- Content --- */
.content {
  padding: 60px 0;
}
.content .content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.content-item { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.text-link {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.text-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  background: var(--card);
  border-color: rgba(121,255,225,0.35);
}
.text-link[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }
@media (max-width: 780px) {
  .content .content-grid { grid-template-columns: 1fr; }
}

.content .subheading { margin: 28px 0 12px; font-size: 18px; letter-spacing: 0.2px; }
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.video { position: relative; aspect-ratio: 16 / 9; background: #0f1013; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 980px) { .video-grid { grid-template-columns: 1fr; } }

.channel-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* Media Slider */
.media .media-slider { position: relative; }
.media .slider-container { overflow: hidden; border-radius: 20px; }
.media .slider-track { display: flex; transition: transform 0.5s ease; }
.media .slide { min-width: 100%; background: var(--card); border: 1px solid var(--border); position: relative; }
.media .slide img { width: 100%; height: 600px; /* Increased height */ object-fit: contain; /* Changed to contain */ }
.media .slide figcaption { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.8)); color: white; padding: 20px; font-size: 16px; font-weight: 500; }

/* VP Video Slide */
.media .vp-video-slide .video-container { width: 100%; height: 400px; display: flex; align-items: center; justify-content: center; background: var(--card); }
.media .vp-video-slide iframe { width: 280px; height: 380px; border-radius: 12px; border: 1px solid var(--border); }
.media .slider-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 20px; }
.media .slider-btn { background: var(--card); border: 1px solid var(--border); color: var(--text); width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 20px; transition: all 0.2s ease; }
.media .slider-btn:hover { border-color: var(--accent); background: rgba(121,255,225,0.08); }
.media .slider-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.media .slider-dots { display: flex; gap: 8px; }
.media .slider-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); cursor: pointer; transition: background 0.2s ease; }
.media .slider-dot.active { background: var(--accent); }
@media (max-width: 780px) { 
  .media .slide img { height: 300px; }
  .media .slide figcaption { padding: 16px; font-size: 14px; }
  .media .slider-btn { width: 40px; height: 40px; font-size: 18px; }
}

/* Redpinata Brands */
.redpinata-brands h2 { margin-bottom: 8px; }
.redpinata-brands .section-intro { margin-bottom: 20px; }
.redpinata-brands .brands-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.redpinata-brands .brand-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; text-align: center; }
.redpinata-brands .brand-card:hover { border-color: rgba(121,255,225,0.35); box-shadow: 0 0 0 1px rgba(121,255,225,0.18) inset; }
.redpinata-brands .brand-logo { width: 120px; height: 60px; object-fit: contain; margin: 0 auto 16px; display: block; }
.redpinata-brands .brand-logo-placeholder { width: 120px; height: 60px; margin: 0 auto 16px; background: var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; font-size: 18px; }
.redpinata-brands .brand-card h3 { margin: 0 0 12px; color: var(--text); }
.redpinata-brands .brand-card p { color: var(--muted); margin: 0 0 16px; font-size: 14px; line-height: 1.5; }
@media (max-width: 1100px) { .redpinata-brands .brands-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { 
  .redpinata-brands .brands-header h2 { font-size: 42px; }
  .redpinata-brands .brands-header .section-intro { font-size: 18px; }
}
@media (max-width: 780px) { 
  .redpinata-brands .brands-header { padding: 80px 0; }
  .redpinata-brands .brands-header h2 { font-size: 36px; }
  .redpinata-brands .brands-header .section-intro { font-size: 16px; line-height: 1.7; }
  .redpinata-brands .brands-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* External Links */
.links .link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.links .link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  color: var(--text);
  text-decoration: none;
  text-align: center;
}
.links .link-card:hover { border-color: rgba(121,255,225,0.35); box-shadow: 0 0 0 1px rgba(121,255,225,0.18) inset; }
.links .link-logo { max-width: 100%; height: 60px; object-fit: contain; margin-bottom: 8px; }
.links .link-title { font-size: 18px; font-weight: 600; color: var(--text); }
.links .link-icon { color: var(--accent); margin-right: 4px; }
.links .link-desc { color: var(--muted); font-size: 14px; flex-grow: 1; margin: 0; }
.links .link-cta {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  margin-top: 12px; /* Add margin top to separate from description */
}
.links .link-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  background: var(--card);
  border-color: rgba(121,255,225,0.35);
}
@media (max-width: 1100px) { .links .link-grid { grid-template-columns: 1fr 1fr 1fr; } .links .link-logo { height: 56px; } }
@media (max-width: 780px) { .links .link-grid { grid-template-columns: 1fr 1fr; } .links .link-logo { height: 52px; } }
@media (max-width: 520px) { .links .link-grid { grid-template-columns: 1fr; } }

/* News */
.news .news-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.news .news-item { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.news .news-meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; }

.contact .grid-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.contact-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; gap: 12px; flex-wrap: wrap; }
.contact-form { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: grid; gap: 12px; }
.contact-form label { display: grid; gap: 6px; color: var(--muted); }
.contact-form input, .contact-form textarea { width: 100%; background: #0f1013; border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 10px; }
.form-note { color: var(--muted); font-size: 12px; margin: 6px 0 0; }

.contact-copy p {
  margin-bottom: 2rem;
  max-width: 450px;
}

.social-links {
  margin-top: 2rem;
  display: flex;
  gap: 1.5rem;
}

.social-links a {
  color: var(--text-dim);
  transition: all 0.2s ease;
}

.social-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.social-links svg {
  width: 24px;
  height: 24px;
}


.site-footer {
  background-color: var(--surface-dark);
  border-top: 1px solid rgba(255,255,255,0.06); padding: 28px 0; background: #0b0b0c; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-links { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

[data-animate] { opacity: 0; transform: translateY(10px); }
.in-view { opacity: 1 !important; transform: translateY(0) !important; transition: opacity .6s ease, transform .6s ease; }

/* Interactive Timeline Section */
#timeline {
    padding: 250px 0 150px 0;
    position: relative;
    /* Hintergrund entfernt für vollen 3D-Effekt */
    background: transparent;
    backdrop-filter: none;
    border: none; /* Dünne Linien oben/unten entfernt */
    z-index: 2;
}

.timeline-year-bg {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateX(-50%) translateY(-50%); /* Zentriert die Zahl horizontal */
    font-size: 14rem; /* War 16rem */
    font-weight: 800;
    color: rgba(255, 255, 255, 0.04); /* War 0.03 */
    z-index: 0; /* Hinter den Karten, im selben stacking context */
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

/* Globale Seiten-Fades */
.page-fade {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 10vw;
    z-index: 100; /* über Content, unter Overlays */
    pointer-events: none;
}
.page-fade-left { left: 0; background: linear-gradient(to right, var(--bg) 25%, transparent); }
.page-fade-right { right: 0; background: linear-gradient(to left, var(--bg) 25%, transparent); }


.timeline-year-bg.year-position-top {
    top: 20%; /* Positioniert die Jahreszahl im oberen Bereich */
}

.timeline-year-bg.year-position-bottom {
    top: 80%; /* Positioniert die Jahreszahl im unteren Bereich */
}

#timeline-date-display { display: none; }

#timeline .container-fluid {
    max-width: 100%;
    padding: 0;
}

#timeline h2 {
    text-align: center;
    margin-bottom: 60px;
    color: var(--text-heading);
    font-size: 2.8rem;
}

.timeline-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 40px 0 60px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-main);
    cursor: grab;
}

.timeline-scroll-container:active {
    cursor: grabbing;
}

.timeline-wrapper {
    position: relative;
    display: inline-block;
    min-height: 850px; /* War 750px */
    padding: 0; /* Kein horizontaler Puffer mehr */
}

.timeline-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* hinter allem im Timeline-Wrapper */
    pointer-events: none; /* Linie nicht klickblockend */
}

.timeline-events-back, .timeline-events-front {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    pointer-events: none;
}

.timeline-events-front { z-index: 6; }
.timeline-card { pointer-events: auto; }

.timeline-card {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 130px; /* War 150px */
    background-color: var(--bg-alpha-1);
    border-radius: 12px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transform: translate(-50%, 0);
    z-index: 2;
    opacity: 0.8; /* always visible */
    visibility: visible;
    /* keine Transform-Transition -> kein Delay beim Parallax */
    transition: opacity 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    cursor: pointer;
    will-change: transform; /* GPU Hint */
}

.timeline-card.has-image { width: 160px; /* War 200px */ }
.timeline-card.is-milestone {
    width: 160px; /* War 200px */
    padding: 20px; /* War 26px */
    border-top-width: 6px;
}
.timeline-card.is-milestone .timeline-card-title { font-size: 1rem; }
.timeline-card.is-milestone .timeline-card-year { font-size: 1.2rem; }
.timeline-card.is-milestone .tags .tag { font-weight: 600; }

.layer-back { z-index: 1; opacity: 0.6; filter: blur(0.2px); }
.layer-front { z-index: 3; opacity: 0.9; }

.timeline-event.layer-back { opacity: 0.85; }
.timeline-event.layer-front { opacity: 1; }

.timeline-card.active {
    opacity: 1;
    transform: translate(-50%, -10px) scale(1.18); /* Fallback falls Parallax nicht läuft */
    filter: none;
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
    z-index: 999; /* ganz vorn */
}

.timeline-card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.timeline-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.timeline-card-logo {
    height: 30px;
    max-width: 100px;
    object-fit: contain;
}

.timeline-card-year {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
}

.timeline-card-title {
    font-size: 0.85rem; /* War 0.9rem */
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.timeline-card p {
    font-size: 0.7rem; /* War 0.75rem */
    line-height: 1.4;
    color: var(--text-med);
    margin-bottom: 0.6rem;
}

.timeline-card .tags .tag {
    background-color: var(--bg-alpha-2);
    color: var(--text-med);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.timeline-card.has-image {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.timeline-card .timeline-card-media {
    width: 100%;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.timeline-card .timeline-card-media img {
    width: 100%;
    height: auto;
    display: block;
}

.timeline-card .timeline-card-content {
    padding: 10px; /* War 12px */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-card.is-milestone .timeline-card-content {
    padding: 15px;
}

.timeline-card.has-image.is-milestone .timeline-card-content {
     padding-top: 12px;
}

/* Custom Scrollbar */
.timeline-scroll-container::-webkit-scrollbar {
    height: 12px;
}
.timeline-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-1);
    border-radius: 10px;
}
.timeline-scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 10px;
    border: 3px solid var(--bg-1);
}
.timeline-scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-light);
}

/* Positioning classes for cards */
.timeline-card.position-top {
    bottom: 50%;
    margin-bottom: -100px; /* War -150px */
}
.timeline-card.position-bottom {
    top: 50%;
    bottom: auto;
    margin-top: 10px; /* War 50px */
}

/* Stack-Reihenfolge präzisieren */
.timeline-card.position-bottom { z-index: 7; }
.timeline-card.position-top { z-index: 1; }
/* Exakte Baselines: gleiche optische Entfernung zur Mittelachse */
.timeline-card.position-top { transform-origin: center; }
.timeline-card.position-bottom { transform-origin: center; }

/* Events im Stack angleichen */
.timeline-event.row-bottom { z-index: 8; }
.timeline-event.row-top { z-index: 2; }

/* Mobile responsive for Timeline */
@media (max-width: 992px) {
    .timeline-event {
        width: 28px;
        height: 28px;
    }
}


@media (max-width: 768px) {
    #timeline {
        padding: 160px 0 110px 0;
    }

    .timeline-year-bg {
        font-size: 9rem;
        color: rgba(255,255,255,0.05);
    }

    .page-fade { display: none; } /* Fades auf Mobile ausblenden */

    #timeline h2 {
        font-size: 2.2rem;
        margin-bottom: 50px;
    }

    .timeline-event {
        width: 24px;
        height: 24px;
        border-width: 2px;
        box-shadow: 0 0 0 4px var(--bg-main), 0 3px 10px rgba(0,0,0,0.2);
    }
    .timeline-event .year {
        font-size: 0.9rem;
        top: -30px;
    }
     .timeline-details-container {
        min-height: 280px;
    }
    .timeline-details {
        padding: 20px;
    }
    .timeline-details h3 {
        font-size: 1.5rem;
    }
    .timeline-details p {
        font-size: 1rem;
    }
    .timeline-details-header {
        flex-direction: column;
        gap: 10px;
    }
    .timeline-logo {
        height: 35px;
    }
    #timeline-date-display { display: none; }

    .timeline-wrapper {
        min-height: 650px;
    }

    .timeline-card { width: 88px; }
    .timeline-card.has-image { width: 105px; }
    .timeline-card.is-milestone { width: 105px; padding: 12px; }
    .timeline-card-year { font-size: 0.95rem; }
    .timeline-card-title { font-size: 0.64rem; }
    .timeline-card p { font-size: 0.55rem; }
    .timeline-card .timeline-card-content { padding: 8px; }
    .timeline-card .timeline-card-media img { border-radius: 8px 8px 0 0; }
    .timeline-card.position-top { margin-bottom: -80px; }
    .timeline-card.position-bottom { margin-top: 6px; }
    /* Icons in Tags auf sehr kleinen Karten ausblenden, um Überlauf zu vermeiden */
    .timeline-card .tags .tag svg { display: none; }
}
  
/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-3);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  z-index: 100;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.cookie-banner.show {
  opacity: 1;
  transform: translateY(0);
}

.cookie-banner .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.cookie-banner .cookie-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

@media (min-width: 768px) {
  .cookie-banner .container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .cookie-banner p {
    max-width: 70%;
  }
}

@media (max-width: 600px) {
  .cookie-banner .button {
    width: 100%;
  }
}

.timeline-events-back, .timeline-events-front { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.timeline-events-front { z-index: 6; }
.timeline-card { pointer-events: auto; }

/* Overlay */
.timeline-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 2000; }
.timeline-overlay.show { display: flex; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); }

/* Overlay passt sich dynamisch an die Bildbreite an (per JS), begrenzt durch Viewport */
.overlay-card {
  position: relative;
  width: auto;                 /* per JS auf Bildbreite gesetzt */
  max-width: 96vw;             /* nie breiter als der Viewport */
  max-height: 96vh;            /* nie höher als der Viewport */
  overflow-y: auto;              /* Text scrollt innerhalb */
  background: var(--bg-2-alpha);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  z-index: 1;
  box-sizing: border-box;      /* Padding in Breite/Höhe einrechnen */
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.timeline-overlay.show .overlay-card {
  opacity: 1;
  transform: scale(1);
}

.overlay-close { position: absolute; top: 10px; right: 12px; font-size: 28px; line-height: 1; background: transparent; border: none; color: var(--text); cursor: pointer; }
.overlay-content h3 { margin-top: 0; }
/* Bild im Overlay skaliert responsiv; Breite steuert die Card-Breite */
.overlay-content .overlay-media {
  display: block;
  width: 100%;                 /* füllt Card-Innenbreite */
  height: auto;
  max-height: 86vh;             /* Platz für Titel/Tags/Text lassen */
  object-fit: contain;
  margin: 12px 0;
  border-radius: 8px;
}

.overlay-content .tags .tag {
    border: none;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.timeline-card.is-milestone {
    width: 200px;
}

