/* iPii.TV 3D-Erlebnis — Marken-Tokens von ipii.tv */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-var.woff2?v=20260823-3d10") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/space-grotesk-var.woff2?v=20260823-3d10") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-var.woff2?v=20260823-3d10") format("woff2");
}

:root {
  --canvas: #2b2b2a;
  --canvas-deep: #242423;
  --canvas-raised: #30302f;
  --surface: #353533;
  --ink: #fdf3f3;
  --ink-soft: rgba(253, 243, 243, 0.78);
  --ink-muted: rgba(253, 243, 243, 0.55);
  --ink-faint: rgba(253, 243, 243, 0.34);
  --mark: #b3362f;
  --cta: #8a1d1d;
  --cta-hover: #a52525;
  --ink-red: #d96a5f;
  --positive: #93aa99;
  --hairline: rgba(253, 243, 243, 0.105);
  --font-display: "Inter", sans-serif;
  --font-app: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scroll-padding-block: 0;
}
body {
  background: var(--canvas-deep);
  color: var(--ink);
  font-family: var(--font-app);
  overflow-x: hidden;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink-red); outline-offset: 3px; }

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--canvas-deep);
  display: flex; flex-direction: column; gap: 28px;
  align-items: center; justify-content: center;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-bars { display: flex; gap: 10px; height: 84px; align-items: flex-end; }
.loader-bars span {
  width: 18px; height: 72px; border-radius: 9px; background: var(--ink);
  animation: barload 1.1s var(--ease) infinite;
}
.loader-bars span.red { background: var(--mark); height: 84px; animation-delay: 0.12s; }
.loader-bars span:nth-child(3) { animation-delay: 0.24s; }
.loader-bars span:nth-child(4) { animation-delay: 0.36s; }
@keyframes barload { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(0.55); } }
#loader p { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); letter-spacing: 0; }

/* ---------- Canvas & Vignette ---------- */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
#vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 58%, rgba(10, 10, 10, 0.34) 100%),
    linear-gradient(to bottom, rgba(16,16,15,0.46), transparent 16%, transparent 84%, rgba(16,16,15,0.5));
}

/* ---------- Topbar ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(18px, 4vw, 44px);
  opacity: 0; transition: opacity 0.8s var(--ease) 0.2s;
}
/* Scrim hinter der Topbar, damit vorbeiscrollende Texte lesbar bleiben */
#topbar::before {
  content: ""; position: absolute; inset: 0; height: 86px; z-index: -1;
  background: linear-gradient(rgba(24, 24, 23, 0.92), rgba(24, 24, 23, 0));
  pointer-events: none;
}
body.ready #topbar { opacity: 1; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; font-weight: 500; font-size: 17px; }
.brand strong { color: var(--ink-red); font-weight: 500; }
.toplinks { display: flex; gap: 22px; align-items: center; font-size: 14px; }
.toplinks a { text-decoration: none; color: var(--ink-soft); transition: color var(--fast, 150ms); }
.toplinks a:hover { color: var(--ink); }
.toplinks .cta {
  background: var(--cta); color: var(--ink); padding: 9px 18px; border-radius: 8px;
  transition: background 150ms;
}
.toplinks .cta:hover { background: var(--cta-hover); }
.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(20, 20, 19, 0.55);
}
.view-switch > span,
.view-switch > a {
  min-width: 38px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.view-switch > span { background: var(--cta); color: var(--ink); }
.view-switch > a:focus-visible { outline: 1px solid var(--cta); outline-offset: 2px; }
@media (max-width: 640px) {
  .toplinks > a:not(.cta) { display: none; }
  .toplinks { gap: 8px; }
  .toplinks .cta { padding: 10px 12px; }
  .view-switch > span,
  .view-switch > a { min-width: 34px; }
}
@media (max-width: 480px) {
  #topbar { padding: 15px 14px; }
  .toplinks > .cta { display: none; }
  .brand { flex: 0 0 auto; }
}

/* ---------- Bullets ---------- */
#bullets {
  position: fixed; right: clamp(10px, 2vw, 26px); top: 50%; transform: translateY(-50%);
  z-index: 20; display: flex; flex-direction: column; gap: 14px;
  opacity: 0; transition: opacity 0.8s var(--ease) 0.4s;
}
body.ready #bullets { opacity: 1; }
#bullets a {
  /* 24px Touch-Target, sichtbarer Punkt bleibt 8px (content-box) */
  width: 8px; height: 8px; padding: 8px; margin: -8px;
  border-radius: 50%;
  background: var(--ink-faint); background-clip: content-box; display: block; position: relative;
  transition: background 220ms, transform 220ms var(--ease);
}
#bullets a.active {
  background: var(--mark);
  transform: scale(1.5);
  box-shadow: 0 0 12px rgba(179, 54, 47, 0.6);
}
#bullets a::after {
  content: attr(data-label);
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0;
  color: var(--ink-muted); white-space: nowrap;
  opacity: 0; transition: opacity 200ms; pointer-events: none;
}
#bullets a:hover::after, #bullets a.active::after { opacity: 1; }
/* Mobile/Tablet: Punkt-Navigation ausblenden statt anschneiden (Scroll-Steuerung reicht) */
@media (max-width: 900px) { #bullets { display: none; } }

/* ---------- Sim-Chip ---------- */
#simchip {
  position: fixed; right: clamp(18px, 4vw, 44px); bottom: 18px; z-index: 20;
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0;
  color: var(--ink-muted);
  background: rgba(20, 20, 19, 0.55); border: 1px solid var(--hairline);
  padding: 9px 14px; border-radius: 999px;
  backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.8s var(--ease) 0.6s;
  max-width: min(78vw, 560px);
}
body.ready #simchip { opacity: 1; }
#simchip .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--mark); flex: none;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(179,54,47,0.55); } 60% { box-shadow: 0 0 0 7px rgba(179,54,47,0); } }

/* ---------- Sound-Toggle ---------- */
#soundtoggle {
  position: fixed; left: clamp(18px, 4vw, 44px); bottom: 18px; z-index: 21;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--hairline);
  background: rgba(20, 20, 19, 0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.8s var(--ease) 0.7s, border-color 200ms, transform 200ms var(--ease);
}
body.ready #soundtoggle { opacity: 1; }
#soundtoggle:hover { border-color: var(--ink-faint); transform: scale(1.06); }
#soundtoggle .bars { display: flex; gap: 3px; align-items: flex-end; height: 15px; }
#soundtoggle .bars i {
  width: 2.5px; height: 4px; border-radius: 1.5px;
  background: var(--ink-muted);
  transition: background 200ms;
}
#soundtoggle.on .bars i { background: var(--ink-red); animation: eq 1s ease-in-out infinite; }
#soundtoggle.on .bars i:nth-child(2) { animation-delay: 0.18s; }
#soundtoggle.on .bars i:nth-child(3) { animation-delay: 0.36s; }
#soundtoggle.on .bars i:nth-child(4) { animation-delay: 0.54s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@media (prefers-reduced-motion: reduce) { #soundtoggle.on .bars i { animation: none; height: 10px; } }

/* ---------- Scroll hint ---------- */
#scrollhint {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0; text-transform: uppercase;
  color: var(--ink-muted); transition: opacity 0.5s;
}
#scrollhint i {
  width: 1px; height: 42px; background: linear-gradient(var(--mark), transparent);
  display: block; animation: drip 1.8s var(--ease) infinite;
}
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: top; } 56% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
#scrollhint.gone { opacity: 0; }
@media (max-height: 800px) { #scrollhint { display: none; } }

/* ---------- Story panels ---------- */
#story { position: relative; z-index: 10; }
.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: safe center;
  padding: 14vh clamp(18px, 4vw, 44px) 12vh;
  pointer-events: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.panel .copy { pointer-events: none; max-width: 560px; }
.panel .copy a, .panel .copy nav { pointer-events: auto; }
.copy.left { margin-right: auto; }
.copy.right { margin-left: auto; text-align: left; }
@media (min-width: 900px) {
  .copy.right { margin-right: clamp(52px, 6vw, 96px); }
}
.copy.center { margin: 0 auto; text-align: center; }
.copy.slim { max-width: 640px; }

.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0;
  text-transform: uppercase; color: var(--ink-red); margin-bottom: 20px;
}
h1, h2 {
  font-family: var(--font-display); font-weight: 800;
  letter-spacing: 0; line-height: 1.04;
  text-wrap: balance;
}
h1 { font-size: 72px; margin-bottom: 26px; }
h2 { font-size: 48px; margin-bottom: 22px; }
@media (max-height: 780px) {
  h2 { font-size: 40px; }
}
/* Mobil: Text bekommt eine dunkle, weiche Lesefläche vor der 3D-Szene */
@media (max-width: 700px) {
  .panel .copy {
    background: rgba(18, 18, 17, 0.52);
    border-radius: 8px;
    padding: 22px 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  h1 { font-size: 40px; }
  h2 { font-size: 32px; }
}
h1 em, h2 em { font-style: normal; color: var(--ink-red); }
.lead { font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-soft); line-height: 1.6; }
.copy p:not(.eyebrow):not(.fine) { color: var(--ink-soft); line-height: 1.65; font-size: 15.5px; }
.copy p + p { margin-top: 12px; }

/* Text-Lesbarkeit über 3D: weiche Schatten-Kontur statt Panel-in-Panel */
.copy { text-shadow: 0 2px 22px rgba(8, 8, 8, 0.85), 0 0 60px rgba(8, 8, 8, 0.6); }

.ticks { list-style: none; margin-top: 20px; display: flex; flex-direction: column; gap: 9px; }
.ticks li { color: var(--ink-muted); font-size: 14px; padding-left: 18px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 2px; background: var(--mark); }
.ticks li b { color: var(--ink); font-weight: 600; }

.steps { list-style: none; margin-top: 18px; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: s; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; padding-left: 44px; position: relative; }
.steps li::before {
  content: "0" counter(s);
  position: absolute; left: 0; top: 0;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-red);
}
.steps li b { color: var(--ink); }
.steps code {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9em;
  white-space: nowrap;
}

.cta-row { display: flex; gap: 14px; margin-top: 30px; justify-content: inherit; flex-wrap: wrap; }
.copy.center .cta-row { justify-content: center; }
.cta-row.compact { margin-top: 20px; }
.cta-row.compact .btn { padding: 11px 18px; font-size: 13px; }
.btn {
  text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 14px 28px; border-radius: 8px; transition: background 160ms, transform 160ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--cta); color: var(--ink); }
.btn.primary:hover { background: var(--cta-hover); }
.btn.ghost { border: 1px solid var(--hairline); color: var(--ink-soft); }
.btn.ghost:hover { border-color: var(--ink-faint); color: var(--ink); }
.fine { margin-top: 16px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0; }
.fine a { color: var(--ink-muted); }

/* Hero & Finale zentrieren vertikal stärker */
.hero, .finale { align-items: flex-end; padding-bottom: 16vh; }
.finale { align-items: center; }

.price-row { display: flex; gap: 16px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.price {
  border: 1px solid var(--hairline); border-radius: 8px;
  padding: 22px 34px; background: rgba(20, 20, 19, 0.5); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; gap: 6px;
}
.price.featured { border-color: rgba(217, 106, 95, 0.5); }
.price .amount { font-family: var(--font-display); font-weight: 800; font-size: 38px; letter-spacing: 0; }
.price .per { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); letter-spacing: 0; }

@media (max-width: 380px) {
  h1 { font-size: 36px; }
  h2 { font-size: 29px; }
  .btn { padding: 12px 18px; text-align: center; }
  .price { padding: 18px 20px; width: 100%; }
}

@media (max-width: 360px) and (max-height: 700px) {
  #simchip { display: none; }
  #soundtoggle { top: 15px; bottom: auto; left: 106px; }
  .panel { padding-top: 80px; padding-bottom: 40px; }
  .panel .copy { padding: 16px 14px; }
  h1 { font-size: 34px; margin-bottom: 18px; }
  .lead { font-size: 14px; line-height: 1.48; }
  .cta-row { gap: 8px; margin-top: 18px; }
  .fine { margin-top: 10px; }
}

html[data-quality="medium"] .panel .copy,
html[data-quality="medium"] #simchip,
html[data-quality="medium"] #soundtoggle {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Footer */
.foot { align-items: center; padding-top: 8vh; padding-bottom: 10vh; }
.foot-logo { opacity: 0.9; margin-bottom: 18px; }
.grenze { font-size: 14px; }
.grenze b { color: var(--ink); }
.footlinks { display: flex; gap: 26px; justify-content: center; margin-top: 26px; font-size: 13.5px; flex-wrap: wrap; }
.footlinks a { color: var(--ink-muted); text-decoration: none; }
.footlinks a:hover { color: var(--ink); }

/* WebGL-Fehler */
#webgl-error {
  position: fixed; inset: 0; z-index: 90; background: var(--canvas-deep);
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px;
}
#webgl-error[hidden] { display: none; }
#webgl-error a { color: var(--ink-red); }

/* Panel-Inhalte: gestaffeltes, ruhiges Einblenden je Sektion */
.copy > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.panel.on .copy > * { opacity: 1; transform: none; }
.panel.on .copy > *:nth-child(1) { transition-delay: 0.05s; }
.panel.on .copy > *:nth-child(2) { transition-delay: 0.14s; }
.panel.on .copy > *:nth-child(3) { transition-delay: 0.24s; }
.panel.on .copy > *:nth-child(4) { transition-delay: 0.34s; }
.panel.on .copy > *:nth-child(5) { transition-delay: 0.44s; }
.panel.on .copy > *:nth-child(6) { transition-delay: 0.52s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .copy > * { transition: none; }
  #scrollhint i, .loader-bars span, #simchip .dot { animation: none; }
}

/* Mobile: 3D bleibt die Hauptfläche, Text liegt kompakt und scrollbar am unteren Rand. */
@media (max-width: 700px) {
  #scrollhint { display: none; }

  .panel,
  .hero,
  .finale,
  .foot {
    align-items: flex-end;
    padding: 72px 14px 84px;
  }

  .panel .copy {
    pointer-events: auto;
    touch-action: pan-y;
    width: 100%;
    max-width: 560px;
    max-height: min(42svh, 380px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(217, 106, 95, 0.55) transparent;
    padding: 15px 16px;
    background: rgba(18, 18, 17, 0.78);
    border: 1px solid rgba(253, 243, 243, 0.08);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  }

  .panel .copy::-webkit-scrollbar { width: 4px; }
  .panel .copy::-webkit-scrollbar-track { background: transparent; }
  .panel .copy::-webkit-scrollbar-thumb {
    background: rgba(217, 106, 95, 0.55);
    border-radius: 2px;
  }

  .eyebrow { font-size: 10px; margin-bottom: 10px; }
  h1 { font-size: 28px; margin-bottom: 13px; overflow-wrap: anywhere; }
  h2 { font-size: 27px; margin-bottom: 12px; }
  .lead { font-size: 14px; line-height: 1.45; }
  .copy p:not(.eyebrow):not(.fine) { font-size: 13.5px; line-height: 1.48; }
  .copy p + p { margin-top: 8px; }

  .ticks { margin-top: 11px; gap: 6px; }
  .ticks li { font-size: 12.5px; line-height: 1.35; padding-left: 16px; }
  .ticks li::before { top: 5px; width: 6px; height: 6px; }
  .steps { margin-top: 11px; gap: 9px; }
  .steps li { font-size: 12.5px; line-height: 1.4; padding-left: 36px; }
  .steps li::before { font-size: 10px; }

  .cta-row { gap: 8px; margin-top: 14px; }
  .cta-row.compact { margin-top: 11px; }
  .cta-row.compact .btn { flex: 1 1 135px; padding: 10px 12px; font-size: 12px; }
  .btn { padding: 10px 14px; font-size: 13px; }
  .fine { margin-top: 9px; font-size: 10px; line-height: 1.4; }

  .price-row { gap: 8px; margin-top: 13px; }
  .price { flex: 1 1 130px; padding: 13px 14px; gap: 3px; }
  .price .amount { font-size: 27px; }
  .price .per { font-size: 9.5px; }
  .foot-logo { width: 30px; height: auto; margin-bottom: 10px; }
  .footlinks { gap: 12px; margin-top: 13px; font-size: 12px; }
}

@media (max-width: 360px) and (max-height: 700px) {
  .hero .copy { padding: 8px 10px; }
  .hero .eyebrow { font-size: 8px; margin-bottom: 4px; }
  .hero h1 { font-size: 25px; margin-bottom: 6px; }
  .hero .lead { font-size: 11.5px; line-height: 1.3; }
  .hero .cta-row { margin-top: 6px; }
  .hero .btn { padding: 7px 11px; font-size: 11.5px; }
  .hero .fine { display: none; }
}


/* Sichtbarer Fokus-Ring (2026-08-24) */
a:focus-visible, button:focus-visible {
  outline: 2px solid #d96a5f;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Dezente Legal-Links im Hero (Impressumspflicht) */
.hero-legal { margin-top: 10px; }
.hero-legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(253,243,243,0.25); }
.hero-legal a:hover { color: #fdf3f3; }
