/* frameus – V2 (artsy) */

/* Avenir Next kommt vom Gerät (Mac/iPhone haben sie). Überall sonst: Mulish als freie, ähnliche Ersatzschrift.
   Für den Livegang: Avenir-Next-Webfont-Lizenz (Monotype) kaufen und hier als woff2 einbinden. */

:root {
  --ink: #f4f2ee;
  --ink-dim: rgba(244, 242, 238, .55);
  --ink-faint: rgba(244, 242, 238, .32);
  --bg: #050505;
  --font: "Frameus Sans", "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 2.6vw, 40px);
  --ease: cubic-bezier(.22, .61, .2, 1);
  --nav-size: clamp(17px, 1.6vw, 30px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
body { font-family: var(--font); font-weight: 400; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; }

@media (hover: hover) and (pointer: fine) {
  html, body, *, *::before, *::after { cursor: none !important; }
}

/* ---------- Bühne (Videos) ---------- */
#stage { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
/* Unsichtbare Glasscheibe über allen Videos: die Maus erreicht die Vimeo-Player nie.
   Sonst setzt der Vimeo-Player beim Bewegen seinen eigenen Mauszeiger (in seiner Bildmitte). */
#stage::after { content: ""; position: absolute; inset: 0; z-index: 50; background: transparent; }
.scene { position: absolute; inset: 0; opacity: 0; transition: opacity .5s var(--ease); pointer-events: none; }
.scene.is-active { opacity: 1; }
.scene .poster, .scene .loop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.scene.show-poster .poster { opacity: 1; }            /* Standbild nur im Notfall */
.scene .loop.is-ready { opacity: 1; }
.scene .vimeo { position: absolute; inset: 0; opacity: 0; transition: opacity .7s var(--ease); }
.scene.is-ready .vimeo { opacity: 1; }

/* Querformat: Video füllt immer den ganzen Screen */
.frame { position: absolute; top: 50%; left: 50%;
  width: max(100vw, calc(100vh * var(--r)));
  height: max(100vh, calc(100vw / var(--r)));
  transform: translate(-50%, -50%); }
.frame iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; }

/* Hochformat: 3 × 9:16 nebeneinander (= 27:16), randlos auf den Screen skaliert. Handy: 1 × 9:16 im Vollbild. */
.tri { position: absolute; top: 50%; left: 50%; display: flex; transform: translate(-50%, -50%);
  width: max(100vw, calc(100vh * 27 / 16)); height: max(100vh, calc(100vw * 16 / 27)); }
.tri.n1 { width: max(100vw, calc(100vh * 9 / 16)); height: max(100vh, calc(100vw * 16 / 9)); }
.tri .cell { flex: 1 1 0; position: relative; overflow: hidden; }
/* Jede Zelle ist exakt 9:16. Weicht das Video ab (z. B. 4:5), wird es per Cover hineinskaliert – nie Ränder. */
.tri .cell iframe { pointer-events: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 0; display: block;
  width: max(100%, calc(100% * var(--r) / .5625)); height: max(100%, calc(100% * .5625 / var(--r))); }

/* ---------- Schleier (dunkler / unscharf, wenn Text drüber liegt) ---------- */
#veil { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .7s var(--ease);
  background: rgba(0, 0, 0, .38); }
body[data-panel="work"] #veil, body[data-panel="talents"] #veil { background: linear-gradient(90deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.5) 100%); opacity: 1; }
body[data-panel="about"] #veil, body[data-panel="contact"] #veil { opacity: 1; background: rgba(0, 0, 0, .4); }

/* ---------- Logo ---------- */
#logo { position: fixed; top: max(12px, calc(var(--gutter) - 18px)); left: max(12px, calc(var(--gutter) - 18px)); z-index: 30; width: clamp(92px, 7.5vw, 128px); color: #fff; mix-blend-mode: difference; display: block; }
#logo svg { width: 100%; height: auto; display: block; }
#logo svg, #intro .mark svg { shape-rendering: geometricPrecision; }
/* Handys/Tablets: kein Mischmodus – iOS rendert ihn über Videos unscharf. Stattdessen reines Weiß mit weichem Schatten */
@media (pointer: coarse) {
  #logo { mix-blend-mode: normal; }
  #logo::before { content: ""; position: absolute; z-index: -1; pointer-events: none; inset: -1.6em -2.2em;
    background: radial-gradient(closest-side, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)); }
}

/* ---------- Navigation (rechts, Mitte zwischen work und talents = Bildschirmmitte) ---------- */
#menu { position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 20; display: flex; align-items: center; }
/* weicher, transparent-schwarzer Hof hinter dem Menü, damit es auch auf hellen Stellen lesbar bleibt */
#menu::before { content: ""; position: absolute; z-index: -1; pointer-events: none; top: -9em; bottom: -9em; right: calc(-1 * var(--gutter)); width: 34em;
  font-size: var(--nav-size); background: radial-gradient(ellipse 60% 50% at 100% 50%, rgba(0, 0, 0, .34), rgba(0, 0, 0, .14) 55%, rgba(0, 0, 0, 0) 100%); }
#nav, .list li button { text-shadow: 0 0 .9em rgba(0, 0, 0, .28); }
#nav { display: flex; flex-direction: column; align-items: flex-end; font-size: var(--nav-size); line-height: 1.02; text-transform: lowercase; }
#nav button { display: block; text-transform: lowercase; padding: 0 0 0 .6em; transform-origin: right center; transition: transform .5s var(--ease), opacity .5s var(--ease); }
body[data-panel] #nav button { opacity: .38; transform: scale(.9); }
body[data-panel] #nav button.is-on { opacity: 1; transform: scale(1.1); }

/* Listen (Work / Talents) gleiten links neben der Navigation auf */
.list { position: absolute; right: 100%; top: 50%; transform: translate(16px, -50%); opacity: 0; pointer-events: none;
  transition: opacity .5s var(--ease), transform .6s var(--ease); text-align: right; padding-right: clamp(14px, 1.4vw, 26px); }
.list.is-open { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.list ul { list-style: none; max-height: 78vh; overflow-y: auto; scrollbar-width: none; padding: max(1vh, .4em) 0 max(1vh, .45em) 5em; }
.list ul::-webkit-scrollbar { display: none; }
.list li button { display: block; width: 100%; text-align: right; white-space: nowrap; text-transform: lowercase; font-size: var(--nav-size); line-height: 1.02;
  transform-origin: right center; transition: transform .45s var(--ease), opacity .45s var(--ease); }
.list.has-hover li button, .list:hover li button { opacity: .38; transform: scale(.92); }
.list.has-hover:not(:hover) li button.is-on, .list li button:hover { opacity: 1; transform: scale(1.06); }

/* ---------- About ---------- */
.panel { position: fixed; z-index: 15; opacity: 0; pointer-events: none; transition: opacity .6s var(--ease), transform .8s var(--ease); }
.panel.is-open { opacity: 1; pointer-events: auto; }
#about { left: var(--gutter); top: 50%; transform: translateY(calc(-50% + 18px)); max-width: min(42rem, 56vw); }
#about.is-open { transform: translateY(-50%); }
#about .lead { font-size: clamp(26px, 2.6vw, 46px); line-height: 1.12; letter-spacing: -.005em; font-weight: 400; margin: 0; }
#about .body { margin-top: 1.1em; max-width: 34rem; font-size: clamp(14px, 1.05vw, 18px); line-height: 1.34; }
#about .body p { color: rgba(244, 242, 238, .58); }
#about .body p { margin: 0; }
#about .body p + p { margin-top: .8em; }

/* ---------- Contact: mittig, einfach untereinander ---------- */
#contact { inset: 0; display: grid; place-content: center; text-align: center; transform: translateY(14px); }
#contact.is-open { transform: none; pointer-events: none; }
#contact.is-open > div { pointer-events: auto; }   /* Links nur klickbar, wenn Contact offen ist */
#contact > div { pointer-events: none; font-weight: 600; font-size: clamp(22px, 2.5vw, 44px); line-height: 1.16; letter-spacing: -.005em; }
#contact a { display: block; width: fit-content; margin: 0 auto; transition: opacity .4s var(--ease); }
#contact > div:hover a { opacity: .45; }
#contact > div a:hover { opacity: 1; }
#contact .addr { margin-top: 1.1em; font-weight: 400; font-size: .42em; line-height: 1.4; }

/* ---------- Info unten links (Projekt oder Talent) ---------- */
#info { position: fixed; z-index: 12; left: 0; bottom: 0; padding: 0 var(--gutter) var(--gutter); display: flex; gap: clamp(24px, 3vw, 56px); align-items: flex-end;
  opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .8s var(--ease); pointer-events: none; max-width: 100vw; text-shadow: 0 1px 14px rgba(0,0,0,.45); }
/* Dunkler Schleier hinter dem Text: Ellipse genau so groß wie die Fläche → läuft an allen Rändern auf 0 aus, keine Kante */
#info::before { content: ""; position: absolute; left: 0; bottom: 0; width: 80vw; height: 62vh; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 100% 100% at 0% 100%, rgba(0,0,0,.75) 0%, rgba(0,0,0,.6) 22%, rgba(0,0,0,.38) 45%, rgba(0,0,0,.16) 68%, rgba(0,0,0,.05) 85%, rgba(0,0,0,0) 100%); }
body.show-info #info { opacity: 1; transform: none; }
body.show-info #info button { pointer-events: auto; }
#info h2 { font-weight: 600; font-size: clamp(17px, 1.3vw, 23px); line-height: 1.15; margin-bottom: .7rem; }
/* der Titel bestimmt die Breite nicht mit – Credits und Text stehen immer im gleichen Abstand, ein langer Titel ragt einfach darüber */
#info h2 { width: 0; white-space: nowrap; }
#info h2 span { display: block; font-weight: 400; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); margin-top: .35rem; }
#info dl { display: grid; grid-template-columns: max-content max-content; justify-content: start; column-gap: 1.1em; row-gap: .2em; font-size: 13px; line-height: 1.45; }
#info dt { color: var(--ink-dim); text-transform: uppercase; letter-spacing: .1em; font-size: 9.5px; padding-top: .25em; }
#info dd { color: var(--ink); }
#info ul { list-style: none; font-size: 13.5px; line-height: 1.5; }
#info ul button { text-align: left; transition: opacity .3s; }
#info ul:hover button { opacity: .5; }
#info ul button:hover { opacity: 1; }
#info ul span { color: var(--ink-dim); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; margin-left: .7em; }
#info p { max-width: 23rem; font-size: 13.5px; line-height: 1.55; color: rgba(244,242,238,.88); -webkit-text-stroke: .15px rgba(244,242,238,.5); }

/* ---------- Fuß: Ton + Rechtliches ---------- */
#foot { position: fixed; z-index: 25; right: var(--gutter); bottom: var(--gutter); display: flex; gap: 1.4rem; align-items: center; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); }
#foot a, #foot button { transition: color .3s; }
#foot a:hover, #foot button:hover { color: var(--ink); }
#sound { display: inline-flex; align-items: center; gap: .6em; letter-spacing: .16em; text-transform: uppercase; font-size: 10px; }
#sound .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
#sound .bars i { width: 2px; height: 3px; background: currentColor; transition: height .3s; }
body.sound-on #sound { color: var(--ink); }
body.sound-on #sound .bars i { animation: bar 1s ease-in-out infinite; }
body.sound-on #sound .bars i:nth-child(2) { animation-delay: -.3s; }
body.sound-on #sound .bars i:nth-child(3) { animation-delay: -.6s; }
@keyframes bar { 0%, 100% { height: 3px; } 50% { height: 10px; } }

/* ---------- Cursor-Punkt (bleibt immer klein) ---------- */
#dot { position: fixed; left: 0; top: 0; z-index: 100; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #fff; pointer-events: none;
  mix-blend-mode: difference; transition: opacity .3s; opacity: 0; will-change: transform; }
#dot.is-visible { opacity: 1; }
@media not ((hover: hover) and (pointer: fine)) { #dot { display: none; } }

/* ---------- Intro (nach icomat): Logo baut sich aus reinem Weiß auf (von unten-Mitte nach links,
   rechts und oben), dann schiebt sich alles nach oben weg: Dunkel kommt zuerst an den unteren Ecken,
   wird Schwarz, und darunter erscheint direkt die Seite ---------- */
#intro { position: fixed; inset: 0; z-index: 90; overflow: hidden; pointer-events: none; }
/* .bahn fährt nach oben, .hell fährt gegenläufig mit – das Weiß steht also still und wird nur
   vom Schwarz überdeckt (.deckel schneidet es auf Höhe der Schwarz-Mitte ab). Strecke: 130+100+60 = 290vh + 100vh */
#intro .bahn, #intro .hell { will-change: transform; transition: transform .9s cubic-bezier(.65, 0, .3, 1); }
#intro .bahn { position: absolute; left: 0; top: 0; width: 100%; }
#intro.weg .bahn { transform: translate3d(0, -390vh, 0); }
#intro .deckel { position: absolute; left: 0; top: 0; width: 100%; height: 280vh; overflow: hidden; }
/* dvh = wirklich sichtbare Höhe (iPhone-Safari rechnet 100vh ohne Adressleiste → Logo säße zu tief) */
#intro .hell { position: relative; height: 100vh; height: 100dvh; background: #f6f6f4; overflow: hidden; display: grid; place-items: center; }
#intro.weg .hell { transform: translate3d(0, 390vh, 0); }
#intro .hell .grain { mix-blend-mode: multiply; opacity: .2; }
#intro .wisch { position: absolute; left: 0; top: 100vh; top: 100dvh; width: 100%; z-index: 2; }
/* runde Front: an beiden Seiten kommt das Dunkel zuerst, die Mitte bleibt am längsten hell */
#intro .kante { height: 130vh;
  background: linear-gradient(rgba(11, 11, 11, 0) 55%, #0b0b0b 100%),
    radial-gradient(ellipse 52% 115% at 50% 0%, rgba(11, 11, 11, 0) 0%, rgba(11, 11, 11, .45) 45%, rgba(11, 11, 11, .9) 78%, #0b0b0b 100%);
  -webkit-mask-image: linear-gradient(transparent, rgba(0, 0, 0, .06) 12%, rgba(0, 0, 0, .22) 24%, rgba(0, 0, 0, .46) 36%, rgba(0, 0, 0, .7) 48%, rgba(0, 0, 0, .87) 58%, rgba(0, 0, 0, .96) 67%, #000 76%);
          mask-image: linear-gradient(transparent, rgba(0, 0, 0, .06) 12%, rgba(0, 0, 0, .22) 24%, rgba(0, 0, 0, .46) 36%, rgba(0, 0, 0, .7) 48%, rgba(0, 0, 0, .87) 58%, rgba(0, 0, 0, .96) 67%, #000 76%); }
#intro .schwarz { height: 100vh; margin-top: -1px; background: #0b0b0b; }
#intro .aus { height: 60vh; margin-top: -1px; background: linear-gradient(#0b0b0b, rgba(11, 11, 11, .55) 45%, rgba(11, 11, 11, 0)); }
#intro .mark { position: relative; z-index: 3; width: clamp(74px, 6.15vw, 107px); color: #111; }
@property --b { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
#intro .mark svg { width: 100%; height: auto; display: block; --b: 0%;
  -webkit-mask-image: radial-gradient(ellipse calc(var(--b) * .75) calc(var(--b) * 2.4) at 50% 100%, #000 62%, transparent 100%);
          mask-image: radial-gradient(ellipse calc(var(--b) * .75) calc(var(--b) * 2.4) at 50% 100%, #000 62%, transparent 100%); }
#intro.da .mark svg { animation: aufbau .6s cubic-bezier(.35, .6, .25, 1) forwards; }
@keyframes aufbau { to { --b: 130%; } }
#intro.is-done { visibility: hidden; }
body:not(.logo-da) #logo { opacity: 0; }
body.logo-da #logo { transition: opacity .5s var(--ease); }

/* Filmkorn (Intro) */
.grain { position: absolute; inset: -100%; pointer-events: none; z-index: 2; opacity: .16; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain .5s steps(5) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-7%, 4%); } 40% { transform: translate(5%, -9%); } 60% { transform: translate(-3%, 8%); } 80% { transform: translate(9%, 2%); } 100% { transform: translate(0, 0); } }

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  :root { --nav-size: 20px; --menu-h: calc(4 * var(--nav-size) * 1.02); }
  #menu { top: var(--gutter); bottom: auto; transform: none; }
  #nav { margin-top: -.18em; }
  .list { position: fixed; right: var(--gutter); left: var(--gutter); top: calc(var(--gutter) + var(--menu-h) + 22px); transform: translateY(-10px); padding-right: 0; }
  .list.is-open { transform: none; }
  .list ul { max-height: 55vh; padding: .3em 0 .45em 2em; margin-top: -.3em; }
  .list li button { white-space: normal; text-wrap: balance; padding-left: 1.2em; }
  #about { max-width: none; right: var(--gutter); top: auto; bottom: calc(var(--gutter) + 40px); transform: translateY(18px); }
  #about.is-open { transform: none; }
  #info { flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: calc(var(--gutter) + 30px); padding-right: 30vw; }
  #info p { display: none; }
  #info h2 { width: auto; white-space: normal; }
  #foot { left: var(--gutter); justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation: none !important; } }
