/* ============================================================
   Borki — Kindergeschichten
   Bunt, fröhlich, kindgerecht
   ============================================================ */

/* ----------------------------------------------------------
   1. RESET & ROOT (Light Default)
   ---------------------------------------------------------- */

:root {
  --sky: #e8f4fd;
  --sky-light: #f0f8ff;
  --cloud: #ffffff;
  --sun: #ffd940;
  --sun-glow: rgba(255, 217, 64, 0.2);
  --grass: #5cb85c;
  --grass-dark: #4a9a4a;
  --grass-light: #6fcf6f;
  --earth: #c8a96e;
  --sand: #f5e6c8;
  --borki-pink: #f2d5c4;
  --accent: #ff6b35;
  --accent-light: #ff8c5a;
  --accent-glow: rgba(255, 107, 53, 0.15);
  --purple: #9b59b6;
  --purple-light: #bb77d6;
  --blue: #5dade2;
  --blue-light: #85c1e9;
  --red: #e74c3c;

  --bg: var(--sky-light);
  --bg-alt: var(--sky);
  --card-bg: var(--cloud);
  --text: #3a3226;
  --text-light: #6b5d4f;
  --text-muted: #9b8e7e;

  --section-padding: 5rem 2rem;
  --card-padding: 1.5rem;
  --gap: 2rem;
  --transition: 0.3s ease;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-round: 50%;

  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

[data-theme="dark"] {
  --sky: #1a1a2e;
  --sky-light: #16213e;
  --cloud: #1f2b47;
  --bg: var(--sky-light);
  --bg-alt: var(--sky);
  --card-bg: var(--cloud);
  --text: #e8e0d8;
  --text-light: #f0ebe5;
  --text-muted: #8b8078;
  --sun-glow: rgba(255, 217, 64, 0.08);
  --accent-glow: rgba(255, 107, 53, 0.08);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1.05rem;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--grass-dark);
}

/* ----------------------------------------------------------
   2. TYPOGRAPHY
   ---------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-light);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.6rem); }

p {
  margin-bottom: 1rem;
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: block;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 0.75rem;
}

/* ----------------------------------------------------------
   3. NAVIGATION
   ---------------------------------------------------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  background: var(--cloud);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
}

.nav-logo img {
  height: 44px;
  width: auto;
}

.nav-logo span {
  background: linear-gradient(135deg, var(--accent), var(--sun));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  width: 26px;
  height: 3px;
  background: var(--text);
  border-radius: 3px;
  transition: all var(--transition);
}

.theme-toggle {
  background: none;
  border: 2px solid var(--sun);
  border-radius: var(--radius-round);
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--sun-glow);
  transform: rotate(20deg);
}

/* ----------------------------------------------------------
   4. HERO
   ---------------------------------------------------------- */

.hero {
  padding: 8rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky) 0%, var(--bg) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,40 C360,80 720,0 1080,40 C1260,60 1380,50 1440,40 L1440,80 L0,80 Z' fill='%235cb85c'/%3E%3C/svg%3E") no-repeat bottom center;
  background-size: cover;
}

.hero-mascot {
  width: 180px;
  height: auto;
  margin: 0 auto 2rem;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero h1 {
  margin-bottom: 1rem;
  color: var(--text-light);
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.9rem 2.2rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.hero-cta:hover {
  background: var(--accent-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

/* ----------------------------------------------------------
   5. SECTIONS
   ---------------------------------------------------------- */

section {
  padding: var(--section-padding);
  overflow-x: clip;
}

section:nth-child(even) {
  background: var(--bg-alt);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ----------------------------------------------------------
   6. STORY CARDS (Homepage Preview)
   ---------------------------------------------------------- */

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}

.story-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.story-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  color: inherit;
}

.story-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.story-card-body {
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.story-card-body h3 {
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.story-card-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex: 1;
}

.story-badge {
  display: inline-block;
  background: var(--sun);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.8rem;
  border-radius: 50px;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.story-badge--moon { background: var(--purple-light); color: #fff; }
.story-badge--chocolate { background: var(--earth); color: #fff; }
.story-badge--devil { background: var(--red); color: #fff; }

.story-listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
  padding-top: 0.75rem;
}

.story-card:hover .story-listen-btn {
  color: var(--grass-dark);
}

/* ----------------------------------------------------------
   7. AUDIO PLAYER
   ---------------------------------------------------------- */

.player-section {
  padding: var(--section-padding);
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.player-item {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: all var(--transition);
}

.player-item:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.player-item.active {
  border: 2px solid var(--accent);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.player-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.player-play-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-round);
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: all var(--transition);
}

.player-play-btn:hover {
  background: var(--accent-light);
  transform: scale(1.08);
}

.player-info h3 {
  margin-bottom: 0.15rem;
}

.player-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.player-controls {
  display: none;
}

.player-item.active .player-controls {
  display: block;
}

.player-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  margin-bottom: 0.5rem;
}

.player-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--sun));
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s linear;
}

.player-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-display);
}

/* ----------------------------------------------------------
   8. GALLERY
   ---------------------------------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  transition: transform var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----------------------------------------------------------
   9. ABOUT SECTION
   ---------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}

.about-img {
  width: 200px;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.1));
}

.about-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ----------------------------------------------------------
   10. FOOTER
   ---------------------------------------------------------- */

.footer {
  background: var(--grass);
  color: #fff;
  padding: 3rem 2rem 1.5rem;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  height: 40px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0 C480,40 960,40 1440,0 L1440,40 L0,40 Z' fill='%235cb85c'/%3E%3C/svg%3E") no-repeat bottom center;
  background-size: cover;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.footer-inner a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-inner a:hover {
  color: var(--sun);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-family: var(--font-display);
  font-weight: 500;
}

.footer-copy {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ----------------------------------------------------------
   11. COOKIE BANNER
   ---------------------------------------------------------- */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--cloud);
  padding: 1.25rem 2rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1500;
  display: none;
}

.cookie-banner.show {
  display: block;
}

.cookie-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-inner p {
  flex: 1;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 200px;
}

.cookie-btns {
  display: flex;
  gap: 0.75rem;
}

.cookie-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.cookie-btn--accept {
  background: var(--accent);
  color: #fff;
}

.cookie-btn--accept:hover {
  background: var(--accent-light);
}

.cookie-btn--decline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

.cookie-btn--decline:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ----------------------------------------------------------
   12. REVEAL ANIMATIONS
   ---------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ----------------------------------------------------------
   13. RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    background: var(--cloud);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 999;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.4rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-img {
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  :root {
    --section-padding: 3.5rem 1.25rem;
    --card-padding: 1.25rem;
  }

  .hero {
    padding: 6rem 1.25rem 3rem;
  }

  .hero-mascot {
    width: 130px;
  }

  .story-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .player-item {
    padding: 1.25rem;
  }

  .player-play-btn {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 5rem 1rem 2.5rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
}

/* ----------------------------------------------------------
   14. STORY TEXT PAGE
   ---------------------------------------------------------- */

.story-text {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.9;
}

.story-text h2 {
  margin: 3rem 0 1.5rem;
  color: var(--accent);
}

.story-text .chapter-img {
  border-radius: var(--radius-lg);
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.story-text .dialog {
  font-style: italic;
  color: var(--grass-dark);
}

.story-text .dialog-borki {
  color: var(--accent);
  font-weight: 600;
}

/* ----------------------------------------------------------
   15. DARK THEME OVERRIDES
   ---------------------------------------------------------- */

[data-theme="dark"] .nav.scrolled {
  background: var(--cloud);
}

[data-theme="dark"] .story-card {
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.06);
}

[data-theme="dark"] .player-item {
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.06);
}

[data-theme="dark"] .gallery-item {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .footer {
  background: #1a3a1a;
}

[data-theme="dark"] .footer::before {
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0 C480,40 960,40 1440,0 L1440,40 L0,40 Z' fill='%231a3a1a'/%3E%3C/svg%3E") no-repeat bottom center;
  background-size: cover;
}

[data-theme="dark"] .hero::before {
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,40 C360,80 720,0 1080,40 C1260,60 1380,50 1440,40 L1440,80 L0,80 Z' fill='%231a3a1a'/%3E%3C/svg%3E") no-repeat bottom center;
  background-size: cover;
}

[data-theme="dark"] .cookie-banner {
  background: #1f2b47;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}
