@import url('https://fonts.googleapis.com/css2?family=Jersey+15&display=swap');

/* Winter-Olympics by Kirchhoff | Team Farner
   Basislayout: 2/3 dunkler, karierter Bereich oben, 1/3 weiß unten,
   plus dezenter quadratischer Schneefall. Noch keine Inhalte. */

/* Reset & Basics */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #ffffff; /* Fallback */
  color: #0f172a;
  overflow-y: auto;
}

.info-bar {
  position: relative;
  z-index: 20;
  height: var(--info-bar-height);
  width: 100%;
  background: var(--accent);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Jersey 15", system-ui, sans-serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-toggle {
  position: fixed;
  top: calc(12px + var(--info-bar-height));
  right: 28px;
  padding: 0;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-family: "Jersey 15", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1;
  border-radius: 999px;
  cursor: pointer;
  z-index: 30;
  transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
  background: rgba(106, 228, 179, 0.25);
  border-color: var(--accent);
  outline: none;
}

.audio-toggle:active {
  transform: translateY(1px);
}

.audio-toggle.is-playing {
  background: rgba(106, 228, 179, 0.35);
  border-color: var(--accent);
}

:root {
  --bg-top: #222222; /* Fast schwarz, sehr dunkles Blau/Grau */
  --bg-bottom: #ffffff;
  --grid-line: rgba(148, 163, 184, 0.18); /* Leicht heller als Hintergrund */
  --grid-size: 120px;
  --grid-fill-hover: rgba(255, 255, 255, 0.15);
  --accent: #52FB7C;
  --illustration-scale: 0.9; /* einheitlicher Skalierungsfaktor für alle SVGs */
  --info-bar-height: 40px;
}


/* Voller Viewport ohne sichtbare Inhalte */

.site-main {
  min-height: 100vh;
}

.viewport-layout {
  position: relative;
  min-height: 100vh;
  height: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-bottom);
}


/* Oberes 2/3: dunkel, kariert, volle Breite */
.viewport-layout__top {
  position: relative;
  flex: 2;
  background-color: var(--bg-top);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 140px;
  box-sizing: border-box;

  /* Kariertes Muster mit großen Quadraten */
  background-image:
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(180deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size); /* Relativ große Quadrate */
  background-position: 0 0;
  overflow: hidden;
}

.viewport-layout__top::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--grid-size);
  height: var(--grid-size);
  background: var(--grid-fill-hover);
  transform: translate(var(--hover-x, -9999px), var(--hover-y, -9999px)); /* default offscreen */
  opacity: 0;
  transition: opacity 0.35s ease, background-color 0.2s ease, transform 0.08s ease;
  pointer-events: none;
}

.viewport-layout__top.is-hovering::after {
  opacity: 1;
}

/* Headline & Subline positioning */
.hero-text {
  position: relative;
  transform: none;
  text-align: center;
  z-index: 10;
  width: 100%;
}

.site-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 273px;
  max-width: 70vw;
  margin: 0 auto 24px;
}

.site-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-headline {
  color: #FFF;
  text-align: center;
  font-family: "Jersey 15";
  font-size: 95px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  white-space: nowrap;
  margin: 0;
}

.hero-subline {
  color: var(--accent);
  text-align: center;
  font-family: "Jersey 15";
  font-size: 30px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .hero-headline {
    white-space: normal;
    font-size: clamp(48px, 12vw, 76px);
    max-width: 90vw;
    margin: 0 auto;
  }

  .hero-subline {
    font-size: clamp(20px, 6vw, 28px);
    max-width: 90vw;
    margin: 10px auto 0;
  }

  .site-logo {
    width: 220px;
    max-width: 80vw;
    margin-bottom: 16px;
  }
}

/* Unteres 1/3: weiß, volle Breite */
.viewport-layout__bottom {
  flex: 1;
  background-color: var(--bg-bottom);
}

.footer-links {
  position: static;
  height: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  font-family: "Jersey 15";
  font-style: normal;
  font-weight: 400;
  font-size: 18px;
  line-height: 20px;
  text-align: center;
  color: #282828;
  z-index: 10;
  margin: 8px auto 0;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links a:active {
  color: #000;
  transform: translateY(1px);
}

.site-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 32px;
  background: var(--bg-bottom);
  position: static;
  gap: 16px;
}

.footer-link--highscores {
  position: fixed;
  left: 24px;
  bottom: 24px;
  margin: 0;
  z-index: 10;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  font-family: "Jersey 15";
  font-style: normal;
  font-weight: 400;
  font-size: 18px;
  line-height: 20px;
  letter-spacing: 0;
  background: none;
  padding: 0;
  border-radius: 0;
}

.footer-link--highscores:hover {
  color: var(--accent);
}

.footer-link--highscores:active {
  color: #000;
  transform: translateY(1px);
}

@media (max-width: 900px) {
  .site-footer {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .footer-link--highscores {
    position: static;
    left: auto;
    bottom: auto;
    margin: 0;
  }
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Highscore page */
.highscore-page {
  background: #222222;
  color: #f5f5f5;
  font-family: "Jersey 15", system-ui, sans-serif;
}

.highscore-shell {
  min-height: 100vh;
  padding: 48px 24px 56px;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

.highscore-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

.highscore-back {
  position: absolute;
  top: 16px;
  left: 16px;
  color: #56fd8b;
  text-decoration: none;
  font-size: 18px;
  letter-spacing: 0.08em;
  z-index: 2;
}

.highscore-heading {
  text-align: center;
  font-size: clamp(52px, 6vw, 82px);
  margin: 24px 0 48px;
  letter-spacing: 0.08em;
  z-index: 1;
  position: relative;
}

.highscore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(32px, 4vw, 64px);
  z-index: 1;
  position: relative;
}

.highscore-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.highscore-card__hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.highscore-card__icon {
  width: 96px;
  height: auto;
  filter: drop-shadow(0 0 6px rgba(86, 253, 139, 0.4));
}

.highscore-card__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0.08em;
}

.highscore-card__top-score {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #56fd8b;
  font-size: 28px;
  letter-spacing: 0.08em;
}

.highscore-card__score {
  min-width: 52px;
  text-align: right;
}

.highscore-card__dots {
  color: rgba(255, 255, 255, 0.8);
}

.highscore-card__name {
  min-width: 56px;
  text-align: left;
}

.highscore-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  width: min(280px, 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: #e6e6e6;
}

.highscore-list li {
  display: grid;
  grid-template-columns: 48px 48px 1fr 64px;
  gap: 6px;
}

.highscore-list .score,
.highscore-list .name {
  text-align: left;
}

.highscore-list .place {
  text-align: left;
}

.highscore-list .dots {
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

@media (max-width: 640px) {
  .highscore-shell {
    padding: 32px 16px 40px;
  }

  .highscore-card__icon {
    width: 80px;
  }
}

@media (min-width: 1024px) {
  .footer-credit {
    position: fixed;
    left: 24px;
    bottom: 24px;
    margin: 0;
    text-align: left;
    z-index: 20;
  }

  .footer-links {
    position: fixed;
    right: 24px;
    bottom: 24px;
    margin: 0;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    background: none;
    padding: 0;
    border-radius: 0;
  }
}

/* Schneeflocken-Layer */

.snow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -10vh; /* Start leicht oberhalb des Viewports */
  background-color: #e5f0ff;
  opacity: 0.85;
  /* Quadratisch, Größe wird über nth-child überschrieben */
  width: 6px;
  height: 6px;
  animation-name: snow-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* Unterschiedliche Positionen, Größen und Geschwindigkeiten */

.snowflake:nth-child(1) {
  left: 5%;
  width: 5px;
  height: 5px;
  animation-duration: 14s;
  animation-delay: -2s;
}

.snowflake:nth-child(2) {
  left: 15%;
  width: 7px;
  height: 7px;
  animation-duration: 18s;
  animation-delay: -6s;
}

.snowflake:nth-child(3) {
  left: 25%;
  width: 4px;
  height: 4px;
  animation-duration: 16s;
  animation-delay: -9s;
}

.snowflake:nth-child(4) {
  left: 35%;
  width: 8px;
  height: 8px;
  animation-duration: 20s;
  animation-delay: -4s;
}

.snowflake:nth-child(5) {
  left: 45%;
  width: 6px;
  height: 6px;
  animation-duration: 17s;
  animation-delay: -11s;
}

.snowflake:nth-child(6) {
  left: 55%;
  width: 5px;
  height: 5px;
  animation-duration: 19s;
  animation-delay: -7s;
}

.snowflake:nth-child(7) {
  left: 65%;
  width: 7px;
  height: 7px;
  animation-duration: 15s;
  animation-delay: -3s;
}

.snowflake:nth-child(8) {
  left: 75%;
  width: 4px;
  height: 4px;
  animation-duration: 21s;
  animation-delay: -12s;
}

.snowflake:nth-child(9) {
  left: 85%;
  width: 6px;
  height: 6px;
  animation-duration: 17s;
  animation-delay: -5s;
}

.snowflake:nth-child(10) {
  left: 50%;
  width: 9px;
  height: 9px;
  animation-duration: 23s;
  animation-delay: -10s;
}

.snowflake:nth-child(11) {
  left: 12%;
  width: 4px;
  height: 4px;
  animation-duration: 19s;
  animation-delay: -8s;
}

.snowflake:nth-child(12) {
  left: 32%;
  width: 5px;
  height: 5px;
  animation-duration: 22s;
  animation-delay: -14s;
}

.snowflake:nth-child(13) {
  left: 68%;
  width: 7px;
  height: 7px;
  animation-duration: 18s;
  animation-delay: -1s;
}

.snowflake:nth-child(14) {
  left: 78%;
  width: 6px;
  height: 6px;
  animation-duration: 20s;
  animation-delay: -6s;
}

.snowflake:nth-child(15) {
  left: 90%;
  width: 4px;
  height: 4px;
  animation-duration: 16s;
  animation-delay: -9s;
}

.snowflake:nth-child(16) {
  left: 3%;
  width: 8px;
  height: 8px;
  animation-duration: 24s;
  animation-delay: -13s;
}

@keyframes snow-fall {
  from {
    transform: translate3d(0, -10vh, 0);
  }
  to {
    transform: translate3d(0, 110vh, 0);
  }
}

/* Left-side SVG placement */
.side-svg-wrapper {
  position: absolute;
  left: clamp(24px, 6vw, 110px);
  bottom: 18vh;   /* weiter nach oben in den dunklen Bereich */
  transform: none;
  z-index: 5;
  pointer-events: auto;
}

.side-svg {
  width: calc(333px * var(--illustration-scale));
  height: auto;
  overflow: visible; /* verhindert Abschneiden beim Pulsieren */
}

.side-link,
.svg-link {
  display: inline-block;
  text-decoration: none;
  outline: none;
  cursor: pointer;
}

.side-link:focus-visible,
.svg-link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 6px;
}

.side-link #bubble_stock,
.svg-link #bubble_esg,
.svg-link #bubble_pdf {
  transform-origin: center;
  transform-box: fill-box;
}

.side-link:hover #bubble_stock,
.side-link:focus-visible #bubble_stock,
.svg-link:hover #bubble_esg,
.svg-link:focus-visible #bubble_esg,
.svg-link:hover #bubble_pdf,
.svg-link:focus-visible #bubble_pdf {
  animation: bubble-pulse 0.8s ease-in-out infinite;
}


@keyframes bubble-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}


.esg-svg-wrapper {
  position: absolute;
  left: clamp(240px, 18vw, 340px);
  bottom: 8vh;
  z-index: 10;
  pointer-events: auto;
}

.esg-svg {
  width: calc(230px * var(--illustration-scale));
  height: auto;
  overflow: visible;
}

@media (max-width: 1024px) and (min-width: 701px) {
  .viewport-layout {
    min-height: 90vh;
  }

  .viewport-layout__top {
    flex: 1.6;
    padding-top: 110px;
  }

  .side-svg-wrapper {
    bottom: 14vh;
  }

  .esg-svg-wrapper {
    bottom: 10vh;
  }

  .pdf-svg-wrapper {
    bottom: 12vh; /* already set */
  }
}

.pdf-svg-wrapper {
  position: absolute;
  right: clamp(24px, 6vw, 110px);
  bottom: 16vh; /* ragt in den dunklen Bereich hinein */
  z-index: 1;
  pointer-events: auto;
}

/* Override positions for 1024x768 range */
@media (max-width: 1024px) and (min-width: 701px) {
  .side-svg-wrapper {
    bottom: 14vh;
  }

  .esg-svg-wrapper {
    left: 280px;
    bottom: 10vh;
  }

  .pdf-svg-wrapper {
    bottom: 12vh;
  }
}

@media (min-width: 1700px) {
  .side-svg-wrapper {
    left: 300px;
  }

  .esg-svg-wrapper {
    left: 520px;
  }

  .pdf-svg-wrapper {
    right: 300px;
  }
}

/* Ab 2000px wieder näher zusammenrücken */
@media (min-width: 2000px) {
  .side-svg-wrapper {
    left: 540px;
  }

  .esg-svg-wrapper {
    left: 830px;
  }

  .pdf-svg-wrapper {
    right: 470px;
  }
}

/* Flache Viewports: SVGs etwas weiter von den Seiten weg platzieren */
@media (max-height: 800px) and (min-width: 1024px) {
  .side-svg-wrapper {
    left: 140px;
  }

  .esg-svg-wrapper {
    left: 260px;
  }

  .pdf-svg-wrapper {
    right: 140px;
  }
}

/* Ab 1600px etwas mehr Abstand zur Seite */
@media (min-width: 1600px) and (max-width: 1699px) {
  .side-svg-wrapper {
    left: 180px;
  }

  .esg-svg-wrapper {
    left: 320px;
  }

  .pdf-svg-wrapper {
    right: 180px;
  }
}

.pdf-svg {
  width: calc(564px * var(--illustration-scale));
  height: auto;
  overflow: visible;
}

@media (max-width: 1024px) {
  :root {
    --illustration-scale: 0.72; /* ~20% kleiner */
  }
}

@media (max-width: 700px) {
  :root {
    --illustration-scale: 0.58; /* nochmal ~20% kleiner */
    --grid-size: 90px; /* feineres Grid auf Mobile */
  }

  body {
    overflow-y: auto;
  }

  .viewport-layout {
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .viewport-layout__top,
  .viewport-layout__bottom {
    width: 100%;
  }

  .viewport-layout__top {
    min-height: 60vh;
    order: 1;
    padding-top: 120px;
  }

  .hero-headline {
    font-size: clamp(52px, 14vw, 76px);
  }

  .hero-subline {
    font-size: clamp(20px, 5.2vw, 26px);
  }

  .side-svg-wrapper,
  .esg-svg-wrapper,
  .pdf-svg-wrapper {
    position: static;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
  }

  .side-svg {
    max-width: 90vw;
  }

  .esg-svg,
  .pdf-svg {
    max-width: 90vw;
  }

  /* Stock Shopper leicht ins dunkle Feld ziehen */
  .side-svg-wrapper {
    position: relative;
    left: -100px;
    bottom: auto;
    transform: rotate(0);
    width: auto;
    order: 2;
    margin-top: -132px;
    z-index: 3;
  }

  /* PDF und ESG untereinander */
  .pdf-svg-wrapper {
    order: 3;
    margin-top: -72px;
    margin-left: 80px;
    z-index: 5;
  }

  .esg-svg-wrapper {
    order: 4;
    margin-top: 20px;
    margin-left: -170px;
    /* margin-bottom: 120px; */
  }

  .viewport-layout__bottom {
    order: 5;
  }

  /* Footer zentriert unten */
  .footer-links {
    justify-content: center;
  }

  .footer-credit {
    display: block;
  }
}

/* Ensure ESG offset in 1024x768 range is not overridden */
@media (max-width: 1024px) and (min-width: 701px) {
  .esg-svg-wrapper {
    left: 280px !important;
  }
}

/* Portrait 768x1024: adjust ESG left */
@media (max-width: 769px) and (min-height: 1024px) {
  .esg-svg-wrapper {
    left: 180px !important;
  }
}

/* 1180 x 820 viewport: PDF weiter nach links rücken */
@media (max-width: 1220px) and (min-width: 1100px) and (max-height: 880px) {
  .side-svg-wrapper {
    left: 220px !important;
    bottom: 12vh;
  }

  .esg-svg-wrapper {
    left: 380px !important;
  }

  .pdf-svg-wrapper {
    right: 220px !important;
  }
}


/* iPad Air Portrait 820x1180: ESG leicht nach rechts/unten */
@media (width: 820px) and (height: 1180px) and (orientation: portrait) {
  .esg-svg-wrapper {
    left: 250px !important;
    bottom: 9vh;
  }
}


/* 1280 x 853 viewport: mehr Abstand zu den Rändern */
@media (width: 1280px) and (height: 853px) and (orientation: landscape) {
  .side-svg-wrapper {
    left: 200px !important;
  }

  .esg-svg-wrapper {
    left: 360px !important;
  }

  .pdf-svg-wrapper {
    right: 260px !important;
  }
}


/* 1024 x 600 viewport: SVGs weiter nach unten */
@media (width: 1024px) and (height: 600px) and (orientation: landscape) {
  .side-svg-wrapper {
    bottom: 6vh;
  }

  .esg-svg-wrapper {
    bottom: 3vh;
  }

  .pdf-svg-wrapper {
    bottom: 0;
  }
}


/* 1280 x 800 viewport: spezifische Positionen */
@media (width: 1280px) and (height: 800px) and (orientation: landscape) {
  .pdf-svg-wrapper {
    right: 280px;
  }

  .side-svg-wrapper {
    left: 340px;
  }

  .esg-svg-wrapper {
    left: 500px;
  }
}

/* Legal pages */
.legal-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 12px 12px;
}

.legal-body {
  font-size: 16px;
  line-height: 1.6;
  display: grid;
  gap: 32px;
  font-family: Arial, sans-serif;
}

.legal-container .hero-headline,
.legal-container h2,
.legal-container .hero-subline {
  font-family: "Jersey 15", system-ui, sans-serif;
}

.legal-body strong {
  font-family: "Jersey 15", system-ui, sans-serif;
}

.legal-container h2 {
  font-size: 32px;
  margin: 0 0 6px;
}

/* Flache Viewports (Höhe <= 900px, Breite >= 700px) -> Illustrationen kleiner */
@media (max-height: 900px) and (min-width: 700px) {
  :root {
    --illustration-scale: 0.48;
  }
}
