/* ==========================================================================
   flowstatehq.de · Die Weiche
   FlowState GbR (Wiesbaden) · Link-Weiche Wallet / Agentur · Stand 16.11.2026
   Ein Schrift-System (Encode Sans variabel, Breite als Marken-Mechanik),
   Tinten-Stack aus der Web-Tinte #1B2633, Petrol = Wallet, Orange = Agentur.
   ========================================================================== */

@font-face {
  font-family: "Encode Sans FS";
  src: url("../assets/fonts/encode-sans-latin-wdth.woff2") format("woff2-variations"),
       url("../assets/fonts/encode-sans-latin-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Tinten-Stack (getönt aus #1B2633, nie Schwarz) */
  --ink-950: #080D13;
  --ink-900: #0A1017;
  --ink-850: #0D141C;
  --ink-800: #111A24;
  --ink-750: #15202C;
  --ink-700: #1B2633;
  --line: #213041;
  --line-soft: rgba(124, 150, 176, 0.14);

  /* Text */
  --paper: #EEF2F5;
  --paper-2: #A7B4C1;
  --paper-3: #7E8C9A;

  /* Wege */
  --teal: #3CCBB7;
  --teal-glow: rgba(60, 203, 183, 0.13);
  --teal-haze: rgba(60, 203, 183, 0.07);
  --orange: #F2871C;
  --orange-glow: rgba(242, 135, 28, 0.13);
  --orange-haze: rgba(242, 135, 28, 0.06);
  --root-line: #8A9AAB;

  /* Licht */
  --sky: rgba(64, 104, 140, 0.30);
  --sky-2: rgba(40, 70, 100, 0.18);
  --streak: rgba(238, 242, 245, 0.95);
  --streak-0: rgba(238, 242, 245, 0);
  --tile-ring: rgba(238, 242, 245, 0.10);
  --shadow: rgba(4, 8, 12, 0.55);

  /* Typo */
  --font: "Encode Sans FS", "Encode Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-h1: clamp(2.55rem, min(1.45rem + 4.5vw, 1rem + 7.2vh), 5.4rem);
  --fs-sub: clamp(1rem, 0.93rem + 0.32vw, 1.2rem);
  --fs-title: clamp(1.12rem, 0.92rem + 0.95vw, 1.75rem);
  --fs-body: clamp(0.875rem, 0.84rem + 0.18vw, 1rem);
  --fs-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --fs-micro: 0.75rem;

  /* Form */
  --radius-door: clamp(18px, 1.4rem, 26px);
  --radius-tile: 23%;
  --gutter: 16px;
  --fork-h: clamp(58px, 8.2vh, 100px);

  /* Bewegung: EIN Haus-Easing */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-flow: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink-850);
  color-scheme: dark;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--paper);
  background:
    radial-gradient(70% 42% at 50% -6%, var(--sky) 0%, var(--sky-2) 45%, transparent 75%),
    linear-gradient(180deg, var(--ink-850) 0%, var(--ink-900) 70%, var(--ink-950) 100%);
  background-color: var(--ink-850);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 50%; top: 8px; z-index: 50;
  transform: translate(-50%, -160%);
  padding: 10px 16px; border-radius: 999px;
  background: var(--paper); color: var(--ink-900);
  font-size: var(--fs-small); font-weight: 600;
  transition: transform 0.25s var(--ease);
}
.skip:focus-visible { transform: translate(-50%, 0); }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* -------------------------------------------------------------- Seite */
.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  padding-block: max(30px, calc(env(safe-area-inset-top) + 18px)) max(18px, env(safe-area-inset-bottom));
}

main {
  width: 100%;
  max-width: 940px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* -------------------------------------------------------------- Falke */
.brand { width: 100%; display: flex; justify-content: center; }

.lockup {
  position: relative;
  width: clamp(158px, 120px + 7.5vw, 222px);
  aspect-ratio: 840 / 231;
}
.lockup img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
/* Ein Bild, zwei Schnitte: Falke oben, Wortmarke unten (pixelgleich zum Lockup) */
.lockup-mark { clip-path: inset(0 0 35% 0); }
.lockup-type { clip-path: inset(65% 0 0 0); }

/* Lichtspur auf der Flügel-Oberkante, nur im Intro sichtbar */
.streak {
  position: absolute;
  top: 1.2%;
  right: 22%;
  width: 120vw;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--streak-0) 0%, var(--streak-0) 55%, var(--streak) 100%);
  transform-origin: 100% 50%;
  display: none;
  pointer-events: none;
}

/* -------------------------------------------------------------- Frage */
.ask {
  text-align: center;
  margin-top: clamp(24px, 4.2vh, 52px);
}

h1 {
  font-size: var(--fs-h1);
  font-weight: 720;
  font-stretch: 125%;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
/* Wort-Masken für den Aufstieg; Platz unten gegen abgeschnittene Kanten */
h1 .w {
  display: inline-block;
  overflow: clip;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
  vertical-align: top;
}
h1 .w > span { display: inline-block; }

.sub {
  margin: 0.95em auto 0;
  max-width: 34ch;
  font-size: var(--fs-sub);
  line-height: 1.45;
  color: var(--paper-2);
  text-wrap: balance;
}

/* -------------------------------------------------------------- Weiche */
.ways {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin-top: clamp(10px, 1.2vh, 22px);
  padding-top: var(--fork-h);
}
/* Petrol-/Orange-Dunst unter den Türen */
.ways::before,
.ways::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 30%;
  width: 60%;
  height: 90%;
  pointer-events: none;
}
.ways::before { left: 0; background: radial-gradient(closest-side, var(--teal-haze), transparent); }
.ways::after { right: 0; background: radial-gradient(closest-side, var(--orange-haze), transparent); }

.fork {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: var(--fork-h);
  overflow: visible;
  pointer-events: none;
}
.fork path { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.fork-stem { stroke: var(--root-line); opacity: 0.7; }
.fork-arm { opacity: 0.75; transition: opacity 0.3s var(--ease); }
.fork-arm--wallet { stroke: url(#g-wallet); }
.fork-arm--agentur { stroke: url(#g-agentur); }
.st-root { stop-color: var(--root-line); }
.st-wallet { stop-color: var(--teal); }
.st-agentur { stop-color: var(--orange); }
.st-fade { stop-opacity: 0.55; }
.st-out { stop-opacity: 0.12; }

.ways.is-wallet .fork-arm--wallet,
.ways.is-agentur .fork-arm--agentur { opacity: 1; }
.ways.is-wallet .fork-arm--agentur,
.ways.is-agentur .fork-arm--wallet { opacity: 0.4; }

/* Lichtpunkte (Flow), von JS erzeugt */
.comet { fill: none; stroke-linecap: round; filter: url(#glow); }
.comet--tail { stroke-width: 1.5; opacity: 0.45; }
.comet--head { stroke-width: 2.6; }
.comet--wallet { stroke: var(--teal); }
.comet--agentur { stroke: var(--orange); }

/* -------------------------------------------------------------- Türen */
.doors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2.4vw, 28px);
}

.door {
  --acc: var(--teal);
  --acc-glow: var(--teal-glow);
  position: relative;
  display: flex;
  border-radius: var(--radius-door);
  background:
    radial-gradient(110% 60% at 50% 0%, var(--acc-glow) 0%, transparent 62%),
    var(--ink-800);
  box-shadow: inset 0 0 0 1px var(--line), 0 24px 48px -28px var(--shadow);
  transition: background-color 0.3s var(--ease), transform 0.16s var(--ease);
}
.door--agentur { --acc: var(--orange); --acc-glow: var(--orange-glow); }

.door-in {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(18px, 1.2rem + 1.4vw, 30px) clamp(12px, 0.6rem + 1.6vw, 34px) clamp(16px, 1rem + 1vw, 26px);
}

.door-icon {
  width: clamp(42px, 2.2rem + 1.4vw, 60px);
  height: auto;
  aspect-ratio: 1;
  border-radius: var(--radius-tile);
  box-shadow: 0 0 0 1px var(--tile-ring), 0 10px 24px -10px var(--shadow);
  transition: transform 0.3s var(--ease);
}

.door-brand {
  margin-top: clamp(12px, 0.6rem + 0.6vw, 18px);
  font-size: var(--fs-small);
  font-weight: 620;
  font-stretch: 110%;
  letter-spacing: 0.01em;
  color: var(--acc);
}

.door-title {
  margin-top: 0.3em;
  font-size: var(--fs-title);
  font-weight: 680;
  font-stretch: 116%;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
  hyphens: manual;
}
/* Die ganze Tür ist der Link (Stretched Link), ohne verschachtelte Anker */
.door-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-door);
}
.door-link:focus-visible { outline: none; }
.door-link:focus-visible::after { outline: 2px solid var(--acc); outline-offset: 4px; }

.door-text {
  margin-top: 0.65em;
  max-width: 30ch;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--paper-2);
  text-wrap: pretty;
}

.door-foot {
  margin-top: auto;
  padding-top: clamp(14px, 0.8rem + 0.8vw, 22px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-small);
}

.door-go {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 620;
  font-stretch: 88%;
  letter-spacing: -0.005em;
  color: var(--paper);
  white-space: nowrap;
}
.door-go svg {
  width: 14px; height: 14px; flex: none;
  fill: var(--acc);
  transition: transform 0.25s var(--ease);
}

.door-alt {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  margin: -6px -4px;
  color: var(--paper-3);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.door-alt svg { width: 14px; height: 14px; flex: none; fill: currentColor; }
.door-alt span {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.3s var(--ease);
}
.door-alt:focus-visible { outline-color: var(--acc); }

/* Kontur-Spur, von JS erzeugt */
.trace {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}
.trace path { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.trace .trace-line { opacity: 0.7; transition: opacity 0.3s var(--ease); }
.door--wallet .trace-line { stroke: url(#t-wallet); }
.door--agentur .trace-line { stroke: url(#t-agentur); }
.door.is-on .trace .trace-line { opacity: 1; }

/* Treffer-Ring an der Kartenkante (nur im Intro) */
.hit {
  position: absolute;
  left: 50%; top: 0;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 1.5px solid var(--acc);
  display: none;
  pointer-events: none;
  z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
  .door:hover { background-color: var(--ink-750); }
  .door:hover .door-icon { transform: translateY(-2px) scale(1.04); }
  .door:hover .door-go svg { transform: translateX(3px); }
  .door-alt:hover { color: var(--paper); }
  .door-alt:hover span { background-size: 100% 1px; }
}
.door:active { transform: scale(0.985); }
.door:has(.door-alt:active) { transform: none; }

/* -------------------------------------------------------------- Direkt */
.direct {
  margin-top: clamp(20px, 2.8vh, 44px);
  text-align: center;
}
.direct-lead {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--paper-3);
}
.direct-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
}
.direct-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--paper-2);
  transition: color 0.2s var(--ease), transform 0.16s var(--ease);
}
.direct-list svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.direct-list span {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.3s var(--ease);
}
.direct-list a:active { transform: scale(0.97); }

/* -------------------------------------------------------------- Fuß */
.foot {
  width: 100%;
  max-width: 900px;
  margin-top: clamp(18px, 2.4vh, 40px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 20px;
  font-size: var(--fs-micro);
  color: var(--paper-3);
}
.foot-links { display: flex; gap: 18px; }
.foot-links a {
  padding: 6px 0;
  background: linear-gradient(currentColor, currentColor) 0 85% / 0 1px no-repeat;
  transition: color 0.2s var(--ease), background-size 0.3s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .direct-list a:hover,
  .foot-links a:hover { color: var(--paper); }
  .direct-list a:hover span { background-size: 100% 1px; }
  .foot-links a:hover { background-size: 100% 1px; }
}

/* -------------------------------------------------------------- Größen */
@media (min-width: 600px) {
  .sub { max-width: none; }
  .sub-a { display: block; }
}
@media (min-width: 768px) {
  .door-in { padding-inline: clamp(20px, 3vw, 40px); }
  .door-foot { flex-direction: row; justify-content: center; gap: 22px; }
}

/* Sehr schmale Geräte: Türen stapeln, Weiche wird zum Stamm */
@media (max-width: 349px) {
  .doors { grid-template-columns: 1fr; }
  .fork-arm { display: none; }
  :root { --fork-h: 36px; }
}

/* ==========================================================================
   Intro-Partitur. Versteckte Zustände NUR unter .js.play und nur bei
   erlaubter Motion. .go (von main.js) startet; Failsafes entfernen .play.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js.play .lockup-mark,
  .js.play .lockup-type,
  .js.play h1 .w > span,
  .js.play .sub,
  .js.play .door,
  .js.play .door-in > *,
  .js.play .direct,
  .js.play .foot { opacity: 0; }
  .js.play .fork path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
  .js.play .trace .trace-line { stroke-dasharray: 1 1; stroke-dashoffset: 1; }

  .go .streak,
  .go .hit { display: block; }
  .go .streak { animation: fs-streak 0.78s var(--ease) 0s both; }
  .go .lockup-mark { animation: fs-mark 0.9s var(--ease) 0.06s both; }
  .go .lockup-type { animation: fs-type 0.8s var(--ease) 0.3s both; }
  .go h1 .w > span { animation: fs-rise 0.95s var(--ease) both; }
  .go h1 .w:nth-child(1) > span { animation-delay: 0.36s; }
  .go h1 .w:nth-child(2) > span { animation-delay: 0.45s; }
  .go h1 .w:nth-child(4) > span { animation-delay: 0.54s; }
  .go h1 .w:nth-child(5) > span { animation-delay: 0.63s; }
  .go .sub { animation: fs-up 0.9s var(--ease) 0.7s both; }

  .go .fork-stem { animation: fs-draw 0.42s var(--ease) 0.74s both; }
  .go .fork-arm { animation: fs-draw 0.6s var(--ease) 0.94s both; }
  .go .door { animation: fs-door 0.9s var(--ease) 1.2s both; transform-origin: 50% 0; }
  .go .hit { animation: fs-hit 0.85s var(--ease) 1.22s both; }
  .go .trace .trace-line { animation: fs-draw 0.95s var(--ease) 1.26s both; }
  .go .door-in > * { animation: fs-up 0.85s var(--ease) both; }
  .go .door-in > :nth-child(1) { animation-delay: 1.3s; }
  .go .door-in > :nth-child(2) { animation-delay: 1.36s; }
  .go .door-in > :nth-child(3) { animation-delay: 1.42s; }
  .go .door-in > :nth-child(4) { animation-delay: 1.48s; }
  .go .door-in > :nth-child(5) { animation-delay: 1.54s; }
  .go .direct { animation: fs-up 0.9s var(--ease) 1.68s both; }
  .go .foot { animation: fs-fade 0.9s var(--ease) 1.8s both; }
}

@keyframes fs-streak {
  0%   { opacity: 0; transform: translateX(-70%) scaleX(0.4); }
  18%  { opacity: 1; }
  52%  { opacity: 1; transform: translateX(0) scaleX(1); }
  100% { opacity: 0; transform: translateX(0) scaleX(0); }
}
@keyframes fs-mark {
  0%   { opacity: 0; clip-path: inset(0 100% 35% 0); transform: translateX(-16%); }
  12%  { opacity: 1; }
  100% { opacity: 1; clip-path: inset(0 0 35% 0); transform: none; }
}
@keyframes fs-type {
  0%   { opacity: 0; clip-path: inset(65% 100% 0 0); transform: translateX(-4%); }
  15%  { opacity: 1; }
  100% { opacity: 1; clip-path: inset(65% 0 0 0); transform: none; }
}
@keyframes fs-rise {
  0%   { opacity: 0; transform: translateY(105%); }
  20%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes fs-up {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: none; }
}
@keyframes fs-fade {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes fs-draw {
  0%   { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes fs-door {
  0%   { opacity: 0; transform: translateY(10px) scale(0.965); }
  100% { opacity: 1; transform: none; }
}
@keyframes fs-hit {
  0%   { opacity: 0; transform: scale(0.3); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: scale(3.4); }
}

/* Globaler reduced-motion-Block */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
