/* ==========================================================================
   Pozivnica za venčanje — Milan & Simona
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Fontovi
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Great Vibes';
  src: url('../fonts/great-vibes.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-garamond-400.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-garamond-500.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-garamond-400-italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: block;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-garamond-500-italic.woff') format('woff');
  font-weight: 500;
  font-style: italic;
  font-display: block;
}


/* --------------------------------------------------------------------------
   2. Promenljive (boje i pozadine)
   -------------------------------------------------------------------------- */

:root {
  --bg: #e9dcb8;
  --paper: #f1e5c4;
  --ink: #3f4a3a;
  --soft: #6b7a64;
  --accent: #7a916f;
  --line: #cfd6bf;
  --seal: #6a8260;
  --env: #e3e8d0;

  /* tekstura starog papira */
  --pp: url('../img/papir-tekstura.svg');

  /* tamnozelena pozadina sa mekim mrljama */
  --deco:
    radial-gradient(ellipse 700px 520px at 0% 0%,    rgba(14, 84, 56, .55), transparent 70%),
    radial-gradient(ellipse 620px 520px at 100% 22%, rgba(14, 84, 56, .42), transparent 70%),
    radial-gradient(ellipse 640px 520px at 0% 58%,   rgba(14, 84, 56, .45), transparent 70%),
    radial-gradient(ellipse 640px 520px at 100% 88%, rgba(14, 84, 56, .5),  transparent 70%);

  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}


/* --------------------------------------------------------------------------
   3. Osnova
   -------------------------------------------------------------------------- */

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  overflow-x: hidden;
  background-color: #0a2a1d;
  background-image: var(--deco);
  color: var(--ink);
  font-family: 'Cormorant Garamond', 'Cormorant', 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 19px;
  font-style: italic;
  line-height: 1.6;
  text-align: center;
}

p {
  margin: .6em 0;
}

strong,
b {
  font-weight: 500;
}


/* --------------------------------------------------------------------------
   4. Tipografija
   -------------------------------------------------------------------------- */

.script {
  font-family: 'Great Vibes', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Brush Script MT', cursive;
  font-weight: 400;
  font-style: normal;
}

.eyebrow {
  font-size: 14px;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--soft);
}

h1 {
  margin: 10px 0;
  font-size: 68px;
  line-height: 1.1;
  color: var(--accent);
}

h2 {
  margin: 0 0 8px;
  font-size: 46px;
  color: var(--accent);
}

.amp {
  display: block;
  font-size: 44px;
  color: var(--soft);
}

.date {
  margin-top: 18px;
  font-size: 24px;
  letter-spacing: .2em;
}

.muted {
  color: var(--soft);
}

/* ukras: linija sa srcem */
.orn {
  display: block;
  width: 180px;
  margin: 22px auto;
  color: var(--accent);
}

/* srce u ukrasu i na kovertu "kuca" */
.orn path:last-child,
.env .front path:last-child {
  transform-box: fill-box;
  transform-origin: center;
  animation: hb 1.8s ease-in-out infinite;
}


/* --------------------------------------------------------------------------
   5. Naslovna strana — koverta sa pečatom
   -------------------------------------------------------------------------- */

#cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: #0a2a1d;
  background-image: var(--deco);
  transition: opacity 1s, visibility 1s;
}

#cover.gone {
  opacity: 0;
  visibility: hidden;
}

/* koverta */
.evl {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(97vw, 540px);
  height: auto;
  aspect-ratio: 1.45 / 1;
  padding: 0 18px;
  overflow: visible;
  perspective: 1400px;
  background: #f6f2e6;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(205, 195, 160, .7);
  transition: background-color .9s, box-shadow .9s;
}

/* kartica unutar koverte */
#cover .evl .paper {
  position: absolute;
  left: 8%;
  top: 10%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 84%;
  height: 84%;
  padding: 0 14px;
  text-align: center;
  background-color: #ecdcb4;
  background-image:
    radial-gradient(ellipse closest-side at 50% 50%, transparent 62%, rgba(139, 96, 38, .34) 100%),
    var(--pp);
  border-radius: 3px 7px 4px 6px / 6px 3px 7px 4px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, .35),
    inset 2px 2px 3px rgba(255, 248, 225, .8),
    inset -2px -2px 4px rgba(95, 65, 25, .5),
    inset 0 0 34px rgba(150, 105, 45, .3);
  transition: transform 1.2s cubic-bezier(.22, .7, .2, 1);
}

#cover .evl .paper .pn {
  margin-top: 10px;
  font-size: clamp(38px, 11vw, 56px);
  line-height: 1.1;
  color: var(--accent);
}

#cover .evl .paper .orn {
  width: 150px;
  margin: 4px auto;
}

#cover .evl .paper .pd {
  font-size: clamp(18px, 5vw, 24px);
  letter-spacing: .2em;
}

/* prednji "džep" koverte */
#cover .evl .pocket {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  transition: opacity .9s;
}

/* preklop koverte */
#cover .evl .flapw {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 100%;
  height: 55%;
  transform-origin: 50% 0;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .18));
  transition: transform .8s ease-in-out, z-index 0s .4s, opacity .9s;
}

.flapw svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* grančice oko pečata (crta ih JS) */
#sp {
  position: absolute;
  left: 50%;
  top: 55%;
  z-index: 4;
  width: 94%;
  height: auto;
  overflow: visible;
  transform: translate(-50%, -50%);
  transition: opacity .9s;
}

/* pečat — dugme za otvaranje */
#cover #open {
  all: unset;
  position: absolute;
  left: 50%;
  top: 55%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin: 0;
  cursor: pointer;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8ea683, #587050);
  color: #fff;
  font: 36px/1 'Great Vibes', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Brush Script MT', cursive;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(30, 45, 25, .6);
  box-shadow:
    0 0 22px rgba(122, 145, 111, .75),
    0 6px 20px rgba(60, 80, 50, .3),
    inset 0 0 0 6px rgba(252, 250, 242, .3);
  transform: translate(-50%, -50%);
  transition: transform .3s;
  animation: beat 2.2s ease-in-out infinite;
}

#cover #open:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

/* talasi koji se šire oko pečata */
#cover #open::before,
#cover #open::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #7a916f;
  border-radius: 50%;
  pointer-events: none;
  animation: ring 2.2s ease-out infinite;
}

#cover #open::after {
  animation-delay: 1.1s;
}

/* "Pritisnite pečat da otvorite" */
#cover .evl .hint {
  position: absolute;
  left: 0;
  bottom: 7%;
  z-index: 4;
  width: 100%;
  margin: 0;
  text-align: center;
  animation: hint 2.2s ease-in-out infinite;
}

/* --- Animacija otvaranja (klase dodaje JS redom: o1 → o2 → o3 → gone) --- */

/* o1: preklop se otvara, pečat nestaje */
#cover.o1 .evl .flapw {
  z-index: 0;
  transform: rotateX(180deg);
}

#cover.o1 .evl #open {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.35);
  transition: opacity .45s, transform .45s;
  animation: none;
}

#cover.o1 .evl .hint {
  opacity: 0;
  transition: opacity .4s;
  animation: none;
}

/* o2: kartica izlazi iz koverte */
#cover.o2 .evl .paper {
  transform: translateY(-70%);
}

/* o3: koverta nestaje, kartica se uvećava */
#cover.o3 .evl .paper {
  transform: translateY(-3%) scale(1.14);
  transition: transform 1s ease-in-out;
}

#cover.o3 .evl {
  background-color: transparent;
  box-shadow: none;
}

#cover.o3 .evl .pocket,
#cover.o3 .evl .flapw,
#cover.o3 .evl #sp {
  opacity: 0;
}


/* --------------------------------------------------------------------------
   6. Zlatna loza oko gornjeg dela strane (crta je JS)
   -------------------------------------------------------------------------- */

.frame {
  --accent: #d9bf80;
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  container-type: inline-size;
  transform: translateX(-50%);
}

.frame svg {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}


/* --------------------------------------------------------------------------
   7. Sekcije — kartice od starog papira
   -------------------------------------------------------------------------- */

section,
footer {
  position: relative;
  z-index: 1;
  width: calc(100% - 56px);
  max-width: 560px;
  margin: 22px auto;
  padding: 40px 22px;
  text-align: center;
  text-shadow: 0 0 8px var(--bg), 0 0 3px var(--bg);
  background-color: #ecdcb4;
  background-image:
    radial-gradient(ellipse closest-side at 50% 50%, transparent 62%, rgba(139, 96, 38, .34) 100%),
    linear-gradient(180deg, transparent 49.6%, rgba(90, 60, 20, .16) 50%, rgba(255, 250, 230, .4) 50.4%, transparent 51.3%),
    var(--pp);
  border-radius: 3px 7px 4px 6px / 6px 3px 7px 4px;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, .6),
    inset 2px 2px 3px rgba(255, 248, 225, .8),
    inset -2px -2px 4px rgba(95, 65, 25, .5),
    inset 0 0 34px rgba(150, 105, 45, .3);
}

section > *,
footer > * {
  max-width: 100%;
}

/* blago iskrivljene kartice */
section:nth-of-type(odd)  { rotate: -.5deg; }
section:nth-of-type(even) { rotate: .5deg; }
footer                    { rotate: -.4deg; }

.frame + section {
  margin-top: 18px;
}

/* pojavljivanje pri skrolovanju */
.fade {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s, transform 1s;
}

.fade.in {
  opacity: 1;
  transform: none;
}


/* --------------------------------------------------------------------------
   8. Fotografije
   -------------------------------------------------------------------------- */

.photo {
  width: min(300px, 100%);
  aspect-ratio: 3 / 4;
  margin: 0 auto 30px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 300px 300px 10px 10px;
  box-shadow: 0 10px 40px rgba(120, 90, 50, .18);
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
  border-radius: 292px 292px 4px 4px;
}

.photo.first {
  margin: 30px auto 0;
}

/* okrugla fotografija */
.photo.o {
  width: min(340px, 100%);
  aspect-ratio: 4 / 5;
  margin-top: 28px;
  border-radius: 50%;
}

.photo.o img {
  border-radius: 50%;
  object-position: 50% 30%;
}


/* --------------------------------------------------------------------------
   9. Sačuvajte datum — kalendar u koverti
   -------------------------------------------------------------------------- */

.env {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 340 / 360;
  margin: 34px auto 0;
  container-type: inline-size;
}

.cal {
  position: absolute;
  top: 0;
  left: 9%;
  width: 82%;
  height: 82%;
  padding: 4cqw 4cqw 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3cqw;
  box-shadow: 0 4px 14px rgba(120, 90, 50, .15);
  transform: rotate(-1.5deg);
}

.cal h4 {
  margin: 0 0 2cqw;
  font: 400 8.5cqw 'Great Vibes', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Brush Script MT', cursive;
  line-height: 1.1;
  color: var(--accent);
}

.cal .g {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .6cqw;
}

.cal .g i {
  position: relative;
  font-size: 4.4cqw;
  font-style: normal;
  line-height: 7.4cqw;
  color: var(--ink);
}

/* nazivi dana */
.cal .g i.w {
  font-size: 3cqw;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--soft);
}

/* zaokružen datum venčanja */
.cal .g i.on {
  color: var(--paper);
  font-weight: 500;
}

.cal .g i.on::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 7.8cqw;
  height: 7.8cqw;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.env .front {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: auto;
}

.cal-note {
  margin-top: 20px;
}


/* --------------------------------------------------------------------------
   10. Odbrojavanje
   -------------------------------------------------------------------------- */

.count {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 24px;
}

.count div {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 2px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50px 50px 8px 8px;
}

.count b {
  display: block;
  font-size: clamp(24px, 8vw, 34px);
  font-weight: 500;
  line-height: 1;
  color: var(--accent);
}

.count span {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--soft);
}


/* --------------------------------------------------------------------------
   11. Program dana
   -------------------------------------------------------------------------- */

.tl {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 26px auto 0;
  padding: 0;
  text-align: center;
}

.tl div {
  position: relative;
}

/* tanka linija između stavki */
.tl div:not(:last-child)::after {
  content: "";
  display: block;
  width: 1px;
  height: 30px;
  margin: 24px auto;
  background: var(--line);
}

.tl time {
  display: block;
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
}

.tl strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
  font-weight: 500;
}

.tl small {
  display: block;
  font-size: 17px;
  color: var(--soft);
}

/* okrugla ikonica iznad stavke */
.ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  margin: 0 auto 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(120, 90, 50, .12);
  color: var(--accent);
}

.ico svg {
  width: 62px;
  height: 62px;
}

/* dugme "Mapa" */
.map {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 16px;
  border: 1px solid var(--accent);
  border-radius: 30px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: .3s;
}

.map:hover {
  background: var(--accent);
  color: var(--paper);
}

.map svg {
  vertical-align: -2px;
  margin-right: 6px;
}


/* --------------------------------------------------------------------------
   12. Potvrda dolaska (RSVP)
   -------------------------------------------------------------------------- */

.rsvp form {
  max-width: 360px;
  margin: 10px auto 0;
}

.rsvp .field {
  margin-top: 20px;
}

.rsvp label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--soft);
}

/* polje za imena gostiju */
.rsvp textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  padding: 12px 18px;
  resize: vertical;
  font: inherit;
  font-size: 20px;
  line-height: 1.4;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  transition: border-color .3s, box-shadow .3s;
}

.rsvp textarea::placeholder {
  color: var(--soft);
  opacity: .6;
}

.rsvp textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 145, 111, .2);
}

.rsvp textarea.invalid,
.rsvp textarea.invalid:focus {
  border-color: #a31b31;
  box-shadow: 0 0 0 3px rgba(163, 27, 49, .15);
}

.rsvp .note {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--soft);
}

/* dugme za slanje */
.rsvp-btn {
  margin-top: 28px;
  padding: 12px 32px;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-shadow: none;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 40px;
  box-shadow: 0 6px 16px rgba(60, 80, 50, .25);
  transition: background .3s, opacity .3s;
}

.rsvp-btn:hover {
  background: #5f7a55;
}

.rsvp-btn:disabled {
  opacity: .6;
  cursor: default;
}

/* poruka o grešci */
.rsvp-msg {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: 16px;
  color: #a31b31;
}

/* zahvalnica posle slanja */
.rsvp-thanks .script {
  margin-top: 6px;
  font-size: 44px;
  color: var(--accent);
}


/* --------------------------------------------------------------------------
   13. Podnožje — kontakt i potpis
   -------------------------------------------------------------------------- */

footer {
  color: var(--soft);
}

.kont {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 6px;
  margin: 0 -10px 4px;
}

.kont .eyebrow {
  grid-column: 1 / -1;
  font-size: 12px;
}

.kb {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.4;
}

.kb b {
  display: block;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--accent);
}

.kb a {
  display: block;
  padding: 0 2px;
  color: var(--soft);
  font-size: 13.5px;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
}

/* e-mail adresa (JS je po potrebi dodatno smanjuje da stane) */
.kb a + a {
  font-size: 12.5px;
}

.kb a:hover {
  color: var(--accent);
}

.sign-love {
  font-size: 44px;
  color: var(--accent);
}

.sign-names {
  font-size: 38px;
  color: var(--ink);
}


/* --------------------------------------------------------------------------
   14. Animacije
   -------------------------------------------------------------------------- */

/* pulsiranje pečata */
@keyframes beat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.07); }
}

/* talas oko pečata */
@keyframes ring {
  0%   { transform: scale(1);   opacity: .7; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* otkucaj srca */
@keyframes hb {
  0%, 56%, 100% { transform: scale(1); }
  14%           { transform: scale(1.2); }
  28%           { transform: scale(1); }
  42%           { transform: scale(1.13); }
}

/* treperenje teksta "Pritisnite pečat" */
@keyframes hint {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}


/* --------------------------------------------------------------------------
   15. Telefoni
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
  body { font-size: 18px; }
  h1   { font-size: 54px; }
  h2   { font-size: 40px; }
}
