:root {
  --barn-red: #A9341F;
  --barn-dark: #7A2418;
  --cream: #F6E7C8;
  --paper: #FBF2DD;
  --wood: #7A4A26;
  --wood-dark: #52301A;
  --straw: #D9A441;
  --amber: #E8933C;
  --sunset: #F2A65A;
  --leaf: #6E8B3D;
  --leaf-dark: #4F6628;
  --ink: #432A16;
}

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

body {
  font-family: 'Bitter', Georgia, serif;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ═══════════ INTRO ═══════════ */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #E8933C;
  overflow: hidden;
  transition: opacity 1s ease;
  cursor: pointer;
}
.intro.fade-out { opacity: 0; pointer-events: none; }

.scene-zoom {
  position: absolute;
  inset: 0;
  transition: transform 1.6s cubic-bezier(0.5, 0, 0.75, 0.4);
  transform-origin: 50% 58%;
}
.scene-zoom.zoom { transform: scale(2.1); }

.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
}
.scene-open { opacity: 0; transition: opacity 1.1s ease; }
.scene-open.show { opacity: 1; }

.rooster {
  position: absolute;
  left: 50%;
  bottom: -55%;
  width: min(62vw, 300px);
  transform: translateX(-50%);
  transition: bottom 0.8s cubic-bezier(0.34, 1.4, 0.64, 1);
  z-index: 5;
  filter: drop-shadow(0 12px 20px rgba(60, 25, 5, 0.4));
}
.rooster img { width: 100%; display: block; }
.rooster.out { bottom: 4%; }
.rooster.crow img { animation: crow 0.55s ease-in-out 3; transform-origin: 50% 92%; }
@keyframes crow {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-7deg) translateY(-6px); }
  60% { transform: rotate(4deg); }
}
.rooster.gone { bottom: -60%; transition: bottom 0.6s ease-in; }

.bubble {
  position: absolute;
  top: -13%;
  right: -8%;
  background: var(--paper);
  color: var(--barn-dark);
  font-family: 'Alfa Slab One', serif;
  font-size: clamp(14px, 4vw, 20px);
  padding: 9px 15px;
  border-radius: 16px;
  border: 3px solid var(--barn-dark);
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.4);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 22px;
  border: 7px solid transparent;
  border-top-color: var(--barn-dark);
}
.bubble.show { opacity: 1; transform: scale(1); }

.knock-wrap {
  position: absolute;
  left: 50%;
  bottom: 7%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 6;
  transition: opacity 0.4s;
}
.knock-wrap.hide { opacity: 0; }
.knock-hint {
  font-family: 'Alfa Slab One', serif;
  font-size: clamp(16px, 4.6vw, 22px);
  color: var(--cream);
  background: rgba(82, 48, 26, 0.92);
  padding: 13px 26px;
  border-radius: 14px;
  border: 2.5px solid var(--straw);
  box-shadow: 0 6px 0 rgba(40, 20, 5, 0.45);
  letter-spacing: 0.5px;
}
.knock-tap {
  display: inline-block;
  font-size: 30px;
  margin-top: 10px;
  animation: tap 1.4s ease-in-out infinite;
}
@keyframes tap { 50% { transform: translateY(-9px); } }

/* ═══════════ POZIVNICA ═══════════ */

body.revealed {
  background:
    linear-gradient(180deg, #F2A65A 0%, #F6C078 26%, #FBF2DD 58%, #F0DDB4 100%);
  background-attachment: fixed;
}

.invite {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 18px 52px;
  animation: fadeUp 1s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

/* Traka sa imenom */
.hero { text-align: center; padding: 40px 0 26px; }

.ribbon {
  position: relative;
  display: block;
  background: var(--paper);
  border: 3px solid var(--wood-dark);
  border-radius: 6px;
  padding: 16px 20px 14px;
  margin: 0 14px 30px;
  box-shadow: 0 7px 0 rgba(60, 30, 10, 0.3);
  transform: rotate(-1.6deg);
}
.ribbon::before, .ribbon::after {
  content: '';
  position: absolute;
  top: 22%;
  width: 34px;
  height: 62%;
  background: var(--straw);
  border: 3px solid var(--wood-dark);
  z-index: -1;
}
.ribbon::before {
  left: -30px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 42% 50%);
}
.ribbon::after {
  right: -30px;
  clip-path: polygon(0 0, 100% 0, 58% 50%, 100% 100%, 0 100%);
}
.ribbon-name {
  display: block;
  font-family: 'Alfa Slab One', serif;
  font-size: clamp(19px, 5.4vw, 27px);
  color: var(--barn-dark);
  line-height: 1.25;
}
.ribbon-sub {
  display: block;
  font-family: 'Caveat', cursive;
  font-size: clamp(22px, 6vw, 29px);
  color: var(--wood);
  margin-top: 2px;
}

.hero-title {
  font-family: 'Alfa Slab One', serif;
  font-size: clamp(44px, 12vw, 66px);
  line-height: 1;
  color: var(--barn-red);
  text-shadow: 3px 4px 0 rgba(82, 48, 26, 0.28);
  letter-spacing: 2px;
}
.hero-num {
  display: block;
  font-size: clamp(88px, 26vw, 140px);
  color: var(--amber);
  -webkit-text-stroke: 3px var(--barn-dark);
  text-shadow: 5px 6px 0 rgba(82, 48, 26, 0.32);
  margin-top: 4px;
}
.hero-kicker {
  font-family: 'Caveat', cursive;
  font-size: clamp(26px, 7vw, 34px);
  color: var(--wood-dark);
  margin-top: 10px;
}

.hero-scene {
  width: min(86vw, 420px);
  margin-top: 24px;
  border: 4px solid var(--wood);
  border-radius: 18px;
  box-shadow: 0 8px 0 rgba(82, 48, 26, 0.28);
  transform: rotate(-1.2deg);
}
.hero-toast {
  font-family: 'Caveat', cursive;
  font-size: clamp(21px, 5.6vw, 26px);
  color: var(--wood);
  margin-top: 4px;
}

/* Kartice */
.card {
  background: var(--paper);
  border: 3px solid var(--wood);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 26px;
  box-shadow: 0 7px 0 rgba(82, 48, 26, 0.25);
}
.card-title {
  font-family: 'Alfa Slab One', serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  color: var(--cream);
  background: var(--wood);
  border: 2.5px solid var(--wood-dark);
  border-radius: 10px;
  padding: 9px 18px;
  margin: -42px auto 20px;
  width: fit-content;
  box-shadow: 0 4px 0 rgba(50, 28, 10, 0.4);
}

.countdown { display: flex; gap: 10px; justify-content: center; }
.cd-box {
  flex: 1;
  max-width: 92px;
  background: var(--barn-red);
  border: 2.5px solid var(--barn-dark);
  color: var(--paper);
  border-radius: 12px;
  text-align: center;
  padding: 13px 4px 10px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
}
.cd-box span {
  display: block;
  font-family: 'Alfa Slab One', serif;
  font-size: 28px;
  line-height: 1;
}
.cd-box small { font-size: 11.5px; opacity: 0.9; font-family: 'Bitter', serif; }

.details { list-style: none; display: grid; gap: 17px; }
.details li { display: flex; gap: 14px; align-items: flex-start; font-size: 16px; line-height: 1.5; }
.d-ico {
  font-size: 22px;
  background: #F3E2BC;
  border: 2.5px solid var(--straw);
  border-radius: 12px;
  padding: 8px 10px;
  flex-shrink: 0;
}
.details a { color: var(--barn-red); font-weight: 700; }

.rsvp-note { text-align: center; font-size: 16px; margin-bottom: 18px; }
.field { display: block; margin-bottom: 15px; }
.field span { display: block; font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 2.5px solid var(--wood);
  border-radius: 11px;
  background: #FFFDF6;
  color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232, 147, 60, 0.35);
}

.rsvp-buttons { display: flex; gap: 12px; margin-top: 22px; }
.btn {
  flex: 1;
  font-family: 'Alfa Slab One', serif;
  font-size: 16px;
  padding: 15px 8px;
  border-radius: 13px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  letter-spacing: 0.5px;
}
.btn:active { transform: translateY(4px); box-shadow: none !important; }
.btn-yes {
  background: var(--leaf);
  color: #FFFDF6;
  border: 2.5px solid var(--leaf-dark);
  box-shadow: 0 5px 0 var(--leaf-dark);
}
.btn-no {
  background: #EADFC6;
  color: var(--wood-dark);
  border: 2.5px solid #BCA476;
  box-shadow: 0 5px 0 #BCA476;
}
.btn[disabled] { opacity: 0.6; cursor: wait; }

.rsvp-done {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  padding: 18px 10px 6px;
  color: var(--leaf-dark);
}

.foot { text-align: center; padding-top: 12px; }
.foot-big {
  font-family: 'Caveat', cursive;
  font-size: clamp(28px, 8vw, 36px);
  color: var(--barn-dark);
}
.foot-small { font-size: 13.5px; opacity: 0.7; margin-top: 6px; }

@media (max-width: 400px) {
  .cd-box span { font-size: 23px; }
  .rsvp-buttons { flex-direction: column; }
}
