:root {
  --cream: #f7f3ea;
  --cream-2: #f1ebde;
  --ink: #2f2c25;
  --ink-soft: #6b6656;
  --sage: #78846b;
  --sage-deep: #566149;
  --line: rgba(47, 44, 37, 0.18);

  --serif: "Cormorant Garamond", serif;
  --sans: "Jost", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.scroller {
  height: 100vh;
  height: 100svh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.scroller.no-snap {
  scroll-snap-type: none;
}

.section {
  height: 100vh;
  height: 100svh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6vh 6vw;
}

/* reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s cubic-bezier(.22,.61,.36,1), transform 1s cubic-bezier(.22,.61,.36,1);
}
.section.is-visible .reveal {
  opacity: 1;
  transform: translateY(0);
}
.section.is-visible .reveal:nth-child(1) { transition-delay: .05s; }
.section.is-visible .reveal:nth-child(2) { transition-delay: .18s; }
.section.is-visible .reveal:nth-child(3) { transition-delay: .3s; }
.section.is-visible .reveal:nth-child(4) { transition-delay: .42s; }

/* -------- dots nav -------- */
.dots {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dot {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--ink-soft);
  transition: background .4s ease, transform .4s ease, border-color .4s ease;
}
.dot.active::after {
  background: var(--sage-deep);
  transform: scale(1.3);
  border-color: var(--sage-deep);
}
@media (max-width: 640px) {
  .dots { display: none; }
}

/* -------- hero -------- */
.hero {
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  z-index: 0;
}
@property --mx {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 50%;
}
@property --my {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 50%;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(480px circle at var(--mx) var(--my),
      rgba(247, 243, 234, .18) 0%,
      rgba(247, 243, 234, .62) 55%,
      rgba(247, 243, 234, .72) 100%);
  transition: --mx .3s ease-out, --my .3s ease-out;
  z-index: 1;
}

/* touch devices have no cursor, so the reveal-spot above would sit frozen
   dead-center — right over the text. Swap in a static vignette instead,
   deliberately heaviest behind the text and lightest at the edges, plus a
   slow cinematic drift on the photo so the hero still feels alive. */
@media (pointer: coarse) {
  .hero-overlay {
    background: radial-gradient(120% 85% at 50% 42%,
        rgba(247, 243, 234, .8) 0%,
        rgba(247, 243, 234, .6) 55%,
        rgba(247, 243, 234, .38) 100%);
    transition: none;
  }
  .hero-bg {
    animation: hero-drift 17s ease-in-out infinite alternate;
  }
}
@keyframes hero-drift {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.1) translate(-1%, -2%); }
}
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}
.hero-kicker {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--sage-deep);
}
.hero-names {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(14px, 3vw, 28px);
  flex-wrap: wrap;
}
.hero-names .name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 5.4rem);
  line-height: 1;
  letter-spacing: .01em;
  color: var(--ink);
}
.hero-names .amp {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--sage-deep);
}
.hero-invite {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  line-height: 1.55;
  max-width: 440px;
  color: var(--ink);
}
.hero-date {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(.95rem, 1.6vw, 1.15rem);
  letter-spacing: .18em;
  color: var(--ink-soft);
}

.scroll-cue {
  position: absolute;
  bottom: max(5vh, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  padding: 12px;
  z-index: 3;
}
.scroll-cue span {
  display: block;
  width: 1px;
  height: 34px;
  background: var(--ink-soft);
  position: relative;
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  60% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* -------- invite -------- */
.invite-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vw, 80px);
  max-width: 900px;
  flex-wrap: wrap;
}
.photo-frame {
  width: min(70vw, 340px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  flex-shrink: 0;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(.92) contrast(1.02);
}
.invite-text {
  max-width: 360px;
  text-align: left;
}
.invite-text h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  margin-bottom: 16px;
}
.invite-text p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
@media (max-width: 640px) {
  .invite-grid { flex-direction: column; }
  .invite-text { text-align: center; }
}

/* -------- details -------- */
.details {
  flex-direction: column;
  gap: 44px;
}
.details-heading {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  color: var(--sage-deep);
}
.details-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 6vw, 90px);
  flex-wrap: wrap;
  max-width: 900px;
}
.detail-block {
  text-align: center;
  min-width: 220px;
}
.detail-block h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 10px;
}
.detail-sub {
  color: var(--ink-soft);
  font-size: .95rem;
  letter-spacing: .03em;
  margin-bottom: 18px;
}
.detail-time {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--sage-deep);
  margin-bottom: 14px;
}
.detail-link {
  display: inline-block;
  font-size: .82rem;
  letter-spacing: .06em;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding: 6px 2px;
  touch-action: manipulation;
  transition: color .3s ease, border-color .3s ease;
}
.detail-link:hover {
  color: var(--sage-deep);
  border-color: var(--sage-deep);
}
.divider {
  width: 1px;
  height: 100px;
  background: var(--line);
}
@media (max-width: 640px) {
  .details-grid { flex-direction: column; }
  .divider { width: 60px; height: 1px; }
}

/* -------- rsvp -------- */
.rsvp-panel {
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  min-height: min(400px, 58vh);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rsvp-step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  opacity: 0;
  transform: translateY(14px) scale(.98);
  pointer-events: none;
  transition: opacity .55s cubic-bezier(.22,.61,.36,1), transform .55s cubic-bezier(.22,.61,.36,1);
}
@media (max-width: 480px), (max-height: 700px) {
  .rsvp-step { gap: 18px; }
}
.rsvp-step.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  position: relative;
}

.rsvp-lead {
  font-size: .95rem;
  color: var(--ink-soft);
  margin-bottom: -8px;
}
.rsvp-question {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 500;
}
.rsvp-sub {
  color: var(--ink-soft);
  font-size: .95rem;
  max-width: 320px;
}

.rsvp-actions {
  display: flex;
  gap: 18px;
}
.rsvp-btn {
  font-family: var(--sans);
  font-size: .92rem;
  letter-spacing: .08em;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 14px 30px;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
  z-index: 0;
  transition: color .45s ease;
}
.rsvp-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sage-deep);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.22,.61,.36,1);
  z-index: -1;
}
.rsvp-btn:hover::before,
.rsvp-btn:focus-visible::before {
  transform: scaleX(1);
}
.rsvp-btn:hover,
.rsvp-btn:focus-visible {
  color: var(--cream);
  border-color: var(--sage-deep);
}

.rsvp-input {
  width: 100%;
  font-family: var(--serif);
  font-size: 1.2rem;
  text-align: center;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 4px 12px;
  color: var(--ink);
}
.rsvp-input:focus {
  outline: none;
  border-color: var(--sage-deep);
}
.rsvp-input::placeholder {
  color: var(--ink-soft);
  font-style: italic;
}

.guest-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
.guest-label {
  font-size: .82rem;
  letter-spacing: .1em;
  color: var(--ink-soft);
}
.stepper {
  display: flex;
  align-items: center;
  gap: 16px;
}
.stepper-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color .3s ease, color .3s ease;
}
.stepper-btn:hover {
  border-color: var(--sage-deep);
  color: var(--sage-deep);
}
.stepper-value {
  font-family: var(--serif);
  font-size: 1.3rem;
  min-width: 20px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rsvp-submit {
  font-family: var(--sans);
  font-size: .9rem;
  letter-spacing: .1em;
  background: var(--sage-deep);
  color: var(--cream);
  border: none;
  padding: 13px 34px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .35s ease, transform .2s ease;
}
.rsvp-submit:hover {
  background: var(--sage);
}
.rsvp-submit:disabled {
  opacity: .55;
  cursor: default;
}
.rsvp-back {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: .8rem;
  letter-spacing: .05em;
  cursor: pointer;
  touch-action: manipulation;
  padding: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rsvp-error {
  color: #a8433c;
  font-size: .82rem;
  min-height: 1em;
}

@media (max-width: 480px) {
  .rsvp-actions { gap: 12px; }
  .rsvp-btn { padding: 13px 24px; font-size: .85rem; }
}

/* short viewports: landscape phones, small older devices */
@media (max-height: 480px) {
  .section { padding: 4vh 6vw; }
  .hero-content { gap: 12px; }
  .hero-kicker { font-size: 1rem; }
  .hero-names .name { font-size: clamp(2rem, 7vw, 3.2rem); }
  .hero-invite { font-size: .9rem; }
  .rsvp-step { gap: 14px; }
  .rsvp-panel { min-height: min(320px, 70vh); }
}
