/* ============================================================
   NIKOLINA & KREŠIMIR — Wedding invitation (elegant edition)
   Koverta → otvaranje → elegantna pozivnica
   ============================================================ */

:root {
  --burgundy:        #6b1a1a;
  --burgundy-soft:   #8a2828;
  --burgundy-deep:   #4d0f0f;
  --cream:           #fbf9f4;
  --cream-warm:      #f5ecd9;
  --paper:           #fffdf7;
  --ink:             #2a2018;
  --ink-soft:        #5a4a3a;
  --gold:            #b89968;
  --gold-light:      #d8bf8a;

  --serif:  'Cormorant Garamond', 'Times New Roman', serif;
  --script: 'Dancing Script', cursive;
  --italian:'Italianno', cursive;

  --shadow-soft: 0 10px 40px rgba(80, 30, 20, 0.12);
  --shadow-deep: 0 20px 60px rgba(80, 30, 20, 0.20);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.locked {
  overflow: hidden;
  height: 100vh;
}

/* ============================================
   POZADINSKI SLOJEVI (parallax, suptilni)
   ============================================ */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-gradient {
  background:
    radial-gradient(ellipse at top left,    rgba(184,153,104,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right,rgba(107,26,26,0.06)   0%, transparent 60%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 100%);
}

.bg-petals { overflow: hidden; }
.bg-petals .petal {
  position: absolute;
  color: rgba(107, 26, 26, 0.15);
  font-size: 18px;
  animation: petal-fall 22s linear infinite;
  user-select: none;
}
.bg-petals .petal:nth-child(1) { left:  5%; animation-delay:  0s; font-size: 14px; }
.bg-petals .petal:nth-child(2) { left: 18%; animation-delay:  4s; font-size: 22px; }
.bg-petals .petal:nth-child(3) { left: 32%; animation-delay:  9s; font-size: 16px; }
.bg-petals .petal:nth-child(4) { left: 48%; animation-delay:  2s; font-size: 20px; }
.bg-petals .petal:nth-child(5) { left: 62%; animation-delay: 13s; font-size: 18px; }
.bg-petals .petal:nth-child(6) { left: 76%; animation-delay:  6s; font-size: 14px; }
.bg-petals .petal:nth-child(7) { left: 88%; animation-delay: 16s; font-size: 24px; }
.bg-petals .petal:nth-child(8) { left: 95%; animation-delay: 11s; font-size: 16px; }

@keyframes petal-fall {
  0%   { top: -10%;  opacity: 0; transform: translateX(0)   rotate(0deg); }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.6; }
  100% { top: 110%; opacity: 0; transform: translateX(40px) rotate(360deg); }
}

/* ============================================
   KOVERTA — HERO SEKCIJA
   ============================================ */
.envelope-section {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.envelope-section.opened {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.envelope-wrap {
  text-align: center;
  perspective: 1400px;
}

.envelope {
  position: relative;
  width: min(440px, 90vw);
  height: min(280px, 57vw);
  margin: 0 auto;
  cursor: pointer;
  outline: none;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.18));
}
.envelope:hover { transform: translateY(-4px); }
.envelope:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; }

.envelope.opening { animation: env-shake 0.4s ease 0.1s 1; }
@keyframes env-shake {
  0%, 100% { transform: rotate(0deg); }
  20%  { transform: rotate(-1.2deg); }
  60%  { transform: rotate(1.2deg); }
  80%  { transform: rotate(-0.6deg); }
}

/* Stražnji dio koverte (uvijek vidljiv, drži pismo) */
.env-back {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--cream-warm) 0%, #ead9b8 100%);
  border: 1px solid var(--gold-light);
  border-radius: 4px;
  box-shadow: inset 0 0 60px rgba(184,153,104,0.15);
}

/* Pismo unutar koverte (na početku skriveno iza prednjeg dijela) */
.env-letter {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 12%;
  bottom: 12%;
  background: var(--paper);
  border: 1px solid var(--gold-light);
  border-radius: 2px;
  padding: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 1.2s cubic-bezier(0.34, 1.0, 0.64, 1.0) 0.5s,
              opacity 0.4s ease 0.5s;
  z-index: 2;
}
.letter-monogram {
  font-family: var(--italian);
  font-size: clamp(40px, 8vw, 60px);
  color: var(--burgundy);
  line-height: 1;
}
.letter-monogram .amp {
  color: var(--gold);
  margin: 0 6px;
}
.letter-divider {
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 12px 0;
}
.letter-text {
  font-family: var(--serif);
  font-size: clamp(14px, 2.5vw, 18px);
  letter-spacing: 4px;
  color: var(--ink-soft);
}

/* Prednji body koverte */
.env-front {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, var(--cream) 0%, var(--cream-warm) 100%);
  border: 1px solid var(--gold-light);
  border-radius: 4px;
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 100% 100%, 0 100%);
  z-index: 3;
  transition: opacity 0.4s ease 0.6s;
}
.env-front-inner {
  position: absolute;
  bottom: 10%;
  left: 0;
  right: 0;
  text-align: center;
}
.env-recipient {
  font-family: var(--italian);
  font-size: clamp(22px, 4vw, 30px);
  color: var(--burgundy);
  margin: 0 0 4px;
}
.env-from {
  font-family: var(--serif);
  font-size: clamp(11px, 2vw, 13px);
  letter-spacing: 2px;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
}

/* Gornji preklop koverte — otvara se pri kliku */
.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background:
    linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 100%);
  border: 1px solid var(--gold-light);
  border-radius: 4px 4px 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  z-index: 5;
  transform-origin: top center;
  transition: transform 0.9s cubic-bezier(0.55, 0.05, 0.45, 0.95);
  box-shadow: inset 0 0 40px rgba(184,153,104,0.15);
}

/* Wax seal */
.env-seal {
  position: absolute;
  top: 30%;
  left: 50%;
  width: clamp(56px, 12vw, 78px);
  height: clamp(56px, 12vw, 78px);
  margin-left: calc(clamp(56px, 12vw, 78px) / -2);
  background:
    radial-gradient(circle at 35% 30%, var(--burgundy-soft) 0%, var(--burgundy) 50%, var(--burgundy-deep) 100%);
  border-radius: 50%;
  box-shadow:
    inset 0 4px 12px rgba(255,255,255,0.18),
    inset 0 -4px 12px rgba(0,0,0,0.35),
    0 4px 10px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  transform-origin: center;
  transition: transform 0.5s ease, opacity 0.5s ease;
}
.seal-text {
  font-family: var(--italian);
  color: var(--gold-light);
  font-size: clamp(22px, 5vw, 32px);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
  line-height: 1;
}
.seal-amp {
  font-size: 0.7em;
  margin: 0 2px;
}

/* OTVARANJE — kaskadne animacije */
.envelope.opened .env-seal {
  transform: scale(0.4) rotate(35deg) translate(40px, -20px);
  opacity: 0;
}
.envelope.opened .env-flap {
  transform: rotateX(-180deg);
}
.envelope.opened .env-letter {
  transform: translateY(-65%) scale(1.05);
  z-index: 10;
}
.envelope.opened .env-front {
  opacity: 0.85;
}

/* Hint ispod koverte */
.envelope-hint {
  margin-top: 36px;
  font-family: var(--script);
  font-size: clamp(18px, 3vw, 24px);
  color: var(--burgundy);
  letter-spacing: 0.5px;
  animation: hint-pulse 2.4s ease-in-out infinite;
}
.envelope-hint .hint-icon {
  color: var(--gold);
  margin: 0 10px;
  font-size: 0.8em;
}
@keyframes hint-pulse {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50%      { opacity: 1;    transform: translateY(-3px); }
}
.envelope-section.opened .envelope-hint { opacity: 0; }

/* ============================================
   POZIVNICA (otkriva se nakon otvaranja)
   ============================================ */
.invitation {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s ease 0.4s, transform 1.2s ease 0.4s;
  pointer-events: none;
  padding: 60px 20px 0;
}
.invitation.revealed {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============================================
   GLAVNA KARTICA POZIVNICE (kao original)
   ============================================ */
.invite-card {
  max-width: 600px;
  margin: 0 auto 80px;
}

.invite-frame {
  position: relative;
  background: var(--paper);
  padding: 60px 40px 50px 80px;
  border-radius: 6px;
  box-shadow: var(--shadow-deep);
  border-left: 1px solid var(--burgundy);
}
.invite-frame::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(184,153,104,0.4);
  pointer-events: none;
  border-radius: 2px;
}

/* vertikalni datum */
.date-vertical {
  position: absolute;
  left: 36px;
  top: 50px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--burgundy);
  padding-right: 20px;
}
.date-vertical::before {
  content: '';
  position: absolute;
  top: -24px;
  right: -1px;
  height: 24px;
  width: 1px;
  background: var(--burgundy);
}
.date-num {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.date-tagline {
  margin-top: 18px;
  font-size: 9px;
  letter-spacing: 1.8px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--ink);
  font-weight: 600;
}

/* imena */
.names {
  margin: 0 0 24px 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: 0.5px;
}
.name-line {
  display: block;
  font-size: clamp(40px, 9vw, 64px);
  color: var(--ink);
}
.name-amp {
  display: inline-block;
  font-style: italic;
  font-family: var(--italian);
  font-size: clamp(44px, 9vw, 70px);
  color: var(--gold);
  padding-right: 14px;
  vertical-align: -8px;
}
.name-line.accent {
  color: var(--burgundy);
  display: inline-block;
}

.script-line {
  font-family: var(--script);
  font-size: clamp(22px, 4vw, 30px);
  color: var(--ink);
  margin: 22px 0;
}
.script-line.center { text-align: center; margin-top: 28px; }

.date-spelled {
  font-family: var(--serif);
  font-size: clamp(22px, 4vw, 32px);
  letter-spacing: 4px;
  color: var(--ink);
  margin: 22px 0 38px;
  font-weight: 500;
}

.schedule {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 38px;
}
.schedule-item strong {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 4px;
  color: var(--burgundy);
}
.schedule-item span {
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--ink);
  line-height: 1.5;
}

.ornament {
  text-align: center;
  color: var(--gold);
  letter-spacing: 8px;
  margin: 24px 0;
  font-size: 16px;
}

.rsvp {
  font-size: 14px;
  letter-spacing: 0.6px;
  line-height: 1.9;
  margin: 0 0 32px;
  text-align: center;
  color: var(--ink);
}
.rsvp strong { color: var(--burgundy); }
.rsvp-line { display: inline-block; }
.rsvp a {
  color: var(--burgundy);
  text-decoration: none;
  border-bottom: 1px dotted var(--burgundy);
}
.rsvp a:hover { color: var(--burgundy-soft); }

/* COUNTDOWN */
.countdown {
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  text-align: center;
}
.countdown-cell {
  background: var(--burgundy);
  color: var(--cream);
  border-radius: 4px;
  padding: 16px 4px;
  border: 1px solid var(--gold);
  box-shadow: var(--shadow-soft);
}
.countdown-cell .num {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(20px, 5vw, 28px);
  margin-bottom: 4px;
}
.countdown-cell .lbl {
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 2px;
  opacity: 0.85;
  text-transform: uppercase;
}

/* ============================================
   LOKACIJE
   ============================================ */
.locations {
  max-width: 760px;
  margin: 0 auto 80px;
}

.section-heading {
  text-align: center;
  font-family: var(--italian);
  font-size: clamp(42px, 7vw, 58px);
  color: var(--burgundy);
  margin: 0 0 8px;
  font-weight: 400;
}
.heading-flourish {
  color: var(--gold);
  margin: 0 14px;
  font-size: 0.6em;
  vertical-align: middle;
}

.section-sub {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 40px;
  letter-spacing: 0.5px;
}

.location {
  background: var(--paper);
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  padding: 32px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.location::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(184,153,104,0.25);
  border-radius: 4px;
  pointer-events: none;
}

.location-head {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(107,26,26,0.15);
}
.loc-time {
  flex-shrink: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(16px, 3vw, 20px);
  color: var(--burgundy);
  letter-spacing: 1.5px;
  padding: 12px 16px;
  border: 1px solid var(--burgundy);
  border-radius: 4px;
  background: var(--cream);
  min-width: 90px;
  text-align: center;
}
.loc-title {
  font-family: var(--serif);
  font-size: clamp(20px, 3.5vw, 26px);
  color: var(--burgundy);
  margin: 0 0 6px;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.loc-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 2px;
  color: var(--ink);
}
.loc-addr {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  margin: 0;
  color: var(--ink-soft);
}

.loc-body {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 20px;
  align-items: stretch;
}

.map {
  position: relative;
  width: 100%;
  height: 260px;
  border-radius: 4px;
  background: #eee;
  overflow: hidden;
  border: 1px solid var(--gold-light);
  box-shadow: var(--shadow-soft);
}
.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px solid var(--gold-light);
  border-radius: 4px;
  background: var(--cream);
}
.qr-code {
  width: 140px;
  height: 140px;
  background: #fff;
  padding: 4px;
  border-radius: 2px;
}
.qr-code img, .qr-code canvas, .qr-code svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.qr-label {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.loc-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--burgundy);
  color: var(--cream);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--burgundy);
  border-radius: 2px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(107,26,26,0.18);
}
.btn:hover {
  background: var(--burgundy-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(107,26,26,0.28);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(107,26,26,0.20);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  text-align: center;
  padding: 50px 20px 60px;
  color: var(--ink-soft);
  font-family: var(--serif);
}
.footer-monogram {
  font-family: var(--italian);
  font-size: clamp(40px, 7vw, 54px);
  color: var(--burgundy);
  line-height: 1;
  margin-bottom: 8px;
}
.footer-monogram .amp { color: var(--gold); margin: 0 4px; }
.footer p { margin: 4px 0; letter-spacing: 1px; }
.footer-small {
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 12px !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 720px) {
  .invite-frame {
    padding: 48px 24px 36px 60px;
  }
  .date-vertical { left: 22px; top: 36px; padding-right: 14px; gap: 8px; }
  .date-num { font-size: 26px; }
  .ornament { letter-spacing: 4px; }

  .locations { padding: 0 4px; }
  .location { padding: 22px 18px; }
  .location-head { gap: 16px; }
  .loc-time { padding: 10px 12px; min-width: 76px; font-size: 14px; }

  .loc-body { grid-template-columns: 1fr; }
  .map { height: 220px; }
  .qr { padding: 18px; }
  .qr-code { width: 170px; height: 170px; }

  .countdown { gap: 6px; }
  .countdown-cell { padding: 12px 2px; }
  .countdown-cell .lbl { font-size: 8px; letter-spacing: 1px; }

  .btn { padding: 12px 24px; font-size: 12px; letter-spacing: 1.5px; }
}

@media (max-width: 420px) {
  .invite-frame { padding: 36px 18px 30px 50px; }
  .date-vertical { left: 14px; top: 30px; padding-right: 10px; }
  .date-num { font-size: 22px; }
  .date-tagline { font-size: 8px; letter-spacing: 1px; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .envelope-section, .bg-layer { display: none !important; }
  .invitation { opacity: 1 !important; transform: none !important; }
  body { background: white; }
}
