:root {
  color-scheme: light;
  --bg: #f3f2ec;
  --surface: #fbfbf7;
  --surface-alt: #e4eae3;
  --text: #29352f;
  --muted: #66736a;
  --primary: #a15e47;
  --primary-strong: #794633;
  --ring: rgba(113, 137, 119, 0.4);
  --shadow: 0 20px 50px rgba(48, 59, 50, 0.12);
  --serif: Georgia, "Times New Roman", serif;
  --container: 1180px;
}

:root[data-theme="eucalyptus-terracotta"] {
  color-scheme: light;
  --bg: #f3f2ec;
  --surface: #fbfbf7;
  --surface-alt: #e4eae3;
  --text: #29352f;
  --muted: #66736a;
  --primary: #a15e47;
  --primary-strong: #794633;
  --ring: rgba(113, 137, 119, 0.4);
  --shadow: 0 20px 50px rgba(48, 59, 50, 0.12);
}

:root[data-theme="zand-terracotta"] {
  color-scheme: light;
  --bg: #f5eee5;
  --surface: #fffaf3;
  --surface-alt: #e9dbcf;
  --text: #40362f;
  --muted: #74665b;
  --primary: #b76545;
  --primary-strong: #8c4832;
  --ring: rgba(183, 101, 69, 0.34);
  --shadow: 0 20px 50px rgba(88, 64, 49, 0.13);
}

:root[data-theme="roze-bordeaux"] {
  color-scheme: light;
  --bg: #f4edf0;
  --surface: #fff9fb;
  --surface-alt: #eadce2;
  --text: #3a2e35;
  --muted: #75636e;
  --primary: #986079;
  --primary-strong: #74465c;
  --ring: rgba(152, 96, 121, 0.34);
  --shadow: 0 20px 50px rgba(76, 49, 62, 0.13);
}

:root[data-theme="nacht"] {
  color-scheme: dark;
  --bg: #202a28;
  --surface: #293532;
  --surface-alt: #35443e;
  --text: #f2eee6;
  --muted: #c0c9c0;
  --primary: #d89b7c;
  --primary-strong: #f0b493;
  --ring: rgba(216, 155, 124, 0.45);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

img {
  display: block;
  width: 100%;
}

a {
  color: var(--primary-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--primary);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

.container {
  width: min(var(--container), 90vw);
  margin-inline: auto;
}

.hero {
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  color: var(--text);
  font: 700 1.1rem var(--serif);
  letter-spacing: 0.12em;
  text-decoration: none;
}

.wordmark span,
.hero h1 span {
  color: var(--primary);
  font-style: italic;
}

.topbar__link,
.footer a:last-child {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.hero__grid {
  display: grid;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-top: clamp(1.5rem, 5vw, 4.5rem);
}

.hero__content {
  max-width: 540px;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--primary-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p,
figure {
  margin-top: 0;
}

.hero h1 {
  margin-bottom: 1rem;
  font: 400 clamp(3.5rem, 8vw, 6.5rem) / 0.98 var(--serif);
  letter-spacing: -0.055em;
}

.anniversary {
  border-top: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
  padding-top: 0.8rem;
}

.anniversary__label {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.025em;
}

.anniversary__label time {
  color: var(--text);
}

.anniversary__duration {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 0;
}

.anniversary__unit {
  display: flex;
  flex-direction: row-reverse;
  align-items: baseline;
  gap: 0.25rem;
}

.anniversary__unit[hidden] {
  display: none;
}

.anniversary__unit dd,
.anniversary__unit dt {
  margin: 0;
}

.anniversary__unit dd {
  font: 600 1rem var(--serif);
}

.anniversary__unit dt {
  color: var(--muted);
  font-size: 0.75rem;
}

.hero__photo {
  position: relative;
  margin: 0;
}

.hero__photo img {
  height: auto;
  border-radius: 2px 90px 2px 2px;
  box-shadow: var(--shadow);
}

.section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.gallery-section {
  padding-bottom: clamp(4rem, 7vw, 6rem);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.7rem;
}

.section-heading h2 {
  margin: 0;
  font: 400 clamp(2.4rem, 5vw, 4rem) / 1 var(--serif);
  letter-spacing: -0.04em;
}

.photographer-credit {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.photographer-credit a {
  color: var(--muted);
  font-weight: 600;
}

.photographer-credit a:hover {
  color: var(--primary-strong);
}

.photographer-credit span {
  margin-inline: 0.25rem;
}

.gallery-access {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
  max-width: 580px;
}

.gallery-access label {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 0.9rem;
}

.gallery-access input {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 0.4rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.gallery-access button,
.gallery-lock {
  min-height: 46px;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 4px;
  background: var(--primary-strong);
  color: var(--surface);
  font: inherit;
  cursor: pointer;
}

.gallery-access button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.gallery-access p {
  flex-basis: 100%;
  min-height: 1.6em;
  margin: 0;
  color: var(--primary-strong);
}

.gallery-lock {
  margin-bottom: 1.5rem;
}

.gallery-access[hidden],
.gallery-lock[hidden] {
  display: none;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-rows: 8px;
  gap: clamp(0.55rem, 1.2vw, 1rem);
}

.gallery img:not([src]) {
  visibility: hidden;
}

.gallery__item {
  position: relative;
  grid-row-end: span 1;
  margin: 0;
  overflow: visible;
  border-radius: 2px;
}

.gallery__item:hover,
.gallery__item:focus-within {
  z-index: 1;
}

.gallery__item img {
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  transform-origin: center;
  transition: transform 220ms ease;
}

.gallery__link {
  display: block;
  cursor: pointer;
}

.gallery__link:hover img,
.gallery__link:focus-visible img {
  transform: scale(1.035);
}

.photo-viewer {
  width: fit-content;
  max-width: 96vw;
  max-height: 95vh;
  margin: auto;
  padding: 3.5rem 1rem 1rem;
  overflow: auto;
  border: 0;
  background: var(--surface);
  color: var(--text);
}

.photo-viewer::backdrop {
  background: rgba(17, 21, 18, 0.88);
  backdrop-filter: blur(4px);
}

.photo-viewer__stage {
  position: relative;
  display: grid;
  place-items: center;
}

.photo-viewer__image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(95vh - 5rem);
  margin-inline: auto;
  object-fit: contain;
}

.photo-viewer__image:not([src]) {
  visibility: hidden;
}

.photo-viewer__close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  padding: 0.45rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.photo-viewer__status {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: calc(100% - 2rem);
  padding: 0.55rem 0.85rem;
  transform: translateX(-50%);
  border-radius: 6px;
  background: rgba(17, 21, 18, 0.85);
  color: white;
  font-size: 0.875rem;
  pointer-events: none;
}

.photo-viewer__status[hidden] {
  display: none;
}

.photo-viewer__status[data-loading="true"]::before {
  content: "";
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: photo-loading 0.9s linear infinite;
}

@keyframes photo-loading {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .photo-viewer__status[data-loading="true"]::before {
    animation: none;
  }
}

.photo-viewer__nav {
  position: absolute;
  top: 50%;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font: 600 1.4rem/1 "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer;
}

.photo-viewer__nav--previous {
  left: 0.65rem;
}

.photo-viewer__nav--next {
  right: 0.65rem;
}

.photo-viewer__nav:hover {
  background: var(--primary);
  color: white;
}

.photo-viewer__close:hover {
  background: var(--primary);
  color: white;
}

:root[data-layout="raster"] .gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

:root[data-layout="ruim"] .gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
}

.film-section {
  background: var(--surface-alt);
}

.section-heading--center {
  justify-content: center;
  text-align: center;
}

.film-placeholder {
  display: grid;
  min-height: 240px;
  aspect-ratio: 16 / 7;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--text) 94%, transparent), color-mix(in srgb, var(--text) 76%, var(--primary))),
    var(--text);
  color: var(--bg);
  text-align: center;
}

.film-placeholder__play {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--bg) 70%, transparent);
  border-radius: 50%;
}

.film-placeholder__play::after {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid var(--bg);
  content: "";
}

.film-placeholder p {
  margin: 0;
  font: italic clamp(1rem, 2.5vw, 1.35rem) var(--serif);
}

.footer {
  padding: 1.5rem 0;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.footer__inner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.footer__inner a:last-child {
  text-decoration: none;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

@media (max-width: 760px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }

  .hero__content {
    max-width: none;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 520px) {
  .container {
    width: min(100% - 2rem, var(--container));
  }

  .topbar {
    min-height: 64px;
  }

  .hero h1 {
    font-size: clamp(3.5rem, 16vw, 5.2rem);
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  :root[data-layout="ruim"] .gallery {
    grid-template-columns: 1fr;
  }

  .film-placeholder {
    min-height: 230px;
    aspect-ratio: 4 / 3;
  }

  .footer__inner {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .footer__inner p {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
