:root {
  --paper: #fbfaf6;
  --paper-deep: #f2eee5;
  --ink: #2f342d;
  --muted: #687064;
  --eucalyptus: #6c958d;
  --eucalyptus-dark: #355e57;
  --gold: #b99543;
  --gold-soft: #eadbb3;
  --line: rgba(86, 104, 91, 0.18);
  --shadow: 0 20px 55px rgba(55, 64, 51, 0.14);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(108, 149, 141, 0.18), transparent 32rem),
    linear-gradient(180deg, var(--paper), #fff);
}

body.lightbox-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  min-height: min(780px, calc(100vh - 32px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.86fr);
  align-items: center;
  gap: 44px;
  padding: 28px 0;
}

.hero-copy {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.04;
  color: var(--eucalyptus-dark);
}

h1 {
  font-size: clamp(3.1rem, 9vw, 6.6rem);
  max-width: 780px;
}

#page-title {
  max-width: 720px;
  font-family: "Great Vibes", "Segoe Script", "Brush Script MT", cursive;
  font-size: clamp(4.15rem, 9.6vw, 7.4rem);
  font-weight: 550;
  line-height: 1.02;
  text-wrap: balance;
  -webkit-text-stroke: 0.26px currentColor;
  text-shadow:
    0.14px 0 currentColor,
    -0.08px 0 currentColor,
    0 0.09px currentColor;
}

.page-title-emphasis {
  font-size: 1.5em;
}

h2 {
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.lead {
  margin: 24px 0 0;
  max-width: 540px;
  color: var(--muted);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.primary-link,
.button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  color: #fff;
  background: var(--eucalyptus-dark);
  box-shadow: 0 12px 28px rgba(53, 94, 87, 0.24);
}

.primary-link {
  margin-top: 34px;
}

.primary-link:hover,
.button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.ghost-button {
  min-height: 44px;
  padding: 0 18px;
  color: var(--eucalyptus-dark);
  background: rgba(108, 149, 141, 0.12);
}

.hero-art {
  position: relative;
  min-height: 520px;
}

.hero-image {
  position: absolute;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
}

.hero-image-main {
  inset: 18px 8px auto auto;
  width: min(430px, 82vw);
  aspect-ratio: 1;
  border-radius: 34px;
}

.hero-image-accent {
  left: -18px;
  bottom: 10px;
  width: min(240px, 50vw);
  aspect-ratio: 1;
  border-radius: 28px;
}

.panel,
.gallery-section,
.privacy-note {
  margin-top: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 42px rgba(55, 64, 51, 0.08);
}

.panel,
.gallery-section {
  border-radius: 8px;
  padding: clamp(20px, 4vw, 36px);
}

.section-copy {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.notice {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 8px;
  color: #6d4d05;
  background: #fff5d6;
  border: 1px solid rgba(185, 149, 67, 0.35);
}

.hidden {
  display: none !important;
}

.upload-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  margin-top: 24px;
  align-items: stretch;
}

.upload-box > .button {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
}

.file-picker-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.file-picker {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 92px;
  padding: 18px 20px;
  border: 2px dashed rgba(108, 149, 141, 0.42);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(108, 149, 141, 0.1), rgba(234, 219, 179, 0.14));
  cursor: pointer;
}

.file-picker:hover {
  border-color: rgba(53, 94, 87, 0.62);
}

.file-picker-secondary {
  background: rgba(255, 255, 255, 0.72);
}

.file-picker-title {
  color: var(--eucalyptus-dark);
  font-size: 1.25rem;
  font-weight: 900;
}

.file-picker-copy {
  margin-top: 4px;
  color: var(--muted);
}

.visually-hidden-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.message-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-label {
  color: var(--eucalyptus-dark);
  font-weight: 900;
}

.message-textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 14px 16px;
  border: 1px solid rgba(108, 149, 141, 0.32);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.message-textarea:focus {
  outline: 3px solid rgba(108, 149, 141, 0.2);
  border-color: rgba(53, 94, 87, 0.68);
}

.message-textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.message-helper {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.progress-wrap {
  margin-top: 20px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--eucalyptus), var(--gold));
  transition: width 180ms ease;
}

.status-text {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.selected-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.selected-preview-item {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
  margin: 0;
  min-height: 176px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(242, 238, 229, 0.7);
}

.selected-preview-item img {
  width: 100%;
  height: 100%;
  min-height: 126px;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

.remove-preview-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(47, 52, 45, 0.72);
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.remove-preview-button:hover {
  background: rgba(47, 52, 45, 0.8);
}

.remove-preview-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.gallery-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 3px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  margin: 0;
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
}

.gallery-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  background:
    linear-gradient(rgba(47, 52, 45, 0.26), rgba(47, 52, 45, 0.26)),
    var(--gallery-backdrop, none);
  background-position: center;
  background-size: cover;
  filter: blur(14px);
  transform: scale(1.08);
  transition: opacity 180ms ease;
}

.gallery-item a,
.gallery-item img {
  width: 100%;
  height: 100%;
}

.gallery-item a {
  position: relative;
  z-index: 1;
  display: block;
}

.gallery-item img {
  object-fit: cover;
  transition: transform 260ms ease;
}

.guestbook-message {
  position: absolute;
  left: 10px;
  right: 72px;
  bottom: 10px;
  z-index: 2;
  max-height: 48%;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  color: #fff;
  background: rgba(47, 52, 45, 0.66);
  box-shadow: 0 8px 22px rgba(47, 52, 45, 0.18);
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.35;
  white-space: pre-wrap;
  backdrop-filter: blur(10px);
}

.gallery-item.is-landscape {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
  background: #211f1b;
}

.gallery-item.is-landscape img {
  object-fit: cover;
}

.gallery-item.is-landscape-contained::before {
  opacity: 1;
}

.gallery-item.is-landscape-contained img {
  object-fit: contain;
}

.gallery-item:hover img {
  transform: scale(1.035);
}

.gallery-item.is-landscape:hover img {
  transform: scale(1.018);
}

.gallery-item.is-landscape-contained:hover img {
  transform: scale(1.01);
}

.heart-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 52px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  color: #fff;
  background: rgba(47, 52, 45, 0.62);
  box-shadow: 0 8px 22px rgba(47, 52, 45, 0.2);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.heart-button:hover {
  transform: translateY(-1px);
  background: rgba(47, 52, 45, 0.74);
}

.heart-button:disabled {
  cursor: default;
}

.heart-button.is-hearted {
  color: #fff7f8;
  background: rgba(185, 73, 91, 0.84);
}

.heart-button.is-pending {
  opacity: 0.7;
}

.heart-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.heart-count {
  min-width: 1ch;
  font-weight: 900;
  line-height: 1;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: rgba(24, 28, 24, 0.82);
}

.lightbox-frame {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(100%, 1120px);
  max-height: min(92vh, 920px);
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

.lightbox-media {
  display: grid;
  place-items: center;
  min-height: 0;
  background: #151713;
  touch-action: pan-y;
  user-select: none;
}

.lightbox-media img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
}

.lightbox-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  padding: 14px 18px 16px;
  color: var(--ink);
  background: #fff;
}

.lightbox-title {
  color: var(--eucalyptus-dark);
  font-weight: 900;
}

.lightbox-count {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.lightbox-caption {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-wrap;
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  z-index: 21;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.74);
  color: #fff;
  background: rgba(24, 28, 24, 0.58);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  transform: translateY(-1px);
  background: rgba(24, 28, 24, 0.72);
}

.lightbox-close {
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  width: 50px;
  height: 64px;
  border-radius: 8px;
  font-size: 3rem;
  line-height: 1;
  transform: translateY(-50%);
}

.lightbox-nav:hover {
  transform: translateY(calc(-50% - 1px));
}

.lightbox-nav:disabled {
  cursor: default;
  opacity: 0.36;
  transform: translateY(-50%);
}

.lightbox-nav-previous {
  left: max(14px, env(safe-area-inset-left));
}

.lightbox-nav-next {
  right: max(14px, env(safe-area-inset-right));
}

.empty-state {
  grid-column: 1 / -1;
  padding: 34px;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(108, 149, 141, 0.08);
}

.privacy-note {
  border-radius: 8px;
  padding: 18px 20px;
  color: var(--muted);
  line-height: 1.5;
}

.privacy-note strong {
  color: var(--eucalyptus-dark);
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 24px, 680px);
    padding-top: 14px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 24px;
    padding-top: 18px;
  }

  .hero-art {
    min-height: 340px;
    order: -1;
  }

  .hero-image-main {
    right: 0;
    top: 0;
    width: min(320px, 74vw);
    border-radius: 26px;
  }

  .hero-image-accent {
    left: -6px;
    bottom: 0;
    width: min(190px, 46vw);
    border-radius: 22px;
  }

  .upload-box {
    grid-template-columns: 1fr;
  }

  .upload-box > .button {
    grid-column: auto;
    grid-row: auto;
  }

  .file-picker-group {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .gallery-head {
    align-items: start;
    flex-direction: column;
  }

  .photo-lightbox {
    padding: max(58px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
  }

  .lightbox-frame {
    max-height: calc(100vh - 76px);
  }

  .lightbox-media img {
    max-height: calc(100vh - 230px);
  }

  .lightbox-nav {
    top: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
    font-size: 2.2rem;
    transform: none;
  }

  .lightbox-nav:hover,
  .lightbox-nav:disabled {
    transform: none;
  }

  .lightbox-nav-previous {
    left: 18px;
  }

  .lightbox-nav-next {
    right: 18px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 3.1rem;
  }

  #page-title {
    max-width: 9.2em;
    margin-inline: auto;
    font-size: clamp(3.6rem, 14vw, 4.35rem);
    line-height: 1.04;
    text-align: center;
  }

  .hero-art {
    min-height: clamp(330px, 90vw, 360px);
    margin-bottom: 10px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox-text {
    grid-template-columns: 1fr;
    padding: 12px 14px 14px;
  }

  .lightbox-count {
    font-size: 0.88rem;
  }
}
