﻿/* T3 owns this file: birthday home page styles.
   Matches assets/reference/reference_approved_birthday_page_two_candles.png.
   Mobile first (best at 375x812), airy, small illustrations, big title. */

#scene-home {
  position: relative;
  overflow: hidden;           /* rotated bunting must never cause sideways scroll */
  overflow: clip;
}

.home {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(62px, 15vw, 92px) 0 clamp(36px, 8vw, 56px);
  text-align: center;
}

/* ---------- Bunting (one image, two crops) ---------- */
.home__bunting {
  position: absolute;
  top: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.home__bunting img {
  position: absolute;
  max-width: none;
  height: auto;
}
/* Upper strand: purple, yellow, pink. Crop x 0–232, y 16–97 of 318×170. */
.home__bunting--left {
  left: -10px;
  width: clamp(136px, 37vw, 290px);
  aspect-ratio: 232 / 81;
  top: clamp(24px, 6.5vw, 48px);
  transform: rotate(-15deg);
  transform-origin: 0 50%;
}
.home__bunting--left img { width: 137.07%; left: 0; top: -19.75%; }
/* Lower strand: yellow, green, blue. Crop x 40–318, y 98–170. */
.home__bunting--right {
  right: -14px;
  width: clamp(140px, 38vw, 310px);
  aspect-ratio: 278 / 72;
  top: clamp(16px, 4.5vw, 36px);
  transform: rotate(11deg);
  transform-origin: 100% 50%;
}
.home__bunting--right img { width: 114.39%; left: -14.39%; top: -136.1%; }

/* ---------- Title ---------- */
.home__title {
  margin: 0 auto;
  color: var(--ink);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(42px, 12.2vw, 68px);
  line-height: 1.08;
  letter-spacing: .005em;
  text-shadow: 0 1px 0 rgba(62, 95, 134, .08);
}
.home__title:focus { outline: none; }
.home__title:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; border-radius: 8px; }
.home__line { display: block; }
.home__line--name { font-size: 1.14em; line-height: 1.04; }

/* ---------- Subtitle on a pale-yellow brush band ---------- */
.home__subtitle {
  position: relative;
  max-width: 600px;
  margin: clamp(18px, 4.5vw, 30px) auto 0;
  padding: 10px clamp(14px, 5vw, 48px);
  color: var(--ink-soft);
  font-style: italic;
  font-size: clamp(19px, 5.1vw, 26px);
  line-height: 1.4;
  letter-spacing: .01em;
  text-wrap: balance;
}
.home__subtitle::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 4px -4px;
  background:
    linear-gradient(90deg, rgba(251, 238, 194, 0) 0%, rgba(251, 238, 194, .75) 9%, rgba(250, 236, 190, .8) 50%, rgba(251, 238, 194, .75) 91%, rgba(251, 238, 194, 0) 100%);
  border-radius: 38% 46% 42% 50% / 50% 40% 60% 46%;
  filter: blur(1.5px);
  transform: rotate(-1deg);
}

/* ---------- Bird / cake / gift (kept small, as in the reference) ---------- */
.home__art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2%;
  width: min(100%, 480px);
  margin: clamp(18px, 5vw, 26px) auto 0;
}
.home__art img { height: auto; }
.home__bird {
  width: 25%;
  align-self: center;
  margin-top: -4%;
}
.home__cake {
  width: 50%;
  /* hide the stray mark in the image's top-left corner */
  clip-path: inset(0 0 0 2%);
}
.home__gift {
  position: relative;
  display: block;
  width: 11%;
  margin-left: 2%;
  margin-right: 6%;
}
.home__gift img { width: 100%; }
.home__gift .home__sprig {
  position: absolute;
  width: 62%;
  left: 88%;
  bottom: 4%;
  transform: rotate(52deg);
}

/* ---------- Big coral play button ---------- */
.home__play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vw, 26px);
  width: min(100%, 520px);
  min-height: 84px;
  margin: clamp(22px, 5.5vw, 30px) auto 0;
  padding: 12px clamp(20px, 6vw, 44px) 12px clamp(14px, 4vw, 26px);
  border: 0;
  border-radius: var(--radius-pill);
  background:
    radial-gradient(ellipse 70% 90% at 30% 25%, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 60% 80% at 80% 90%, rgba(196, 70, 54, .22), rgba(196, 70, 54, 0) 70%),
    var(--coral);
  color: var(--white);
  font-size: clamp(22px, 6vw, 30px);
  line-height: 1.2;
  letter-spacing: .01em;
  box-shadow: 0 6px 16px -6px rgba(212, 84, 63, .45);
  transition: transform 160ms var(--ease-gentle), background-color 160ms var(--ease-gentle);
}
.home__play:hover { background-color: var(--coral-deep); }
.home__play:active { transform: scale(.98); }
.home__play:focus-visible { outline: 4px solid var(--ink); outline-offset: 5px; }
.home__play-label { text-align: center; text-wrap: balance; }
.home__nowrap { white-space: nowrap; }

/* Play icon: circle with a triangle. Default = coral circle, white triangle (cards). */
.play-icon {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 2px 5px -2px rgba(212, 84, 63, .5);
}
.play-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--white);
  transform: translate(-36%, -50%);
}
/* Big button: white circle, coral triangle. */
.play-icon--white {
  width: clamp(52px, 14vw, 72px);
  height: clamp(52px, 14vw, 72px);
  background: var(--white);
  box-shadow: 0 2px 6px -2px rgba(150, 50, 36, .45);
}
.play-icon--white::after {
  border-width: clamp(11px, 3vw, 15px) 0 clamp(11px, 3vw, 15px) clamp(18px, 5vw, 25px);
  border-left-color: var(--coral);
}

/* ---------- "Or watch each friend’s message below:" ---------- */
.home__or {
  margin: clamp(22px, 5.5vw, 30px) auto 0;
  color: var(--ink);
  text-wrap: balance;
  font-style: italic;
  font-size: clamp(19px, 5vw, 26px);
  line-height: 1.35;
  letter-spacing: .01em;
}

/* ---------- Five birthday-song rows (one per singer, relay order) ---------- */
.home__songs {
  display: grid;
  gap: 12px;
  width: min(100%, 520px);
  margin: clamp(16px, 4.5vw, 26px) auto 0;
  padding: 0;
  list-style: none;
}
.home__song {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 68px;
  padding: 10px 20px;
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 18px;
  color: var(--ink);
  font-size: clamp(20px, 5.4vw, 23px);
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  box-shadow: 0 3px 10px -4px rgba(80, 70, 60, .22), inset 0 0 18px rgba(255, 255, 255, .55);
  transition: transform 160ms var(--ease-gentle), filter 160ms var(--ease-gentle);
}
.home__card--peach    { background: var(--peach); }
.home__card--sage     { background: var(--sage); }
.home__card--lavender { background: var(--lavender); }
.home__card--butter   { background: #fbf1d4; }
.home__card--sky      { background: #e4eef7; }
.home__song:hover, .home__message:hover { filter: brightness(.97); }
.home__song:active, .home__message:active { transform: scale(.98); }
.home__song:focus-visible, .home__message:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

/* ---------- Sufen's spoken message: set apart from the songs ---------- */
.home__message {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(100%, 520px);
  min-height: 84px;
  margin: clamp(22px, 6vw, 32px) auto 0;
  padding: 14px 20px;
  border: 2px dashed rgba(232, 106, 90, .55);
  border-radius: 22px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 4px 14px -6px rgba(80, 70, 60, .25);
  transition: transform 160ms var(--ease-gentle), filter 160ms var(--ease-gentle);
}
.home__message-title { font-size: clamp(20px, 5.4vw, 23px); font-weight: 600; font-style: italic; line-height: 1.25; }

/* ---------- "More wishes below" reminder, floating at the bottom of the first screen ---------- */
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 26px;
  border: 2px solid rgba(62, 95, 134, .25);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .95);
  color: var(--ink);
  font-size: 20px;
  font-style: italic;
  white-space: nowrap;
  box-shadow: 0 6px 18px -8px rgba(62, 95, 134, .45);
  transform: translateX(-50%);
  animation: hint-bob 2.4s var(--ease-gentle) 1.2s infinite;
  transition: opacity 400ms var(--ease-gentle), visibility 400ms;
}
.scroll-hint.is-gone { opacity: 0; visibility: hidden; animation: none; }
.scroll-hint__arrow {
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-right: 3px solid var(--coral);
  border-bottom: 3px solid var(--coral);
  transform: rotate(45deg);
}
@keyframes hint-bob {
  0%, 60%, 100% { transform: translate(-50%, 0); }
  30% { transform: translate(-50%, 6px); }
}

/* Speech bubble drawn in CSS (no new artwork). */
.speech-icon {
  position: relative;
  flex: none;
  width: 46px;
  height: 36px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: var(--coral);
  box-shadow: 0 2px 5px -2px rgba(212, 84, 63, .5);
}
.speech-icon::before { /* tail */
  content: "";
  position: absolute;
  left: 9px;
  bottom: -8px;
  border-style: solid;
  border-width: 10px 4px 0 10px;
  border-color: var(--coral) transparent transparent transparent;
}
.speech-icon::after { /* three dots */
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: -11px 0 0 var(--white), 11px 0 0 var(--white);
}

@media (prefers-reduced-motion: reduce) {
  .home__play, .home__song, .home__message { transition: none; }
  .scroll-hint { animation: none; }
}
