:root {
  color-scheme: light;
  --paper: #efede7;
  --ink: #35372f;
  --muted: #69695f;
  --accent: #535e4c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 28%, #faf9f4 0, transparent 66%),
    var(--paper);
}

.keepsake {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vh, 48px) 24px;
}

.heading { text-align: center; margin-bottom: clamp(22px, 3vh, 36px); }
.small-rule { display: block; height: 1px; width: 28px; background: #a09d8e; margin: 0 auto 14px; }
h1 {
  margin: 0;
  font: 400 clamp(24px, 3.5vw, 30px)/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: -.025em;
}

.photograph {
  width: min(100%, 520px, calc(65vh * .75711 + 40px));
  width: min(100%, 520px, calc(65svh * .75711 + 40px));
  margin: 0;
}
.photo-frame {
  padding: clamp(12px, 2vw, 20px);
  border: 6px solid #35342e;
  outline: 1px solid #211f1a;
  border-radius: 1px;
  background: #f9f8f3;
  box-shadow:
    inset 0 0 0 1px #c5c1b5,
    0 2px 3px #28251c26,
    0 16px 28px -12px #38332445,
    0 36px 65px -35px #38332452;
}
.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 0 0 1px #d2d0c7;
}

.sound { width: min(100%, 380px); margin-top: clamp(25px, 4vh, 40px); }
audio { display: block; width: 100%; height: 44px; }
.player { display: flex; align-items: center; gap: 15px; }
.play-button {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.play-button:hover { background: #414b3b; transform: scale(1.04); }
.play-button:active { transform: scale(.98); }
.play-button:disabled { cursor: default; opacity: .55; }
.play-button svg { width: 22px; height: 22px; grid-area: 1 / 1; }
.icon-pause, .icon-replay { display: none; }
.is-playing .icon-play, .has-ended .icon-play { display: none; }
.is-playing .icon-pause, .has-ended .icon-replay { display: block; }
.track { flex: 1; min-width: 0; }
.track-labels { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.track-title { font-size: 12px; font-weight: 500; letter-spacing: .01em; }
.time { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-divider { color: inherit; }
.seek {
  --progress: 0%;
  display: block;
  width: 100%;
  height: 24px;
  margin: 3px 0 -5px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  accent-color: var(--accent);
}
.seek::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--progress), #d4d3c8 var(--progress)); }
.seek::-moz-range-track { height: 3px; border-radius: 3px; background: #d4d3c8; }
.seek::-moz-range-progress { height: 3px; background: var(--accent); }
.seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 10px; height: 10px; margin-top: -3.5px; background: var(--accent); border: 0; border-radius: 50%; }
.seek::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--accent); }
.seek:disabled { cursor: default; opacity: .5; }
.status { min-height: 1.5em; margin: 15px 0 0; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.5; letter-spacing: .015em; }
.audio-error { font-size: 13px; line-height: 1.6; text-align: center; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 420px) {
  .keepsake { padding-inline: 22px; }
  .photo-frame { border-width: 5px; }
  .sound { padding-inline: 3px; }
  .track-title { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
