/* Wedding Invitation - Curtain Hero + Auto Animations */

:root {
  --burgundy: #722f37;
  --burgundy-dark: #5a252c;
  --envelope-color: #722f37;
  --envelope-color-dark: #5a252c;
  --envelope-color-darker: #4a1f25;
  --white: #ffffff;
  --cream: #faf9f7;
  --text: #2d2d2d;
  --text-light: #6b6b6b;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-script: 'Great Vibes', cursive;
  --font-body: 'Inter', system-ui, sans-serif;
  --max-width: 420px;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --ease-out-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-smooth: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out-soft: cubic-bezier(0.33, 1, 0.68, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
}

body.intro-active { overflow: hidden; height: 100vh; }

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
}

/* ---------- INTRO ENVELOPE (flap + pocket + letter, click to open) ---------- */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  cursor: pointer;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-screen.intro-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1s var(--ease-out-smooth), visibility 1s var(--ease-out-smooth);
}

/* Desk/table background */
.envelope-desk {
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, #d4c4b0 0%, #c4b5a0 40%, #b8a890 100%);
  box-shadow: inset 0 0 80px rgba(0,0,0,0.06);
}

/* Envelope wrapper - centers the envelope */
.intro-screen .envelope-wrapper {
  position: relative;
  width: min(92vw, 280px);
  height: 380px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 80px;
}

/* Envelope container */
.envelope {
  position: relative;
  width: 280px;
  max-width: 100%;
  height: 180px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  margin: 0 auto;
  background-color: var(--envelope-color-darker);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* Front elements - triangle shapes via borders */
.envelope-front {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 3;
}

/* Flap - top triangle, rotates up when open */
.envelope-front.flap {
  left: 0;
  top: 0;
  border-left: 140px solid transparent;
  border-right: 140px solid transparent;
  border-bottom: 82px solid transparent;
  border-top: 98px solid var(--envelope-color-darker);
  transform-origin: top center;
  backface-visibility: hidden;
  pointer-events: none;
}

/* Pocket - bottom/side triangles (envelope body) */
.envelope-front.pocket {
  left: 0;
  top: 0;
  border-left: 140px solid var(--envelope-color);
  border-right: 140px solid var(--envelope-color);
  border-bottom: 90px solid var(--envelope-color-dark);
  border-top: 90px solid transparent;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Seal + curved text on envelope front - visible when closed */
.envelope-seal-front {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + 30px));
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out-smooth);
}

.envelope.open .envelope-seal-front {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out-smooth);
}

/* Letter - invitation card inside envelope (burgundy, matches hero) */
.envelope-letter {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 5%;
  bottom: 5%;
  background: linear-gradient(180deg, var(--envelope-color) 0%, var(--envelope-color-dark) 50%, var(--envelope-color-darker) 100%);
  border-radius: 6px;
  box-shadow: 0 2px 26px rgba(0,0,0,0.2);
  z-index: 1;
  overflow: hidden;
}

.envelope-letter::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
}

.letter-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--white);
  text-align: center;
}

.letter-title {
  font-family: var(--font-script);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

/* Flap open: rotate only ~40deg (subtle open, same as Green) */
.envelope.open .envelope-front.flap {
  transform: rotateX(-40deg);
  transition: transform 1s var(--ease-out-smooth), z-index 0.6s;
  z-index: 1;
}

.envelope.close .envelope-front.flap {
  transform: rotateX(0deg);
  transition: transform 0.7s 0.3s var(--ease-out-smooth), z-index 1s;
  z-index: 5;
}

/* Letter: rises slightly when open to reveal invitation */
.envelope.close .envelope-letter {
  transform: translateY(0);
  transition: transform 0.6s var(--ease-out-smooth), z-index 1s;
  z-index: 1;
}

.envelope.open .envelope-letter {
  transform: translateY(-80px);
  transition: transform 0.8s 0.5s var(--ease-out-soft), z-index 0.6s;
  z-index: 2;
}

.wax-seal {
  display: inline-block;
  margin: 0 0 0.75rem;
  animation: seal-pulse 2.5s var(--ease-in-out-smooth) infinite;
}

.wax-seal:focus {
  outline: none;
}

@keyframes seal-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.seal-svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25)) drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.seal-svg .stamp-initials {
  font-family: var(--font-serif), Georgia, serif;
  letter-spacing: 0.08em;
}

/* Curved text below wax seal */
.curved-text-svg {
  width: 100%;
  max-width: 200px;
  height: auto;
  margin-top: 0.5rem;
}

.curved-text {
  font-family: var(--font-script);
  font-size: 1.15rem;
  fill: #2d2d2d;
  letter-spacing: 0.02em;
}

/* Seal on envelope front - lighter text for contrast on dark envelope */
.envelope-seal-front .curved-text {
  fill: #f5f0eb;
}

/* Main content - hidden until intro opened */
.main-content {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s var(--ease-out-smooth) 0.15s, transform 1s var(--ease-out-smooth) 0.15s;
}

.main-content.visible {
  opacity: 1;
  transform: translateY(0);
}

.main-content[aria-hidden="true"] { visibility: hidden; }
.main-content[aria-hidden="false"] { visibility: visible; }

/* ---------- HERO with curtain texture ---------- */
.hero {
  position: relative;
  min-height: 75vh;
  padding: 2.5rem 1.5rem 1.5rem;
  color: var(--white);
  overflow: hidden;
}

/* Curtain texture - vertical velvet folds, animates when hero ready */
.hero-curtain {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    #5a252c 0%,
    #722f37 8%,
    #6b2a32 16%,
    #722f37 24%,
    #5a252c 32%,
    #722f37 40%,
    #4a1f25 48%,
    #722f37 56%,
    #5a252c 64%,
    #722f37 72%,
    #6b2a32 80%,
    #722f37 88%,
    #5a252c 100%
  );
  background-size: 100% 100%;
  z-index: 0;
  opacity: 0;
}

.hero.hero-ready .hero-curtain {
  animation: heroCurtainIn 0.8s ease forwards;
}

.hero-curtain::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
}

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

/* Hero content - positioned above curtain */
.hero-top-text,
.hero-title,
.hero-decor,
.hero-datetime {
  position: relative;
  z-index: 1;
}

/* Top text - centered, uppercase serif */
.hero-top-text {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 1.5rem;
  padding-top: 0.5rem;
  opacity: 0;
}

.hero.hero-ready .hero-top-text {
  opacity: 1;
}

/* Letter-by-letter handwriting effect */
.hero-char {
  display: inline-block;
  opacity: 0;
  animation: heroCharIn 0.35s ease forwards;
  animation-fill-mode: both;
}

.hero-char-space {
  min-width: 0.35em;
}

@keyframes heroCharIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Big title - centered, script font */
.hero-title {
  font-family: var(--font-script);
  font-size: 3.2rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
  opacity: 0;
  white-space: nowrap;
  display: block;
  width: fit-content;
}

.hero.hero-ready .hero-title {
  opacity: 1;
}

/* Bride image - lower-left, bigger */
.hero-decor {
  position: absolute;
  left: -20px;
  bottom: 1rem;
  width: 200px;
  max-width: 50%;
  opacity: 0;
}

.hero.hero-ready .hero-decor {
  animation: heroSlideUp 0.9s ease forwards;
  animation-delay: 5s;
  animation-fill-mode: both;
}

.hero-decor-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: left bottom;
}


/* Time + date + venue - lower-right corner, serif */
.hero-datetime {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  text-align: right;
  opacity: 0;
}

.hero.hero-ready .hero-datetime {
  animation: heroFadeIn 0.7s ease forwards;
  animation-delay: 5.8s;
  animation-fill-mode: both;
}

.hero-datetime-item {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 0.15rem;
}

.hero-datetime-item:last-child {
  margin-bottom: 0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

/* Keyframe animations */
@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@keyframes heroSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- INVITATION TEXT (decorative quote) ---------- */
.invitation-text {
  background: var(--cream);
  padding: 2.5rem 1.5rem;
}

.invitation-quote {
  position: relative;
  max-width: 340px;
  margin: 0 auto;
  padding: 3rem 2rem 3.25rem;
  border-left: 3px solid var(--burgundy);
  border-right: 3px solid var(--burgundy);
  border-top: 1px solid rgba(114, 47, 55, 0.3);
  border-bottom: 1px solid rgba(114, 47, 55, 0.3);
  background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(250,249,247,0.9) 100%);
  box-shadow: inset 0 0 0 1px rgba(114, 47, 55, 0.08);
}

.quote-corner {
  position: absolute;
  width: auto;
  height: 140px;
  max-width: 55%;
  object-fit: contain;
  object-position: top left;
  pointer-events: none;
}

.quote-corner-tl {
  top: 0;
  left: 0;
}

.quote-corner-br {
  bottom: 0;
  right: 0;
  transform: rotate(180deg);
  object-position: bottom right;
}

.invitation-quote::before,
.invitation-quote::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--burgundy), transparent);
  opacity: 0.6;
}

.invitation-quote::before {
  top: 0.75rem;
}

.invitation-quote::after {
  bottom: 0.75rem;
}

.invitation-paragraph {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.9;
  text-align: center;
  color: #4a4040;
  margin: 0;
  font-style: italic;
  letter-spacing: 0.02em;
}

/* ---------- SECTIONS ---------- */
section { padding: 2rem 1.5rem; }

/* Scroll fade-in - sections animate when scrolling into view (modern wedding style) */
.scroll-fade {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out-smooth), transform 0.8s var(--ease-out-smooth);
}

.scroll-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero: when scroll-fade.visible, ensure smooth reveal (works with hero-ready) */
.hero.scroll-fade {
  transform: translateY(20px);
}

.hero.scroll-fade.visible {
  transform: translateY(0);
}

/* ---------- DATE + LOCATION ---------- */
.date-location {
  background: var(--white);
  text-align: center;
  padding-top: 2.5rem;
}

.date-location .ribbon-wrapper {
  margin-bottom: 1rem;
}

.date-location .ribbon-svg {
  width: 140px;
  height: auto;
  margin: 0 auto;
}

.date-title {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: var(--burgundy);
  margin-bottom: 0.5rem;
}

.location-name {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.location-city {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.75rem;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  transition: opacity 0.2s, transform 0.2s;
}

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

.btn-map {
  background: var(--burgundy);
  color: var(--white);
  border: 2px solid var(--burgundy);
}

.btn-map:hover { opacity: 0.9; }

/* ---------- PROGRAMI ---------- */
.programi {
  background: var(--cream);
  padding-top: 2.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 1.75rem;
  color: var(--burgundy);
}

.timeline {
  max-width: 280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding: 0 0 1rem;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.25rem 0;
  position: relative;
  z-index: 1;
}

.timeline-item:first-child { padding-top: 0; }

/* Timeline items - staggered fade from left on scroll */
.programi-fade {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.6s var(--ease-out-smooth), transform 0.6s var(--ease-out-smooth);
}

.programi-fade.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Line segments between items (broken line with gaps) */
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 1.25rem;
  background: var(--burgundy);
  opacity: 0.4;
  transform: translateX(-50%);
  z-index: 0;
}

.timeline-icon {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--burgundy);
}

.timeline-icon-svg {
  width: 100%;
  height: 100%;
}

/* VALLËZIMI: nusja1.svg - filled, theme color, bigger, centered */
.timeline-icon-nusja {
  width: 20rem;
  min-width: 5rem;
  min-height: 5rem;
  -webkit-mask: url(assets/nusja1.svg) center/contain no-repeat;
  mask: url(assets/nusja1.svg) center/contain no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  background: currentColor;
}

/* DARKA: darka.svg - dinner/plate icon, theme color */
.timeline-icon-darka {
  -webkit-mask: url(assets/darka.svg) center/contain no-repeat;
  mask: url(assets/darka.svg) center/contain no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  background: currentColor;
}

.timeline-time {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--burgundy);
}

.timeline-label {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--text);
  line-height: 1.3;
}

/* ---------- CALENDAR ---------- */
.calendar {
  background: var(--white);
  padding-top: 2.5rem;
}

.calendar-title {
  font-family: var(--font-script);
  font-size: 1.6rem;
}

.countdown-timer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--text);
}

.countdown-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.countdown-item strong {
  color: var(--burgundy);
  font-weight: 700;
  min-width: 1.8em;
  text-align: center;
}

.countdown-done {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--burgundy);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  max-width: 260px;
  margin: 0 auto 1.5rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--cream);
  border-radius: 8px;
  color: var(--text-light);
}

.calendar-day.weekend { font-weight: 600; }

.highlight-day {
  background: var(--burgundy);
  color: var(--white);
  font-weight: 700;
}

.calendar-ribbon {
  display: flex;
  justify-content: center;
}

.calendar-ribbon svg {
  width: 100px;
  height: auto;
  opacity: 0.7;
}

/* ---------- RSVP ---------- */
.rsvp {
  background: var(--cream);
  padding: 2.5rem 1.5rem 3rem;
}

.rsvp-intro {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  text-align: center;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.rsvp-card {
  background: linear-gradient(180deg, #722f37 0%, #5a252c 100%);
  color: var(--white);
  padding: 1.75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.rsvp-prompt {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.75rem;
}

.rsvp-signature {
  font-family: var(--font-script);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 1.25rem;
  opacity: 0.95;
}

.rsvp-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-whatsapp {
  background: #25d366;
  color: var(--white);
  border: none;
  text-align: center;
}

.btn-whatsapp:hover { opacity: 0.9; }

.btn-phone {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.8);
  text-align: center;
}

.btn-phone:hover { background: rgba(255,255,255,0.1); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--burgundy);
  color: var(--white);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.back-to-top:hover { transform: scale(1.05); }

/* Mobile: envelope FULL SCREEN - scale up to cover viewport */
@media (max-width: 768px) {
  .intro-screen {
    overflow: hidden;
  }

  .intro-screen .envelope-desk {
    display: none;
  }

  .intro-screen .envelope-wrapper {
    position: absolute;
    inset: 0;
    width: 280px;
    height: 380px;
    margin: auto;
    padding: 0;
    align-items: center;
    justify-content: center;
    /* Fixed scale - vw/vh invalid in scale(); 3x covers full screen on phones */
    transform: scale(3);
    transform-origin: center center;
  }

  .intro-screen .envelope {
    transform: none;
  }
}

@media (max-width: 430px) {
  .intro-screen .envelope-wrapper {
    transform: scale(2.8);
    transform-origin: center center;
  }
}

@media (max-width: 390px) {
  .intro-screen .envelope-wrapper {
    transform: scale(2.5);
    transform-origin: center center;
  }
}

@media (max-width: 320px) {
  .intro-screen .envelope-wrapper {
    transform: scale(2.2);
    transform-origin: center center;
  }
}

@media (max-width: 390px) {
  .hero-title { font-size: 2.6rem; }
  .date-title { font-size: 1.9rem; }
  .hero-top-text { font-size: 0.8rem; letter-spacing: 0.15em; }
}

@media (max-width: 360px) {
  .hero-title { font-size: 2.2rem; }
}

@media (min-width: 421px) {
  body { background: #e8e4e0; }
  .main-content { box-shadow: 0 0 30px rgba(0,0,0,0.15); }
}
