/* ==========================================================================
   Zuhause für drei — Style
   Mobile-First | BEM | Custom Properties
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
  /* Brand Colors */
  --color-primary: #ff9f43;
  --color-secondary: #48dbfb;
  --color-accent: #1dd1a1;
  --color-bg: #fef9e7;
  --color-text: #2c3e50;

  /* UI States */
  --color-hover: #ffb167;
  --color-error: #ee5253;
  --color-disabled: #c8d6e5;

  /* Gradients */
  --gradient-sunset: linear-gradient(135deg, #ff9f43 0%, #ff6b6b 100%);
  --gradient-forest: linear-gradient(135deg, #1dd1a1 0%, #10ac84 100%);

  /* Typography */
  --font-heading: "Fredoka", sans-serif;
  --font-body: "Nunito", sans-serif;

  /* Spacing */
  --section-padding: 4rem 0;
  --container-max: 1100px;
  --gap: 1.5rem;

  /* Misc */
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(44, 62, 80, 0.1);
  --shadow-lg: 0 8px 40px rgba(44, 62, 80, 0.15);
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-secondary);
  text-decoration: underline;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary);
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
}

/* ---------- Utilities ---------- */
.container {
  width: 90%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition);
  line-height: 1;
  text-align: center;
}

.btn:hover {
  transform: scale(1.05);
}

.btn--primary {
  background: var(--gradient-sunset);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 159, 67, 0.4);
}

.btn--primary:hover {
  box-shadow: 0 6px 25px rgba(255, 159, 67, 0.5);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn--submit {
  width: 100%;
  padding: 1rem;
  position: relative;
}

.btn--submit.is-loading .btn__text {
  visibility: hidden;
}

.btn__loading {
  display: none;
}

.btn--submit.is-loading .btn__loading {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(254, 249, 231, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(44, 62, 80, 0.08);
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}

.nav.is-visible {
  transform: translateY(0);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.75rem 5%;
}

.nav__logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
  text-decoration: none;
}

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

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
}

.nav__toggle.is-open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.is-open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.nav__list {
  list-style: none;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(254, 249, 231, 0.98);
  padding: 1rem 5%;
  box-shadow: 0 4px 10px rgba(44, 62, 80, 0.08);
}

.nav__list.is-open {
  display: block;
}

.nav__link {
  display: block;
  padding: 0.75rem 0;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.nav__link--cta {
  color: var(--color-primary);
}

/* Desktop Nav */
@media (min-width: 768px) {
  .nav__toggle {
    display: none;
  }

  .nav__list {
    display: flex;
    position: static;
    background: none;
    padding: 0;
    box-shadow: none;
    gap: 1.5rem;
    align-items: center;
  }

  .nav__link {
    padding: 0.25rem 0;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #1a1a2e;
}

/* Curtain: black overlay that lifts like a theater curtain */
.hero__curtain {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #1a1a2e;
  pointer-events: none;
  opacity: 1;
  transition: opacity 1.2s ease;
}

.hero.is-intro .hero__curtain {
  opacity: 0;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  opacity: 0;
  transform: scale(1.08);
  transition:
    opacity 2s ease,
    transform 4s ease;
}

.hero.is-intro .hero__bg-img {
  opacity: 0.55;
  transform: scale(1);
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 6rem 5% 3rem;
  max-width: 800px;
}

/* Video / Illustration — drops in with Luxo Jr. bounce */
.hero__illustration {
  width: 280px;
  height: auto;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  border: 4px solid rgba(255, 255, 255, 0.3);
  opacity: 0;
  transform: scale(0) translateY(-60px);
}

.hero.is-intro .hero__illustration {
  animation: luxo-drop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1s forwards;
}

@keyframes luxo-drop {
  0% {
    opacity: 0;
    transform: scale(0) translateY(-60px);
  }
  50% {
    opacity: 1;
    transform: scale(1.12) translateY(8px);
  }
  70% {
    transform: scale(0.95) translateY(-4px);
  }
  85% {
    transform: scale(1.03) translateY(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Title — each word rises up staggered */
.hero__title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.hero__word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  margin-right: 0.25em;
}

.hero__word:last-child {
  margin-right: 0;
}

.hero.is-intro .hero__word {
  animation: word-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero.is-intro .hero__word:nth-child(1) {
  animation-delay: 1.7s;
}
.hero.is-intro .hero__word:nth-child(2) {
  animation-delay: 1.85s;
}
.hero.is-intro .hero__word:nth-child(3) {
  animation-delay: 2s;
}
.hero.is-intro .hero__word:nth-child(4) {
  animation-delay: 2.12s;
}
.hero.is-intro .hero__word:nth-child(5) {
  animation-delay: 2.25s;
}

@keyframes word-rise {
  0% {
    opacity: 0;
    transform: translateY(100%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subtitle — soft fade in */
.hero__subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(15px);
}

.hero.is-intro .hero__subtitle {
  animation: fade-up 0.8s ease 2.8s forwards;
}

/* CTAs — slide up staggered */
.hero__cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.hero__cta .btn {
  opacity: 0;
  transform: translateY(20px);
}

.hero.is-intro .hero__cta .btn:nth-child(1) {
  animation: fade-up 0.6s ease 3.3s forwards;
}

.hero.is-intro .hero__cta .btn:nth-child(2) {
  animation: fade-up 0.6s ease 3.5s forwards;
}

/* Scroll paw — bounces in last */
.hero__scroll {
  display: inline-block;
  opacity: 0;
}

.hero.is-intro .hero__scroll {
  animation: paw-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 3.9s forwards;
}

.hero__scroll-paw {
  width: 48px;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

/* Shared keyframes */
@keyframes fade-up {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes paw-enter {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* After intro is done, enable the bounce loop */
.hero.is-intro-done .hero__scroll {
  opacity: 1;
  animation: bounce 2s ease-in-out infinite;
}

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

/* Reduced motion: skip all animations */
@media (prefers-reduced-motion: reduce) {
  .hero__curtain {
    opacity: 0;
  }
  .hero__bg-img {
    opacity: 0.55;
    transform: none;
  }
  .hero__illustration {
    opacity: 1;
    transform: none;
  }
  .hero__word {
    opacity: 1;
    transform: none;
  }
  .hero__subtitle {
    opacity: 1;
    transform: none;
  }
  .hero__cta .btn {
    opacity: 1;
    transform: none;
  }
  .hero__scroll {
    opacity: 1;
    animation: bounce 2s ease-in-out infinite;
  }
}

@media (min-width: 768px) {
  .hero__illustration {
    width: 340px;
  }

  .hero__title {
    font-size: 3rem;
  }

  .hero__subtitle {
    font-size: 1.25rem;
  }

  .hero__cta {
    flex-direction: row;
    justify-content: center;
  }
}

/* ---------- Story ---------- */
.story {
  padding: var(--section-padding);
}

.story__intro {
  text-align: center;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-primary);
  max-width: 700px;
  margin: 0 auto 2rem;
}

.story__text {
  max-width: 720px;
  margin: 0 auto 3rem;
}

.story__text p {
  margin-bottom: 1.25rem;
}

.story__text p:last-child {
  margin-bottom: 0;
}

/* Character Cards */
.characters {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  max-width: 900px;
  margin: 0 auto;
}

.character-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: center;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
  will-change: transform;
}

.character-card:hover {
  box-shadow: var(--shadow-lg);
}

.character-card__img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.character-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Minou Eyes — closed by default, opens on scroll, closes on hover ("pet") */
.character-card__img--minou-open,
.character-card__img--minou-closed {
  transition: opacity 0.4s ease;
}

/* Closed eyes layer sits on top */
.character-card__img--minou-closed {
  position: absolute;
  inset: 0;
  opacity: 1;
}

/* When card is in "awake" state (scroll-triggered), hide closed eyes */
.character-card--minou.is-awake .character-card__img--minou-closed {
  opacity: 0;
}

/* Hover = "petting" — eyes close again (override awake) */
.character-card--minou.is-awake:hover .character-card__img--minou-closed {
  opacity: 1;
}

.character-card__name {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1rem 0 0.25rem;
  color: var(--color-primary);
}

.character-card__desc {
  padding: 0 1.25rem 1.25rem;
  font-size: 1rem;
  color: #5a6a7a;
}

@media (min-width: 640px) {
  .characters {
    grid-template-columns: repeat(3, 1fr);
  }

  .character-card__img-wrap {
    aspect-ratio: 4 / 5;
  }
}

/* ---------- Quest (Was wir suchen) ---------- */
.quest {
  padding: var(--section-padding);
  background: #fff;
}

.quest__intro {
  text-align: center;
  font-size: 1.1rem;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  color: #5a6a7a;
}

.quest__list {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-width: 700px;
  margin: 0 auto;
}

.quest__item {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--color-bg);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.quest__item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.quest__icon-wrap {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quest__icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.quest__emoji {
  font-size: 2.75rem;
  line-height: 1;
}

.quest__text {
  flex: 1;
  min-width: 0;
}

.quest__label {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.quest__desc {
  font-size: 1rem;
  color: #5a6a7a;
}

/* ---------- Why (Warum wir) ---------- */
.why {
  padding: var(--section-padding);
}

.why__intro {
  text-align: center;
  font-size: 1.1rem;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  color: #5a6a7a;
}

.why__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  max-width: 900px;
  margin: 0 auto;
}

.why__card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--color-primary);
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.why__card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.why__card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.why__card p {
  font-size: 1rem;
  color: #5a6a7a;
}

@media (min-width: 640px) {
  .why__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Contact ---------- */
.contact {
  padding: var(--section-padding);
  background: #fff;
}

.contact__intro {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 2.5rem;
}

.contact__wrap {
  max-width: 600px;
  margin: 0 auto;
}

.contact__form {
  background: var(--color-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact__form-intro {
  text-align: center;
  font-style: italic;
  color: #5a6a7a;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group__label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.form-group__input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 2px solid var(--color-disabled);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.form-group__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 159, 67, 0.2);
}

.form-group__input--textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group__input.is-invalid {
  border-color: var(--color-error);
}

/* Honeypot */
.form-group--hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.contact__privacy {
  font-size: 0.875rem;
  color: #8a9ab0;
  text-align: center;
  margin-top: 1rem;
}

/* Success */
.contact__success {
  text-align: center;
  padding: 2rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact__success-img {
  width: 200px;
  margin: 0 auto 1.5rem;
  border-radius: var(--radius);
}

.contact__success-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
}

/* ---------- Footer ---------- */
.footer {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: #8a9ab0;
  position: relative;
}

.footer p {
  margin-bottom: 0.25rem;
}

.scroll-top {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.scroll-top:hover {
  color: var(--color-hover);
}

/* ---------- Peek-a-boo ---------- */
.peek-a-boo {
  position: fixed;
  bottom: -80px;
  right: 20px;
  z-index: 50;
  transition: bottom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.peek-a-boo.is-visible {
  bottom: 0;
}

.peek-a-boo__img {
  width: 80px;
  height: auto;
  border-radius: 12px 12px 0 0;
}

/* ---------- Pfoten-Cursor (Desktop only) ---------- */
@media (hover: hover) and (pointer: fine) {
  .paw-cursor,
  .paw-cursor a,
  .paw-cursor button,
  .paw-cursor [role="button"] {
    cursor:
      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><text y="22" font-size="22">🐾</text></svg>')
        14 14,
      auto;
  }
}

/* ---------- Scroll Reveal Base ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Character Card Bounce ---------- */
.character-card {
  opacity: 0;
  transform: scale(0.8) translateY(30px);
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow var(--transition);
}

.character-card.is-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Staggered reveal */
.character-card:nth-child(2) {
  transition-delay: 0.1s;
}

.character-card:nth-child(3) {
  transition-delay: 0.2s;
}

/* ---------- Print ---------- */
@media print {
  .nav,
  .peek-a-boo,
  .hero__scroll,
  .scroll-top {
    display: none;
  }

  .hero {
    min-height: auto;
    background: none;
  }

  .hero__bg {
    display: none;
  }

  .hero__content {
    color: var(--color-text);
  }

  .hero__title,
  .hero__subtitle {
    color: var(--color-text);
    text-shadow: none;
  }
}
