/* TimeTales · Startseite "Drei Tore".
   Standard (Handy, Touch, fx lite/off, reduzierte Bewegung, ohne JS): Hero, danach drei Welt-Tafeln, die sich per
   position: sticky übereinander schieben.
   html.ix-pin (setzt das Inline-Skript im <head>, page-index.js bestätigt oder entfernt es): Hero und WizardRP-Tafel
   liegen in EINER klebenden Bühne. Das erste Tor ist ein Fenster auf die Tafel darunter; beim Scrollen fahren vier
   deckende Flächen (oben, links, rechts, unten) per translate auseinander. Kein clip-path, kein Filter, kein JS-Pin. */

/* ---------- Welt-Tokens (world-*.css gilt hier nicht, daher lokal) ---------- */
.ix-world--wizard, .ix-gate--wizard {
  --accent: #f2c66d; --accent-ink: #171004; --ink-0: #07080d;
  --w-family: var(--font-serif); --w-weight: 500; --w-stretch: 100%; --w-tracking: -.012em; --w-case: none;
}
.ix-world--scp, .ix-gate--scp {
  --accent: #e23b3b; --accent-ink: #0b0505; --ink-0: #070707; --radius: 0px; --radius-pill: 0px;
  --w-family: var(--font-display-narrow); --w-weight: 850; --w-stretch: 68%; --w-tracking: -.004em; --w-case: uppercase;
}
.ix-world--swtor, .ix-gate--swtor {
  --accent: #6fb8ff; --accent-ink: #03101f; --ink-0: #04060d;
  --w-family: var(--font-display-wide); --w-weight: 700; --w-stretch: 125%; --w-tracking: .06em; --w-case: uppercase;
}
.ix-world--wizard { --btn-family: var(--font-body); --btn-weight: 700; --btn-size: .75rem; --btn-tracking: .16em; --btn-case: uppercase; --art-w: 3200px; --art-h: 1800px; }
.ix-world--scp { --btn-family: var(--font-display); --btn-weight: 800; --btn-size: 1rem; --btn-stretch: 82%; --btn-tracking: .055em; --btn-case: uppercase; --meta-family: var(--font-mono); --art-w: 2985px; --art-h: 2239px; }
.ix-world--swtor { --btn-family: var(--font-display); --btn-weight: 700; --btn-size: .75rem; --btn-stretch: 125%; --btn-tracking: .14em; --btn-case: uppercase; --art-w: 4800px; --art-h: 2700px; }

/* Die Hub-Farben bleiben für Hero und Bühne erhalten, auch wenn eine Tafel --ink-0 umsetzt */
.ix-journey { position: relative; --hub-ink: #06070a; background: var(--hub-ink); }
.ix-stage { display: contents; }
.ix-runway, .ix-hero__jamb { display: none; }

/* ---------- Hero ---------- */
.ix-hero {
  position: relative;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh; min-height: 100svh;
  background: var(--hub-ink);
}

.ix-hero__copy {
  position: relative; z-index: 3;
  display: grid; gap: var(--s-5);
  padding: calc(var(--nav-h) + clamp(1rem, 3.5vh, 2.5rem)) var(--gutter) clamp(1.25rem, 3.5vh, 2.25rem);
  background: var(--hub-ink);
  --display-cap: 9.6vw;
}
.ix-hero__copy > :not(canvas) { position: relative; z-index: 1; }
.ix-hero__title { margin: 0; animation: ix-fade-up .6s var(--ease-out) both; }
.ix-hero__title em { display: block; }
.ix-hero__side { display: grid; gap: var(--s-5); animation: ix-fade-up .6s var(--ease-out) .1s both; }
.ix-hero__lead { margin: 0; max-width: 38ch; color: var(--text); font-size: var(--step-0); }
.ix-hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.ix-sand { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
html:not(.js) :is(.ix-sand, .ix-dune) { display: none; }

.ix-gates {
  position: relative;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 300px;
  padding: 0 var(--gutter) clamp(.75rem, 2.5vh, 1.5rem);
}
.ix-gate { position: relative; display: flex; flex-direction: column; min-width: 0; color: var(--text); text-decoration: none; background: var(--hub-ink); }
.ix-gate__frame { position: relative; flex: 1; min-height: 0; overflow: hidden; overflow: clip; border-top: 1px solid var(--line-strong); }
.ix-gate + .ix-gate .ix-gate__frame { border-left: 1px solid var(--line-strong); }
.ix-gate__frame picture { position: absolute; inset: 0; animation: ix-fade .6s var(--ease-out) .15s both; }
.ix-gate--scp .ix-gate__frame picture { animation-delay: .22s; }
.ix-gate--swtor .ix-gate__frame picture { animation-delay: .29s; }
.ix-gate__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-3) var(--ease-out); }
.ix-gate--wizard img { object-position: 70% 40%; }
.ix-gate--scp img { object-position: 50% 12%; }
.ix-gate--swtor img { object-position: 30% 50%; }
/* weicher Übergang zur Beschriftung, als Verlauf über dem Bild */
.ix-gate__frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--hub-ink) 70%, transparent) 0, transparent 26%);
}

.ix-gate__cap {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  height: 64px; padding: 0 var(--s-4);
  border-top: 1px solid var(--line-strong);
  background: var(--hub-ink);
}
.ix-gate__name, .ix-world__title {
  font-family: var(--w-family); font-weight: var(--w-weight); font-stretch: var(--w-stretch);
  letter-spacing: var(--w-tracking); text-transform: var(--w-case);
}
.ix-gate__name { font-size: clamp(1.05rem, .8rem + 1vw, 1.75rem); line-height: 1; white-space: nowrap; transition: color var(--dur-1); }
.ix-gate--wizard .ix-gate__name { font-size: clamp(1.3rem, 1rem + 1.3vw, 2.2rem); }
.ix-gate--swtor .ix-gate__name { font-size: clamp(.8rem, .6rem + .8vw, 1.3rem); }
.ix-gate__state { display: inline-block; min-width: 3.9em; }

@media (hover: hover) {
  .ix-gate:hover .ix-gate__name { color: var(--accent); }
  .ix-gate:hover .ix-gate__frame img { transform: scale(1.04); }
}
.ix-gate:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 4; }

@media (min-width: 900px) {
  .ix-hero__copy {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 25rem); align-items: end; gap: var(--s-7);
    --display-cap: min(6.3vw, 12.5vh);
  }
  .ix-hero__side { padding-bottom: .4rem; }
}
@media (max-width: 899px) {
  .ix-gate__cap { flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--s-2); height: 88px; padding: 0 var(--s-2); }
  .ix-gate__cap .tt-chip { --chip-pad: 8px; padding-inline: 8px; gap: 6px; letter-spacing: .02em; }
  .ix-gate--wizard img { object-position: 68% 40%; }
}

/* ---------- Welt-Tafeln: volle Höhe, normaler Fluss, sticky gestapelt ---------- */
.ix-world {
  position: relative; isolation: isolate;
  display: grid; min-height: 100vh; min-height: 100svh;
  overflow: hidden; overflow: clip;
  background: var(--ink-0); color: var(--text);
  border-top: 1px solid var(--line-strong);
}
@media (min-height: 600px) {
  .ix-world { position: sticky; top: 0; }
  /* Haltestrecke: die Tafel steht kurz vollständig, bevor die nächste darüber fährt */
  .ix-world--wizard, .ix-world--scp { margin-bottom: 35vh; }
}

.ix-world__art {
  position: absolute; inset: 0; z-index: -2; margin-inline: auto;
  width: min(100%, var(--art-w)); height: min(100%, var(--art-h));
  overflow: hidden; overflow: clip;
}
.ix-world__pic { position: absolute; inset: 0; display: block; }
.ix-world__pic img { width: 100%; height: 100%; object-fit: cover; }
.ix-world--wizard .ix-world__pic img { object-position: 50% 40%; }
.ix-world--scp .ix-world__pic img { object-position: 62% 30%; }
.ix-world--swtor .ix-world__pic img { object-position: 50% 45%; }
/* sehr große Bildschirme: Bild bleibt in seiner Auflösung und läuft an den Rändern in die Fläche aus */
@media (min-width: 1811px) {
  .ix-world--scp .ix-world__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, var(--ink-0), transparent 10%, transparent 90%, var(--ink-0)); }
}
@media (min-width: 2091px) {
  .ix-world--swtor .ix-world__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, var(--ink-0), transparent 10%, transparent 90%, var(--ink-0)); }
}

.ix-world__fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ix-world--wizard .ix-world__fx {
  background: linear-gradient(to top, var(--ink-0) 0 14%, color-mix(in srgb, var(--ink-0) 78%, transparent) 34%, transparent 64%);
}
.ix-world--scp .ix-world__fx {
  background:
    repeating-linear-gradient(to bottom, rgb(0 0 0 / .22) 0 1px, transparent 1px 3px),
    linear-gradient(to right, color-mix(in srgb, var(--ink-0) 88%, transparent) 0, transparent 52%),
    linear-gradient(to top, var(--ink-0) 0, transparent 36%);
}
.ix-world--scp .ix-world__fx::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22vh;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 7%, transparent) 96%, color-mix(in srgb, var(--accent) 55%, transparent) 99%);
  animation: ix-scan 5.5s steps(44) infinite;
}
.ix-world--swtor .ix-world__fx {
  background:
    linear-gradient(to top, var(--ink-0) 0 18%, color-mix(in srgb, var(--ink-0) 76%, transparent) 38%, transparent 66%),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink-0) 55%, transparent), transparent 24%);
}
.ix-journey.is-idle .ix-world__fx::before { animation-play-state: paused; }

.ix-world__body {
  display: grid; align-content: end; gap: var(--s-5);
  padding: calc(var(--nav-h) + var(--s-5)) var(--gutter) clamp(2rem, 6vh, 4.5rem);
  min-width: 0;
}
.ix-world__title { margin: 0; line-height: .86; color: var(--text); white-space: nowrap; }
.ix-world__title em { font-style: normal; color: var(--accent); }
.ix-world__info { display: grid; gap: var(--s-4); justify-items: start; }
.ix-world__pitch { margin: 0; max-width: 46ch; font-size: var(--step-0); line-height: 1.55; color: var(--text); text-wrap: pretty; }
.ix-world__chip { min-width: 10.5rem; }

/* WizardRP: großer Serifentitel unten links, Infozeile darunter */
.ix-world--wizard .ix-world__title { font-size: min(20vw, 38vh); letter-spacing: -.03em; margin-left: -.04em; }
.ix-world--wizard .ix-world__title em { font-style: italic; font-weight: 500; }
.ix-world--wizard .ix-world__pitch { font-family: var(--font-serif); font-size: var(--step-1); line-height: 1.35; max-width: 40ch; }

/* SCP:RP: Titel oben links, Akte unten links, die Figur bleibt rechts frei */
.ix-world--scp .ix-world__body { align-content: space-between; }
.ix-world--scp .ix-world__title { font-size: min(26vw, 30vh); line-height: .8; margin-left: -.02em; }
.ix-world--scp .ix-world__info {
  width: min(100%, 31rem); padding: var(--s-5);
  background: var(--ink-0); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
}
.ix-world--scp .ix-world__pitch { font-family: var(--font-mono); font-size: .875rem; line-height: 1.6; }

/* SWTOR RP: breit, zentriert */
.ix-world--swtor .ix-world__body { justify-items: center; text-align: center; }
.ix-world--swtor .ix-world__title { font-size: min(10.4vw, 22vh); line-height: 1; margin-right: -.06em; }
.ix-world--swtor .ix-world__info { justify-items: center; }
.ix-world--swtor .ix-world__pitch { max-width: 52ch; }

@media (min-width: 900px) {
  .ix-world--wizard .ix-world__info { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line-strong); }
  .ix-world--wizard .ix-world__info .tt-btn { justify-self: end; }
  .ix-world--scp .ix-world__title { font-size: min(15vw, 28vh); }
  /* Figur nach rechts rücken, damit Titel und Akte links frei stehen */
  .ix-world--scp .ix-world__art { translate: 12% 0; }
  .ix-world--scp .ix-world__art::before { content: ""; position: absolute; z-index: 1; inset: 0 auto 0 0; width: 14%; background: linear-gradient(to right, var(--ink-0), transparent); }
}

/* Das Bild gleitet nach, während die Tafel hereinfährt (scrollgebunden im Compositor, nur transform) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .ix-world__pic { animation: ix-art-in linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
  }
}

/* ---------- Bühne: das erste Tor öffnet sich in WizardRP ---------- */
html.js.ix-pin .ix-stage { display: block; position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; overflow: clip; }
html.js.ix-pin .ix-runway { display: block; height: 120vh; }
html.js.ix-pin .ix-hero { position: absolute; inset: 0; z-index: 2; min-height: 0; background: transparent; }
html.js.ix-pin .ix-gates { min-height: 0; }
html.js.ix-pin .ix-world--wizard { position: absolute; inset: 0; z-index: 1; min-height: 0; margin: 0; border-top: 0; }
html.js.ix-pin .ix-world--wizard .ix-world__art { animation: ix-fade .6s var(--ease-out) .15s both; }
html.js.ix-pin .ix-world--wizard .ix-world__pic { animation: none; transform: scale(1.1); transform-origin: 19% 70%; }
html.js.ix-pin .ix-world--wizard :is(.ix-world__fx, .ix-world__body) { opacity: 0; visibility: hidden; }

/* Tor eins ist das Fenster */
html.js.ix-pin .ix-gate--wizard { background: transparent; }
html.js.ix-pin .ix-gate--wizard .ix-gate__frame picture,
html.js.ix-pin .ix-gate--wizard .ix-gate__frame::after { display: none; }

/* links: Rand neben dem Fenster */
html.js.ix-pin .ix-hero__jamb { display: block; position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: var(--gutter); background: var(--hub-ink); }
/* rechts: Tor zwei und drei, nach oben und unten verlängert */
html.js.ix-pin :is(.ix-gate--scp, .ix-gate--swtor) { z-index: 1; }
html.js.ix-pin :is(.ix-gate--scp, .ix-gate--swtor)::before { content: ""; position: absolute; z-index: -1; inset: -100vh -2px -100vh -1px; background: var(--hub-ink); }
html.js.ix-pin .ix-gate--swtor::before { right: calc(-1 * var(--gutter) - 2px); }
/* unten: Beschriftung von Tor eins, nach links und unten verlängert */
html.js.ix-pin .ix-gate--wizard .ix-gate__cap { position: relative; z-index: 2; }
html.js.ix-pin .ix-gate--wizard .ix-gate__cap::before { content: ""; position: absolute; z-index: -1; inset: 0 0 -60vh calc(-1 * var(--gutter)); background: var(--hub-ink); }

/* ---------- Community ---------- */
.ix-community { position: relative; z-index: 1; background: var(--ink-0); border-top: 1px solid var(--line); }
html.js .ix-community:has(.ix-dune) { padding-bottom: 230px; }
.ix-dune { position: absolute; left: 0; bottom: 0; width: 100%; height: 200px; display: block; pointer-events: none; }
.ix-community__grid { display: grid; gap: var(--s-8); }
.ix-discord { display: grid; gap: var(--s-6); justify-items: start; align-content: start; }
.ix-discord__title { margin: 0; max-width: 12ch; }
.ix-discord__stats { display: flex; flex-wrap: wrap; gap: var(--s-6) var(--s-8); margin: 0; visibility: hidden; }
.ix-discord.is-live .ix-discord__stats { visibility: visible; }
html:not(.js) .ix-discord__stats { display: none; }
.ix-stat { display: grid; gap: var(--s-2); }
.ix-stat dt { color: var(--text-3); }
.ix-stat__num {
  margin: 0; min-width: 3ch; text-align: left;
  font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: var(--step-4);
  line-height: .95; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text);
}
.ix-stat--online .ix-stat__num { color: var(--ok); }

.ix-rows { list-style: none; margin: 0; padding: 0; align-self: end; border-bottom: 1px solid var(--line-strong); }
.ix-row {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-1) var(--s-4);
  padding: var(--s-5) var(--s-3) var(--s-5) 0;
  border-top: 1px solid var(--line-strong); color: var(--text); text-decoration: none; overflow: hidden; overflow: clip;
}
.ix-row::before {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: scaleY(0); transform-origin: 50% 100%; transition: transform var(--dur-2) var(--ease-out);
}
.ix-row > * { position: relative; transition: transform var(--dur-2) var(--ease-out), color var(--dur-1); }
.ix-row__name { font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-size: var(--step-3); line-height: 1; letter-spacing: -.01em; }
.ix-row__desc { grid-column: 1; color: var(--text-2); font-size: var(--step-0); }
.ix-row__icon { grid-column: 2; grid-row: 1 / span 2; width: 34px; height: 34px; fill: currentColor; color: var(--accent); }
@media (hover: hover) {
  .ix-row:hover::before { transform: scaleY(1); }
  .ix-row:hover > * { color: var(--accent-ink); }
  .ix-row:hover :is(.ix-row__name, .ix-row__desc) { transform: translateX(var(--s-4)); }
  .ix-row:hover .ix-row__icon { transform: translateX(-4px) rotate(-45deg); }
  .ix-row[target="_blank"]:hover .ix-row__icon { transform: translate(-2px, -2px) scale(1.12); }
}
.ix-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (min-width: 900px) {
  .ix-community__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-9); }
}

/* ---------- Keyframes ---------- */
@keyframes ix-fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes ix-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ix-scan { from { transform: translateY(-22vh); } to { transform: translateY(100vh); } }
@keyframes ix-art-in { from { transform: scale(1.1) translateY(-5%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .ix-hero__title, .ix-hero__side, .ix-gate__frame picture, .ix-world__art, .ix-world--scp .ix-world__fx::before { animation: none !important; }
}
html[data-fx="off"] :is(.ix-gate__frame picture, .ix-world__pic, .ix-world--scp .ix-world__fx::before) { animation: none; }
