:root {
  color-scheme: light;
}

body {
  overflow-x: hidden;
  background: #d7cbb9;
  color: #24201c;
}

.paper-texture {
  position: fixed;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 250, 235, 0.46), transparent 33rem),
    radial-gradient(circle at 75% 72%, rgba(124, 102, 77, 0.24), transparent 37rem),
    repeating-linear-gradient(93deg, rgba(93, 74, 52, 0.035) 0 1px, transparent 1px 5px),
    #d7cbb9;
}

.scrapbook-page {
  position: relative;
  z-index: 4;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-rows: auto 1fr auto;
  padding: clamp(1.1rem, 2.5vw, 2rem);
  pointer-events: none;
}

.scrap-collage {
  position: fixed;
  z-index: 1;
  inset: -1.5vh -1.5vw;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: clamp(0.5rem, 0.82vw, 0.95rem);
  overflow: hidden;
  transform: rotate(-0.35deg) scale(0.995);
  pointer-events: none;
}

.scrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  border: clamp(0.24rem, 0.38vw, 0.45rem) solid #f6f0e5;
  background: #f6f0e5;
  box-shadow: 0 1rem 2.2rem rgba(54, 43, 32, 0.3);
}

.scrap::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(66, 51, 37, 0.15);
  content: "";
}

.scrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) contrast(0.96) sepia(0.08);
}

.photo-trigger {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  padding: 0;
  appearance: none;
  background: transparent;
  cursor: zoom-in;
  pointer-events: auto;
}

.photo-trigger:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -3px;
}

.photo-trigger:hover img {
  filter: saturate(0.92) contrast(1.02);
}

.scrap--4,
.scrap--11,
.scrap--12,
.scrap--14 {
  align-self: center;
  justify-self: center;
  width: auto;
}

.scrap--4 {
  height: 125%;
  aspect-ratio: 900 / 1273;
}

.scrap--11,
.scrap--12,
.scrap--14 {
  height: 112%;
  aspect-ratio: 4 / 3;
}

.scrap--1 { z-index: 2; grid-area: 1 / 1 / 2 / 2; transform: rotate(-8deg) scale(1.01); }
.scrap--2 { z-index: 1; grid-area: 1 / 2 / 3 / 3; transform: rotate(5deg) scale(1.03); }
.scrap--3 { z-index: 2; grid-area: 4 / 1 / 5 / 3; transform: rotate(-4deg) scale(0.97); }
.scrap--4 { z-index: 2; grid-area: 1 / 5 / 2 / 6; transform: rotate(6.5deg) scale(1.02); }
.scrap--5 { grid-area: 1 / 6 / 2 / 8; transform: rotate(-5.5deg) scale(1.03); }
.scrap--6 { z-index: 2; grid-area: 2 / 3 / 3 / 5; transform: rotate(4.5deg) scale(0.96); }
.scrap--7 { grid-area: 2 / 5 / 3 / 7; transform: rotate(-6.5deg) scale(1.03); }
.scrap--8 { z-index: 2; grid-area: 3 / 5 / 4 / 7; transform: rotate(5.5deg) scale(1.02); }
.scrap--9 { grid-area: 2 / 7 / 3 / 8; transform: rotate(-3.5deg) scale(0.98); }
.scrap--10 { z-index: 2; grid-area: 3 / 3 / 4 / 5; transform: rotate(7deg) scale(1.03); }
.scrap--11 { z-index: 2; grid-area: 3 / 1 / 4 / 3; transform: rotate(-5deg) scale(0.98); }
.scrap--12 { z-index: 2; grid-area: 1 / 3 / 2 / 5; transform: rotate(3.8deg) scale(0.98); }
.scrap--13 { grid-area: 3 / 7 / 4 / 9; transform: rotate(-7.5deg) scale(1.01); }
.scrap--14 { z-index: 2; grid-area: 4 / 5 / 5 / 7; transform: rotate(4.5deg) scale(0.98); }
.scrap--15 { grid-area: 2 / 1 / 3 / 2; transform: rotate(6.5deg) scale(1.03); }
.scrap--16 { z-index: 2; grid-area: 4 / 3 / 5 / 5; transform: rotate(-4.8deg) scale(1.01); }
.scrap--17 { grid-area: 1 / 8 / 2 / 9; transform: rotate(7.5deg) scale(0.98); }

.topbar,
.footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.owner {
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 0.35rem;
  background: rgba(248, 244, 235, 0.82);
  box-shadow: 0 0.35rem 1rem rgba(54, 43, 32, 0.16);
  font-family: "Aptos Display", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1rem, 1.55vw, 1.3rem);
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1.1;
}

.back-link {
  padding: 0.45rem 0.7rem;
  border-bottom: 2px solid currentColor;
  background: rgba(248, 244, 235, 0.82);
  box-shadow: 0 0.35rem 1rem rgba(54, 43, 32, 0.16);
  pointer-events: auto;
}

.back-link:focus-visible,
.social-link:focus-visible,
.contact-trigger:focus-visible {
  outline-color: #25211c;
}

.hero {
  display: grid;
  place-content: center;
  padding: 2rem 0;
}

.imagine-polaroid {
  position: relative;
  width: min(470px, 40vw);
  margin: 0;
  padding: clamp(0.5rem, 0.8vw, 0.72rem);
  background: #f8f4eb;
  box-shadow: 0 2.3rem 5rem rgba(56, 42, 27, 0.35);
  transform: rotate(-1.25deg);
}

.imagine-crop {
  display: block;
  overflow: hidden;
  aspect-ratio: 1.7;
}

.imagine-crop img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.tape {
  position: absolute;
  z-index: 2;
  top: -1.1rem;
  left: 50%;
  width: clamp(5rem, 10vw, 7.5rem);
  height: 2.2rem;
  background: rgba(235, 211, 155, 0.76);
  box-shadow: inset 0 0 0.15rem rgba(110, 88, 50, 0.18);
  transform: translateX(-50%) rotate(2deg);
  pointer-events: none;
}

.footer {
  align-items: flex-end;
  justify-content: flex-end;
  flex-direction: column;
}

.footer .social-links {
  justify-content: flex-end;
  pointer-events: auto;
}

.social-link,
.contact-trigger {
  border: 0;
  background: rgba(249, 244, 233, 0.88);
  box-shadow: 0 0.4rem 1rem rgba(76, 59, 41, 0.15);
}

.social-link:hover,
.contact-trigger:hover {
  background: #25211c;
  color: #fff;
}

.social-link--instagram {
  background: linear-gradient(135deg, #7c3aed, #e1306c 55%, #f59e0b);
  color: #fff;
}

.social-link--strava img {
  width: 1.05rem;
}

.contact-panel {
  max-width: 20rem;
  border: 1px solid rgba(54, 43, 32, 0.2);
  background: rgba(249, 244, 233, 0.94);
  box-shadow: 0 0.8rem 1.8rem rgba(76, 59, 41, 0.2);
  font-style: normal;
  text-align: right;
  pointer-events: auto;
}

.lightbox {
  width: min(96vw, 100rem);
  height: 94vh;
  max-width: none;
  max-height: none;
  border: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
}

.lightbox::backdrop {
  background: rgba(18, 15, 13, 0.9);
  backdrop-filter: blur(0.35rem);
}

.lightbox-frame {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(96vw - 1rem);
  max-height: calc(94vh - 1rem);
  box-sizing: border-box;
  border: clamp(0.3rem, 0.6vw, 0.7rem) solid #f8f4eb;
  background: #f8f4eb;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.48);
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: grid;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  padding: 0;
  background: rgba(20, 17, 15, 0.8);
  color: #fff;
  cursor: pointer;
  font: 300 2rem/1 system-ui, sans-serif;
  place-items: center;
}

.lightbox-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (min-width: 761px) {
  .scrap--2 { z-index: 3; }
  .scrap--4 { top: 2.25rem; }
  .scrap--11 { left: 1rem; }
  .scrap--12 { top: 1.25rem; }
  .scrap--14 { top: -1.5rem; }

  .scrap--6 {
    grid-area: 2 / 2 / 3 / 4;
    width: 72%;
    height: 84%;
    align-self: center;
    justify-self: end;
    transform: rotate(4.5deg);
  }

  .scrap--6 img {
    object-position: 68% center;
  }

  .scrap--7 { grid-area: 2 / 6 / 3 / 8; }
  .scrap--9 {
    left: 1rem;
    grid-area: 2 / 8 / 3 / 9;
  }

  .footer .social-links {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-items: end;
  }

  .footer .contact-trigger {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 760px) {
  .scrapbook-page {
    padding: 1rem;
  }

  .scrap-collage {
    inset: -0.5vh -2vw;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(7, minmax(0, 1fr));
    gap: 0.48rem;
    transform: rotate(-0.2deg) scale(0.99);
  }

  .scrap { border-width: 0.2rem; }
  .scrap--1 { grid-area: 1 / 1 / 2 / 2; }
  .scrap--2 { grid-area: 1 / 2 / 2 / 3; }
  .scrap--3 { grid-area: 1 / 3 / 2 / 5; }
  .scrap--4 { grid-area: 2 / 1 / 3 / 3; }
  .scrap--5 { grid-area: 3 / 1 / 4 / 2; }
  .scrap--6 { grid-area: 3 / 2 / 4 / 4; }
  .scrap--7 { grid-area: 4 / 1 / 5 / 3; }
  .scrap--8 { grid-area: 4 / 3 / 5 / 5; }
  .scrap--9 { grid-area: 5 / 1 / 6 / 2; }
  .scrap--10 { grid-area: 5 / 2 / 6 / 4; }
  .scrap--11 { grid-area: 6 / 1 / 7 / 3; }
  .scrap--12 { grid-area: 2 / 3 / 3 / 5; }
  .scrap--13 { grid-area: 5 / 4 / 6 / 5; }
  .scrap--14 { grid-area: 6 / 3 / 7 / 5; }
  .scrap--15 { grid-area: 7 / 1 / 8 / 2; }
  .scrap--16 { grid-area: 7 / 2 / 8 / 4; }
  .scrap--17 { grid-area: 3 / 4 / 4 / 5; }

  .scrap--11,
  .scrap--14 {
    top: -0.75rem;
  }

  .imagine-polaroid {
    width: min(70vw, 390px);
    transform: rotate(-0.6deg);
  }

  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .social-links {
    gap: 0.45rem;
  }

  .social-link,
  .contact-trigger {
    min-height: 2.55rem;
    padding: 0.6rem 0.78rem;
    font-size: 0.68rem;
  }

  .contact-panel {
    max-width: none;
    text-align: left;
  }
}

@media (max-height: 700px) and (min-width: 761px) {
  .imagine-polaroid {
    width: min(380px, 37vw);
  }

  .hero {
    padding: 0.5rem 0;
  }
}
