:root {
  --ink: #f0ebe2;
  --dim: #b5aea3;
  --faint: #8d877d;
  --warm: #ffc387;
  --night: #0b0a0a;
  --serif: Palatino, "Palatino Linotype", "Book Antiqua", "URW Palladio L", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--night);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(90vmax 70vmax at 72% -12%, rgba(255, 170, 105, 0.13), transparent 65%),
    radial-gradient(70vmax 60vmax at 10% 110%, rgba(70, 60, 110, 0.14), transparent 70%),
    var(--night);
  background-attachment: fixed;
}

#home {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  column-gap: clamp(32px, 5vw, 88px);
  align-items: center;
  padding: clamp(24px, 5vh, 56px) clamp(24px, 6vw, 96px) clamp(16px, 2.5vh, 28px);
  padding-left: max(clamp(24px, 6vw, 96px), env(safe-area-inset-left));
  padding-right: max(clamp(24px, 6vw, 96px), env(safe-area-inset-right));
  padding-bottom: max(clamp(16px, 2.5vh, 28px), env(safe-area-inset-bottom));
  transition: opacity 0.9s ease;
  animation: arrive 1.8s ease both;
}

#home.leaving { opacity: 0; pointer-events: none; }

@keyframes arrive { from { opacity: 0; } to { opacity: 1; } }

.print {
  display: block;
  justify-self: end;
  width: 100%;
  max-width: 660px;
  max-height: 80vh;
  max-height: 80dvh;
  height: auto;
  object-fit: cover;
  border: clamp(6px, 0.8vmin, 11px) solid #c9c2b5;
  border-radius: clamp(8px, 1.1vmin, 14px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 26px 80px rgba(0, 0, 0, 0.7), 0 0 120px rgba(255, 170, 105, 0.07);
  transform: rotate(-0.5deg);
}

.words { min-width: 0; }

h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2rem, 3.7vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: 0.015em;
}

.dates {
  margin: 0.8em 0 0;
  color: var(--dim);
  font-size: clamp(0.98rem, 1.25vw, 1.2rem);
  letter-spacing: 0.04em;
}

.line {
  margin: 1.15em 0 0;
  font-style: italic;
  font-size: clamp(1.2rem, 1.8vw, 1.7rem);
  line-height: 1.3;
}

#play {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 52px;
  margin-top: clamp(26px, 4.2vh, 44px);
  padding: 0 1.6em 0 1.35em;
  color: var(--ink);
  font: inherit;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  background: rgba(255, 195, 135, 0.09);
  border: 1px solid rgba(255, 205, 155, 0.5);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

#play svg { color: var(--warm); flex: none; }

#play:hover { background: rgba(255, 195, 135, 0.2); border-color: rgba(255, 215, 170, 0.85); }

#play:focus-visible { outline: 2px solid var(--warm); outline-offset: 3px; }

.note {
  margin: 0.95em 0 0;
  color: var(--faint);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.help {
  grid-column: 1 / -1;
  margin: clamp(20px, 3vh, 30px) 0 0;
  color: var(--faint);
  font-size: 0.95rem;
  text-align: center;
}

.help a { color: var(--dim); text-underline-offset: 0.18em; }

.help a:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; border-radius: 2px; }

#stage {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 0.9s ease;
}

#stage.on { opacity: 1; }

#stage[hidden] { display: none; }

#film {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  outline: none;
}

.noscript { position: fixed; inset: auto 0 12px; margin: 0; text-align: center; }

.noscript a { color: var(--ink); }

/* Tall screens: the photo above the words, as in the film's portrait ending. */
@media (max-aspect-ratio: 1/1) {
  #home {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    justify-items: center;
    align-content: start;
    row-gap: clamp(22px, 3.6vh, 40px);
    padding-top: max(clamp(26px, 5.5vh, 64px), env(safe-area-inset-top));
    text-align: center;
  }

  .print {
    justify-self: center;
    width: min(100%, 560px);
    max-height: 46vh;
    max-height: 46dvh;
  }

  .words { align-self: start; }

  h1 { font-size: clamp(1.9rem, 8vw, 3rem); }

  .dates { font-size: clamp(0.95rem, 3.6vw, 1.2rem); }

  .line { font-size: clamp(1.15rem, 5vw, 1.6rem); }

  .help { margin-top: 0; }
}

/* Short, wide screens such as a phone on its side. */
@media (min-aspect-ratio: 1/1) and (max-height: 480px) {
  #home { padding-top: 14px; padding-bottom: 8px; column-gap: 28px; }
  .print { max-height: 74vh; max-height: 74dvh; width: auto; }
  h1 { font-size: 1.7rem; }
  .dates { margin-top: 0.4em; font-size: 0.9rem; }
  .line { margin-top: 0.6em; font-size: 1.05rem; }
  #play { margin-top: 12px; min-height: 44px; font-size: 1rem; }
  .note { margin-top: 0.5em; font-size: 0.82rem; }
  .help { margin-top: 6px; font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  #home { animation: none; transition: none; }
  #stage { transition: none; }
}
