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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  background: #000;
}

/* Background video */
.video-background {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Wedding title, top centre. Each text is moved separately by parallax.js. */
.wedding-title {
  position: fixed;
  top: clamp(20px, 6vh, 70px);
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #1f2a26;
  pointer-events: none;
  user-select: none;
}

.wedding-title > *,
.wt-details > * {
  will-change: transform;
  opacity: 0;
  animation: wt-fade 1.4s ease forwards;
}

.wt-names {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: min(5.5rem, 11vw, 12vh);
  line-height: 1.05;
  text-shadow: 0 0 18px rgba(255,255,255,0.65);
  animation-delay: 0.2s;
}

.wt-wedding {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: min(1.15rem, 4vw);
  letter-spacing: 0.55em;
  margin-right: -0.55em; /* keep spaced text optically centred */
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255,255,255,0.7);
  animation-delay: 0.6s;
}

.wt-details {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin-top: 0.5em;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: min(1.05rem, 3.6vw);
  letter-spacing: 0.3em;
  text-shadow: 0 0 12px rgba(255,255,255,0.7);
  opacity: 1;
  animation: none;
}

.wt-date  { animation-delay: 0.9s; }
.wt-dot   { animation-delay: 1.0s; letter-spacing: 0; }
.wt-place { animation-delay: 1.1s; text-transform: uppercase; }

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

@media (prefers-reduced-motion: reduce) {
  .wedding-title > *,
  .wt-details > * {
    animation: none;
    opacity: 1;
  }
}

/* Top right controls (sound + fullscreen) */
.top-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 3;
}

.icon-btn {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s, transform 0.2s;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.08);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

/* Chapter menu — "mission select" tiles, centred on screen */
.menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  z-index: 2;
  width: 94%;
  max-width: 1100px;
}

.chapter-card {
  position: relative;
  flex: 0 1 260px;
  min-width: 0;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 0;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.chapter-card:hover,
.chapter-card:focus-visible {
  transform: scale(1.07);
  z-index: 1;
  border-color: #fff;
  box-shadow: 0 16px 36px rgba(0,0,0,0.7);
  outline: none;
}

.chapter-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  filter: grayscale(1);
  transition: filter 0.4s ease;
}

.chapter-card:hover video,
.chapter-card:focus-visible video {
  filter: grayscale(0);
}

/* Text block, bottom-left */
.card-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 40px 14px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
  color: #fff;
  font-family: 'Barlow Condensed', 'Nunito', sans-serif;
  text-align: left;
  pointer-events: none;
}

.card-num {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  opacity: 0.75;
}

/* Name and time slide up on hover */
.card-name,
.card-time {
  max-height: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.card-name {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-time {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0;
  margin-top: 2px;
}

.chapter-card:hover .card-name,
.chapter-card:focus-visible .card-name,
.chapter-card:hover .card-time,
.chapter-card:focus-visible .card-time {
  max-height: 2em;
  opacity: 1;
  transform: none;
}

.chapter-card:hover .card-time,
.chapter-card:focus-visible .card-time {
  opacity: 0.75;
  transition-delay: 0.08s;
}

/* Red accent bar grows along the bottom edge */
.card-bar {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 4px;
  background: #e10600;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.chapter-card:hover .card-bar,
.chapter-card:focus-visible .card-bar {
  transform: scaleX(1);
}

/* Touch screens have no hover: always show the name */
@media (hover: none) {
  .card-name {
    max-height: 2em;
    opacity: 1;
    transform: none;
  }
}

/* Back button — shown during playback */
.back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  border-radius: 50px;
  padding: 10px 20px 10px 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
}

.back-btn:hover {
  background: rgba(0,0,0,0.8);
  transform: translateX(-3px);
}

.back-btn svg {
  width: 18px;
  height: 18px;
}

/* Small screens: centred 2 x 2 grid */
@media (max-width: 600px) {
  .wedding-title {
    top: 76px; /* below the sound / fullscreen buttons */
  }

  .menu {
    gap: 8px;
  }

  .chapter-card {
    flex-basis: calc(50% - 4px);
  }

  .card-info {
    padding: 28px 10px 10px;
  }

  .card-name {
    font-size: 1.2rem;
  }
}
