/*
Theme Name: Ernst Stage Design
Theme URI: https://ernst.studio
Author: Ernst Studio
Description: Onepage-Theme für Ernst — Stage Design, technische Planung, LED-Content und Media Server Operating. Eigenständiges Theme mit Startseiten-Template, DE/EN-Umschalter und zwei Darstellungen für Projekte.
Version: 1.11.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ernst
Tags: one-column, custom-colors, custom-menu, portfolio, dark
*/

:root {
  --bg: #0a0a0b;
  --fg: #f4f1ea;
  --acc: #eda32c;
  --line: rgba(244, 241, 234, 0.16);
  --mute: rgba(244, 241, 234, 0.62);
  --mute2: rgba(244, 241, 234, 0.45);
  --card: #131315;
  --display: Anton, Impact, "Haettenschweiler", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --body: Archivo, Helvetica, Arial, sans-serif;
  --pad: 28px;
}
@supports (color: oklch(0.5 0.1 90)) {
  :root { --acc: oklch(0.78 0.18 85); }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Sprungziele starten unter der festen Kopfzeile */
#top, #work, #leistungen, #team, #kontakt { scroll-margin-top: calc(var(--e-header-h, 92px) + 20px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--acc); }
::selection { background: var(--acc); color: var(--bg); }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; margin: 0; letter-spacing: -0.01em; }
p { text-wrap: pretty; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* Sprachumschaltung */
.en { display: none; }
body.lang-en .de { display: none; }
body.lang-en .en { display: inline; }

/* Kopfzeile */
.e-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px var(--pad);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.e-header.is-scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: rgba(244, 241, 234, 0.12);
}
/* Auf dunklem Grund braucht der Invertier-Effekt nicht mehr zu greifen */
.e-header.is-scrolled .e-logo,
.e-header.is-scrolled .e-nav,
.e-header.is-scrolled .e-lang { mix-blend-mode: normal; }
.e-logo { font-family: var(--display); font-size: 26px; letter-spacing: 0.14em; mix-blend-mode: difference; display: flex; align-items: center; }
.e-logo.has-image { mix-blend-mode: normal; }
.e-logo-img { display: block; height: var(--logo-h, 72px); width: auto; max-width: 46vw; object-fit: contain; }
.e-nav { display: flex; gap: 26px; mix-blend-mode: difference; }
.e-nav a, .e-lang button { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.e-lang { display: flex; gap: 2px; mix-blend-mode: difference; }
.e-lang button {
  border: 1px solid var(--fg); background: transparent; color: inherit;
  padding: 5px 9px; cursor: pointer; letter-spacing: 0.14em;
}
.e-lang button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* Hero */
.e-hero { position: relative; min-height: 100vh; display: grid; grid-template-rows: 1fr auto; padding: 96px var(--pad) 22px; }
.e-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,0.045) 0 2px, transparent 2px 9px);
}
.e-hero.has-media::before { opacity: 0.5; }
.e-hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
/* Unschärfe: leicht überzeichnen, damit an den Rändern keine weichen Kanten entstehen */
.e-hero-media video, .e-hero-slider {
  filter: blur(var(--blur, 6px));
  transform: scale(1.06);
  transform-origin: center;
}
.e-hero-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Slider-Plugins (z. B. Slider Revolution) füllen die Fläche und bleiben passiv */
.e-hero-slider { position: absolute; inset: 0; pointer-events: none; }
.e-hero-slider > * { height: 100%; }
.e-hero-slider rs-module-wrap,
.e-hero-slider rs-module,
.e-hero-slider .rev_slider_wrapper,
.e-hero-slider .rev_slider,
.e-hero-slider sr7-module,
.e-hero-slider sr7-content { height: 100% !important; min-height: 100% !important; }
.e-hero-slider img, .e-hero-slider video { width: 100%; height: 100%; object-fit: cover; }
.e-hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(10,10,11,0) 42%),
    rgba(10,10,11,var(--dim, 0.55));
}
.e-hero-inner, .e-hero-meta { z-index: 2; }
.e-glow {
  position: absolute; z-index: 1; left: 50%; top: 18%; width: 78vw; height: 62vh;
  transform: translateX(-50%); filter: blur(18px); pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, rgba(237,163,44,0.16), transparent 62%);
}
.e-hero-inner { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; }
.e-eyebrow { font-family: var(--mono); font-size: 15px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--acc); animation: e-flicker 6s infinite; }
.e-hero h1 { font-size: clamp(52px, 12vw, 210px); line-height: 1.12; letter-spacing: 0.05em; text-wrap: balance; }
.e-hero h1 em { font-style: normal; color: var(--acc); }
.e-title .e-line { display: block; overflow: hidden; }
.e-title .e-line > span {
  display: block;
  transform: translateY(105%);
  animation: e-line-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.e-title .e-line:nth-child(1) > span { animation-delay: 0.15s; }
.e-title .e-line:nth-child(2) > span { animation-delay: 0.27s; }
.e-title .e-line:nth-child(3) > span { animation-delay: 0.39s; }
@keyframes e-line-up { to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .e-title .e-line > span { transform: none; animation: none; }
}
.e-lede { max-width: 620px; font-size: 17px; line-height: 1.5; color: rgba(244,241,234,0.66); margin: 10px 0 0; }
.e-hero-meta {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(244,241,234,0.5); border-top: 1px solid var(--line); padding-top: 14px;
}
@keyframes e-flicker {
  0%,100% { opacity: 1; } 45% { opacity: 1; } 47% { opacity: 0.35; } 49% { opacity: 1; } 78% { opacity: 0.6; } 80% { opacity: 1; }
}

/* Laufband */
.e-ticker { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; background: var(--acc); color: var(--bg); }
.e-ticker-track { display: flex; width: max-content; animation: e-marquee 26s linear infinite; font-family: var(--display); font-size: 34px; padding: 10px 0; text-transform: uppercase; }
.e-ticker-track > div { display: flex; gap: 34px; padding-right: 34px; flex: 0 0 auto; }
@keyframes e-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .e-ticker-track { animation: none; } .e-eyebrow { animation: none; }
}

/* Abschnitte */
.e-section { padding: 92px var(--pad) 0; }
.e-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 34px; }
.e-section-head h2 { font-size: clamp(40px, 7vw, 104px); line-height: 0.98; }
.e-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--acc); margin-bottom: 22px; }

/* Projekte */
.e-toggle { display: flex; gap: 2px; }
.e-toggle button {
  border: 1px solid rgba(244,241,234,0.35); background: transparent; color: inherit;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 8px 13px; cursor: pointer;
}
.e-toggle button:hover, .e-toggle button[aria-pressed="true"] { border-color: var(--fg); }
.e-toggle button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

.e-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.e-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x mandatory; }
.e-strip .e-proj { flex: 0 0 min(76vw, 900px); scroll-snap-align: start; aspect-ratio: 16/9; }
body:not(.work-strip) .e-strip { display: none; }
body.work-strip .e-grid { display: none; }

.e-proj {
  position: relative; overflow: hidden; padding: 18px;
  display: flex; align-items: flex-end;
  background: repeating-linear-gradient(45deg, rgba(244,241,234,0.07) 0 3px, transparent 3px 12px), var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.25s ease;
}
.e-proj:hover { border-color: var(--acc); }
.e-proj img, .e-proj video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.e-proj.fit-contain img, .e-proj.fit-contain video { object-fit: contain; padding: 14px; }
.e-proj::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,10,11,0.72), transparent 58%); pointer-events: none; }
.e-proj > * { position: relative; z-index: 2; }
.e-proj-slot { position: absolute; top: 16px; left: 18px; z-index: 2; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute2); }
.e-proj-body { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.e-proj h3 { font-size: clamp(26px, 3.4vw, 52px); }
.e-proj small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--acc); }
/* 6 Spalten — Formate */
.e-proj.pano       { grid-column: span 6; aspect-ratio: 32/9; }
.e-proj.banner     { grid-column: span 6; aspect-ratio: 21/9; }
.e-proj.full       { grid-column: span 6; aspect-ratio: 16/9; }
.e-proj.wide       { grid-column: span 4; aspect-ratio: 16/9; }
.e-proj.widebox    { grid-column: span 4; aspect-ratio: 4/3; }
.e-proj.half       { grid-column: span 3; aspect-ratio: 3/2; }
.e-proj.halfsquare { grid-column: span 3; aspect-ratio: 1/1; }
.e-proj.box        { grid-column: span 2; aspect-ratio: 4/3; }
.e-proj.square     { grid-column: span 2; aspect-ratio: 1/1; }
.e-proj.tall       { grid-column: span 2; aspect-ratio: 3/4; }
.e-proj.portrait   { grid-column: span 2; aspect-ratio: 9/16; }

.e-proj.tall h3, .e-proj.box h3, .e-proj.square h3, .e-proj.portrait h3 { font-size: 29px; }
.e-proj.half h3, .e-proj.halfsquare h3 { font-size: clamp(24px, 2.6vw, 40px); }
.e-proj.tall .e-proj-body, .e-proj.box .e-proj-body,
.e-proj.square .e-proj-body, .e-proj.portrait .e-proj-body { display: block; }

/* Leistungen */
.e-svc { border-top: 1px solid var(--line); }
.e-svc-row {
  display: grid; grid-template-columns: 62px minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px;
  align-items: start; padding: 26px 0; border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}
.e-svc-row:hover { background: rgba(244,241,234,0.04); }
.e-svc-row span.num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: rgba(244,241,234,0.4); padding-top: 8px; }
.e-svc-row h3 { font-size: clamp(30px, 4.4vw, 66px); line-height: 1.02; }
.e-svc-row p { font-size: 15px; line-height: 1.55; color: var(--mute); margin: 6px 0 0; }

/* Studio */
.e-studio { padding: 92px var(--pad); display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 44px; align-items: start; }
.e-studio h2 { font-size: clamp(34px, 5.2vw, 78px); line-height: 1; margin-bottom: 18px; }
.e-studio p { font-size: 16px; line-height: 1.55; color: rgba(244,241,234,0.66); max-width: 46ch; }
.e-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.e-stats div { background: var(--bg); padding: 24px 20px; }
.e-stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 52px; line-height: 1; }
.e-stats span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(244,241,234,0.5); }

/* Kunden */
.e-clients { padding: 0 var(--pad) 92px; }
.e-clients-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(244,241,234,0.4); border-top: 1px solid var(--line); padding-top: 16px; margin-bottom: 18px; }
.e-clients-list { display: flex; flex-wrap: wrap; gap: 10px 34px; font-family: var(--display); font-size: clamp(20px, 2.6vw, 38px); text-transform: uppercase; color: rgba(244,241,234,0.55); }

/* Kontakt */
.e-contact { padding: 96px var(--pad); background: var(--acc); color: var(--bg); display: flex; flex-direction: column; gap: 18px; }
.e-contact .e-label { color: var(--bg); margin: 0; }
.e-contact h2 { font-size: clamp(40px, 8.6vw, 138px); line-height: 1.08; }
.e-contact p { font-size: 17px; line-height: 1.5; max-width: 52ch; margin: 0; }
.e-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.e-actions a {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 15px 26px; border: 1px solid var(--bg); color: var(--bg);
  transition: background 0.2s ease, color 0.2s ease;
}
.e-actions a.solid { background: var(--bg); color: var(--fg); }
.e-actions a:hover { background: var(--fg); color: var(--bg); }
.e-actions a.solid:hover { background: var(--fg); color: var(--bg); }

/* Fuß */
.e-footer {
  background: var(--bg);
  display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: space-between;
  padding: 22px var(--pad); font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--mute2);
}
.e-footer a { color: inherit; }

/* Einblenden beim Scrollen */
.e-reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.e-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .e-reveal { opacity: 1; transform: none; transition: none; } }

/* Kleine Bildschirme */
@media (max-width: 900px) {
  :root { --pad: 18px; }
  .e-logo-img { height: calc(var(--logo-h, 72px) * 0.7); }
  .e-nav { display: none; }
  .e-grid { grid-template-columns: repeat(2, 1fr); }
  .e-proj { grid-column: span 2 !important; }
  .e-proj.tall, .e-proj.portrait { aspect-ratio: 3/4; }
  .e-proj.pano, .e-proj.banner { aspect-ratio: 21/9; }
  .e-proj.square, .e-proj.halfsquare { aspect-ratio: 1/1; }
  .e-proj.wide, .e-proj.full, .e-proj.half { aspect-ratio: 16/10; }
  .e-svc-row { grid-template-columns: 1fr; gap: 8px; }
  .e-svc-row span.num { padding-top: 0; }
  .e-hero-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .e-ticker-track { font-size: 24px; }
}

/* WordPress-Editor-Inhalte auf Unterseiten (Impressum etc.) */
.e-page { padding: 140px var(--pad) 92px; max-width: 760px; }
.e-page h1 { font-size: clamp(34px, 6vw, 78px); line-height: 1; margin-bottom: 24px; }
.e-page h2, .e-page h3 { font-family: var(--body); text-transform: none; font-weight: 600; margin: 32px 0 8px; }
.e-page p, .e-page li { font-size: 16px; line-height: 1.6; color: rgba(244,241,234,0.78); }
.e-page a { color: var(--acc); text-decoration: underline; }
