:root {
  --ivory: #f4efe6;
  --paper: #fbf7ed;
  --paper-warm: #eadfcf;
  --ink: #342820;
  --muted: #776a5c;
  --sage: #69765e;
  --sage-deep: #40523e;
  --clay: #a76652;
  --rose: #b58a7d;
  --walnut: #2f241e;
  --line: rgba(71, 62, 48, 0.18);
  --shadow: 0 18px 45px rgba(48, 36, 27, 0.16);
  --fast: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ivory);
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(167, 102, 82, 0.13), transparent 26rem),
    linear-gradient(135deg, #f4efe6 0%, #fffaf0 46%, #e9eee2 100%);
  color: var(--ink);
  font-family: "Nunito Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
}

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

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.hero {
  isolation: isolate;
  min-height: 62svh;
  overflow: hidden;
  padding: 7svh clamp(1.25rem, 5vw, 6rem) 3svh;
  position: relative;
}

.grain {
  background-image:
    linear-gradient(rgba(52, 40, 32, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 40, 32, 0.025) 1px, transparent 1px);
  background-size: 34px 34px, 34px 34px;
  inset: 0;
  mask-image: linear-gradient(to bottom, black 0%, black 72%, transparent 100%);
  opacity: 0.58;
  pointer-events: none;
  position: absolute;
  z-index: -2;
}

.hero::before {
  background:
    linear-gradient(120deg, rgba(64, 82, 62, 0.1), transparent 34%),
    linear-gradient(300deg, rgba(167, 102, 82, 0.11), transparent 38%),
    var(--paper);
  border: 1px solid rgba(54, 42, 31, 0.08);
  border-radius: 50%;
  box-shadow: inset 0 0 90px rgba(255, 255, 255, 0.54);
  content: "";
  height: min(76vw, 780px);
  left: 50%;
  opacity: 0.72;
  position: absolute;
  top: 44%;
  transform: translate(-50%, -50%);
  width: min(76vw, 780px);
  z-index: -3;
}

.branch {
  fill: none;
  opacity: 0.42;
  pointer-events: none;
  position: absolute;
  stroke: var(--sage-deep);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: clamp(7rem, 15vw, 13rem);
}

.branch-left {
  bottom: 5svh;
  left: max(-2.5rem, -2vw);
  transform: rotate(-7deg);
}

.branch-right {
  right: max(-2.5rem, -2vw);
  top: 6svh;
  transform: rotate(6deg);
}

.hero-inner {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 3vw, 2rem);
  justify-content: center;
  margin: 0 auto;
  max-width: 1180px;
  min-height: 44svh;
  text-align: center;
}

.date-mark {
  color: var(--sage-deep);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1rem, 2vw, 1.45rem);
  letter-spacing: 0.18em;
  margin: 0;
}

.title-script {
  filter: drop-shadow(0 16px 26px rgba(48, 36, 27, 0.12));
  max-width: min(100%, 1120px);
  overflow: visible;
}

.script-line {
  animation: write 2.6s cubic-bezier(0.73, 0.02, 0.18, 1) forwards, fillInk 900ms ease forwards;
  fill: transparent;
  font-family: "Marck Script", "Cormorant Garamond", cursive;
  paint-order: stroke fill;
  stroke: url("#ink");
  stroke-dasharray: 1240;
  stroke-dashoffset: 1240;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.script-line-one {
  animation-delay: 0.25s, 2s;
  font-size: clamp(4.4rem, 8.8vw, 7.4rem);
}

.script-line-two {
  animation-delay: 1.75s, 3.55s;
  font-size: clamp(5.7rem, 12vw, 9.4rem);
}

@keyframes write {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fillInk {
  to {
    fill: #342820;
  }
}

.gallery-section {
  background:
    linear-gradient(180deg, rgba(244, 239, 230, 0.15), rgba(251, 247, 237, 0.95) 10rem),
    var(--paper);
  padding: clamp(1rem, 2.1vw, 2.35rem) clamp(0.85rem, 2vw, 2.25rem) clamp(3rem, 6vw, 6rem);
  position: relative;
}

.gallery-section::before {
  background: linear-gradient(90deg, transparent, rgba(64, 82, 62, 0.28), rgba(167, 102, 82, 0.28), transparent);
  content: "";
  height: 1px;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: min(92vw, 1180px);
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin: 0 auto clamp(0.8rem, 1.8vw, 1.3rem);
  max-width: 1760px;
  padding: 0 clamp(0.25rem, 1.5vw, 1rem);
}

.section-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.section-kicker {
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
}

h2 {
  color: var(--walnut);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.25rem, 4.3vw, 4.8rem);
  font-weight: 500;
  line-height: 0.9;
  margin: 0;
}

.drive-link {
  align-items: center;
  border: 1px solid rgba(64, 82, 62, 0.35);
  border-radius: 999px;
  color: var(--sage-deep);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.86rem;
  font-weight: 700;
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0.72rem 1rem;
  text-decoration: none;
  transition: background var(--fast), border-color var(--fast), transform var(--fast);
}

.drive-link::after {
  content: "↗";
  font-size: 0.9em;
}

.drive-link:hover,
.drive-link:focus-visible {
  background: rgba(105, 118, 94, 0.08);
  border-color: rgba(64, 82, 62, 0.64);
  transform: translateY(-1px);
}

.gallery-shell {
  margin: 0 auto;
  max-width: 1840px;
}

.photo-wall {
  column-gap: clamp(0.65rem, 1.15vw, 1.35rem);
  columns: 5 245px;
  width: 100%;
}

.raw-reveal,
.raw-intro {
  break-inside: avoid;
  column-span: all;
}

.raw-reveal {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(105, 118, 94, 0.12), rgba(167, 102, 82, 0.13)),
    rgba(251, 247, 237, 0.82);
  border: 1px solid rgba(64, 82, 62, 0.24);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: clamp(1rem, 2vw, 2rem) 0 clamp(0.9rem, 2vw, 1.5rem);
  padding: clamp(1.1rem, 2vw, 1.65rem);
}

.raw-reveal p,
.raw-intro p {
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  margin: 0;
  text-transform: uppercase;
}

.raw-button {
  background: var(--sage-deep);
  border: 1px solid var(--sage-deep);
  border-radius: 999px;
  color: #fff8ed;
  cursor: pointer;
  font: 700 0.95rem/1 "Nunito Sans", sans-serif;
  min-height: 3rem;
  padding: 0.9rem 1.25rem;
  transition: background var(--fast), border-color var(--fast), transform var(--fast);
}

.raw-button:hover,
.raw-button:focus-visible {
  background: var(--walnut);
  border-color: var(--walnut);
  transform: translateY(-1px);
}

.raw-intro {
  border-top: 1px solid rgba(64, 82, 62, 0.28);
  margin: clamp(1.5rem, 4vw, 3rem) 0 clamp(1rem, 2.5vw, 1.8rem);
  padding-top: clamp(1.1rem, 2.5vw, 2rem);
}

.raw-intro h3 {
  color: var(--walnut);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 4vw, 4.6rem);
  font-weight: 500;
  line-height: 0.95;
  margin: 0.15rem 0 0;
}

.photo {
  background: #efe6d8;
  border: 1px solid rgba(52, 40, 32, 0.1);
  break-inside: avoid;
  box-shadow: var(--shadow);
  margin: 0 0 clamp(0.65rem, 1.15vw, 1.35rem);
  opacity: 0;
  overflow: hidden;
  position: relative;
  transform: translateY(36px) scale(0.985);
  transition:
    opacity 650ms ease,
    transform 800ms cubic-bezier(0.2, 0.84, 0.18, 1),
    box-shadow var(--fast);
}

.photo.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.photo button {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  width: 100%;
}

.photo-download {
  align-items: center;
  background: rgba(47, 36, 30, 0.48);
  border: 1px solid rgba(255, 248, 237, 0.38);
  border-radius: 999px;
  color: #fff8ed;
  display: inline-flex;
  height: 2.15rem;
  justify-content: center;
  opacity: 0.74;
  outline: 0;
  position: absolute;
  right: 0.55rem;
  text-decoration: none;
  top: 0.55rem;
  transition: opacity var(--fast), background var(--fast), transform var(--fast);
  width: 2.15rem;
  z-index: 4;
}

.photo-download svg,
.viewer-download svg {
  fill: none;
  height: 1.1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 1.1rem;
}

.photo-download:hover,
.photo-download:focus-visible {
  background: rgba(47, 36, 30, 0.72);
  box-shadow: 0 0 0 3px rgba(211, 169, 95, 0.42);
  opacity: 1;
  transform: translateY(-1px);
}

.photo img {
  background: linear-gradient(135deg, #e7dccd, #f8f2e8);
  min-height: 12rem;
  object-fit: cover;
  transition: filter var(--fast), transform 500ms ease;
  width: 100%;
}

.photo:hover {
  box-shadow: 0 20px 55px rgba(48, 36, 27, 0.22);
}

.photo:hover img {
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.012);
}

.photo figcaption {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.site-footer {
  align-items: center;
  background: var(--sage-deep);
  color: #fff8ed;
  display: flex;
  font-size: 0.9rem;
  justify-content: space-between;
  letter-spacing: 0.08em;
  padding: 1.2rem clamp(1rem, 4vw, 4rem);
}

.site-footer p {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.4rem;
  letter-spacing: 0;
  margin: 0;
}

.site-footer a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.viewer {
  align-items: center;
  background: rgba(26, 20, 16, 0.86);
  display: grid;
  inset: 0;
  justify-items: center;
  opacity: 0;
  padding: clamp(0.8rem, 3vw, 2rem);
  pointer-events: none;
  position: fixed;
  transition: opacity var(--fast);
  z-index: 20;
}

.viewer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.viewer-image {
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
  max-height: 90svh;
  object-fit: contain;
  opacity: 1;
  transition: opacity var(--fast);
  width: auto;
}

.viewer.is-loading .viewer-image {
  opacity: 0;
}

.viewer-loader {
  animation: spin 780ms linear infinite;
  border: 3px solid rgba(251, 247, 237, 0.28);
  border-top-color: #fff8ed;
  border-radius: 999px;
  height: 3rem;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity var(--fast);
  width: 3rem;
}

.viewer.is-loading .viewer-loader {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.viewer-close,
.viewer-nav,
.viewer-download {
  align-items: center;
  background: rgba(251, 247, 237, 0.92);
  border: 0;
  border-radius: 999px;
  color: var(--walnut);
  cursor: pointer;
  display: inline-flex;
  font-family: "Nunito Sans", sans-serif;
  justify-content: center;
  outline: 0;
  position: fixed;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--fast), box-shadow var(--fast), transform var(--fast);
}

.viewer-close {
  font-size: 2rem;
  height: 3rem;
  right: clamp(0.9rem, 2vw, 1.5rem);
  top: clamp(0.9rem, 2vw, 1.5rem);
  width: 3rem;
}

.viewer-download {
  height: 3rem;
  right: calc(clamp(0.9rem, 2vw, 1.5rem) + 3.45rem);
  text-decoration: none;
  top: clamp(0.9rem, 2vw, 1.5rem);
  width: 3rem;
}

.viewer-nav {
  font-size: 3.2rem;
  height: 3.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3.4rem;
}

.viewer-prev {
  left: clamp(0.8rem, 2vw, 1.4rem);
}

.viewer-next {
  right: clamp(0.8rem, 2vw, 1.4rem);
}

.viewer-close:hover,
.viewer-nav:hover,
.viewer-download:hover,
.viewer-close:focus-visible,
.viewer-nav:focus-visible,
.viewer-download:focus-visible {
  background: #fffaf1;
  box-shadow: 0 0 0 3px rgba(211, 169, 95, 0.42);
}

.viewer-nav:hover,
.viewer-nav:focus-visible {
  transform: translateY(-50%) scale(1.04);
}

.viewer-close:hover,
.viewer-close:focus-visible,
.viewer-download:hover,
.viewer-download:focus-visible {
  transform: scale(1.04);
}

@media (max-width: 920px) {
  .hero {
    min-height: 70svh;
    padding-top: 8svh;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-actions {
    justify-content: flex-start;
  }

  .photo-wall {
    columns: 3 210px;
  }
}

@media (max-width: 620px) {
  .hero {
    min-height: 64svh;
    padding-inline: 0.85rem;
  }

  .hero::before {
    height: 110vw;
    width: 110vw;
  }

  .date-mark {
    letter-spacing: 0.12em;
  }

  .title-script {
    margin-inline: -0.6rem;
    width: calc(100% + 1.2rem);
  }

  .script-line {
    stroke-width: 2.1;
  }

  .branch {
    opacity: 0.24;
    width: 8rem;
  }

  .gallery-section {
    padding-inline: 0.55rem;
  }

  .section-actions,
  .drive-link {
    width: 100%;
  }

  .drive-link {
    justify-content: center;
  }

  .photo-wall {
    columns: 1 100%;
  }

  .raw-reveal {
    align-items: flex-start;
    flex-direction: column;
  }

  .photo {
    box-shadow: 0 12px 28px rgba(48, 36, 27, 0.14);
  }

  .site-footer {
    gap: 1rem;
  }

  .viewer-nav {
    bottom: 1.2rem;
    top: auto;
    transform: none;
  }

  .viewer-prev {
    left: 1rem;
  }

  .viewer-next {
    right: 1rem;
  }

  .viewer-nav:hover,
  .viewer-nav:focus-visible {
    transform: scale(1.02);
  }

  .viewer-close {
    height: 2.7rem;
    width: 2.7rem;
  }

  .viewer-download {
    height: 2.7rem;
    right: calc(clamp(0.9rem, 2vw, 1.5rem) + 3.05rem);
    width: 2.7rem;
  }

  .photo-download {
    height: 2rem;
    opacity: 0.82;
    right: 0.45rem;
    top: 0.45rem;
    width: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .photo {
    opacity: 1;
    transform: none;
  }
}
