@font-face {
  font-family: 'Reenie Beanie';
  src: url('./assets/fonts/ReenieBeanie.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: 'Astro notes';
  src: url('./assets/fonts/OoohBaby-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: #403a40;
  font-family: Georgia, serif;
}

.astro-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 44px 48px 56px;
  background-image: url('./assets/paper-texture.png');
  background-size: 400px;
}

.astro-content {
  max-width: 1110px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #746d76;
  font: 400 20px/1.2 'Astro notes', 'Segoe Print', cursive;
  text-decoration: none;
}

.back-arrow { width: 20px; height: 13px; flex-shrink: 0; }
.back-link:hover { color: #403a40; text-decoration: underline; text-underline-offset: 4px; }

.astro-heading {
  margin: 24px 0 0;
  color: #625966;
  font: 400 38px/1.2 'Reenie Beanie', 'Segoe Print', cursive;
}

.astro-heading + .astro-gallery { margin-top: 10px; }

.astro-gallery {
  columns: 3;
  column-gap: 48px;
  margin-top: 24px;
  padding: 18px 14px 0;
}

.memory {
  --tilt: -2deg;
  --tape: #c5d7e4;
  position: relative;
  display: inline-block;
  vertical-align: top;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 48px;
  padding: 10px 10px 0;
  background: #fffdf9;
  box-shadow: 0 1px 2px #55455324, 2px 5px 9px -6px #5545534a;
  transform: rotate(var(--tilt));
}

/* Translucent strips with torn ends sit across the paper borders. */
.memory::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: -13px;
  left: calc(50% - 43px);
  width: 86px;
  height: 30px;
  background-color: var(--tape);
  background-image: url('./assets/paper-texture.png');
  background-size: 200px;
  background-blend-mode: multiply;
  opacity: .78;
  clip-path: polygon(2% 0, 98% 2%, 96% 15%, 100% 27%, 97% 42%, 100% 58%, 96% 72%, 99% 89%, 97% 100%, 0 96%, 3% 80%, 0 67%, 3% 54%, 0 38%, 3% 21%, 0 9%);
  transform: rotate(-7deg);
  pointer-events: none;
}

.memory:nth-child(3n + 2) { --tilt: 2deg; --tape: #d9c9e2; }
.memory:nth-child(3n) { --tilt: -1deg; --tape: #eee1b0; }
.memory:nth-child(5n) { --tilt: 3deg; }
.memory:nth-child(4n)::before { left: 12px; transform: rotate(-28deg); width: 70px; }
.memory:nth-child(4n + 2)::before { left: auto; right: 5px; transform: rotate(24deg); width: 74px; }

.astro-photo { display: block; }
.astro-photo img { display: block; width: 100%; height: auto; }

.memory-13 .astro-photo img {
  aspect-ratio: 23 / 20;
  object-fit: cover;
  object-position: center top;
}

.memory figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 10px 2px 9px;
  color: #625966;
  font: 400 25px/1.15 'Reenie Beanie', 'Segoe Print', cursive;
  text-align: center;
}

.memory figcaption:empty {
  min-height: 10px;
  padding: 0;
}

.memory-6 figcaption { font-size: 23px; }
.ink-doodle { display: block; width: 33px; height: 32px; color: #898090; }
.doodle-heart { width: 31px; color: #b77f8a; transform: rotate(-9deg); }
.doodle-star { width: 37px; color: #9aabc0; transform: rotate(8deg); }

.album-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 0 10px;
}

.album-footer .ink-doodle { width: 40px; height: 40px; transform: rotate(12deg); }
.album-footer p { margin: 0; color: #79707c; font: 26px/1.5 'Astro notes', cursive; transform: rotate(-4deg); }

a:focus-visible { outline: 2px solid #716385; outline-offset: 5px; }

@media (max-width: 900px) {
  .astro-page { padding: 36px 38px 40px; }
  .astro-gallery { columns: 2; column-gap: 42px; }
}

@media (max-width: 560px) {
  .astro-page { padding: 28px 28px 36px; }
  .astro-gallery { columns: 1; padding: 14px 12px 0; }
  .memory { margin-bottom: 42px; }
}

@media (prefers-reduced-motion: no-preference) {
  .memory { transition: transform 180ms ease; }
  .memory:hover, .memory:focus-within { transform: rotate(0deg); }
}
