:root {
  --ivory: #fff8ee;
  --paper: #f7eadc;
  --rose: #c98685;
  --rose-deep: #9d5658;
  --terracotta: #b96245;
  --olive: #66755b;
  --aegean: #447f8e;
  --ink: #2d2923;
  --muted: #756b61;
  --gold: #c49a5d;
  --shadow: 0 24px 70px rgba(61, 45, 34, 0.18);
  color-scheme: light;
  font-family:
    "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  color: var(--ink);
  transition:
    background 240ms ease,
    color 240ms ease,
    box-shadow 240ms ease;
}

.site-header.is-scrolled {
  background: rgba(255, 248, 238, 0.92);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(61, 45, 34, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-family: Georgia, serif;
  font-size: 1.4rem;
  line-height: 1;
}

.brand i {
  color: var(--gold);
  font-size: 0.8em;
}

nav {
  display: flex;
  gap: clamp(12px, 3vw, 34px);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

nav a {
  text-decoration: none;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 112px 22px 72px;
  isolation: isolate;
}

.hero-bg,
.hero-shade,
#constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-bg {
  object-fit: cover;
  z-index: -4;
  opacity: 1;
  transform: scale(1.02);
}

.hero-shade {
  z-index: -2;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 248, 238, 0.34), rgba(255, 248, 238, 0.1) 46%, transparent 66%),
    linear-gradient(180deg, rgba(255, 248, 238, 0.08), rgba(255, 248, 238, 0.04) 48%, rgba(255, 248, 238, 0.32));
}

#constellation {
  z-index: -1;
  opacity: 0.48;
}

.hero-content {
  width: min(820px, 100%);
  text-align: center;
  color: var(--ink);
  text-shadow:
    0 1px 0 rgba(255, 248, 238, 0.82),
    0 10px 38px rgba(255, 248, 238, 0.72);
}

.hero-meta {
  position: relative;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-bottom: 24px;
  padding: 0 16px;
  border: 1px solid rgba(196, 154, 93, 0.26);
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.72);
  box-shadow: 0 14px 36px rgba(87, 59, 45, 0.09);
  backdrop-filter: blur(8px);
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.hero-meta {
  margin-bottom: 24px;
}

.paper-invite {
  position: relative;
  width: min(300px, 70vw);
  height: min(214px, 50vw);
  margin: 0 auto 30px;
  perspective: 900px;
  animation: invite-arrive 1050ms cubic-bezier(0.16, 0.84, 0.22, 1) both;
}

.paper-card,
.envelope-pocket,
.envelope-line {
  position: absolute;
}

.paper-card {
  left: 50%;
  z-index: 4;
  bottom: 22%;
  width: 70%;
  height: 76%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border-radius: 7px;
  border: 1px solid rgba(196, 154, 93, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.98), rgba(247, 234, 220, 0.98)),
    var(--ivory);
  box-shadow: 0 20px 44px rgba(87, 59, 45, 0.14);
  opacity: 0;
  transform: translate(-50%, 92px) rotate(-4deg) scale(0.92);
  animation:
    letter-emerge 2600ms 420ms cubic-bezier(0.16, 0.96, 0.2, 1) forwards,
    paper-float 5200ms 3150ms ease-in-out infinite;
}

.invite-small,
.invite-date {
  color: var(--rose-deep);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.invite-names {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: clamp(2.55rem, 12vw, 4.25rem);
  line-height: 0.86;
}

.envelope-pocket {
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 44%;
  border-radius: 8px;
  background:
    linear-gradient(148deg, rgba(223, 183, 173, 0.92), rgba(157, 86, 88, 0.9)),
    var(--rose);
  box-shadow: 0 24px 44px rgba(87, 59, 45, 0.15);
  transform-origin: center bottom;
  animation:
    envelope-settle 1200ms 260ms cubic-bezier(0.18, 0.85, 0.2, 1) both,
    envelope-breathe 2100ms 1220ms ease-in-out both;
}

.envelope-pocket::before {
  animation: pocket-left-open 1500ms 680ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.envelope-pocket::after {
  animation: pocket-right-open 1500ms 680ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.envelope-pocket::before,
.envelope-pocket::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 248, 238, 0.18);
}

.envelope-pocket::before {
  clip-path: polygon(0 0, 50% 58%, 0 100%);
}

.envelope-pocket::after {
  clip-path: polygon(100% 0, 50% 58%, 100% 100%);
}

.envelope-line {
  --ring-rotate: 8deg;
  z-index: 1;
  width: 84%;
  height: 84%;
  left: 8%;
  top: 6%;
  border: 1px solid rgba(196, 154, 93, 0.22);
  border-radius: 999px;
  transform: rotate(var(--ring-rotate)) scale(0.82);
  opacity: 0;
  animation: reveal-ring 1700ms 650ms ease forwards;
}

.line-right {
  --ring-rotate: -16deg;
  transform: rotate(var(--ring-rotate)) scale(0.68);
  border-color: rgba(68, 127, 142, 0.2);
  animation-delay: 820ms;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(3.25rem, 12vw, 8.5rem);
  line-height: 0.9;
}

h2 {
  font-size: clamp(2.3rem, 6vw, 5.4rem);
  line-height: 0.98;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.hero-copy {
  width: min(620px, 100%);
  margin: 24px auto 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 22px;
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

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

.button.primary {
  border-color: var(--rose-deep);
  background: var(--rose-deep);
  color: var(--ivory);
}

.button.ghost {
  border-color: rgba(157, 86, 88, 0.38);
  background: rgba(255, 248, 238, 0.55);
  color: var(--rose-deep);
  backdrop-filter: blur(14px);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 1px;
  height: 58px;
  background: rgba(45, 41, 35, 0.22);
}

.scroll-cue span {
  display: block;
  width: 7px;
  height: 7px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--rose-deep);
  animation: scroll-dot 1800ms ease-in-out infinite;
}

section:not(.hero) {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 11vw, 150px) clamp(20px, 6vw, 86px);
}

section:not(.hero) > * {
  position: relative;
  z-index: 1;
}

section:not(.hero)::before,
section:not(.hero)::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.intro-section::before {
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  border: 1px solid rgba(196, 154, 93, 0.14);
  border-radius: 50%;
}

.intro-section::before {
  right: -170px;
  top: -180px;
}

.day-section::after,
.rsvp-section::after {
  width: 58vw;
  max-width: 760px;
  height: 220px;
  border-top: 1px dashed rgba(68, 127, 142, 0.22);
  border-radius: 50%;
}

.day-section::after {
  right: -10vw;
  bottom: -92px;
  transform: rotate(-8deg);
}

.rsvp-section::after {
  right: -12vw;
  top: -104px;
  transform: rotate(-10deg);
}

.intro-section::after {
  right: 4vw;
  bottom: 28px;
  width: min(230px, 34vw);
  height: min(230px, 34vw);
  background: url("assets/rhodes-hero.png") center / cover no-repeat;
  border-radius: 50%;
  opacity: 0.1;
  filter: saturate(0.85);
}

.intro-section {
  background: var(--ivory);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.8fr);
  gap: clamp(34px, 7vw, 96px);
  align-items: start;
}

.function-visual {
  position: relative;
  min-height: clamp(220px, 30vw, 360px);
  margin-top: clamp(42px, 7vw, 86px);
  overflow: hidden;
  border: 1px solid rgba(45, 41, 35, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(circle at 24% 72%, rgba(68, 127, 142, 0.14), transparent 25%),
    radial-gradient(circle at 78% 25%, rgba(201, 134, 133, 0.16), transparent 27%),
    repeating-linear-gradient(90deg, rgba(45, 41, 35, 0.055) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(45, 41, 35, 0.045) 0 1px, transparent 1px 46px),
    rgba(255, 248, 238, 0.74);
  box-shadow: 0 28px 68px rgba(61, 45, 34, 0.12);
}

.function-visual svg {
  position: absolute;
  inset: 10% 5% 8%;
  width: 90%;
  height: 82%;
  overflow: visible;
}

.function-area {
  fill: url("#functionFill");
  opacity: 0;
  animation: function-fill 1800ms 1000ms ease forwards;
}

.function-ghost {
  fill: none;
  stroke: rgba(196, 154, 93, 0.28);
  stroke-width: 2;
  stroke-dasharray: 3 13;
}

.function-path {
  fill: none;
  stroke: var(--aegean);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  filter: drop-shadow(0 10px 22px rgba(68, 127, 142, 0.18));
  animation: function-draw 2700ms 360ms cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
}

.function-point {
  fill: var(--rose-deep);
  opacity: 0;
  transform-origin: center;
  animation: point-pop 700ms ease forwards;
}

.function-point.p1 {
  animation-delay: 620ms;
}

.function-point.p2 {
  animation-delay: 1180ms;
}

.function-point.p3 {
  animation-delay: 1760ms;
}

.function-point.p4 {
  animation-delay: 2360ms;
}

.function-pin {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--rose-deep);
  color: var(--ivory);
  font-family: Georgia, serif;
  font-size: 1.45rem;
  box-shadow: 0 18px 34px rgba(157, 86, 88, 0.22);
  animation: pin-drift 4200ms ease-in-out infinite;
}

.function-a {
  left: 15%;
  bottom: 25%;
}

.function-e {
  right: 10%;
  top: 18%;
  animation-delay: 800ms;
}

.body-copy,
.rsvp-copy p,
.timeline-item p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
}

.day-section {
  background:
    linear-gradient(90deg, rgba(68, 127, 142, 0.08), rgba(201, 134, 133, 0.14)),
    var(--paper);
}

.timeline {
  display: grid;
  gap: 18px;
  width: min(900px, 100%);
  margin-top: 44px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid rgba(45, 41, 35, 0.15);
}

.time {
  color: var(--terracotta);
  font-family: Georgia, serif;
  font-size: 1.7rem;
}

.rsvp-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(320px, 540px);
  gap: clamp(34px, 7vw, 90px);
  align-items: start;
  background:
    radial-gradient(circle at 84% 18%, rgba(196, 154, 93, 0.18), transparent 22%),
    linear-gradient(180deg, #fff8ee, #f5e4d5);
}

.rsvp-form {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(45, 41, 35, 0.12);
  border-radius: 8px;
  background: rgba(255, 248, 238, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

label,
legend {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(45, 41, 35, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0;
  padding: 14px 14px;
}

textarea {
  resize: vertical;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  margin-bottom: 4px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(45, 41, 35, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
}

.choice input {
  width: auto;
  margin: 0;
  accent-color: var(--rose-deep);
}

.form-button {
  width: 100%;
  border-radius: 6px;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--rose-deep);
  font-weight: 700;
  line-height: 1.5;
}

.data-note {
  border-left: 3px solid var(--gold);
  padding-left: 16px;
}

footer {
  padding: 34px 20px;
  background: var(--ink);
  color: var(--ivory);
  text-align: center;
}

footer p {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.05rem;
}

@keyframes invite-arrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes letter-emerge {
  0% {
    opacity: 0;
    transform: translate(-50%, 92px) rotate(-4deg) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, 58px) rotate(-3deg) scale(0.96);
  }
  52% {
    opacity: 1;
    transform: translate(-50%, -44px) rotate(2deg) scale(1.025);
  }
  74% {
    transform: translate(-50%, -18px) rotate(-0.9deg) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -28px) rotate(0deg) scale(1);
  }
}

@keyframes envelope-settle {
  0% {
    transform: translateY(18px) scaleX(0.94);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scaleX(1);
    opacity: 1;
  }
}

@keyframes envelope-breathe {
  0%,
  100% {
    transform: translateY(0) scaleX(1);
  }
  45% {
    transform: translateY(4px) scaleX(1.025);
  }
}

@keyframes pocket-left-open {
  0%,
  100% {
    opacity: 1;
    transform: translateX(0);
  }
  50% {
    opacity: 0.76;
    transform: translateX(-7px) skewY(-3deg);
  }
}

@keyframes pocket-right-open {
  0%,
  100% {
    opacity: 1;
    transform: translateX(0);
  }
  50% {
    opacity: 0.76;
    transform: translateX(7px) skewY(3deg);
  }
}

@keyframes paper-float {
  0%,
  100% {
    transform: translate(-50%, -28px) rotate(0deg) scale(1);
  }
  50% {
    transform: translate(-50%, -34px) rotate(0.45deg) scale(1);
  }
}

@keyframes reveal-ring {
  from {
    opacity: 0;
    transform: rotate(var(--ring-rotate)) scale(0.72);
  }
  to {
    opacity: 1;
    transform: rotate(var(--ring-rotate)) scale(1);
  }
}

@keyframes scroll-dot {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  50% {
    transform: translateY(48px);
    opacity: 1;
  }
}

@keyframes function-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes function-fill {
  to {
    opacity: 1;
  }
}

@keyframes point-pop {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  70% {
    opacity: 1;
    transform: scale(1.25);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pin-drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

  nav {
    max-width: 270px;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 0.68rem;
  }

  .split,
  .rsvp-section {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .function-visual {
    min-height: 260px;
  }

  .function-pin {
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
  }
}

@media (max-width: 520px) {
  .hero {
    min-height: 100svh;
    padding: 118px 18px 54px;
  }

  .brand {
    font-size: 1.15rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .paper-invite {
    width: min(220px, 60vw);
    height: min(145px, 38vw);
    margin-bottom: 16px;
  }

  h1 {
    font-size: clamp(2.9rem, 15vw, 4.2rem);
  }

  .hero-copy {
    font-size: 1rem;
    line-height: 1.65;
  }

  .function-visual {
    min-height: 220px;
  }

  .function-visual svg {
    inset: 14% 2% 8%;
    width: 96%;
  }

  .function-a {
    left: 8%;
    bottom: 20%;
  }

  .function-e {
    right: 6%;
    top: 14%;
  }
}

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