@font-face {
  font-family: "DIN Condensed";
  src: url("assets/fonts/DINCondensed-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Adobe Handwriting";
  src: url("assets/fonts/AdobeHandwriting.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --sky-top: #a8c4d4;
  --sky-bottom: #f0dcc4;
  --navy: #2a3d52;
  --navy-soft: #3b4d61;
  --gold: #c4a05a;
  --cream: #f5ebe0;
  --white: #ffffff;
  --shadow: rgba(42, 61, 82, 0.18);
  --font-oliver: "DIN Condensed", "Arial Narrow", sans-serif;
  --font-hand: "Adobe Handwriting", "Segoe Print", cursive;
  --font-body: "Montserrat", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --stage-h: 100vh;
  --stage-h: 100dvh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--navy);
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
  overflow-x: hidden;
}

/* Geen scroll tot na de reveal (kaart zichtbaar) */
body:not(.can-scroll) {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body:not(.can-scroll) .cta,
body:not(.can-scroll) .icon-btn,
body:not(.can-scroll) .skip-link {
  touch-action: manipulation;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: var(--white);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.stars span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff8e0;
  opacity: 0.35;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.stars span.spark {
  width: 7px;
  height: 7px;
  border-radius: 0;
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
  background: #ffe9a0;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.85);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.1);
  }
}

.top-bar {
  position: fixed;
  top: max(0.75rem, var(--safe-top));
  right: max(0.75rem, var(--safe-right));
  z-index: 40;
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.top-bar[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
}

.icon-btn {
  width: 2.85rem;
  height: 2.85rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px var(--shadow);
  display: grid;
  place-items: center;
  color: var(--navy);
}

.icon-svg {
  width: 1.2rem;
  height: 1.2rem;
}

.icon-svg .speaker {
  fill: currentColor;
}

.icon-btn .mute-x {
  display: none;
}

.icon-btn[aria-pressed="true"] .wave,
.icon-btn[aria-pressed="true"] .wave-2 {
  display: none;
}

.icon-btn[aria-pressed="true"] .mute-x {
  display: block;
}

.stage {
  position: relative;
  height: var(--stage-h);
  min-height: 560px;
  overflow: hidden;
}

.scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
}

.layer {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  --px: 0px;
  --py: 0px;
}

body.is-playing .layer[data-depth] {
  translate: var(--px) var(--py);
}

.sky {
  inset: 0;
  background:
    linear-gradient(180deg, #a9c5d6 0%, #c5d6e0 35%, #e8dcc8 70%, #f1ddc6 100%);
  z-index: 1;
}

.moon {
  top: 4%;
  left: 3%;
  width: min(32vw, 220px);
  z-index: 3;
  transform: translate3d(-16px, -12px, 0);
}

.cloud-a,
.cloud-b {
  /* Wolken door de onderkant van OLIVER */
  top: auto;
  bottom: calc(71% - min(88vw, 620px) * 0.393);
}

.cloud-a {
  left: -10%;
  width: min(88vw, 620px);
  z-index: 4;
  transform: translate3d(-24px, 10px, 0);
}

.cloud-b {
  right: -5%;
  width: min(72vw, 500px);
  z-index: 6;
  transform: translate3d(28px, 8px, 0);
}

.cloud-c {
  top: 35%;
  left: 22%;
  width: min(48vw, 340px);
  z-index: 6;
  transform: translate3d(0, 12px, 0);
}

.cloud img,
.moon img,
.hill img,
.astronauts img {
  width: 100%;
  height: auto;
}

.name {
  top: calc(24% - 36px);
  left: 50%;
  width: 100vw;
  z-index: 5;
  transform: translate3d(-50%, 0, 0);
  visibility: hidden;
  text-align: center;
}

.oliver-title {
  display: inline-block;
  margin: 0;
  font-family: var(--font-oliver);
  font-weight: 700;
  /* Fallback tot JS de exacte breedte zet */
  font-size: 38vw;
  letter-spacing: 0.03em;
  line-height: 0.85;
  color: #2a3d52;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 1;
  -webkit-text-fill-color: #2a3d52;
  text-shadow: none;
}

.hill {
  left: 50%;
  bottom: 0;
  /* Ellips: punten links/rechts op de onderhoeken; onderste helft valt weg via overflow */
  width: 160%;
  transform: translate3d(-50%, calc(50% + 24px), 0);
  z-index: 8;
}

/* Mannetjes + bol: één asset, bovenop de berg */
.astronauts {
  left: 42%;
  bottom: 7%;
  width: min(38vw, 280px);
  transform: translate3d(-50%, 20px, 0);
  z-index: 9;
}

/* Sequence: sky → hill → astronauts → moon → clouds → OLIVER last */
body.is-playing .sky,
body.is-playing .moon,
body.is-playing .cloud-a,
body.is-playing .cloud-b,
body.is-playing .cloud-c,
body.is-playing .hill,
body.is-playing .astronauts,
body.is-playing .name {
  animation-fill-mode: forwards;
  animation-timing-function: var(--ease-out);
}

body.is-playing .sky {
  animation: fade-in 1s both;
}

body.is-playing .hill {
  animation: hill-in 2s 1.2s both;
}

body.is-playing .astronauts {
  animation: astronauts-in 1.8s 3.4s both;
}

body.is-playing .moon {
  animation: rise-in 1.6s 5.8s both;
}

body.is-playing .cloud-a {
  animation: cloud-in 1.8s 8s both;
}

body.is-playing .cloud-b {
  animation: cloud-in-right 1.8s 9.1s both;
}

body.is-playing .cloud-c {
  animation: cloud-in 1.6s 10s both;
}

body.is-playing .name {
  visibility: visible;
  animation: oliver-last 3.2s 13s both;
  animation-timing-function: linear;
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes cloud-in {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes cloud-in-right {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes hill-in {
  to {
    opacity: 1;
    transform: translate3d(-50%, 50%, 0);
  }
}

@keyframes astronauts-in {
  to {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes oliver-last {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(8px) rotate(2deg);
  }
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: max(1rem, calc(var(--safe-bottom) + 0.65rem));
  z-index: 25;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 56px;
  height: 72px;
  color: var(--navy);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
  border-radius: 999px;
  background: rgba(245, 235, 224, 0.88);
  box-shadow:
    0 6px 20px rgba(42, 61, 82, 0.28),
    0 0 0 1px rgba(42, 61, 82, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.scroll-hint.is-visible {
  opacity: 1;
  pointer-events: auto;
  animation: scroll-hint-bob 1.7s ease-in-out infinite;
}

.scroll-hint-icon {
  display: block;
  width: 26px;
  height: 44px;
}

.scroll-hint-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scroll-hint.is-visible .scroll-dot {
  animation: scroll-dot 1.7s ease-in-out infinite;
}

.scroll-hint.is-visible .scroll-chevron {
  animation: scroll-chevron 1.7s ease-in-out infinite;
}

@keyframes scroll-hint-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

@keyframes scroll-dot {
  0%,
  100% {
    opacity: 1;
    transform: translateY(0);
  }
  55% {
    opacity: 0.2;
    transform: translateY(7px);
  }
}

@keyframes scroll-chevron {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.intro {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.55rem;
  padding: max(1.5rem, var(--safe-top)) 1.25rem max(1.5rem, var(--safe-bottom));
  text-align: center;
  background: linear-gradient(180deg, rgba(168, 196, 212, 0.55), rgba(240, 220, 196, 0.62));
  transition: opacity 0.7s var(--ease-out), visibility 0.7s;
}

body.is-playing .intro {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-sat {
  width: min(36vw, 140px);
  margin-bottom: 0.35rem;
  animation: bob 5s ease-in-out infinite;
  filter: drop-shadow(0 8px 18px var(--shadow));
}

.intro-brand {
  margin: 0;
  font-family: var(--font-oliver);
  font-weight: 700;
  font-size: clamp(1.6rem, 7vw, 3rem);
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  color: var(--navy);
}

.intro-title {
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-hand);
  font-size: clamp(1.9rem, 7vw, 3.1rem);
  line-height: 1.15;
  color: var(--navy-soft);
}

.intro-sub {
  margin: 0 0 0.5rem;
  font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  font-weight: 500;
  color: rgba(42, 61, 82, 0.72);
}

.cta {
  margin-top: 0.35rem;
  min-height: 48px;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(0.85rem, 3.6vw, 0.95rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 10px 28px var(--shadow);
}

.kaart {
  position: relative;
  z-index: 5;
  padding:
    3.25rem max(1.15rem, var(--safe-left))
    max(4rem, calc(var(--safe-bottom) + 2.5rem))
    max(1.15rem, var(--safe-right));
  background: linear-gradient(180deg, rgba(240, 220, 196, 0.55), var(--cream) 30%, #efe4d6);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  pointer-events: none;
}

.kaart[data-ready="true"] {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.kaart-inner {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
}

.kaart-name {
  margin: 0;
  font-family: var(--font-oliver);
  font-weight: 700;
  font-size: clamp(3.2rem, 16vw, 5.8rem);
  line-height: 0.9;
  text-transform: uppercase;
  color: var(--navy);
}

.kaart-name span {
  display: block;
  margin-top: 0.12em;
  font-family: var(--font-body);
  font-size: 0.28em;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: var(--gold);
}

.kaart-stats {
  margin: 1rem 0 0;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: clamp(0.78rem, 3.4vw, 0.95rem);
  color: var(--navy-soft);
}

.feet {
  margin: 1.5rem auto 0;
  width: min(140px, 36vw);
}

.feet img {
  margin: 0 auto;
  filter: drop-shadow(0 6px 14px var(--shadow));
}

.families {
  margin-top: 2.25rem;
  display: grid;
  gap: 1.5rem;
}

.family h3,
.contact-block h3 {
  margin: 0;
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy-soft);
}

.family p {
  margin: 0.35rem 0 0;
  font-size: 1.02rem;
  font-weight: 500;
}

.script {
  font-family: var(--font-hand) !important;
  font-size: clamp(1.85rem, 6.5vw, 2.6rem) !important;
  font-weight: 400 !important;
  line-height: 1.2;
}

.contact {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(42, 61, 82, 0.12);
}

.contact-block h3 {
  margin-bottom: 0.65rem;
}

.contact-block p {
  margin: 0.35rem 0;
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.contact-block .label {
  font-weight: 700;
  color: var(--gold);
}

.contact-block a {
  text-decoration: none;
  border-bottom: 1px solid rgba(42, 61, 82, 0.25);
}

.lijst-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(196, 160, 90, 0.35);
}

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

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

  .hill {
    width: 150%;
  }

  .astronauts {
    bottom: 12%;
    width: min(28vw, 260px);
  }
}

@media (max-width: 720px) {
  .name {
    top: calc(22% - 28px);
    width: 100vw;
  }

  .oliver-title {
    letter-spacing: 0.04em;
  }

  .cloud-a,
  .cloud-b {
    bottom: calc(74% - 95vw * 0.393);
  }

  .cloud-a {
    width: 95vw;
  }

  .cloud-b {
    right: -2%;
    width: 78vw;
  }

  .cloud-c {
    top: 34%;
    left: 18%;
    width: 58vw;
  }

  .hill {
    width: 170%;
  }

  .astronauts {
    left: 40%;
    bottom: 5%;
    width: 44vw;
  }

  .moon {
    width: 36vw;
  }
}

@media (min-width: 900px) {
  .name {
    top: calc(23% - 40px);
    width: 100vw;
  }

  .oliver-title {
    letter-spacing: 0.06em;
  }

  .cloud-c {
    top: 34%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stars span,
  .intro-sat,
  .scroll-hint.is-visible,
  .scroll-hint.is-visible .scroll-dot,
  .scroll-hint.is-visible .scroll-chevron {
    animation: none !important;
  }

  body.is-playing .sky,
  body.is-playing .moon,
  body.is-playing .cloud-a,
  body.is-playing .cloud-b,
  body.is-playing .cloud-c,
  body.is-playing .hill,
  body.is-playing .astronauts,
  body.is-playing .name {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}

body.reduced-motion.is-playing .sky,
body.reduced-motion.is-playing .moon,
body.reduced-motion.is-playing .cloud-a,
body.reduced-motion.is-playing .cloud-b,
body.reduced-motion.is-playing .cloud-c,
body.reduced-motion.is-playing .hill,
body.reduced-motion.is-playing .astronauts,
body.reduced-motion.is-playing .name {
  opacity: 1;
  visibility: visible;
  filter: none;
  animation: none;
  transform: none;
}

body.reduced-motion.is-playing .hill {
  transform: translate3d(-50%, 50%, 0);
}

body.reduced-motion.is-playing .astronauts {
  transform: translate3d(-50%, 0, 0);
}

body.reduced-motion.is-playing .name {
  transform: translate3d(-50%, 0, 0);
  visibility: visible;
}
