/* Blossom & Oud — cloned from webgencyinvitations.com/blossomoud */

/* NewFonts stack (same weights as original Tilda project) */
@font-face {
  font-family: "NewFonts";
  src: url("assets/fonts/GTSuperDisplay-Light.woff") format("woff");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NewFonts";
  src: url("assets/fonts/ImperialScript-Regular.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NewFonts";
  src: url("assets/fonts/ArticaPro.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NewFonts";
  src: url("assets/fonts/TheSilverEditorial.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NewFonts";
  src: url("assets/fonts/Ovo-Regular.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NewFonts";
  src: url("assets/fonts/Canela-Light.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NewFonts";
  src: url("assets/fonts/ReemKufi-Regular.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Webgency stack */
@font-face {
  font-family: "Webgency";
  src: url("assets/fonts/SourceSans3-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Webgency";
  src: url("assets/fonts/Rufina-Regular.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f9e6d4;
  --gold: #866739;
  --gold-deep: #876836;
  --olive: #747b54;
  --charcoal: #454545;
  --ink: #2a2a2a;
  --border: #ac9778;
  --swatch-olive: #60603b;
  --swatch-wine: #360c1a;
  --swatch-espresso: #40312c;
  --swatch-champagne: #efdfcd;
  --swatch-ring: #fffaf8;
  --font-script: "NewFonts", Arial, sans-serif;
  --font-serif: "NewFonts", "Ovo", Georgia, serif;
  --font-body: "Webgency", Arial, sans-serif;
  --font-ui: "NewFonts", Arial, sans-serif;
  --max: 720px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--charcoal);
  font-family: var(--font-body);
  line-height: 1.55;
  overflow-x: hidden;
}

/* Fixed ambient video behind all content after the hero */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.page-bg__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-bg__veil {
  position: absolute;
  inset: 0;
  background: rgba(249, 230, 212, 0.78);
}

.page {
  position: relative;
  z-index: 1;
}

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

button,
input {
  font: inherit;
}

/* —— Envelope overlay (Tilda artboard 320×850) —— */
.envelope {
  --env-w: 320;
  --env-h: 850;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.envelope.is-open {
  pointer-events: none;
}

.envelope__scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #f4ebe0;
  transition: opacity 1.4s linear 2.2s;
}

.envelope.is-opening .envelope__scrim {
  opacity: 0;
}

.envelope__stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.envelope__artboard {
  position: relative;
  width: calc(var(--env-w) * 1px);
  height: calc(var(--env-h) * 1px);
  flex-shrink: 0;
  transform: scale(var(--env-scale, 1));
  transform-origin: center center;
}

/* Separate stacking contexts: base flaps → top flap → seal */
.env-stack {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.env-stack--base {
  z-index: 1;
}

.env-stack--flap {
  z-index: 2;
}

.env-stack--front {
  z-index: 3;
}

.env-el {
  position: absolute;
  display: block;
  max-width: none;
  pointer-events: none;
  will-change: transform, opacity;
}

/*
  Black PNG backdrops → transparent via SVG filter (not mix-blend-mode),
  so z-index stacking works: top flap can cover bottom flap.
*/
.env-el--right,
.env-el--left,
.env-el--bottom,
.env-el--top,
.env-el--seal {
  filter: url(#envBlackToAlpha);
}

.env-el--right {
  left: -75px;
  top: 83px;
  width: 856px;
  height: 684px;
  object-fit: fill;
  z-index: 1;
  transform: rotate(90deg);
}

.env-el--left {
  left: -475px;
  top: 105px;
  width: 856px;
  height: 640px;
  object-fit: fill;
  z-index: 1;
  transform: rotate(-90deg);
}

.env-el--bottom {
  left: -247px;
  top: 221px;
  width: 815px;
  height: 787px;
  object-fit: fill;
  z-index: 2;
  transform: rotate(180deg);
}

.env-el--top {
  left: -244px;
  top: -99px;
  width: 807px;
  height: 569px;
  object-fit: fill;
  z-index: 1;
  filter: url(#envBlackToAlpha) drop-shadow(0 10px 16px rgba(90, 60, 30, 0.18));
}

.env-el--hint {
  left: 52px;
  top: 468px;
  width: 217px;
  margin: 0;
  z-index: 1;
  color: #866739;
  font-family: var(--font-script);
  font-size: 20px;
  line-height: 31px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.env-el--flower {
  left: 66px;
  top: 510px;
  width: 188px;
  height: 45px;
  object-fit: contain;
  z-index: 1;
}

.env-el--seal {
  left: 80px;
  top: 310px;
  width: 160px;
  height: 160px;
  object-fit: contain;
  z-index: 2;
  filter: url(#envBlackToAlpha) drop-shadow(0 6px 12px rgba(80, 50, 20, 0.22));
}

/* Opening animation — timings from Tilda sbs-opts */
.envelope.is-opening .env-el--hint,
.envelope.is-opening .env-el--flower {
  animation: envFadeOut 1500ms linear forwards;
}

.envelope.is-opening .env-el--seal {
  animation: envSealOut 1500ms linear 1000ms forwards;
}

.envelope.is-opening .env-el--top {
  animation: envTopOut 1500ms linear 2500ms forwards;
}

.envelope.is-opening .env-el--bottom {
  animation: envBottomOut 1500ms linear 2500ms forwards;
}

.envelope.is-opening .env-el--left {
  animation: envLeftOut 2500ms linear 2500ms forwards;
}

.envelope.is-opening .env-el--right {
  animation: envRightOut 2500ms linear 2500ms forwards;
}

.envelope.is-open {
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms ease, visibility 400ms ease;
}

@keyframes envFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes envSealOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.22);
  }
}

@keyframes envTopOut {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-430px);
  }
}

@keyframes envBottomOut {
  from {
    transform: translateY(0) rotate(180deg);
  }
  to {
    transform: translateY(606px) rotate(180deg);
  }
}

@keyframes envLeftOut {
  0% {
    transform: translateX(0) rotate(-90deg);
    opacity: 1;
  }
  80% {
    transform: translateX(-559px) rotate(-90deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-559px) rotate(-90deg);
    opacity: 0;
  }
}

@keyframes envRightOut {
  0% {
    transform: translateX(0) rotate(90deg);
    opacity: 1;
  }
  80% {
    transform: translateX(559px) rotate(90deg);
    opacity: 1;
  }
  100% {
    transform: translateX(559px) rotate(90deg);
    opacity: 0;
  }
}

/* —— Page shell —— */
.page {
  opacity: 1;
}

.page.is-revealed {
  opacity: 1;
}

body.is-locked {
  overflow: hidden;
}

/* dim page until envelope starts opening */
body:not(.is-unlocked) .page {
  filter: brightness(0.92);
}

body.is-unlocked .page {
  filter: none;
  transition: filter 0.8s ease;
}

.section {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.25rem;
  text-align: center;
  background: transparent;
}

.section--tight {
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
}

.divider {
  width: 139px;
  margin: 0.85rem auto 1.5rem;
}

.heading {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-script);
  font-weight: 300;
  font-size: clamp(2rem, 5.5vw, 2.55rem);
  letter-spacing: 0.02em;
}

.subheading {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-script);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 300;
}

/* —— Hero —— */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 3rem 1.25rem 2.5rem;
  background: transparent;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  visibility: hidden;
}

.hero__canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__content {
  position: relative;
  z-index: 2;
  animation: floatIn 1.1s ease both 0.2s;
  text-shadow: 0 2px 18px rgba(249, 230, 212, 0.45);
}

.hero__names {
  margin: 0;
  color: var(--gold);
  font-family: "NewFonts", Arial, sans-serif;
  font-weight: 300;
  font-size: clamp(3.2rem, 14vw, 3.7rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.hero__amp {
  display: block;
  margin: 0.15rem 0;
  font-size: 0.48em;
  font-weight: 300;
  line-height: 1.1;
}

.hero__meta {
  margin-top: 1.35rem;
  color: rgb(134, 103, 57);
  font-family: "NewFonts", Arial, sans-serif;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.35;
}

.hero__meta p {
  margin: 0.15rem 0;
}

.hero__ornament {
  width: min(220px, 55vw);
  margin: 1.75rem auto 0;
  opacity: 0.95;
}

/* —— Invitation card (Tilda artboard 2443433743, 320 base) —— */
.invite {
  padding-block: 0;
  background: transparent;
}

.invite__artboard {
  position: relative;
  width: 320px;
  height: 780px;
  margin: 0 auto;
  overflow: visible;
}

.invite__frame {
  position: absolute;
  top: 43px;
  left: -18px;
  width: 356px;
  height: 734px;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
  z-index: 1;
}

.invite__ornament {
  position: absolute;
  top: 159px;
  left: 54px;
  width: 209px;
  height: auto;
  z-index: 2;
  animation: fadeInUp 2s ease both;
}

.invite__leaf {
  position: absolute;
  top: 234px;
  left: 142px;
  width: 37px;
  height: auto;
  z-index: 2;
  transform-origin: center center;
  animation: leafPulse 8s ease-in-out infinite;
}

.invite__text {
  position: absolute;
  top: 285px;
  left: 38px;
  width: 245px;
  margin: 0;
  z-index: 3;
  color: #454545;
  font-family: "NewFonts", Arial, sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.3;
  text-align: center;
  animation: fadeInUp 2s ease both;
}

.invite__venue {
  position: absolute;
  top: 617px;
  left: 28px;
  width: 265px;
  margin: 0;
  z-index: 3;
  color: #876836;
  font-family: "NewFonts", Arial, sans-serif;
  font-size: 34px;
  font-weight: 300;
  line-height: 1.25;
  text-align: center;
  animation: fadeInUp 2s ease both 0.15s;
}

.invite__flowers {
  position: absolute;
  top: 662px;
  left: 53px;
  width: 217px;
  height: auto;
  z-index: 2;
  animation: fadeInUp 2s ease both 0.25s;
}

@media (min-width: 480px) {
  .invite__artboard {
    width: 356px;
  }

  .invite__frame {
    left: 0;
  }

  .invite__ornament {
    left: calc(50% - 104.5px);
  }

  .invite__leaf {
    left: calc(50% - 18.5px);
  }

  .invite__text {
    left: calc(50% - 122.5px);
  }

  .invite__venue {
    left: calc(50% - 132.5px);
  }

  .invite__flowers {
    left: calc(50% - 108.5px);
  }
}

/* —— Countdown (matches original #countdownContainer) —— */
.countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin: 1.5rem 20px 0;
}

.countdown__unit {
  text-align: center;
  min-width: 0;
}

.countdown__value {
  display: block;
  color: rgb(134, 103, 57);
  font-family: "NewFonts", "Ovo", serif;
  font-size: 45px;
  font-weight: 600;
  line-height: 1;
}

.countdown__label {
  display: block;
  margin-top: 8px;
  color: rgb(134, 103, 57);
  font-family: "NewFonts", "Ovo", serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0;
  text-transform: none;
}

.countdown__sep {
  color: rgb(134, 103, 57);
  font-family: "NewFonts", "Ovo", serif;
  font-size: 52px;
  line-height: 1;
  margin-top: -40px;
  padding-top: 0;
  align-self: center;
}

/* —— Timeline —— */
.timeline {
  position: relative;
  width: min(320px, 100%);
  margin: 1.5rem auto 0;
  padding: 0.5rem 0 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.5rem;
  bottom: 2.5rem;
  width: 1px;
  background: rgba(134, 103, 57, 0.35);
  transform: translateX(-50%);
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.timeline__title {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-script);
  font-weight: 600;
  font-size: 1.05rem;
  text-align: right;
  line-height: 1.25;
}

.timeline__time {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-script);
  font-weight: 600;
  font-size: 1.05rem;
  text-align: left;
}

.timeline__dot {
  width: 14px;
  height: 16px;
  object-fit: contain;
}

.timeline__flower {
  width: 55px;
  margin: 0.25rem auto 0;
}

/* —— Venue —— */
.venue__pin {
  width: 36px;
  margin: 0.5rem auto 1rem;
}

.venue__photo {
  width: min(420px, 100%);
  margin: 0 auto 1.25rem;
}

.venue__name {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-script);
  font-weight: 300;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
}

.venue__place {
  margin: 0.35rem 0 0;
  color: var(--charcoal);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.05rem;
}

/* —— Dress code —— */
.dress__intro {
  width: min(335px, 92%);
  margin: 0 auto 1.5rem;
  color: var(--charcoal);
  font-family: var(--font-script);
  font-weight: 100;
  font-size: 0.98rem;
}

.dress__art {
  width: min(236px, 70vw);
  margin: 0 auto 1.75rem;
}

.palette {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}

.palette__swatch {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 1px solid var(--swatch-ring);
  box-shadow: 0 0 0 1px rgba(134, 103, 57, 0.15);
}

.dress__rules {
  width: min(420px, 92%);
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.dress__rules h3 {
  margin: 0 0 0.35rem;
  color: var(--gold);
  font-family: var(--font-script);
  font-size: 1.35rem;
  font-weight: 300;
}

.dress__rules p {
  margin: 0;
  color: var(--charcoal);
  font-family: var(--font-script);
  font-weight: 100;
  font-size: 0.95rem;
}

/* —— RSVP —— */
.rsvp {
  width: min(343px, 100%);
  margin: 1.5rem auto 0;
  text-align: left;
}

.rsvp label,
.rsvp legend {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 100;
  font-size: 0.95rem;
}

.rsvp input[type="text"],
.rsvp input[type="number"] {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
}

.rsvp input:focus {
  outline: 2px solid rgba(116, 123, 84, 0.35);
  outline-offset: 1px;
}

.rsvp fieldset {
  margin: 0 0 1.15rem;
  padding: 0;
  border: none;
}

.rsvp__choice {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 100;
}

.rsvp__choice input {
  margin-top: 0.25rem;
  accent-color: #ac9778;
}

.rsvp__submit {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 5px;
  background: var(--olive);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 100;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}

.rsvp__submit:hover {
  background: #63694a;
}

.rsvp__submit:active {
  transform: scale(0.98);
}

.rsvp__thanks {
  display: none;
  margin-top: 1rem;
  color: var(--olive);
  text-align: center;
  font-family: var(--font-ui);
  font-weight: 100;
}

.rsvp.is-sent .rsvp__thanks {
  display: block;
}

.rsvp.is-sent form {
  display: none;
}

/* —— Note —— */
.note__text {
  width: min(320px, 92%);
  margin: 0 auto;
  color: #454545;
  font-family: "NewFonts", Arial, sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.3;
  text-align: center;
}

.note__fa {
  display: block;
  margin-top: 0.55rem;
  font-family: "NewFonts", "Reem Kufi", Tahoma, sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.7;
}

.note__text--red {
  color: #a33a3a;
}

/* —— Closing —— */
.closing__text {
  margin: 0 0 1.25rem;
  color: var(--gold);
  font-family: var(--font-script);
  font-weight: 300;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
}

.closing__ornament {
  width: min(255px, 70vw);
  margin: 0 auto 0.75rem;
}

.closing__flowers {
  width: 50px;
  margin: 0.5rem auto;
}

.closing__line {
  width: 165px;
  margin: 0.75rem auto 0;
}

/* —— Footer video —— */
/* —— Mute control —— */
.audio-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(134, 103, 57, 0.35);
  border-radius: 50%;
  background: rgba(249, 230, 212, 0.92);
  color: var(--gold);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(64, 49, 44, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.audio-toggle.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sealPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes leafPulse {
  0%,
  100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.16);
  }
  50% {
    transform: scale(1);
  }
  75% {
    transform: scale(1.08);
  }
}

@media (max-width: 520px) {
  .timeline__title,
  .timeline__time {
    font-size: 0.95rem;
  }
}
