/* ===== Dizayn «Muhr» — to'q zumrad, oltin yaltiroq, muhrlangan konvert ===== */
:root {
  --bg: #0c1714;
  --bg2: #12231e;
  --ink: #efe6d2;
  --muted: #a7b0a3;
  --gold: #d4b06a;
  --gold-2: #f3dfa2;
  --line: rgba(212, 176, 106, .28);
  --card: rgba(255, 255, 255, .035);
  --wine: #6e1a26;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--sans); font-variant-numeric: lining-nums; color: var(--ink); background: radial-gradient(120% 70% at 50% 0%, #17302a 0%, var(--bg) 55%) fixed, var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.locked { overflow: hidden; height: 100dvh; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 35; pointer-events: none; }

.foil { background: linear-gradient(100deg, #a87a32 0%, #f6e3a8 20%, #c79a4b 38%, #fff3c9 52%, #b88a3e 70%, #e9cf8c 86%, #a87a32 100%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: foil 7s linear infinite; }
@keyframes foil { from { background-position: 0% 0; } to { background-position: 300% 0; } }
.kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .38em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted); font-size: 14.5px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 28px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #e8cd8d, #b88a3e); color: #1a1408; font: 600 15px var(--sans); letter-spacing: .02em; cursor: pointer; text-decoration: none; box-shadow: 0 12px 30px -12px rgba(212,176,106,.55); transition: transform .25s var(--ease); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.btn:disabled { opacity: .6; }

/* ---------- Muqova: konvert */
.cover { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; padding: 24px; background: radial-gradient(circle at 50% 38%, #1f4036 0%, #0c1714 72%); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s; }
.cover.gone { opacity: 0; transform: scale(1.12); filter: blur(6px); pointer-events: none; }
.cover-top { font-size: 11.5px; font-weight: 600; letter-spacing: .38em; text-transform: uppercase; color: var(--gold); animation: fadeUp 1.2s var(--ease) .2s both; }
.cover-hint { text-align: center; font-size: 13px; color: var(--muted); line-height: 1.6; animation: fadeUp 1.2s var(--ease) .8s both; transition: opacity .4s; }
.cover-hint b { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--ink); letter-spacing: .02em; }
.cover.opening .cover-hint, .cover.opening .cover-top { animation: none; opacity: 0; transition: opacity .4s; }

.envelope { position: relative; width: min(330px, 84vw); aspect-ratio: 3 / 2; perspective: 1200px; animation: envIn 1.3s var(--ease) .3s both; }
@keyframes envIn { from { opacity: 0; transform: translateY(40px) rotate(-4deg); } to { opacity: 1; transform: none; } }
.env-back, .env-front, .env-flap { position: absolute; inset: 0; border-radius: 8px; }
.env-back { background: linear-gradient(160deg, #e9dcc0, #d9c59d); box-shadow: 0 40px 80px -30px rgba(0,0,0,.7); }
.env-front { z-index: 3; background: linear-gradient(170deg, #f3e8d0, #e2cfa8); clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%); }
.env-front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent 49.6%, rgba(150,120,70,.25) 50%, transparent 50.4%), linear-gradient(to top left, transparent 49.6%, rgba(150,120,70,.25) 50%, transparent 50.4%); clip-path: polygon(0 100%, 50% 54%, 100% 100%); }
.env-flap { z-index: 4; background: linear-gradient(180deg, #efe2c6, #dcc79f); clip-path: polygon(0 0, 100% 0, 50% 60%); transform-origin: 50% 0; transition: transform .7s var(--ease) .25s, z-index 0s .6s; filter: drop-shadow(0 4px 4px rgba(0,0,0,.15)); }
.letter { position: absolute; z-index: 2; left: 7%; right: 7%; top: 6%; height: 88%; border-radius: 6px; background: #fffaf0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: #2b2a27; box-shadow: 0 10px 30px -10px rgba(0,0,0,.3); transition: transform 1s var(--ease) .85s; }
.letter::before { content: ""; position: absolute; inset: 8px; border: 1px solid #d8c6a1; border-radius: 4px; }
.letter-k { font-size: 9px; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: #b0915a; }
.letter-n { font-family: var(--serif); font-size: 26px; line-height: 1; }
.letter-n i { font-size: 18px; color: #b0915a; }
.letter-d { font-family: var(--serif); font-size: 15px; letter-spacing: .2em; color: #7d766b; }
.seal { position: absolute; z-index: 5; left: 50%; top: 60%; width: 78px; height: 78px; margin: -39px 0 0 -39px; border: 0; padding: 0; cursor: pointer; border-radius: 47% 53% 50% 48% / 52% 46% 54% 48%; background: radial-gradient(circle at 35% 30%, #a5303f 0%, #7a1f2b 45%, #4f111a 100%); box-shadow: 0 8px 18px -6px rgba(0,0,0,.6), inset 0 -3px 6px rgba(0,0,0,.35), inset 0 3px 6px rgba(255,255,255,.18); display: grid; place-items: center; animation: sealPulse 2.4s ease-in-out 1.6s infinite; transition: transform .45s var(--ease), opacity .45s; }
.seal::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 1.5px dashed rgba(240,200,140,.45); }
.seal span { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: .02em; color: #f1cf8e; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.seal span i { font-size: 15px; margin: 0 1px; }
@keyframes sealPulse { 0%, 100% { transform: scale(1); box-shadow: 0 8px 18px -6px rgba(0,0,0,.6), 0 0 0 0 rgba(212,176,106,.45), inset 0 -3px 6px rgba(0,0,0,.35); } 50% { transform: scale(1.05); box-shadow: 0 8px 18px -6px rgba(0,0,0,.6), 0 0 0 14px rgba(212,176,106,0), inset 0 -3px 6px rgba(0,0,0,.35); } }
.cover.opening .seal { animation: none; transform: scale(1.6) rotate(-12deg); opacity: 0; }
.cover.opening .env-flap { transform: rotateX(180deg); z-index: 1; }
.cover.opening .letter { transform: translateY(-58%) scale(1.04); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Ovoz tugmasi */
.sound { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sound-btn { width: 46px; height: 46px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(18,35,30,.7); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line), 0 10px 26px -12px rgba(0,0,0,.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: pointer; }
.sound-btn svg { width: 22px; height: 22px; }
.sound-btn .x { display: none; }
.sound.muted .w1, .sound.muted .w2 { display: none; }
.sound.muted .x { display: inline; }
.sound.low .w2 { display: none; }
.sound.playing:not(.muted) .sound-btn { animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 0%, 100% { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 0 rgba(212,176,106,.35); } 50% { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 8px rgba(212,176,106,0); } }
.sound-panel { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px; background: rgba(18,35,30,.92); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.sound-panel input { width: 130px; accent-color: var(--gold); }
.mute { border: 0; background: none; font: 600 12.5px var(--sans); color: var(--gold); cursor: pointer; }

/* ---------- Asosiy qism */
.invite { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 0 22px calc(40px + env(safe-area-inset-bottom)); opacity: 0; transition: opacity 1.2s var(--ease); }
.invite.show { opacity: 1; }
.hero { position: relative; min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 70px 0 60px; }
.arch { position: absolute; left: 50%; top: 50%; width: min(330px, 86vw); height: auto; transform: translate(-50%, -52%); overflow: visible; }
.arch path { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.arch .a2 { stroke-opacity: .4; }
.arch .a3 { fill: var(--gold); stroke: none; opacity: 0; transition: opacity 1s 2.2s; }
.invite.show .arch path { animation: draw 2.6s var(--ease) .4s forwards; }
.invite.show .arch .a2 { animation-delay: .8s; }
.invite.show .arch .a3 { opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 30px; }
.names { display: flex; flex-direction: column; align-items: center; font-size: clamp(54px, 16vw, 70px); line-height: .95; }
.names .amp { font-size: .55em; color: var(--gold); margin: 6px 0; font-style: italic; }
.hero-date { display: flex; align-items: center; gap: 16px; font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.hero-date b { font-family: var(--serif); font-weight: 500; font-size: 46px; letter-spacing: .04em; line-height: 1; }
.hero-time { font-size: 13.5px; color: var(--muted); letter-spacing: .04em; }
.scroll-cue { position: absolute; bottom: 26px; left: 50%; width: 22px; height: 36px; margin-left: -11px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.scroll-cue i { position: absolute; left: 50%; top: 8px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }
/* Hero: konvert ochilgandan keyin ketma-ket paydo bo'ladi */
.h1, .h2, .h3, .h4, .h5 { opacity: 0; transform: translateY(18px); filter: blur(8px); }
.invite.show .h1, .invite.show .h2, .invite.show .h3, .invite.show .h4, .invite.show .h5 { animation: blurIn 1.4s var(--ease) forwards; }
.invite.show .h1 { animation-delay: .5s; }
.invite.show .h2 { animation-delay: .8s; }
.invite.show .h3 { animation-delay: 1.3s; }
.invite.show .h4 { animation-delay: 1.6s; }
.invite.show .h5 { animation-delay: 2.4s; }
@keyframes blurIn { to { opacity: 1; transform: none; filter: blur(0); } }

.block { padding: 64px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.block h3 { font-size: 40px; line-height: 1.12; }
.block h3 .foil { display: inline-block; }
.ornament { display: flex; align-items: center; gap: 14px; width: 170px; color: var(--gold); font-size: 12px; margin: 0 auto 10px; }
.ornament i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament i:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.text-block p { font-size: 16.5px; color: #cfc8b6; }
.text-block .lead { font-family: var(--serif); font-size: 30px; color: var(--ink); }
.text-block b { font-weight: 600; color: var(--gold-2); }
blockquote { margin: 12px 0 0; padding: 18px 8px 0; border-top: 1px solid var(--line); font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.4; color: var(--gold); }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.countdown div { position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.countdown svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.countdown circle { fill: none; stroke: rgba(212,176,106,.16); stroke-width: 1.5; }
.countdown circle.p { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 226.2; stroke-dashoffset: 226.2; transition: stroke-dashoffset .8s var(--ease); }
.countdown b { position: relative; font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1; }
.countdown span { position: relative; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.info { list-style: none; margin: 6px 0 0; padding: 0; width: 100%; display: grid; gap: 10px; text-align: left; }
.info li { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; font-weight: 500; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.info svg { width: 24px; height: 24px; color: var(--gold); }
.info small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.map-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 4px; }
.map-btns .btn { padding: 0 12px; font-size: 14px; }

.wishes .btn { margin-top: 4px; }
.wish-wrap { position: relative; width: 100%; }
.hearts { position: absolute; right: -14px; bottom: -6px; width: 56px; height: 300px; pointer-events: none; overflow: visible; z-index: 2; }
.heart { position: absolute; bottom: 0; left: 50%; width: 14px; height: 14px; opacity: 0; animation: float var(--t, 3.2s) ease-out forwards; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.heart svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }
@keyframes float {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.4); }
  12% { opacity: 1; transform: translate(calc(-50% + var(--x1, 0px)), -24px) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x2, 0px)), var(--h, -220px)) scale(.9) rotate(var(--r, 0deg)); }
}
.wish-list { width: 100%; display: grid; gap: 12px; margin-top: 18px; text-align: left; }
.wish { padding: 20px 20px 18px; border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); animation: fadeUp .7s var(--ease) both; }
.wish p { font-size: 15.5px; color: #d8d1bf; white-space: pre-line; overflow-wrap: anywhere; }
.wish b { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--gold-2); }
.wish b svg { width: 13px; height: 13px; fill: #e57f8a; stroke: none; }
.wish-empty { text-align: center; color: var(--muted); font-size: 14.5px; padding: 10px 0; }

.end { padding: 56px 0 24px; text-align: center; }
.end p { margin-top: 20px; font-family: var(--serif); font-size: 28px; }
.mono { margin-top: 14px; font-family: var(--serif); font-size: 24px; letter-spacing: .1em; color: var(--gold); }

/* Ko'ringanda paydo bo'lish (xira → tiniq) */
.r { opacity: 0; transform: translateY(22px); filter: blur(6px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); }
.r.in { opacity: 1; transform: none; filter: none; }

/* ---------- Tilak oynasi */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(4,8,7,.55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); opacity: 0; transition: opacity .3s; }
.modal.open { opacity: 1; }
.sheet { position: relative; width: min(480px, 100%); max-height: 92dvh; overflow: auto; display: grid; gap: 14px; padding: 30px 22px calc(26px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: linear-gradient(180deg, #17302a, #10201b); box-shadow: inset 0 1px 0 var(--line); transform: translateY(40px); transition: transform .35s var(--ease); }
.modal.open .sheet { transform: none; }
.sheet h3 { font-size: 34px; text-align: center; margin-bottom: 4px; color: var(--gold-2); }
.sheet label { display: grid; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sheet input, .sheet textarea { width: 100%; padding: 14px 16px; border: 0; border-radius: 14px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); font: 400 16px var(--sans); color: var(--ink); resize: vertical; letter-spacing: 0; text-transform: none; }
.sheet input:focus, .sheet textarea:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--gold); }
.close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.06); color: var(--ink); font-size: 15px; cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.note { min-height: 20px; text-align: center; font-size: 14.5px; }
.note.ok { color: #9fd3b4; }
.note.bad { color: #f0a493; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .r, .h1, .h2, .h3, .h4, .h5 { opacity: 1; transform: none; filter: none; }
  .arch path { stroke-dashoffset: 0; }
}
