/* ==========================================================
   Film-Design "Der rote Faden" (红线)
   Liegt über style.css: Nacht-Palette, Szenen, roter Faden.
   ========================================================== */

:root, :root:not([data-theme="light"]), :root[data-theme="dark"], :root[data-theme="light"] {
  --bg: #0B1226;          /* Tinte / Nachtblau */
  --bg-2: #0F1832;
  --card: #141F3C;
  --ink: #F3EAD8;         /* Papier */
  --ink-2: #D8CEBA;
  --muted: #A49D8E;
  --line: rgba(243, 234, 216, .12);
  --accent: #F2B45A;      /* Laternenlicht: alle normalen Akzente */
  --accent-2: #F2B45A;    /* Laternenlicht */
  --gold: #F2B45A;
  --accent-soft: rgba(242, 180, 90, .14);
  --red: #E0442F;         /* Siegelrot: nur Faden, Stempel, Kontakt */
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 16px 40px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, .85);
  --band-bg: #0F1832;
  --band-fg: #F3EAD8;
  --thread: #E8432E;
  color-scheme: dark;
}
html, body { background: var(--bg); }
body { background:
  radial-gradient(1200px 600px at 80% -10%, rgba(242, 180, 90, .06), transparent 60%),
  radial-gradient(900px 600px at 0% 40%, rgba(70, 100, 200, .06), transparent 60%),
  var(--bg); }

/* Fortschrittsbalken oben = der rote Faden */
.progress span { background: var(--thread) !important; box-shadow: 0 0 8px rgba(232, 67, 46, .8); }

/* Navigation als dunkles Glas */
.nav { background: rgba(11, 18, 38, .72) !important; border-color: var(--line) !important; backdrop-filter: blur(14px) saturate(1.2); }
.nav-links a:hover, .nav-links a.is-current { background: rgba(242, 180, 90, .14); color: var(--accent-2); }
.nav .btn-small { background: var(--red); color: #fff; }
.nav .btn-small:hover { background: var(--ink); color: var(--bg); }
.nav .nav-cv { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.nav .nav-cv:hover { border-color: var(--accent-2); color: var(--accent-2); background: transparent; }
@media (max-width: 700px) { .nav .nav-cv { display: none; } }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent-2); color: var(--bg); }
.btn-ghost { background: rgba(11, 18, 38, .45); border-color: rgba(243, 234, 216, .3); }
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }
.kicker { color: var(--accent-2); }

/* ---------- Startbild ---------- */
.film-hero { min-height: 100svh; padding: 0; display: block; position: relative; isolation: isolate; }
.hero-scene { position: absolute; inset: 0; overflow: hidden; z-index: -1; background: #0b1226; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%;
  transform: scale(calc(1.06 + var(--hp, 0) * .22)) translateY(calc(var(--hp, 0) * 3%));
  transform-origin: 50% 62%; animation: heroIn 2.4s var(--ease) both; }
@keyframes heroIn { from { transform: scale(1.16); filter: brightness(.4) blur(4px); } }
.hero-shade { position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(8, 13, 30, .7) 0%, rgba(8, 13, 30, .25) 30%, rgba(8, 13, 30, 0) 45%, rgba(8, 13, 30, 0) 58%, rgba(8, 13, 30, .62) 72%, rgba(8, 13, 30, .82) 88%, var(--bg) 100%); }
.stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff7e0; box-shadow: 0 0 6px #fff3c4;
  animation: twinkle var(--t, 3s) var(--d, 0s) infinite ease-in-out; }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
.water { position: absolute; left: 0; right: 0; top: 64%; bottom: 0; mix-blend-mode: screen; opacity: .5; pointer-events: none;
  background: repeating-linear-gradient(100deg, transparent 0 38px, rgba(255, 210, 140, .10) 40px, transparent 46px 90px);
  background-size: 400px 100%; animation: shimmer 9s linear infinite;
  -webkit-mask: linear-gradient(to bottom, transparent, #000 25%, #000 70%, transparent);
          mask: linear-gradient(to bottom, transparent, #000 25%, #000 70%, transparent); }
@keyframes shimmer { to { background-position: 400px 0; } }
.glow { position: absolute; inset: 0; mix-blend-mode: soft-light; pointer-events: none;
  background: radial-gradient(40% 30% at 20% 55%, rgba(255, 190, 90, .55), transparent 70%),
              radial-gradient(35% 28% at 82% 52%, rgba(255, 190, 90, .5), transparent 70%);
  animation: flicker 5s infinite; }
@keyframes flicker { 0%, 100% { opacity: .8; } 45% { opacity: 1; } 50% { opacity: .7; } 55% { opacity: .95; } }

/* roter Faden im Startbild: wird beim Laden gezogen, dann läuft ein Lichtimpuls */
.hero-thread { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible;
  transform: scale(calc(1.06 + var(--hp, 0) * .22)) translateY(calc(var(--hp, 0) * 3%)); transform-origin: 50% 62%; }
.thread-line { fill: none; stroke: var(--thread); stroke-width: 3.2; stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(255, 70, 45, .9)) drop-shadow(0 0 14px rgba(255, 70, 45, .45));
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s 1.2s var(--ease) forwards; }
.thread-pulse { fill: none; stroke: #ffd9c4; stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: .04 1; stroke-dashoffset: 1.04;
  filter: drop-shadow(0 0 6px #ff4a30) drop-shadow(0 0 16px #ff4a30); opacity: 0;
  animation: travel 5s 3.8s linear infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes travel { 0% { stroke-dashoffset: 1.04; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }

.film-hero .hero-inner { position: relative; min-height: 100svh; max-width: 980px; margin: 0 auto; text-align: center;
  padding: clamp(96px, 13vh, 130px) var(--gutter) clamp(70px, 10vh, 100px);
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 30vh; }
.film-hero .hero-copy { display: flex; flex-direction: column; align-items: center; }
.film-hero .eyebrow { justify-content: center; margin-bottom: 0; font-size: 13px; background: rgba(11, 18, 38, .5); backdrop-filter: blur(8px); border-color: var(--line); }
.hero-name { margin: 14px 0 0; font: 600 clamp(15px, 1.5vw, 19px)/1.2 var(--display); letter-spacing: .32em; color: var(--accent-2); }
.film-hero .hero-title { margin-top: 10px; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.05; text-shadow: 0 4px 40px rgba(0, 0, 0, .7); }
.film-hero .hero-title .line { white-space: normal; }
.film-hero .hero-title em { background: linear-gradient(100deg, var(--accent-2), #ffe2a8 50%, var(--accent-2)); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.film-hero .hero-bottom { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.film-hero .hero-sub { max-width: 640px; margin: 0 auto; font-size: clamp(15px, 1.3vw, 18px); color: var(--ink); text-shadow: 0 2px 14px rgba(0, 0, 0, .95), 0 0 2px rgba(0, 0, 0, .8); }
.film-hero .hero-cta { justify-content: center; margin-top: 0; }
.film-hero .scroll-hint { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; }

/* Stichwörter, Fotokarten und Abzeichen im Startbild */
.film-hero .rotator { justify-content: center; margin-top: 18px; }
.film-hero .rot-label { color: var(--ink-2); text-shadow: 0 1px 8px #000; }
.film-hero .rot-words { color: var(--accent-2); text-shadow: 0 1px 10px rgba(0, 0, 0, .8); }
.film-hero .hero-visual { position: absolute; inset: 0; aspect-ratio: auto; pointer-events: none; z-index: 1; perspective: 1200px; }
.film-hero .card-photo { pointer-events: auto; border: 5px solid #F3EAD8; border-radius: 6px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .85); }
.film-hero .p1 { width: clamp(170px, 15vw, 250px); height: auto; aspect-ratio: 800 / 534; top: auto; right: 3.5%; bottom: 14%; z-index: 2; }
.film-hero .p2 { width: clamp(130px, 11vw, 190px); height: auto; aspect-ratio: 4 / 3; left: auto; right: 13%; bottom: 31%; z-index: 1; }
.film-hero .p3 { width: clamp(160px, 14vw, 230px); height: auto; aspect-ratio: 800 / 534; left: 3.5%; right: auto; bottom: 15%; z-index: 2; }
.film-hero .badge { pointer-events: auto; background: rgba(11, 18, 38, .62); border-color: rgba(243, 234, 216, .16); }
.film-hero .badge strong { color: var(--ink); }
.film-hero .badge .flags svg { stroke: var(--red); } .film-hero .badge .flags .cn { color: var(--red); }
.film-hero .b1 { top: 34%; left: 5%; }
.film-hero .b2 { top: 30%; right: 5%; left: auto; }
.film-hero .b3 { top: auto; bottom: 39%; left: 13%; }
@media (max-width: 1100px) { .film-hero .hero-visual { display: none; } }

/* ---------- Szenen (Akte) ---------- */
.act { position: relative; margin: clamp(20px, 4vw, 40px) 0; }
.act-stage { position: relative; height: clamp(360px, 78vh, 760px); overflow: hidden; isolation: isolate;
  -webkit-mask: linear-gradient(to bottom, transparent, #000 9%, #000 88%, transparent);
          mask: linear-gradient(to bottom, transparent, #000 9%, #000 88%, transparent); }
.act-img { position: absolute; inset: -4% 0; width: 100%; height: 108%; object-fit: cover; z-index: -2;
  transform: scale(calc(1.16 - var(--p, .5) * .12)) translateY(calc((var(--p, .5) - .5) * -6%));
  will-change: transform; }
.act-shade { position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(8, 13, 30, .92) 0%, rgba(8, 13, 30, .35) 34%, transparent 55%),
              radial-gradient(130% 90% at 50% 40%, transparent 55%, rgba(5, 8, 20, .55)); }
.act-thread { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.act-thread path { fill: none; stroke: var(--thread); stroke-width: .32; stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(255, 70, 45, .9)) drop-shadow(0 0 9px rgba(255, 70, 45, .45));
  stroke-dasharray: 1; stroke-dashoffset: calc(1 - min(1, var(--p, 0) * 1.6)); }
.act-caption { position: absolute; left: 0; right: 0; bottom: clamp(30px, 7vh, 70px); max-width: var(--maxw); margin: 0 auto;
  padding: 0 var(--gutter); }
.act-no { font: 600 12px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--accent-2);
  text-shadow: 0 1px 10px #000; opacity: 0; transform: translateY(12px); transition: .8s var(--ease); }
.act-title { margin: 10px 0 0; font: 500 clamp(34px, 5vw, 64px)/1.02 var(--display); letter-spacing: -.02em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .8); opacity: 0; transform: translateY(16px); transition: .9s .1s var(--ease); }
.act-title .zh-t { display: block; margin-top: 8px; font-size: .42em; letter-spacing: .3em; color: var(--ink-2); font-family: "XY Serif SC", var(--display); }
html[data-lang="zh"] .act-title .zh-t { font-size: .55em; }
.act-sub { max-width: 640px; margin-top: 14px; font: italic 400 clamp(17px, 1.7vw, 22px)/1.45 var(--display); color: #f6e7c4;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .95); opacity: 0; transform: translateY(12px); transition: .9s .25s var(--ease); }
html[data-lang="zh"] .act-sub { font-style: normal; font-family: "XY Serif SC", var(--display); }
.act.is-in .act-no, .act.is-in .act-title, .act.is-in .act-sub { opacity: 1; transform: none; }

/* Inhaltsverzeichnis der Akte */
.act-index { display: flex; flex-wrap: wrap; gap: 10px; }
.act-index a { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 10px; border-radius: 999px;
  border: 1.5px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 14.5px; transition: .3s var(--ease); }
.act-index a b { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 999px;
  background: rgba(242, 180, 90, .14); color: var(--accent-2); font: 600 13px/1 var(--display); }
.act-index a:hover { border-color: var(--accent-2); color: var(--ink); }

/* Fallstudien: alle sichtbar, untereinander */
.cases { padding-bottom: 40px; }
.cases > .wrap + .act { margin-top: clamp(30px, 6vw, 70px); }
.case { margin-top: clamp(-120px, -10vw, -60px); position: relative; z-index: 2; background: rgba(20, 31, 60, .88); backdrop-filter: blur(10px);
  border-color: rgba(243, 234, 216, .1); margin-bottom: clamp(40px, 8vw, 90px); }
.case-meta { color: var(--accent-2); }
.viz-card { background: rgba(11, 18, 38, .6) !important; border-color: var(--line) !important; }

/* In den Projekt-Akten überlappt die Karte die Szene – Untertitel höher setzen */
.cases .act-caption { bottom: clamp(100px, 16vh, 170px); }

/* Über mich: Szene direkt am Abschnittsanfang */
.about { padding-top: 20px; }
.about .act { margin-top: 0; margin-bottom: clamp(40px, 7vw, 80px); }

/* Karten und Bänder an die Nacht anpassen */
.stat, .layer, .cloud, .translate, .video-frame, .tl-body { border-color: var(--line); }
.marquee { background: var(--bg-2); border-color: var(--line); }
.stamp { background: var(--red) !important; }
.contact .btn-primary { background: var(--red); color: #fff; }
.contact .btn-primary:hover { background: var(--ink); color: var(--bg); }
.photo-frame img, .m-item img { filter: saturate(.95) contrast(1.02); }
.contact .blobs { opacity: .35; }
.grain { opacity: .05 !important; mix-blend-mode: screen !important; }

/* ---------- Handy ---------- */
@media (max-width: 760px) {
  .film-hero .hero-inner { padding-top: 96px; gap: 24vh; }
  .act-stage { height: 62vh; min-height: 360px; }
  .act-img { object-position: var(--fx, 40%) 50%; }
  .case { margin-top: -40px; }
  .cases .act-caption { bottom: 70px; }
}

/* ---------- Ruhige Fassung ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-img, .hero-thread, .act-img { transform: none !important; animation: none !important; }
  .stars i, .water, .glow, .thread-pulse { animation: none !important; }
  .thread-line { animation: none; stroke-dashoffset: 0; }
  .act-thread path { stroke-dashoffset: 0; }
  .act-no, .act-title, .act-sub { opacity: 1; transform: none; transition: none; }
}
