:root {
  --ink: #2d211a;
  --muted: #765f53;
  --cream: #fffaf2;
  --paper: #f8efe2;
  --sage: #8a8f5a;
  --terracotta: #c8653d;
  --cacao: #6b4a33;
  --fuchsia: #c2188b;
  --rose: var(--fuchsia);
  --clay: var(--terracotta);
  --orange: var(--terracotta);
  --brown: var(--cacao);
  --line: rgba(107, 74, 51, 0.18);
  --shadow: 0 24px 80px rgba(45, 33, 26, 0.18);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(194, 24, 139, 0.13), transparent 26rem),
    radial-gradient(circle at 85% 34%, rgba(138, 143, 90, 0.2), transparent 24rem),
    linear-gradient(180deg, #fff7ec 0%, #f5e4d2 42%, #fffaf2 100%);
  font-family: var(--sans);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(90, 56, 39, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 56, 39, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent, black 14%, black 86%, transparent);
  z-index: 3;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 260 260' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3.5rem);
  color: #fff8ed;
  background: linear-gradient(180deg, rgba(20, 12, 8, 0.66), rgba(20, 12, 8, 0));
}

.brand {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 700;
}

nav {
  display: flex;
  gap: clamp(0.7rem, 2vw, 1.5rem);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  width: min(100%, 1180px);
  max-width: 1180px;
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(360px, 0.42fr) minmax(0, 0.58fr);
  align-items: stretch;
  padding: 0;
  color: #fff8ef;
  background:
    radial-gradient(circle at 18% 18%, rgba(194, 24, 139, 0.12), transparent 16rem),
    linear-gradient(145deg, #160d09 0%, #2b190f 58%, #452817 100%);
}

.hero-photo,
.hero-overlay {
  position: relative;
  height: 100%;
}

.hero-photo {
  grid-column: 2;
  grid-row: 1;
  object-fit: cover;
  object-position: center 25%;
  transform: scale(1.04);
  animation: slowZoom 16s ease-out forwards;
}

.hero-overlay {
  display: none;
}

.hero-content {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  width: 100%;
  min-width: 0;
  max-width: 560px;
  padding: 8rem clamp(1.2rem, 5vw, 4rem) 4.5rem;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f3b17f;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(4.1rem, 7vw, 6.8rem);
  line-height: 0.86;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.95;
}

h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.hero-copy {
  max-width: 480px;
  margin: 1.4rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.7;
  color: rgba(255, 248, 239, 0.86);
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 2rem;
}

.hero .button {
  min-width: 0;
  min-height: 3rem;
  padding-inline: 0.75rem;
  font-size: 0.84rem;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.95rem 1.2rem;
  border: 1px solid rgba(255, 248, 239, 0.45);
  border-radius: 999px;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.primary {
  color: var(--ink);
  background: #fff8ef;
}

.ghost {
  color: #fff8ef;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.scroll-note {
  position: absolute;
  right: clamp(1rem, 4vw, 4rem);
  bottom: 2rem;
  z-index: 1;
  writing-mode: vertical-rl;
  color: rgba(255, 248, 239, 0.7);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invite-band,
.details,
.palette-section,
.gallery-section,
.rsvp-section {
  position: relative;
  padding: clamp(4.5rem, 9vw, 8rem) clamp(1.2rem, 5vw, 5rem);
}

.section-intro {
  max-width: 820px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.envelope {
  position: relative;
  display: block;
  width: min(78vw, 540px);
  height: min(52vw, 350px);
  margin: 0 auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1000px;
}

.envelope > span {
  position: absolute;
  display: block;
}

.envelope-shadow {
  inset: auto 8% -8% 8%;
  height: 18%;
  border-radius: 50%;
  background: rgba(90, 56, 39, 0.22);
  filter: blur(18px);
}

.envelope-body {
  inset: 22% 0 0;
  border-radius: 0 0 10px 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(160deg, #edd3b8, #b96d49);
  box-shadow: var(--shadow);
  z-index: 3;
}

.envelope-body::before,
.envelope-body::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 51%;
  height: 100%;
  background: linear-gradient(140deg, rgba(255, 250, 242, 0.4), rgba(183, 98, 61, 0.18));
}

.envelope-body::before {
  left: 0;
  clip-path: polygon(0 0, 100% 52%, 0 100%);
}

.envelope-body::after {
  right: 0;
  clip-path: polygon(100% 0, 0 52%, 100% 100%);
}

.envelope-flap {
  left: 0;
  right: 0;
  top: 22%;
  height: 45%;
  transform-origin: top center;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  background: linear-gradient(180deg, #f2d8bd, #c3734d);
  filter: drop-shadow(0 12px 16px rgba(90, 56, 39, 0.18));
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 4;
}

.envelope-letter {
  left: 9%;
  right: 9%;
  bottom: 9%;
  height: 60%;
  display: grid !important;
  place-items: center;
  align-content: center;
  gap: 0.34rem;
  padding: clamp(1rem, 3vw, 1.35rem);
  color: var(--ink);
  text-align: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 18%, rgba(138, 143, 90, 0.13), transparent 7rem),
    radial-gradient(circle at 88% 82%, rgba(194, 24, 139, 0.1), transparent 7rem),
    linear-gradient(120deg, rgba(255, 255, 255, 0.7), transparent 45%),
    #fffaf2;
  border: 1px solid rgba(107, 74, 51, 0.12);
  box-shadow: 0 18px 45px rgba(45, 33, 26, 0.16);
  opacity: 0;
  transform: translateY(48%) scale(0.96);
  transition:
    opacity 220ms ease,
    transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 90ms;
  z-index: 2;
  font-weight: 700;
}

.envelope-letter > span {
  position: static;
}

.letter-kicker,
.letter-date,
.letter-place,
.letter-note {
  color: var(--brown);
  line-height: 1.25;
}

.letter-kicker {
  color: var(--terracotta);
  font-size: clamp(0.58rem, 1.5vw, 0.72rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.script {
  position: static !important;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 5.2vw, 3.1rem);
  line-height: 0.92;
  color: var(--brown);
}

.letter-divider {
  width: min(46%, 190px);
  height: 1px;
  margin: 0.1rem auto 0.16rem;
  background: linear-gradient(90deg, transparent, var(--terracotta), transparent);
}

.letter-date {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: var(--cream);
  background: var(--cacao);
  font-size: clamp(0.72rem, 1.8vw, 0.92rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.letter-place {
  color: var(--brown);
  font-size: clamp(0.78rem, 1.8vw, 0.95rem);
  font-weight: 900;
}

.letter-note {
  color: var(--sage);
  font-size: clamp(0.58rem, 1.45vw, 0.72rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.letter-corner {
  position: absolute !important;
  width: clamp(2.2rem, 7vw, 3.2rem);
  aspect-ratio: 1;
  opacity: 0.72;
}

.letter-corner::before,
.letter-corner::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(138, 143, 90, 0.65);
}

.letter-corner::before {
  inset: 0.3rem 0.8rem 0.8rem 0.3rem;
  border-right: 0;
  border-bottom: 0;
  border-radius: 999px 0 0 0;
}

.letter-corner::after {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50% 50% 50% 0;
  background: rgba(194, 24, 139, 0.18);
}

.letter-corner.top-left {
  top: 0.62rem;
  left: 0.62rem;
}

.letter-corner.top-left::after {
  top: 0.1rem;
  right: 0.28rem;
}

.letter-corner.bottom-right {
  right: 0.62rem;
  bottom: 0.62rem;
  transform: rotate(180deg);
}

.letter-corner.bottom-right::after {
  top: 0.1rem;
  right: 0.28rem;
}

.envelope.is-open .envelope-flap {
  transform: rotateX(178deg);
}

.envelope.is-open .envelope-letter {
  opacity: 1;
  transform: translateY(-28%);
  z-index: 5;
}

.invite-text {
  max-width: 620px;
  margin: 2.2rem auto 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  line-height: 1.5;
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto;
}

.detail-grid article {
  min-height: 220px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.68);
  box-shadow: 0 14px 55px rgba(90, 56, 39, 0.08);
}

.detail-label {
  display: block;
  margin-bottom: 1rem;
  color: var(--clay);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-grid strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1;
}

.detail-grid p {
  color: var(--muted);
  line-height: 1.65;
}

.map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  margin-top: 0.45rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid rgba(107, 74, 51, 0.2);
  border-radius: 999px;
  color: var(--brown);
  background: rgba(255, 250, 242, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.map-link:hover {
  transform: translateY(-2px);
  border-color: rgba(194, 24, 139, 0.34);
  background: rgba(255, 250, 242, 0.94);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  max-width: 960px;
  margin: 2.5rem auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.countdown div {
  min-height: 128px;
  display: grid;
  place-items: center;
  align-content: center;
  background: rgba(255, 250, 242, 0.8);
}

.countdown strong {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 4.5rem);
}

.countdown span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.timeline {
  max-width: 900px;
  margin: 3.5rem auto 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 2rem;
  padding: 0 0 2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 8rem;
  top: 0.25rem;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: calc(8rem - 0.42rem);
  top: 0.25rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 8px rgba(223, 139, 82, 0.14);
}

.timeline time {
  color: var(--clay);
  font-weight: 900;
}

.timeline p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.timeline .map-link {
  margin-top: 0.8rem;
}

.palette-section {
  background:
    radial-gradient(circle at 12% 18%, rgba(138, 143, 90, 0.18), transparent 22rem),
    radial-gradient(circle at 88% 22%, rgba(194, 24, 139, 0.1), transparent 22rem),
    linear-gradient(90deg, rgba(107, 74, 51, 0.06), transparent 50%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.8), rgba(245, 228, 210, 0.75));
}

.palette-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
}

.palette-copy {
  font-family: var(--serif);
  color: var(--brown);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.5;
}

.palette-copy p {
  margin: 0;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.swatches article {
  display: grid;
  grid-template-columns: 5.4rem 1fr;
  grid-template-rows: 1fr auto;
  gap: 0.2rem 1rem;
  align-items: center;
  min-height: 132px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.72);
  box-shadow: 0 14px 45px rgba(90, 56, 39, 0.08);
}

.swatches span {
  grid-row: span 2;
  width: 5.4rem;
  aspect-ratio: 1;
  border: 1px solid rgba(45, 33, 26, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.48), transparent 28%),
    var(--swatch);
  box-shadow: inset 0 -10px 20px rgba(45, 33, 26, 0.08);
}

.swatches strong {
  align-self: end;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.swatches small {
  align-self: start;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 260px;
  gap: 0.9rem;
  max-width: 1180px;
  margin: 0 auto;
}

figure {
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 55px rgba(90, 56, 39, 0.14);
}

figure img {
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

figure:hover img {
  transform: scale(1.04);
}

.featured {
  grid-column: span 2;
  grid-row: span 2;
}

.wide {
  grid-column: span 2;
}

.rsvp-section {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 1.18fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  background:
    linear-gradient(115deg, rgba(90, 56, 39, 0.08), transparent 45%),
    #fff8ef;
}

.rsvp-copy {
  max-width: 560px;
}

.rsvp-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.75;
}

.form-shell {
  min-height: 650px;
  padding: clamp(0.8rem, 2vw, 1.2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.74);
  box-shadow: var(--shadow);
}

.form-shell iframe {
  width: 100%;
  height: 650px;
  border: 0;
  border-radius: 6px;
}

.tally-placeholder {
  min-height: 620px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  border: 1px dashed rgba(90, 56, 39, 0.28);
  border-radius: 6px;
  background: linear-gradient(140deg, rgba(215, 154, 146, 0.18), rgba(255, 250, 242, 0.86));
}

.placeholder-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
}

code {
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: rgba(90, 56, 39, 0.1);
}

footer {
  padding: 2rem 1rem;
  color: #fff8ef;
  text-align: center;
  background: var(--brown);
}

footer p {
  margin: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

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

@keyframes slowZoom {
  from {
    transform: scale(1.04);
  }

  to {
    transform: scale(1);
  }
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
  }

  nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 100svh;
    padding-bottom: 4rem;
  }

  .hero-photo {
    position: absolute;
    inset: 0;
    grid-column: 1;
    object-position: center top;
  }

  .hero-overlay {
    position: absolute;
    inset: 0;
    display: block;
    background:
      linear-gradient(90deg, rgba(24, 14, 9, 0.76) 0%, rgba(24, 14, 9, 0.34) 52%, rgba(24, 14, 9, 0.12) 100%),
      linear-gradient(0deg, rgba(12, 7, 5, 0.72) 0%, rgba(12, 7, 5, 0.03) 62%);
  }

  .hero-content {
    grid-column: 1;
    align-self: end;
  }

  .detail-grid,
  .palette-layout,
  .rsvp-section {
    grid-template-columns: 1fr;
  }

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

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 220px;
  }

  .featured,
  .wide {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .hero {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding: 0;
    background: #160d09;
  }

  .hero-photo {
    position: relative;
    inset: auto;
    height: 68svh;
    min-height: 500px;
    object-position: center top;
    transform: none;
    animation: none;
  }

  .hero-overlay {
    display: none;
  }

  h1 {
    font-size: clamp(3.5rem, 17vw, 4.7rem);
  }

  .hero-copy {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.55;
  }

  .hero-content {
    width: 100%;
    max-width: none;
    padding: 1.5rem 1.2rem 2rem;
    background:
      radial-gradient(circle at 92% 20%, rgba(194, 24, 139, 0.12), transparent 12rem),
      linear-gradient(180deg, #160d09 0%, #2a1810 100%);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .scroll-note {
    display: none;
  }

  .envelope {
    width: 92vw;
    height: 64vw;
  }

  .timeline-item {
    grid-template-columns: 4.5rem 1fr;
    gap: 1.2rem;
  }

  .timeline-item::before {
    left: 4.5rem;
  }

  .timeline-item::after {
    left: calc(4.5rem - 0.42rem);
  }

  .gallery {
    grid-auto-rows: 190px;
  }

  .swatches {
    grid-template-columns: 1fr;
  }

  .swatches article {
    min-height: 112px;
  }

  .form-shell,
  .form-shell iframe,
  .tally-placeholder {
    min-height: 560px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
