:root {
  color-scheme: light;
  --ink: #1f2733;
  --muted: #667085;
  --paper: #fffaf1;
  --cream: #fff6e4;
  --sun: #f6b24a;
  --coral: #e76f51;
  --teal: #2a9d8f;
  --line: rgba(31, 39, 51, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  background: #eadfd4;
  color: var(--ink);
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(100%, 480px);
  height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 46px rgba(31, 39, 51, 0.18);
}

.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  background: var(--paper);
}

.page[hidden] {
  display: none;
}

.home-page {
  color: white;
  overflow: hidden;
}

.city-backdrop,
.hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.city-backdrop {
  background-image: url("./assets/daughter-cover-portrait.jpg");
  background-size: cover;
  background-position: center top;
}

.hero-scrim {
  background:
    linear-gradient(180deg, rgba(14, 16, 20, 0.08), rgba(14, 16, 20, 0.1) 42%, rgba(14, 16, 20, 0.84)),
    linear-gradient(90deg, rgba(14, 16, 20, 0.42), rgba(14, 16, 20, 0.08), rgba(14, 16, 20, 0.18));
}

.home-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  padding: max(28px, env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.home-page .eyebrow {
  color: #ffd38a;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.35rem, 12vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 9vw, 3rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-text {
  max-width: 360px;
  margin-bottom: 24px;
  font-size: 1rem;
  line-height: 1.65;
}

.home-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 330px;
}

.home-menu button {
  min-height: 44px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  text-align: center;
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.18;
  box-shadow: 0 8px 20px rgba(10, 12, 16, 0.14);
}

.home-menu button::after {
  content: "";
}

.locked-menu {
  opacity: 0.58;
}

.app-page {
  padding-bottom: env(safe-area-inset-bottom);
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 88px;
  padding: max(16px, env(safe-area-inset-top)) 18px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.94);
  backdrop-filter: blur(16px);
}

.page-home-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 9px 12px;
  background: var(--ink);
  color: white;
  font-size: 0.86rem;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(31, 39, 51, 0.18);
}

.page-body {
  padding: 18px;
}

.timeline,
.film-grid,
.wish-grid {
  display: grid;
  gap: 14px;
}

.timeline {
  margin-top: 14px;
}

.timeline article,
.quiz-card,
.wish-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 28px rgba(31, 39, 51, 0.08);
}

.timeline article {
  padding: 16px;
}

.timeline span,
.quiz-progress,
.wish-card span {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.timeline h3 {
  margin: 10px 0 8px;
}

.timeline p,
.wish-card p,
.lock-note,
.motion-note {
  color: var(--muted);
  line-height: 1.65;
}

.film-card {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  padding: 22px;
  color: white;
  text-align: left;
  background: #1f2733;
  box-shadow: 0 18px 40px rgba(31, 39, 51, 0.16);
}

.film-card::before,
.film-card::after {
  content: "";
  position: absolute;
  inset: 0;
}

.film-card::before {
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
}

.film-card::after {
  background: linear-gradient(180deg, rgba(18, 22, 29, 0.08), rgba(18, 22, 29, 0.74));
}

.feature-film::before {
  background-image: url("./assets/daughter-cover-portrait.jpg");
}

.family-film::before {
  background-image: url("./assets/journey-hero.png");
}

.film-card span,
.film-card strong,
.film-card p {
  position: relative;
  z-index: 1;
}

.film-card span {
  color: #ffd38a;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.film-card strong {
  display: block;
  margin: 216px 0 10px;
  font-size: 1.7rem;
  line-height: 1.08;
}

.film-card p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.55;
}

.quiz-card {
  padding: 18px;
}

.choices {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.choices button {
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  text-align: left;
}

.choices button.correct {
  border-color: var(--teal);
  background: rgba(42, 157, 143, 0.12);
}

.choices button.wrong {
  border-color: var(--coral);
  background: rgba(231, 111, 81, 0.1);
}

.quiz-feedback {
  min-height: 28px;
  color: #6b4e71;
  font-weight: 750;
}

.next-button {
  width: 100%;
  min-height: 48px;
  background: var(--ink);
  color: white;
  font-weight: 850;
}

.next-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.wish-card {
  position: relative;
  min-height: 176px;
  padding: 20px;
  background: var(--cream);
  color: inherit;
  text-align: left;
}

.video-wish::after {
  content: "播放";
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 0.78rem;
  font-weight: 850;
}

.wish-card strong {
  display: block;
  margin: 12px 0 10px;
  font-size: 1.35rem;
}

.media-viewer {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: stretch;
  background: #000;
}

.media-viewer[hidden] {
  display: none;
}

.media-sheet {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  color: white;
}

.close-video {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  z-index: 2;
  min-width: 64px;
  min-height: 38px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 850;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.media-sheet video,
.media-sheet img {
  align-self: center;
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100svh;
  border-radius: 0;
  background: black;
  object-fit: contain;
}

.media-sheet video[hidden],
.media-sheet img[hidden],
.media-sheet audio[hidden] {
  display: none !important;
}

.media-sheet video::-webkit-media-controls-panel,
.media-sheet video::-webkit-media-controls,
.media-sheet video::-webkit-media-controls-enclosure {
  display: none !important;
}

.media-sheet audio {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 100%;
  width: calc(100% - 28px);
}

#videoFallback {
  display: none;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 40;
  width: min(360px, calc(100% - 36px));
  transform: translateX(-50%);
  padding: 13px 16px;
  border-radius: 10px;
  background: rgba(31, 39, 51, 0.94);
  color: white;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 16px 36px rgba(10, 12, 16, 0.28);
}

.toast[hidden] {
  display: none;
}
