:root {
  --cream: #f7f0e1;
  --cream-2: #efe4cd;
  --sand: #e6d9bc;
  --olive: #6b6f3f;
  --olive-deep: #56592f;
  --gold: #c39a4f;
  --gold-soft: #dcbf84;
  --ink: #3d3a2e;
  --muted: #8a8168;
  --rose: #b0604a;
  --card: #fdf8ec;
  --line: #e2d4b3;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
}

main { position: relative; z-index: 2; }

h1, h2 { font-family: 'Cormorant Infant', Georgia, serif; font-weight: 600; letter-spacing: .01em; }

section { padding: 52px 20px; max-width: 980px; margin: 0 auto 40px; background: rgba(247, 240, 225, 0.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 24px; box-shadow: 0 4px 24px rgba(107, 111, 63, 0.10); }
section h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); text-align: center; margin-bottom: 40px; }

/* ---------- CUBES (3D dice) ---------- */
.scene { position: fixed; inset: 0; z-index: 100; perspective: 1000px; pointer-events: none; }

.cube {
  position: absolute;
  width: 150px; height: 150px;
  transform-style: preserve-3d;
  animation: spin 24s linear infinite;
  opacity: .95;
}
.cube-white { top: 10%; left: 4%; }
.cube-black { bottom: 8%; right: 3%; animation-direction: reverse; animation-duration: 32s; }

.cube .face {
  position: absolute;
  width: 150px; height: 150px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Infant', serif;
  font-size: 64px; font-weight: 700;
  border: 8px solid;
  border-radius: 18px;
  box-shadow: 
    inset 0 0 30px rgba(0,0,0,.15),
    inset 0 -8px 20px rgba(0,0,0,.1),
    0 0 0 1px rgba(0,0,0,.1);
}

.cube-white .face { background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%); color: #0a0a0a; border-color: #1a1a1a; }
.cube-black .face { background: linear-gradient(135deg, #2a2a2a 0%, #0a0a0a 100%); color: #ffffff; border-color: #f0f0f0; }

/* shading for depth */
.cube-white .front  { background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%); }
.cube-white .top    { background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%); }
.cube-white .bottom { background: linear-gradient(0deg, #d8d8d8 0%, #e8e8e8 100%); }
.cube-white .right  { background: linear-gradient(90deg, #f5f5f5 0%, #e8e8e8 100%); }
.cube-white .left   { background: linear-gradient(270deg, #fafafa 0%, #ededed 100%); }
.cube-white .back   { background: linear-gradient(135deg, #d0d0d0 0%, #c0c0c0 100%); }

.cube-black .front  { background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%); }
.cube-black .top    { background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%); }
.cube-black .bottom { background: linear-gradient(0deg, #0a0a0a 0%, #151515 100%); }
.cube-black .right  { background: linear-gradient(90deg, #252525 0%, #1a1a1a 100%); }
.cube-black .left   { background: linear-gradient(270deg, #303030 0%, #252525 100%); }
.cube-black .back   { background: linear-gradient(135deg, #0f0f0f 0%, #050505 100%); }

.cube .front  { transform: rotateY(0deg) translateZ(75px); }
.cube .back   { transform: rotateY(180deg) translateZ(75px); }
.cube .right  { transform: rotateY(90deg) translateZ(75px); }
.cube .left   { transform: rotateY(-90deg) translateZ(75px); }
.cube .top    { transform: rotateX(90deg) translateZ(75px); }
.cube .bottom { transform: rotateX(-90deg) translateZ(75px); }

.cube::after {
  content: '';
  position: absolute; left: 15px; right: 15px; bottom: -40px; height: 50px;
  background: radial-gradient(ellipse, rgba(0,0,0,.5), transparent 70%);
  filter: blur(15px); border-radius: 50%;
  transform: translateZ(-85px);
}

@keyframes spin {
  0% { transform: rotateX(-25deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: rotateX(-25deg) rotateY(360deg) rotateZ(360deg); }
}

/* ---------- FIREWORKS ---------- */
.fireworks { position: fixed; inset: 0; z-index: 99; pointer-events: none; overflow: hidden; }

.firework-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
}

/* ---------- BANNER (подложка) ---------- */
.banner {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  padding: 0;
  margin: 0 auto 20px;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.banner-img {
  width: 100%;
  max-width: 680px;
  height: auto;
  display: block;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(107, 111, 63, 0.18);
}

/* ---------- HERO ---------- */
.hero {
  text-align: center; padding: 60px 20px 60px;
  position: relative;
  background: rgba(247, 240, 225, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0 0 32px 32px;
  max-width: 780px;
  margin: 0 auto 40px;
  box-shadow: 0 8px 32px rgba(107, 111, 63, 0.12);
}

.hero > * { position: relative; z-index: 2; }

.kicker {
  font-size: 1.35rem; letter-spacing: .28em; text-transform: uppercase; color: var(--olive);
  margin-bottom: 18px; font-weight: 600;
}
.kicker-x { color: var(--gold); font-size: 1.5rem; font-weight: 700; }
.title { font-size: clamp(2.8rem, 9vw, 5.4rem); line-height: 1.02; margin-bottom: 22px; }
.date-line { font-size: clamp(1rem, 2.4vw, 1.3rem); color: var(--gold); letter-spacing: .05em; }
.time-place { margin-top: 8px; color: var(--muted); font-size: .98rem; }

.countdown {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 38px auto 34px;
}
.cd-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; min-width: 74px;
  box-shadow: 0 4px 14px rgba(150,120,60,.10);
}
.cd-num { display: block; font-family: 'Cormorant Infant', serif; font-size: 2.2rem; font-weight: 700; color: var(--olive-deep); }
.cd-label { display: block; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.cd-sep { font-size: 1.8rem; color: var(--gold); }

.countdown-done { font-size: 1.3rem; color: var(--olive); margin: 30px 0; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block; padding: 15px 38px; border-radius: 999px;
  font-family: 'Montserrat', sans-serif; font-size: .95rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  border: 2px solid var(--olive); color: #fdf8ec;
  background: var(--olive); transition: all .2s ease; text-decoration: none;
}
.btn:hover { background: transparent; color: var(--olive); }
.btn-primary { box-shadow: 0 8px 24px rgba(107,111,63,.28); }
.btn-block { width: 100%; margin-top: 8px; }

/* ---------- TIMELINE ---------- */
.program { max-width: 100%; }
.program > * { max-width: 980px; margin-left: auto; margin-right: auto; }

.timeline { position: relative; padding-left: 8px; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--gold), var(--olive));
}
.tl-item { position: relative; padding: 0 0 34px 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -7px; top: 6px; width: 16px; height: 16px;
  background: var(--card); border: 3px solid var(--gold); border-radius: 50%;
}
.tl-time { font-family: 'Cormorant Infant', serif; font-size: 1.5rem; font-weight: 700; color: var(--olive-deep); }
.tl-text { color: var(--ink); margin-top: 4px; font-size: .98rem; }
.candle { display: inline-block; }

/* ---------- VENUE ---------- */
.venue-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.venue-grid img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.venue-addr { text-align: center; color: var(--olive-deep); font-size: 1.05rem; margin-bottom: 24px; }

.map-wrap { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.map-wrap iframe { display: block; width: 100%; height: 380px; border: 0; }
.map-none {
  height: 200px; display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--muted); font-size: .95rem;
}

/* ---------- FORM ---------- */
.register { max-width: 100%; }
.register > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.reg-note { text-align: center; color: var(--muted); margin-bottom: 32px; }

#regForm { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { font-size: .82rem; letter-spacing: .04em; color: var(--muted); display: flex; flex-direction: column; gap: 7px; }
input, select, textarea {
  font-family: 'Montserrat', sans-serif; font-size: 1rem;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px;
  transition: border-color .2s ease;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
input.invalid, select.invalid { border-color: var(--rose); }
textarea { resize: vertical; }
select { cursor: pointer; }
select option { background: var(--card); }

.form-msg { text-align: center; font-size: .92rem; min-height: 1.4em; }
.form-msg.ok { color: var(--olive); }
.form-msg.err { color: var(--rose); }

/* ---------- FOOTER ---------- */
footer { text-align: center; padding: 34px 20px 60px; color: var(--muted); font-size: .85rem; }
footer p { position: relative; z-index: 2; }

/* ---------- INVITE CARD MODAL ---------- */
.invite-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(45, 42, 30, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.invite-overlay[hidden] { display: none; }

.invite-wrap { width: 100%; max-width: 460px; margin: auto; }

.invite-card {
  position: relative;
  background: linear-gradient(160deg, var(--card) 0%, var(--cream) 60%, var(--cream-2) 100%);
  border: 2px solid var(--gold-soft);
  border-radius: 26px;
  padding: 40px 28px 34px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(40, 35, 20, 0.35), 0 0 0 6px rgba(195, 154, 79, 0.18);
}

.invite-x2 {
  position: absolute; right: 6px; top: 26%;
  font-family: 'Cormorant Infant', serif;
  font-size: 150px; font-weight: 700; line-height: 1;
  color: rgba(195, 154, 79, 0.12);
  pointer-events: none;
  transform: rotate(-8deg);
  z-index: 0;
}

.invite-brand {
  font-family: 'Cormorant Infant', serif;
  font-size: 1.05rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 26px;
  position: relative; z-index: 1;
}

.invite-greeting {
  font-family: 'Cormorant Infant', serif;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  font-weight: 700; line-height: 1.12;
  color: var(--olive-deep);
  margin-bottom: 10px;
  position: relative; z-index: 1;
}

.invite-subtitle {
  font-size: 1.02rem; color: var(--ink);
  margin-bottom: 24px;
  position: relative; z-index: 1;
}

.invite-details {
  background: rgba(247, 240, 225, 0.85);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 14px;
  margin-bottom: 24px;
  text-align: left;
  position: relative; z-index: 1;
}

.invite-line {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .98rem; color: var(--ink);
  line-height: 1.45; margin-bottom: 10px;
}
.invite-line:last-child { margin-bottom: 0; }
.invite-emoji { flex: 0 0 auto; }
.invite-addr { color: var(--muted); font-size: .9rem; }

.invite-footer {
  font-family: 'Cormorant Infant', serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--rose);
  position: relative; z-index: 1;
}

.invite-actions {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: 22px;
}

.btn-sm { padding: 12px 22px; font-size: .85rem; }

.btn-ghost {
  background: transparent; color: var(--olive);
}
.btn-ghost:hover { background: var(--olive); color: var(--card); }

/* dice as subtle watermark background on the card corners */
.dice {
  position: absolute; width: 110px; height: auto;
  opacity: .5;
  mix-blend-mode: multiply;
  filter: grayscale(1);
  pointer-events: none;
  z-index: 0;
}
.dice-white { top: 16px; left: 16px; transform: rotate(-14deg); }
.dice-black { bottom: 16px; right: 16px; transform: rotate(12deg); }

@media (max-width: 720px) {
  .dice { width: 82px; }
  .dice-white { top: 12px; left: 12px; }
  .dice-black { bottom: 12px; right: 12px; }
  .invite-card { padding: 34px 20px 28px; }
  .invite-x2 { font-size: 120px; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
  body { background-size: auto 100%; background-position: center top; }
  section { padding: 40px 16px; margin-bottom: 24px; border-radius: 18px; }
  .form-row { grid-template-columns: 1fr; }
  .venue-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .scene { display: none; }
  .cd-item { min-width: 58px; padding: 8px 10px; }
  .cd-num { font-size: 1.6rem; }
  .kicker { font-size: 1.05rem; letter-spacing: .18em; }
  .kicker-x { font-size: 1.15rem; }
  .map-wrap iframe { height: 300px; }
  .hero { padding: 48px 16px 48px; }
}

@media (max-width: 380px) {
  .countdown { gap: 6px; }
  .cd-item { min-width: 52px; padding: 6px 8px; }
  .cd-num { font-size: 1.35rem; }
  .cd-sep { font-size: 1.2rem; }
  .btn { padding: 14px 26px; font-size: .85rem; }
}