/* ═══════════════════════════════════════════════════════════════
   ZOYOS · Zugangs-Gate (Oktober 2026)
   Vollbild vor index, cases, workshop. Ruhig, monochrom, Wortmarke
   als einziges Bildelement. Inhalt bleibt im DOM, Rechtsseiten frei.
   Logik: gate.js
   ═══════════════════════════════════════════════════════════════ */

html.gated, html.gated body { overflow: hidden; }

/* Abdeckung, bis gate.js das Overlay eingefügt hat (kein Aufblitzen der Seite) */
html.gated:not(.gate-ready)::after {
  content: ''; position: fixed; inset: 0; z-index: 9000; background: #0E121C;
}

.gate {
  --fg: #fff;
  --fg-2: rgba(255,255,255,.64);
  --fg-3: rgba(255,255,255,.42);
  --hair: rgba(255,255,255,.18);
  --slow: cubic-bezier(.16,1,.3,1);
  position: fixed; inset: 0; z-index: 9000;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  background: #0E121C;
  color: var(--fg);
  font-family: var(--body);
  transition: opacity 1.1s var(--slow);
}
.gate:focus { outline: none; }
.gate h2:focus { outline: none; }

.gate-inner {
  min-height: 100%;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 30px clamp(20px, 4vw, 56px) 28px;
}

/* Kleinschrift: Navigation, Footer, Labels */
.gate-head, .gate-foot, .g-field > span, .g-btn, .g-link, .gate-tag {
  font: 500 11px/1 var(--body); letter-spacing: .22em; text-transform: uppercase;
}

/* ─── Kopfzeile (nur außerhalb des Intros sichtbar) ─── */
.gate-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 40px;
}
.gate-head > * { opacity: 0; visibility: hidden; transition: opacity .6s var(--slow), visibility .6s; }
.gate:not([data-state="intro"]) .gate-head > * { opacity: 1; visibility: visible; }
.gate-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 12px 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--fg-2);
  transition: color .3s;
}
.gate-back:hover { color: var(--fg); }
.gate-back svg { width: 14px; height: 14px; transition: transform .4s var(--slow); }
.gate-back:hover svg { transform: translateX(-3px); }
.gate-logo-sm { height: 15px; width: auto; }

/* ─── Bühne + Ansichten ─── */
.gate-stage {
  display: grid; place-items: center;
  padding: clamp(40px, 8vh, 96px) 0;
}
.gate-view {
  width: 100%; text-align: center;
  opacity: 0; transform: translateY(10px);
  transition: opacity .7s var(--slow), transform .7s var(--slow);
}
.gate-view.is-active { opacity: 1; transform: none; }
.gate-view[hidden] { display: none; }
.gate:not([data-state="intro"]) .gate-stage { padding: clamp(32px, 6vh, 64px) 0; }

/* Intro: nur Wortmarke, eine Zeile, zwei Wege */
.gate-intro { padding-bottom: 4vh; transform: none; }
.gate-logo-lg {
  width: min(70vw, 760px); height: auto; margin-inline: auto;
  opacity: 0; filter: blur(8px); transform: scale(1.015);
  transition: opacity 1.8s var(--slow), filter 1.8s var(--slow), transform 2.2s var(--slow);
}
.gate-tag {
  margin-top: clamp(30px, 4.5vh, 48px);
  letter-spacing: .38em; margin-right: -.38em; color: var(--fg-3);
}
.gate-actions {
  margin-top: clamp(48px, 8vh, 84px);
  display: flex; align-items: center; justify-content: center; gap: 36px;
}
.gate-tag, .gate-actions { opacity: 0; transition: opacity 1.4s var(--slow); }
.gate.is-in .gate-logo-lg { opacity: 1; filter: none; transform: none; }
.gate.is-in .gate-tag { opacity: 1; transition-delay: .7s; }
.gate.is-in .gate-actions { opacity: 1; transition-delay: 1s; }

.g-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #0E121C; border: 0; border-radius: 999px;
  padding: 20px 38px; cursor: pointer;
  transition: background .4s, color .4s;
}
.g-btn:hover { background: #EFF5FF; }
.g-btn:focus-visible, .g-link:focus-visible, .gate-back:focus-visible, .gate-foot a:focus-visible {
  outline: 1px solid #fff; outline-offset: 5px;
}
.g-btn[disabled] { opacity: .55; cursor: progress; }
.g-link {
  position: relative; background: none; border: 0; padding: 20px 2px; cursor: pointer; color: var(--fg-2);
  transition: color .3s;
}
.g-link::after {
  content: ''; position: absolute; left: 2px; right: 2px; bottom: 13px; height: 1px;
  background: currentColor; opacity: .45; transform-origin: left; transition: opacity .3s, transform .5s var(--slow);
}
.g-link:hover { color: var(--fg); }
.g-link:hover::after { opacity: 1; }

/* Formular-Ansichten */
.gate-view h2 {
  font-family: var(--head); font-weight: 400;
  font-size: clamp(32px, 3.8vw, 48px); line-height: 1.1; letter-spacing: -0.025em;
  color: var(--fg);
}
.g-sub {
  max-width: 46ch; margin: 20px auto 0;
  font-size: 15.5px; line-height: 1.75; color: var(--fg-2);
}
.g-sub b { color: var(--fg); font-weight: 500; overflow-wrap: anywhere; }

.gate-form { width: min(560px, 100%); margin: clamp(40px, 6vh, 60px) auto 0; text-align: left; }
.g-row { display: grid; grid-template-columns: 1fr 1fr; column-gap: 36px; }
.g-field { display: block; margin-bottom: 32px; }
.g-field > span { display: block; color: var(--fg-3); margin-bottom: 6px; }
.g-field > span i { font-style: normal; opacity: .6; }
.g-field input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0;
  padding: 10px 0 12px; font: 400 16px/1.4 var(--body); color: var(--fg); outline: none;
  transition: border-color .4s;
}
.g-field input:hover { border-bottom-color: rgba(255,255,255,.32); }
.g-field input:focus { border-bottom-color: #0077FF; }
.g-field input:-webkit-autofill {
  -webkit-text-fill-color: #fff; caret-color: #fff;
  -webkit-box-shadow: 0 0 0 40px #10141F inset;
}
.g-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gate-form .g-btn { display: flex; margin: 16px auto 0; }
.g-legal { margin-top: 26px; text-align: center; font-size: 12px; line-height: 1.6; color: var(--fg-3); }
.g-legal a, .g-error a { color: var(--fg-2); text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 3px; }
.g-legal a:hover, .g-error a:hover { color: var(--fg); }
.g-error { margin-top: 14px; text-align: center; font-size: 13px; color: var(--fg-2); }

/* Zugangscode */
.gate-code { width: min(380px, 100%); margin: clamp(40px, 6vh, 60px) auto 0; }
.gate-code .g-field { margin-bottom: 36px; }
.gate-code input {
  text-align: center; font-size: 18px; letter-spacing: .32em; text-transform: uppercase; padding-left: .32em;
}
.gate-code input::placeholder { color: var(--fg-3); font-size: 11px; letter-spacing: .38em; font-weight: 500; }
.gate-code.is-wrong input { border-bottom-color: #DC2626; }
.g-msg { min-height: 1.4em; margin-top: 22px; font-size: 13px; color: var(--fg-2); }

.g-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Fußzeile ─── */
.gate-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  font-size: 10px; color: var(--fg-3);
  opacity: 0; transition: opacity 1.4s var(--slow) 1.2s;
}
.gate.is-in .gate-foot { opacity: 1; }
.gate-foot nav { display: flex; gap: 30px; }
.gate-foot a { color: var(--fg-3); transition: color .3s; }
.gate-foot a:hover { color: var(--fg); }

/* Abgang */
.gate.is-leaving { opacity: 0; pointer-events: none; }

/* Cookie-Banner passend zum Gate (nur solange es offen ist) */
html.gated .cookie-banner {
  max-width: 380px; padding: 20px 22px; border-radius: 16px;
  background: rgba(22,27,39,.96); border: 1px solid rgba(255,255,255,.1);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 30px 60px -24px rgba(0,0,0,.7);
  font-family: var(--body);
}
html.gated .cookie-banner-text { font-size: 12px; color: rgba(255,255,255,.6); }
html.gated .cookie-banner-title { font: 500 13px/1.4 var(--body); letter-spacing: 0; color: #fff; margin-bottom: 6px; }
html.gated .cookie-banner-toggle { font-family: var(--body); color: rgba(255,255,255,.42); }
html.gated .cookie-banner-toggle:hover { color: #fff; }
html.gated .cookie-banner-details { color: rgba(255,255,255,.6); background: rgba(255,255,255,.04); border-left-color: rgba(255,255,255,.2); }
html.gated .cookie-banner-link { color: #fff; }
html.gated .cookie-banner-btn {
  font: 500 10.5px/1 var(--body); letter-spacing: .18em; text-transform: uppercase;
  padding: 13px 14px; border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.72); background: transparent;
}
html.gated .cookie-banner-btn:hover { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.4); }
html.gated .cookie-banner-btn-accept, html.gated .cookie-banner-btn-accept:hover { background: #fff; color: #0E121C; border-color: #fff; }
html.gated .cookie-banner-btn-accept:hover { background: #EFF5FF; }

@media (prefers-reduced-motion: reduce) {
  .gate, .gate-view, .gate-logo-lg, .gate-tag, .gate-actions, .gate-foot, .gate-head > * { transition: none !important; }
}

@media (max-width: 640px) {
  .gate-inner { padding: 22px 16px 22px; }
  .gate-logo-sm { height: 13px; }
  .gate-logo-lg { width: 78vw; }
  .gate-tag { letter-spacing: .3em; margin-right: -.3em; }
  .gate-actions { flex-direction: column; gap: 6px; }
  .gate-actions .g-btn { width: min(300px, 100%); }
  .gate[data-state="form"] .gate-stage { place-items: start center; padding-top: 48px; }
  .g-row { grid-template-columns: 1fr; }
  .g-field { margin-bottom: 26px; }
  .gate-foot { flex-direction: column; gap: 14px; }
  .gate-foot nav { gap: 22px; }
}
