@import url('../styles.css');

/* =========================
   SV 1923 Stockstadt – Styles
   Fokus: klare Typo, ruhiger Aurora-Background, sanfte Parallax,
   hochwertige Reveals, reaktionsfreudige Micro-Interactions
   ========================= */

:root {
  /* Farben (anpassbar) */
  --fg: #f6f7f6;
  --muted: #cfd6d2;
  --brand: #1fa773;       /* Vereinsgrün */
  --brand-hi: #2dd3a4;    /* Akzent-Gradient */
  --brand-2: #e6efe9;     /* helles Weißgrün */
  --line: #27322d;
  --card: #121614;
  --shadow: 0 16px 60px rgba(0,0,0,.35);
  --ease: cubic-bezier(.2,.8,.2,1);
  --radius: 14px;
  --radius-lg: 18px;

  /* Hintergrund – sanft, beruhigend, grün/teal → leicht bläulich */
  --bg1: 14, 18, 16;
  --bg2: 8, 11, 12;
  --fx1: 40, 170, 140;
  --fx2: 70, 150, 210;

  /* Layout */
  --max-w: 1200px;
  --pad-y: clamp(3rem, 6vw, 6rem);
  --pad-x: 1rem;
  --header-offset: 56px; /* height used for fixed header spacing */
}
/* Background layers: keep them out of document flow so they don't push header down */
.bg-layers { position: fixed; inset: 0; z-index: -10; pointer-events: none; }
.bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: rgb(var(--bg1));
  overflow-x: hidden;
  overflow-y: scroll; /* Scrollen aktiv lassen, auch wenn Inhalt kleiner */

  /* Scrollbar unsichtbar machen */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* Internet Explorer 10+ */
}

body::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.bg-grad, .bg-noise, .bg-vignette, .bg-aurora, .bg-glow { position: absolute; inset: 0; }

/* Hauptgradient (scroll- und zeit-animiert) */
.bg-grad {
  background:
    radial-gradient(900px 600px at 18% 12%, rgba(var(--fx1), .14), transparent 60%),
    linear-gradient(180deg, rgba(var(--bg1), 1) 0%, rgba(var(--bg2), 1) 100%);
  background-size: 160% 160%;
  animation: bgBreath 22s ease-in-out infinite alternate;
  will-change: background-position, filter;
/* ===== Responsive ===== */
@media (max-width: 980px){
  .result-body .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 700px) {
  .result-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .result-head .pair {
    grid-template-columns: 1fr;
    gap: 6px;
    justify-items: center;
  }
  .score {
    font-size: 32px !important;
    margin: 0 auto;
  }
  .team span {
    font-size: 16px !important;
    text-align: center;
  }
  .match-header{grid-template-columns:1fr 40px 1fr}
  .club-grid{grid-template-columns:1fr}
  .footer-grid{grid-template-columns:1fr}
  /* Zeige den Brand-Text auch auf kleinen Bildschirmen */
  .brand span{display:inline-block}
}
@media (max-width:600px){
  /* Mobile: Stapel-Anordnung für Match-Header (SV Stockstadt / VS / Gegner), zentriert */
  .match-header {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  /* Clubs in voller Breite, Inhalt zentrieren */
  .match-header .club {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    gap: 6px;
  }

  /* VS Pill prominent und zentriert */
  .match-header .vs {
    order: 2;
    margin: 0;
    padding: .4rem .8rem;
    font-size: 18px;
  }

  /* Explizite Reihenfolge: Home (1), VS (2), Away (3) */
  .match-header .club:first-child { order: 1; }
  .match-header .club:last-child { order: 3; }

  /* Teamname zentrieren und besser lesbar machen */
  .club span, .team span {
    text-align: center !important;
    display: block;
    font-size: 16px;
  }

  /* Wappen/Bilder mittig und nicht zu groß */
  .match-header .club img, .club img {
    max-width: 84px;
    height: auto;
    display: block;
    margin: 0 auto;
  }
}
/* Responsive nav: mobile dropdown */
.nav-toggle{ display:none; background:transparent; border:0; font-size:22px; color:var(--svs-white); padding:6px; border-radius:6px; }

@media (max-width:899px){
  .nav-toggle{ display:block; }
  .main-nav{ display:none; position:fixed; top:var(--header-offset); right:12px; background:rgba(0,0,0,0.86); padding:10px; border-radius:10px; flex-direction:column; gap:8px; z-index:200; min-width:200px; box-shadow: 0 8px 36px rgba(0,0,0,0.6); }
  .main-nav.open{ display:flex; }
  .main-nav .nav-link{ padding:.6rem .9rem; display:block; }
}

@media (min-width:900px){
  .nav-toggle{ display:none; }
  .main-nav{ display:flex; position:static; background:transparent; padding:0; }
}
}
@keyframes bgBreath {
  0%   { background-position: 32% 18%, 70% 82%, center; }
  100% { background-position: 40% 28%, 62% 74%, center; }
}

/* Aurora-Schimmer (sehr subtil) */
.bg-aurora {
  background:
    conic-gradient(from 220deg at 50% 50%,
      rgba(90,220,200,.10),
      rgba(120,180,220,.06),
      rgba(90,220,200,.10));
  mix-blend-mode: screen;
  animation: auroraSpin 36s linear infinite;
  opacity: .6;
}
@keyframes auroraSpin {
  from { transform: rotate(0deg) scale(1); }
  to   { transform: rotate(360deg) scale(1.15); }
}

/* feines Filmkorn */
.bg-noise {
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter>\
<rect width='100%' height='100%' filter='url(#n)' opacity='.045'/></svg>");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
  opacity: .35;
}
.bg-vignette {
  background: radial-gradient(1100px 760px at 50% 15%, transparent 42%, rgba(0,0,0,.32) 70%, rgba(0,0,0,.6) 100%);
}
.bg-glow { /* folgt Maus via CSS-Variablen --x / --y */
  --x: 50%; --y: 50%;
  background: radial-gradient(420px 320px at var(--x) var(--y), rgba(120,210,200,.12), transparent 70%);
  mix-blend-mode: screen;
}

/* ===== Header ===== */
.site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* ensure header always stays above the mobile nav overlay */
  z-index: 300;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(10,10,10,.45);
  backdrop-filter: blur(10px);
  padding-block: 1rem;
  padding-inline: clamp(12px, calc((100% - var(--container)) / 2), 1rem);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
/* keep page content visible below fixed header */
.main { margin-top: var(--header-offset); }
.brand{display:flex;gap:.7rem;align-items:center;font:700 18px/1 var(--font-display)}
.brand span{letter-spacing:.3px}
.main-nav{display:flex;gap:1rem;align-items:center}
.nav-link{
  position: relative;
  padding:.5rem .9rem;border-radius:999px;
  color: rgba(255,255,255,0.72);
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: 0.02em;
  transition: color 0.22s cubic-bezier(.4,1,.6,1), font-size 0.22s cubic-bezier(.4,1,.6,1);
  background: none;
  box-shadow: none;
  overflow: visible;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 2px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  width: 0%;
  opacity: 0.92;
  transition: left 0.38s cubic-bezier(.4,1,.6,1), right 0.38s cubic-bezier(.4,1,.6,1), width 0.38s cubic-bezier(.4,1,.6,1);
  pointer-events: none;
  z-index: 2;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: #fff;
  font-size: 1.16rem;
}
.nav-link:hover::after,
.nav-link:focus-visible::after {
  left: 0;
  right: 0;
  width: 100%;
}

/* Sections */
.main { overflow-x: hidden; }
.panel { position: relative; padding: var(--pad-y) var(--pad-x); max-width: var(--max-w); margin-inline: auto; }
.panel-hero { min-height: 92vh; display: grid; align-content: center; gap: 2rem; }
.panel-alt {
  background:
    radial-gradient(850px 520px at 85% 0%, rgba(31,167,115,.10), transparent 62%),
    linear-gradient(180deg, rgba(20,23,21,.5), rgba(20,23,21,0));
  border-block: 1px solid rgba(36,48,43,.35);
}
.panel-split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }

/* Typografie */
.hero-title { font-size: clamp(36px, 6vw, 72px); line-height: 1.04; letter-spacing: -0.5px; margin: 0; }
.hero-accent { display: block; font-weight: 300; color: var(--brand-2); margin-top: .45rem; }
.hero-sub { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); max-width: 720px; margin-top: .8rem; }
.overline { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-2); margin: .5rem 0 1rem; }
.h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.14; margin: 0 0 .75rem; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 1rem; }
p { margin: 0 0 1rem; color: #ecf0ee; }

/* Geteilte Überschriften (Duo) */
.duo-head { display: grid; gap: .12rem; }
.duo-part { display: block; position: relative; white-space: nowrap; }
.reveal-pass-right, .reveal-pass-left {
  opacity: 0; filter: blur(6px);
  transition: transform .9s var(--ease), opacity .9s var(--ease), filter .9s var(--ease);
  will-change: transform, opacity, filter;
}
.reveal-pass-right { transform: translateX(18vw); }
.reveal-pass-left  { transform: translateX(-18vw); }
.in-view.reveal-pass-right, .in-view.reveal-pass-left { opacity: 1; filter: blur(0); transform: translateX(0); }

/* Bildplatzhalter / Bilder */
.media-slot {
  width: 100%; border-radius: var(--radius-lg);
  border: 1px dashed rgba(31,167,115,.35);
  background:
    linear-gradient(135deg, rgba(31,167,115,.08), rgba(31,167,115,.02)),
    linear-gradient(45deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  color: var(--brand-2);
  box-shadow: inset 0 0 0 1px rgba(36,48,43,.35);
  position: relative; overflow: hidden;
  transition: border-color .3s var(--ease), filter .4s var(--ease);
  aspect-ratio: 16 / 9; /* harmonische Höhe, vermeidet Quetschen */
}
.media-slot--wide { aspect-ratio: 16/7; }
.media-slot--xl   { aspect-ratio: 21/9; }

.media-slot::after {
  content: attr(data-label) "";
  position: absolute; left: 12px; bottom: 10px;
  background: rgba(0,0,0,.28); padding: .4rem .6rem; border-radius: 8px;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .9;
}
.media-slot img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit;
  transition: transform .7s var(--ease), filter .6s var(--ease);
}
.media-slot:hover { border-color: rgba(31,167,115,.6); filter: saturate(1.04); }
.media-slot:hover img { transform: scale(1.04); }

/* sanfter Shine */
.media-slot::before {
  content: ""; position: absolute; inset: -30% -60%; transform: rotate(8deg);
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.10), rgba(255,255,255,0));
  opacity: 0; transition: transform .9s var(--ease), opacity .6s var(--ease);
}
.media-slot:hover::before { transform: translateX(34%) rotate(10deg); opacity: 1; }

/* Tiles */
.grid-tiles { display: grid; grid-template-columns: repeat(5, minmax(160px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), filter .25s var(--ease);
}
.tile::after {
  content: ""; position: absolute; right: -20%; bottom: -20%; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(31,167,115,.18), rgba(31,167,115,0));
  transform: scale(.85); opacity: 0; transition: transform .35s var(--ease), opacity .35s var(--ease);
}
.tile:hover { transform: translateY(-6px); background: #181c1a; border-color: rgba(31,167,115,.45); filter: saturate(1.05); }
.tile:hover::after { transform: scale(1); opacity: 1; }
.tile-kicker { margin: 0 0 .25rem; font-size: 12px; letter-spacing: .12em; color: var(--brand-2); text-transform: uppercase; }

/* Timeline */
.timeline { position: relative; margin: 1rem 0 1.5rem; padding-left: 1.25rem; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: rgba(31,167,115,.35); }
.timeline-item { position: relative; margin: 0 0 1rem; padding-left: .75rem; }
.timeline-item .dot {
  position: absolute; left: -2px; top: .35rem; width: 10px; height: 10px; background: var(--brand); border-radius: 6px;
  box-shadow: 0 0 0 6px rgba(31,167,115,.12); transform: scale(.6);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), filter .5s var(--ease);
}
.timeline-item.in-view .dot { transform: scale(1); box-shadow: 0 0 0 10px rgba(31,167,115,.18); filter: brightness(1.06); }
.timeline-title { margin: 0 0 .25rem; font-size: 16px; color: var(--brand-2); }
.note { color: var(--muted); font-size: 15px; }

/* Marquee */
.marquee {
  display: grid; grid-auto-flow: column; white-space: nowrap; gap: 2rem; overflow: hidden;
  border-block: 1px solid rgba(36,48,43,.35); padding: .75rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee > span { animation: slide 18s linear infinite; color: #cfe8dc; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-width: 160px; padding: .9rem 1.2rem; border-radius: 12px; font-weight: 600; text-decoration: none;
  transition: transform .15s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-hi)); color: #07130f; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.btn--primary::after {
  content: ""; position: absolute; inset: 0; background: radial-gradient(420px 140px at var(--mx,50%) 140%, rgba(255,255,255,.18), transparent 60%);
  opacity: 0; transition: opacity .2s var(--ease);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 54px rgba(0,0,0,.45); }
.btn--primary:hover::after { opacity: 1; }
.btn--ghost { border: 1px solid var(--line); color: var(--fg); margin-left: .5rem; background: rgba(31,167,115,.06); }
.btn--ghost:hover { background: rgba(31,167,115,.12); transform: translateY(-2px); }

/* Scroll cue */
.scroll-cue { position: absolute; left: 1rem; bottom: 1rem; display: flex; align-items: center; gap: .6rem; color: var(--muted); opacity: .7; font-size: 14px; }
.scroll-cue i { width: 24px; height: 24px; border: 2px solid var(--muted); border-radius: 14px; position: relative; }
.scroll-cue i::after { content: ""; position: absolute; left: 50%; top: 5px; width: 2px; height: 8px; background: var(--muted); transform: translateX(-50%); animation: drop 1.2s var(--ease) infinite; }
@keyframes drop { 0% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, 6px); opacity: .2; } }

/* Reveal-Varianten (global) */
.reveal-up, .reveal-left, .reveal-right, .reveal-scale, .reveal-fade, .reveal-line, .reveal-stagger {
  opacity: 0; filter: blur(6px); will-change: transform, opacity, filter;
  transition: transform .85s var(--ease), opacity .85s var(--ease), filter .85s var(--ease);
}
.reveal-up { transform: translateY(26px); }
.reveal-left { transform: translateX(-28px); }
.reveal-right { transform: translateX(28px); }
.reveal-scale { transform: scale(.96); }
.reveal-fade { transform: translateY(10px); }
.reveal-line { transform: translateX(12px); }
.reveal-stagger { transform: translateY(18px); }
.in-view.reveal-up,
.in-view.reveal-left,
.in-view.reveal-right,
.in-view.reveal-scale,
.in-view.reveal-fade,
.in-view.reveal-line,
.in-view.reveal-stagger { opacity: 1; filter: blur(0); transform: none; }
.delay-1 { transition-delay: .12s; }
.delay-2 { transition-delay: .24s; }
.delay-3 { transition-delay: .36s; }

/* Parallax-Ziele (Transform wird per JS begrenzt gesetzt) */
[data-parallax] { will-change: transform; }

/* Badges */
.badges { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.badge { display: inline-block; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(31,167,115,.08); color: var(--brand-2); font-size: 13px; }

/* Footer */
.site-footer { padding: 2rem var(--pad-x); text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid rgba(36,48,43,.35); }

/* Responsive */
@media (max-width: 1100px) { .grid-tiles { grid-template-columns: repeat(3, minmax(160px, 1fr)); } }
@media (max-width: 840px) {
  .panel-split { grid-template-columns: 1fr; }
  .grid-tiles { grid-template-columns: repeat(2, 1fr); }
  .site-header { grid-template-columns: 1fr auto; }
}
@media (max-width: 560px) {
  .grid-tiles { grid-template-columns: 1fr; }
  .hero-sub { font-size: 16px; }
  .site-nav { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .marquee > span { animation: none !important; }
  .reveal-up, .reveal-left, .reveal-right, .reveal-scale, .reveal-fade, .reveal-line, .reveal-stagger,
  .reveal-pass-right, .reveal-pass-left {
    transition-duration: .01ms !important; transition-delay: 0 !important; transform: none !important; filter: none !important; opacity: 1 !important;
  }
  [data-parallax] { transform: none !important; }
  .bg-grad, .bg-aurora { animation: none !important; }
}

/* Anfangszustand (mobil versteckt) */
@media (max-width: 900px) {
  .main-nav {
    position: absolute;
    top: 100%;
    right: 1rem;
    background: rgba(10,12,11,.9); /* halbtransparent dunkel */
    border: 1px solid rgba(36,48,43,.35);
    padding: 1rem;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 100;
  }

  .main-nav.open {
    display: flex;
  }
}