:root {
  --sage: #5c6a4d;
  --sage-deep: #4a5640;
  --sage-dark: #3a4433;
  --cream: #f4efe4;
  --cream-2: #ebe3d4;
  --paper: #f8f4eb;
  --ink: #2c3028;
  --ink-soft: #5a574e;
  --wax: #8e2f2f;
  --gold: #c4b08a;
  --white: #fffcf7;
  --line: rgba(92, 106, 77, 0.22);
  --shadow: 0 18px 50px rgba(44, 48, 40, 0.12);
  --radius: 28px;
  --max: 720px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

body {
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--sage-dark);
  min-height: 100dvh;
}

.shell {
  width: min(100%, 430px);
  margin: 0 auto;
  background: var(--cream);
  min-height: 100dvh;
  position: relative;
  overflow: clip;
}

body.is-preload,
body.is-intro {
  overflow: hidden;
}

.page {
  width: 100%;
  background: var(--cream);
  min-height: 100dvh;
  position: relative;
}

body.is-preload .page,
body.is-intro .page {
  display: none;
}

/* ===== PRELOADER ===== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: var(--sage-dark);
  transition: opacity 0.55s ease;
}

.preloader-inner {
  text-align: center;
  padding: 24px;
  width: min(100%, 430px);
  min-height: 100dvh;
  display: grid;
  place-content: center;
  background: #f4efe4;
}

.preloader.is-done {
  opacity: 0;
  pointer-events: none;
}

.preloader-names {
  font-size: clamp(36px, 8vw, 52px);
  color: var(--sage-dark);
  margin-bottom: 28px;
}

.preloader-ring {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border: 1.5px solid rgba(92, 106, 77, 0.22);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.preloader-label {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.inner {
  width: min(100%, 640px);
  margin: 0 auto;
}

/* ===== COVER ===== */
.cover {
  position: relative;
  min-height: 100dvh;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #d8e4ee;
  cursor: pointer;
  border: 0;
  padding: 0;
  text-align: inherit;
  transition: opacity 0.85s ease;
  overflow: hidden;
}

.cover-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  pointer-events: none;
}

body.is-preload .cover {
  visibility: hidden;
}

.cover.is-open {
  opacity: 0;
  pointer-events: none;
}

.cover:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: -8px;
}

.cover-inner {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12vh 28px 34vh;
}

.cover-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(34px, 8.4vw, 44px);
  font-style: normal;
  font-synthesis: none;
  font-weight: 600;
  color: var(--sage-dark);
  text-align: center;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.fingerprint {
  margin-top: 10vh;
  width: 88px;
  height: 88px;
  color: var(--sage-deep);
  animation: pulse 2.6s ease-in-out infinite;
}

.cover-hint {
  margin-top: 18px;
  font-family: "Cormorant Garamond", serif;
  font-style: normal;
  font-synthesis: none;
  font-weight: 500;
  font-size: 22px;
  color: var(--sage);
  text-align: center;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.88; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  border-bottom-left-radius: 36px;
  border-bottom-right-radius: 36px;
}

.hero-video,
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.hero-video {
  z-index: 1;
  background: #d9c7a8;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero.has-video .hero-video {
  opacity: 1;
}

.hero.has-video .hero-photo {
  opacity: 0;
}

.hero-photo {
  z-index: 0;
  animation: kenburns 22s ease-in-out infinite alternate;
}

@keyframes kenburns {
  from { transform: scale(1) translateY(0); }
  to { transform: scale(1.08) translateY(-3%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(248, 244, 235, 0.22) 0%, transparent 26%, transparent 58%, rgba(244, 239, 228, 0.5) 100%);
}

.hero-copy {
  position: relative;
  z-index: 3;
  padding: 44px 20px 0;
  text-align: center;
  display: flex;
  justify-content: center;
}

.hero-glass {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: min(86%, 340px);
  padding: 18px 26px 16px;
  border-radius: 28px;
  background: linear-gradient(
    165deg,
    rgba(255, 252, 247, 0.52) 0%,
    rgba(255, 252, 247, 0.22) 45%,
    rgba(244, 239, 228, 0.28) 100%
  );
  backdrop-filter: blur(18px) saturate(1.45);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    0 10px 36px rgba(44, 48, 40, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14);
}

.hero-names {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(42px, 11vw, 56px);
  line-height: 0.95;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.hero-names small {
  display: block;
  font-size: 0.55em;
  font-weight: 500;
  margin: 4px 0;
}

.hero-date {
  margin-top: 10px;
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  color: var(--ink);
}

/* ===== MUSIC ===== */
.music-block {
  padding: 42px 0 28px;
  display: grid;
  place-items: center;
  background: var(--cream);
}

.music-btn {
  position: relative;
  width: 118px;
  height: 118px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--sage-deep);
}

.music-btn svg.ring-text {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.music-core {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid var(--sage);
  display: grid;
  place-items: center;
  margin: 32px auto 0;
  background: var(--white);
}

.music-core .pause {
  display: none;
}

.music-btn.is-on .play { display: none; }
.music-btn.is-on .pause { display: block; }

/* ===== LETTER ===== */
.letter {
  background: var(--sage);
  color: var(--white);
  padding: 56px 28px 64px;
  text-align: center;
}

.script {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-style: italic;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.letter h2 {
  font-size: clamp(34px, 8vw, 42px);
  margin-bottom: 22px;
}

.letter p,
.body-text {
  font-size: 15.5px;
  line-height: 1.7;
  font-weight: 400;
  max-width: 34ch;
  margin: 0 auto;
}

/* ===== CALENDAR / ENVELOPE ===== */
.date-section {
  background:
    linear-gradient(180deg, rgba(92, 106, 77, 0.88), rgba(58, 68, 51, 0.92)),
    url("../assets/cover-landscape.png") center / cover;
  padding: 48px 20px 56px;
  display: grid;
  place-items: center;
}

.envelope {
  width: min(100%, 320px);
  background: linear-gradient(180deg, #f7f1e4, #efe4d0);
  border-radius: 8px 8px 22px 22px;
  padding: 48px 18px 44px;
  position: relative;
  box-shadow: var(--shadow);
  margin-top: 28px;
}

.envelope::before {
  content: "";
  position: absolute;
  top: -34px;
  left: 0;
  right: 0;
  height: 70px;
  background: linear-gradient(180deg, #f3ead8, #eadcc4);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  filter: drop-shadow(0 -2px 0 rgba(255, 255, 255, 0.4));
}

.cal-title {
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 36px;
  color: var(--sage-dark);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px 2px;
  text-align: center;
  font-size: 12px;
  color: #8a7d6a;
  position: relative;
  z-index: 1;
}

.cal-grid .dow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 6px;
}

.cal-grid .day {
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}

.cal-grid .day.is-wedding {
  position: relative;
  color: var(--sage-dark);
  font-weight: 700;
}

.cal-grid .day.is-wedding::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 24px;
  border: 1.5px solid var(--wax);
  border-radius: 50% 50% 50% 50% / 42% 42% 58% 58%;
  transform: rotate(-12deg);
}

.wax {
  width: 78px;
  height: 78px;
  margin: 8px auto -52px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 10px rgba(80, 20, 20, 0.25));
}

/* ===== PLACE ===== */
.place {
  background: var(--sage);
  color: var(--white);
  text-align: center;
  padding: 72px 24px 56px;
}

.place h2 {
  font-size: clamp(36px, 9vw, 46px);
  margin-bottom: 16px;
}

.place .addr {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.95;
  margin-bottom: 12px;
}

.place-note {
  font-size: 13px;
  line-height: 1.55;
  max-width: 34ch;
  margin: 0 auto 28px;
  opacity: 0.88;
}

.map-btn {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 0;
  background: var(--cream);
  color: var(--ink);
  display: grid;
  place-items: center;
  margin: 0 auto;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

/* ===== VENUE PHOTOS ===== */
.gallery {
  background: var(--sage);
  padding: 0 18px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 18px;
}

.venue-hero {
  background: var(--cream);
  padding: 8px 18px 0;
}

.venue-hero img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 50% 50% 46% 46% / 38% 38% 62% 62%;
  box-shadow: var(--shadow);
}

/* ===== PROGRAM ===== */
.program {
  background:
    linear-gradient(180deg, rgba(248, 244, 235, 0.92), rgba(244, 239, 228, 0.94)),
    url("../assets/wishes-landscape.png") center / cover;
  padding: 56px 28px 64px;
}

.program h2 {
  text-align: center;
  font-size: clamp(36px, 9vw, 46px);
  color: var(--sage-dark);
  margin-bottom: 36px;
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--sage);
  opacity: 0.55;
}

.t-item {
  position: relative;
  margin-bottom: 28px;
}

.t-item::before {
  content: "♥";
  position: absolute;
  left: -27px;
  top: 4px;
  font-size: 12px;
  color: var(--sage);
}

.t-item h3 {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 28px;
  color: var(--sage-dark);
  font-weight: 600;
}

.t-item .time {
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--sage);
  margin: 2px 0 6px;
}

.t-item p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ===== COUNTDOWN ===== */
.countdown {
  background: var(--paper);
  margin: 0 18px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 16px 32px;
  text-align: center;
}

.countdown h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 22px;
  color: var(--sage-dark);
}

.ticks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.tick {
  display: grid;
  place-items: center;
  gap: 8px;
}

.tick b {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--sage-dark);
  background: var(--white);
}

.tick span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ===== DRESS CODE ===== */
.dress {
  background: var(--paper);
  padding: 56px 28px 48px;
  text-align: center;
}

.ornament {
  width: 180px;
  height: 18px;
  margin: 0 auto 18px;
  opacity: 0.55;
}

.dress h2 {
  font-size: clamp(36px, 9vw, 46px);
  color: var(--sage-dark);
  margin-bottom: 16px;
}

.dress p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 0 auto 28px;
}

.swatches {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 0 0 3px var(--paper);
}

/* ===== WISHES ===== */
.wishes,
.contacts {
  position: relative;
  padding: 48px 22px 64px;
  min-height: 420px;
  display: grid;
  place-items: center;
}

.wishes-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7);
}

.wish-card {
  position: relative;
  z-index: 1;
  background: rgba(248, 244, 235, 0.92);
  padding: 54px 24px 36px;
  text-align: center;
  width: min(100%, 340px);
  border-radius: 8px;
  box-shadow: var(--shadow);
  clip-path: polygon(
    2% 3%, 6% 0, 94% 1%, 99% 6%,
    100% 94%, 95% 100%, 6% 99%, 0 93%
  );
}

.wish-card .wax {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

.wish-card h2 {
  font-size: 42px;
  color: var(--sage-dark);
  margin-bottom: 14px;
}

.wish-card p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.contacts-actions {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.contacts-phone {
  color: var(--sage-dark);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.04em;
}

/* ===== FORM ===== */
.rsvp {
  background: var(--cream);
  padding: 56px 22px 40px;
}

.rsvp h2 {
  text-align: center;
  font-size: clamp(36px, 9vw, 46px);
  color: var(--sage-dark);
  margin-bottom: 10px;
}

.rsvp .intro {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--sage-dark);
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--sage);
}

.choices {
  display: grid;
  gap: 8px;
}

.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
}

.choice input {
  accent-color: var(--sage);
}

.submit {
  width: 100%;
  margin-top: 10px;
  border: 0;
  background: var(--sage);
  color: var(--white);
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
}

.submit:disabled {
  opacity: 0.6;
}

.form-note {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  min-height: 1.4em;
}

.form-note.ok { color: var(--sage-dark); }
.form-note.err { color: var(--wax); }

/* ===== FOOTER ===== */
.footer {
  background: var(--sage-dark);
  color: var(--cream);
  text-align: center;
  padding: 28px 16px 36px;
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
}

.sage-split {
  background: var(--sage);
}

.program-row {
  background:
    linear-gradient(180deg, rgba(248, 244, 235, 0.92), rgba(244, 239, 228, 0.94)),
    url("../assets/wishes-landscape.png") center / cover;
}

.program-row .program {
  background: transparent;
}

.hidden { display: none !important; }

@media (min-width: 880px) {
  html {
    background: #e6dcc8;
  }

  body {
    overflow-x: clip;
    padding: 28px 0;
    background:
      radial-gradient(ellipse 42% 78% at 50% 48%, rgba(255, 252, 247, 0.7) 0%, transparent 72%),
      linear-gradient(180deg, #e4d9c2 0%, #efe6d4 42%, #ddd3bb 100%);
  }

  body::before,
  body::after {
    content: "";
    position: fixed;
    width: 460px;
    height: 620px;
    background: url("../assets/eucalyptus.png") center / contain no-repeat;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: multiply;
    opacity: 0.58;
  }

  body::before {
    left: calc(50% - 215px - 390px);
    top: 2%;
    transform: rotate(-12deg);
  }

  body::after {
    right: calc(50% - 215px - 390px);
    bottom: 0;
    transform: scaleX(-1) rotate(-10deg);
    opacity: 0.5;
  }

  .shell {
    width: 430px;
    min-height: calc(100dvh - 56px);
    border-radius: 32px;
    box-shadow:
      0 0 0 10px #f6f0e4,
      0 0 0 11px rgba(92, 106, 77, 0.14),
      0 14px 34px rgba(44, 48, 40, 0.16);
    z-index: 1;
  }

  .preloader {
    background: transparent;
  }

  .preloader-inner {
    width: 430px;
    min-height: calc(100dvh - 56px);
    border-radius: 32px;
    box-shadow:
      0 0 0 10px #f6f0e4,
      0 0 0 11px rgba(92, 106, 77, 0.14),
      0 14px 34px rgba(44, 48, 40, 0.16);
  }

  .cover,
  .cover-inner {
    min-height: calc(100dvh - 56px);
  }

  .cover-inner {
    padding: 9vh 28px 24vh;
  }

  .cover-title {
    font-size: 40px;
  }

  .cover-hint {
    color: var(--sage-dark);
  }

  .hero {
    height: calc(100dvh - 56px);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .hero-names {
    font-size: 52px;
  }

  .hero-glass {
    min-width: 300px;
  }

  .footer {
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
  }
}
