:root {
  --ink: #3d3522;
  --paper: #fefdf8;
  --green: #8ec5a0;
  --yellow: #fbeaa5;
  --pink: #f5b9b0;
  --line: #9a8f78;
  --hand: "Kalam", cursive;
  color: var(--ink);
  font-family: var(--hand);
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f0f8ff;
  font-size: 18px;
  line-height: 1.6;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-underline-offset: 5px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #386648;
  outline-offset: 5px;
}
::selection {
  background: var(--yellow);
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
img {
  max-width: 100%;
  object-fit: contain;
}
h1,
h2,
p,
figure {
  margin: 0;
}
h1,
h2 {
  line-height: 1.12;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.4rem, 4.2vw, 3.65rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}
h1 em {
  font-style: normal;
  color: #446b4d;
}
h2 {
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  letter-spacing: -0.025em;
}
p {
  max-width: 65ch;
}
.memory-page {
  position: relative;
  max-width: 1120px;
  margin: 78px auto;
  z-index: 1;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow:
    5px 5px 0 var(--yellow),
    0 18px 55px #3d352212;
  overflow: hidden;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 24px 48px;
  border-bottom: 1px dashed var(--line);
}
.wordmark {
  font-size: 1.65rem;
  font-weight: 700;
  text-decoration: none;
}
.site-header nav {
  display: flex;
  gap: 28px;
  font-size: 1.05rem;
}
.site-header nav a {
  text-decoration: none;
}
.site-header nav a:hover {
  text-decoration: underline;
}
.thank-you {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 58px;
  padding: 70px 58px 72px;
  align-items: center;
}
.thank-you-letter {
  position: relative;
}
.thank-you-letter p {
  margin-top: 22px;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  max-width: 46ch;
}
.thank-you-letter .signature {
  font: 1.45rem/1.4 var(--hand);
  margin: 26px 0;
}
.flower {
  position: absolute;
  left: -40px;
  top: -45px;
  width: 48px;
  height: 80px;
  transform: rotate(-19deg);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 11px 23px;
  background: var(--green);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.2s;
}
.button:hover:not(:disabled) {
  transform: translateY(-2px);
}
.button.secondary {
  background: var(--paper);
  margin: 30px auto 0;
}
.hero-album {
  position: relative;
  width: 100%;
  max-width: 350px;
  margin: auto;
}
.hero-polaroid {
  background: white;
  padding: 14px 14px 10px;
  box-shadow: 0 10px 26px #3d35222b;
  transform: rotate(3deg);
}
.hero-polaroid > img {
  display: block;
  width: 100%;
  height: 350px;
  object-fit: contain;
  background: #faf7f0;
}
.hero-polaroid figcaption {
  text-align: center;
  font-size: 1.35rem;
  padding: 12px 0 3px;
}
.hero-bow {
  position: absolute;
  top: -40px;
  left: 32%;
  width: 120px;
  transform: rotate(2deg);
}
.hero-rings {
  position: absolute;
  right: -30px;
  bottom: 55px;
  transform: rotate(-12deg);
}
.weekend-date {
  text-align: center;
  line-height: 1.5;
  font-size: 1rem;
  margin-top: 38px;
}
.photo-section {
  padding: 52px 48px 60px;
  border-top: 2px dashed var(--line);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
}
.section-heading p {
  margin-top: 15px;
}
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0;
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.filter {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
}
.filter.active {
  background: var(--yellow);
  border-color: var(--ink);
}
#photo-count {
  white-space: nowrap;
  font-size: 0.95rem;
}
.memory-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  align-items: start;
}
.memory-card {
  margin: 0;
  background: white;
  padding: 10px 10px 14px;
  border: 1px solid #ddd7c9;
  box-shadow: 0 5px 12px #3d352214;
  min-width: 0;
}
.memory-card:nth-child(3n + 1) {
  transform: rotate(-1deg);
}
.memory-card:nth-child(3n) {
  transform: rotate(1deg);
}
.memory-card button {
  display: block;
  border: 0;
  padding: 0;
  background: #f1eee4;
  width: 100%;
  color: var(--ink);
}
.memory-card img {
  display: block;
  width: 100%;
  height: 255px;
  object-fit: cover;
}
.memory-card figcaption {
  padding: 13px 6px 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.memory-card small {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  margin-top: 4px;
}
.video-tile {
  display: grid;
  place-items: center;
  min-height: 200px;
  font-size: 1.6rem;
}
#gallery-status {
  padding: 32px 15px;
  text-align: center;
  margin: auto;
  color: #62563b;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  padding: 12px;
  display: block;
  margin: auto;
}
.share-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  padding: 60px;
  background: #f9e5df;
  border-block: 1px solid var(--line);
}
.share-intro > img {
  float: right;
  margin: -10px -12px 0 12px;
  width: 70px;
}
.share-intro > p {
  margin-top: 22px;
}
.small-print {
  font:
    14px/1.65 system-ui,
    sans-serif;
}
.share-section form {
  min-width: 0;
}
.share-section label {
  display: block;
  margin: 17px 0 5px;
  font-weight: 700;
}
.share-section label:first-child {
  margin-top: 0;
}
.share-section label span {
  font-weight: 400;
  font-size: 0.9rem;
}
.share-section input,
.share-section textarea {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  font:
    15px/1.5 system-ui,
    sans-serif;
}
.share-section input[type="file"] {
  padding: 18px 12px;
  border: 2px dashed var(--line);
}
input::file-selector-button {
  border: 1px solid var(--ink);
  background: var(--yellow);
  padding: 8px;
  border-radius: 4px;
  margin-right: 10px;
  color: var(--ink);
}
textarea {
  resize: vertical;
}
.form-help {
  font:
    13px/1.6 system-ui,
    sans-serif;
  margin: 8px 0;
}
.share-section .button {
  margin-top: 18px;
}
#upload-status,
#upload-results {
  font:
    14px/1.6 system-ui,
    sans-serif;
  margin-top: 16px;
  overflow-wrap: anywhere;
}
#upload-results {
  padding-left: 20px;
}
.keepsake-section {
  text-align: center;
  padding: 65px 35px;
}
.keepsake-section > img {
  margin-bottom: 15px;
}
.keepsake-section p {
  margin: 16px auto;
}
.handwritten-note {
  color: #62563b;
}
.keepsake-link {
  display: block;
  margin: 14px auto;
  padding: 16px;
  border-bottom: 1px dashed var(--line);
  max-width: 550px;
  text-align: left;
}
footer {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 48px;
  padding: 25px 0;
  border-top: 1px dashed var(--line);
}
footer p {
  line-height: 1.4;
}
footer > a {
  font-size: 0.9rem;
  margin-left: auto;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 15px;
  background: var(--yellow);
  padding: 10px;
  z-index: 10;
}
.skip-link:focus {
  top: 15px;
}
dialog {
  width: min(1100px, 96vw);
  max-height: 94vh;
  background: #24251f;
  color: var(--paper);
  border: 0;
  padding: 45px 20px 12px;
  border-radius: 8px;
}
dialog::backdrop {
  background: #181a17e8;
}
.lightbox-close {
  position: absolute;
  top: 0;
  right: 12px;
  font-size: 2rem;
  padding: 0 12px;
}
dialog button {
  background: transparent;
  border: 0;
  color: var(--paper);
  min-width: 44px;
  min-height: 44px;
  font-size: 1.5rem;
}
#lightbox-media img,
#lightbox-media video {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
}
.lightbox-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}
.lightbox-bottom p {
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 1rem;
}
dialog button:focus-visible {
  outline-color: var(--yellow);
}
@media (min-width: 1500px) {
  .memory-page {
    margin-top: 65px;
  }
}
@media (max-width: 900px) {
  .memory-page {
    margin: 18px;
  }
  .site-header {
    padding: 22px 28px;
  }
  .thank-you {
    padding: 65px 35px;
    gap: 35px;
  }
  .hero-polaroid > img {
    height: 285px;
  }
  .flower {
    left: -20px;
    top: -50px;
    width: 45px;
  }
  .share-section {
    padding: 45px 32px;
    gap: 35px;
  }
  .photo-section {
    padding: 40px 30px;
  }
  .memory-gallery {
    gap: 16px;
  }
  .memory-card img {
    height: 200px;
  }
  .hero-rings {
    right: -12px;
    width: 75px;
  }
}
@media (max-width: 620px) {
  body {
    font-size: 17px;
  }
  .memory-page {
    margin: 10px 10px 18px;
    box-shadow: 4px 5px 0 var(--green);
  }
  .site-header {
    padding: 19px 20px;
    flex-direction: column;
    gap: 10px;
  }
  .wordmark {
    font-size: 1.65rem;
  }
  .site-header nav {
    gap: 25px;
    font-size: 1rem;
  }
  .thank-you {
    grid-template-columns: 1fr;
    padding: 55px 26px 35px;
    gap: 50px;
  }
  .thank-you-letter p {
    font-size: 15px;
  }
  .flower {
    left: auto;
    right: -8px;
    top: -35px;
    width: 42px;
  }
  .hero-album {
    width: 85%;
    max-width: 320px;
  }
  .hero-polaroid > img {
    height: 290px;
  }
  .hero-bow {
    width: 95px;
    top: -29px;
  }
  .weekend-date {
    margin-top: 30px;
  }
  .photo-section {
    padding: 35px 18px 40px;
  }
  .section-heading img {
    width: 58px;
  }
  .section-heading p {
    font-size: 16px;
  }
  .gallery-toolbar {
    display: block;
    margin: 24px 0;
  }
  .filters {
    gap: 7px;
  }
  .filter {
    font-size: 14px;
    padding: 8px 10px;
  }
  #photo-count {
    margin-top: 12px;
  }
  .memory-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
  .memory-card {
    padding: 6px 6px 10px;
  }
  .memory-card img {
    height: 175px;
  }
  .memory-card figcaption {
    font-size: 14px;
    padding: 9px 3px 0;
  }
  .share-section {
    grid-template-columns: 1fr;
    padding: 35px 25px;
    gap: 28px;
  }
  .share-intro > img {
    width: 62px;
  }
  .share-intro > p {
    margin-top: 16px;
  }
  .keepsake-section {
    padding: 40px 22px;
  }
  footer {
    margin: 0 22px;
    flex-wrap: wrap;
    font-size: 16px;
  }
  footer > a {
    margin: 0;
    width: 100%;
  }
  footer img {
    width: 45px;
    height: 45px;
  }
  .video-tile {
    min-height: 175px;
    font-size: 1.1rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
  }
}

/* A little more room for the original sky and quieter album details. */
.site-header nav a {
  padding: 7px 3px;
}
.site-header nav a[href="#share"] {
  background: var(--yellow);
  border-radius: 6px;
  padding: 7px 14px;
  transform: rotate(-2deg);
}
.wordmark {
  color: #805145;
}
.photo-section {
  background: #fffdf6;
}
#gallery-status {
  border-block: 1px dashed #c8bda5;
  padding: 42px 20px;
  margin: 12px auto;
  width: 100%;
}
.share-section {
  background: #fae8e1;
}
.form-help {
  color: #655541;
}
.keepsake-section {
  background: #f3f6ed;
}
footer {
  padding-block: 30px;
}
@media (min-width: 901px) and (max-width: 1190px) {
  .memory-page {
    margin: 65px 35px;
  }
}
@media (max-width: 620px) {
  .memory-page {
    margin: 38px 14px 24px;
  }
  .thank-you {
    padding-top: 45px;
    gap: 38px;
  }
  .thank-you-letter p {
    line-height: 1.75;
    margin-top: 18px;
  }
  .hero-polaroid > img {
    object-fit: contain;
  }
  .site-header nav {
    gap: 16px;
  }
  .hero-album {
    width: 90%;
  }
}

.hero-polaroid > img {
  height: auto;
  aspect-ratio: 1.18;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 620px) {
  .hero-polaroid > img {
    height: auto;
    object-fit: cover;
  }
}
