/* =========================================================
   "Nur" — nikoh to'yi taklifnomasi · Tabrikon.uz
   Zamonaviy premium: fil suyagi, siyoh, oltin chiziq
   ========================================================= */

:root {
  --ivory: #f7f3ec;
  --paper: #fbf8f3;
  --ink: #1f1c19;
  --ink-2: #4a443d;
  --muted: #6b6358;
  --gold: #a9844c;
  --gold-2: #d2b98a;
  --gold-ink: #84642f;   /* gold for small text: 4.8:1 on ivory */
  --line: rgba(169, 132, 76, .32);
  --line-soft: rgba(31, 28, 25, .1);

  --f-display: 'Cormorant Garamond', Georgia, serif;
  --f-sans: 'Jost', system-ui, sans-serif;
  --f-arabic: 'Amiri', 'Traditional Arabic', serif;

  --ease: cubic-bezier(.22, .78, .2, 1);
  --col: 560px;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .33 0 0 0 0 .22 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--ivory) var(--grain);
  color: var(--ink);
  font-family: var(--f-sans);
  font-weight: 300;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@supports (overflow: clip) { html, body { overflow-x: clip; } }
body.is-locked { overflow: hidden; height: 100dvh; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ol, ul { list-style: none; }
[hidden] { display: none !important; }

/* star symbol strokes */
svg use[href="#star"], svg use { fill: none; stroke: currentColor; }
#star rect, #star circle { fill: none; stroke: currentColor; stroke-width: 1.4; vector-effect: non-scaling-stroke; }

/* floating gold dust */
.dust { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* =========================================================
   GATE (intro with doors)
   ========================================================= */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  text-align: center;
  padding: 24px;
}
.door {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background: var(--paper) var(--grain);
  transition: transform 1.6s cubic-bezier(.7, 0, .2, 1);
  will-change: transform;
}
.door::after { /* seam: fades out behind the text */
  content: ''; position: absolute; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(var(--line) 0 18%, transparent 30% 78%, var(--line) 90%);
}
.door-l { left: 0; }
.door-l::after { right: 0; }
.door-r { right: 0; }
.door-r::after { left: 0; }
.door-line {
  position: absolute; top: 24px; bottom: 24px;
  border: 1px solid var(--line);
}
.door-l .door-line { left: 24px; right: 0; border-right: 0; }
.door-r .door-line { right: 24px; left: 0; border-left: 0; }

.gate-inner {
  position: relative; z-index: 2;
  max-width: 420px;
  transition: opacity .7s ease, transform .9s var(--ease);
}
.gate-star {
  width: 92px; height: 92px; color: var(--gold);
  margin: 0 auto 18px; display: block;
  animation: spin 60s linear infinite;
}
.draw rect, .draw circle { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s var(--ease) forwards; }
.draw rect:nth-child(2) { animation-delay: .35s; }
.draw circle { animation-delay: .8s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.bismillah {
  font-family: var(--f-arabic);
  font-size: 1.55rem; line-height: 1.6;
  color: var(--gold);
  opacity: 0; animation: fade-up 1.1s var(--ease) .6s forwards;
}
.kicker {
  margin-top: 18px;
  font-size: .72rem; font-weight: 400; letter-spacing: .42em; text-transform: uppercase;
  color: var(--muted);
  opacity: 0; animation: fade-up 1.1s var(--ease) .85s forwards;
}
.gate-names {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(2.6rem, 12vw, 3.6rem);
  line-height: 1.05;
  margin: 14px 0 10px;
  display: flex; flex-direction: column; align-items: center;
  opacity: 0; animation: fade-up 1.3s var(--ease) 1.05s forwards;
}
.gate-names i, .names .amp, .final-names i {
  font-style: italic; font-weight: 300;
  color: var(--gold);
  font-size: .6em;
}
.gate-date {
  font-size: .78rem; letter-spacing: .5em; color: var(--ink-2);
  padding-left: .5em;
  opacity: 0; animation: fade-up 1.1s var(--ease) 1.3s forwards;
}
.gate-guest {
  margin-top: 16px;
  font-family: var(--f-display); font-style: italic; font-size: 1.15rem; color: var(--ink-2);
  opacity: 0; animation: fade-up 1.1s var(--ease) 1.45s forwards;
}
.btn-open {
  position: relative;
  margin-top: 30px;
  padding: 15px 34px;
  border: 1px solid var(--gold);
  font-size: .7rem; font-weight: 400; letter-spacing: .32em; text-transform: uppercase;
  color: var(--ink);
  overflow: hidden;
  opacity: 0; animation: fade-up 1.1s var(--ease) 1.6s forwards;
  isolation: isolate;
  transition: color .5s var(--ease);
}
.btn-open::before {
  content: ''; position: absolute; inset: 0;
  background: var(--ink);
  transform: scaleX(0); transform-origin: right;
  transition: transform .6s var(--ease);
  z-index: -1;
}
.btn-open:hover { color: var(--paper); }
.btn-open:hover::before { transform: scaleX(1); transform-origin: left; }
.btn-open span { position: relative; }
.btn-open::after { /* soft breathing glow */
  content: ''; position: absolute; inset: -1px;
  border: 1px solid var(--gold-2);
  animation: breathe 2.6s ease-in-out 2.4s infinite;
  pointer-events: none;
}
@keyframes breathe { 0%, 100% { opacity: 0; transform: scale(1); } 50% { opacity: .9; transform: scale(1.06, 1.18); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* opening */
.gate.is-open .gate-inner { opacity: 0; transform: scale(.96); }
.gate.is-open .door-l { transform: translateX(-101%); transition-delay: .35s; }
.gate.is-open .door-r { transform: translateX(101%); transition-delay: .35s; }
.gate.is-gone { visibility: hidden; pointer-events: none; }

/* =========================================================
   PAGE
   ========================================================= */
.page {
  position: relative; z-index: 2;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 24px;
}
.sec { padding: 72px 0; text-align: center; position: relative; }
.sec + .sec::before { /* hairline separator */
  content: ''; position: absolute; top: 0; left: 50%;
  width: 1px; height: 44px; margin-top: -22px;
  background: linear-gradient(var(--line), transparent);
}

.label {
  font-size: .72rem; font-weight: 400; letter-spacing: .42em; text-transform: uppercase;
  color: var(--gold-ink);
  padding-left: .42em;
}
.title {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(1.9rem, 7.5vw, 2.5rem);
  line-height: 1.15;
  margin-top: 12px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px;
  font-size: .72rem; font-weight: 400; letter-spacing: .28em; text-transform: uppercase;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s;
}
.btn-solid { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-solid:hover { background: transparent; color: var(--ink); }
.btn-line { border: 1px solid var(--gold); color: var(--ink); }
.btn-line:hover { background: var(--gold-ink); border-color: var(--gold-ink); color: var(--paper); }
.btn.wide { width: 100%; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* ---------- hero ---------- */
.hero {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-top: 90px; padding-bottom: 110px;
}
.ornament { position: absolute; width: 150px; height: 150px; color: var(--gold); opacity: .22; pointer-events: none; }
.ornament svg { width: 100%; height: 100%; animation: spin 90s linear infinite; }
.ornament-tl { top: 40px; left: -70px; }
.ornament-br { bottom: 40px; right: -70px; }
.ornament-br svg { animation-direction: reverse; }

.names {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(3.4rem, 17vw, 5.4rem);
  line-height: 1;
  margin: 22px 0 18px;
  display: flex; flex-direction: column; align-items: center;
}
.names .name { display: block; overflow: hidden; padding: .06em .1em .12em; }
.names .rise { display: inline-block; transform: translateY(105%); transition: transform 1.4s var(--ease); }
.names .name:last-child .rise { transition-delay: .25s; }
.hero.is-in .names .rise { transform: none; }
.names .amp { margin: -.05em 0 -.08em; font-size: .5em; }

.rule { display: flex; align-items: center; gap: 14px; width: min(260px, 70%); color: var(--gold); }
.rule span { flex: 1; height: 1px; background: var(--line); transform: scaleX(0); transition: transform 1.4s var(--ease) .4s; }
.rule span:first-child { transform-origin: right; }
.rule span:last-child { transform-origin: left; }
.rule.is-in span { transform: scaleX(1); }
.rule-star { width: 22px; height: 22px; flex-shrink: 0; }

.hero-date {
  margin-top: 20px;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  font-size: .72rem; letter-spacing: .38em; text-transform: uppercase; color: var(--muted);
}
.hero-date b {
  font-family: var(--f-display); font-weight: 400; font-size: 1.7rem;
  letter-spacing: .04em; text-transform: none; color: var(--ink);
}
.scroll-hint {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 54px; background: var(--line-soft); overflow: hidden;
}
.scroll-hint span {
  position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
  background: var(--gold);
  animation: drip 2.2s var(--ease) infinite;
}
@keyframes drip { to { top: 110%; } }

/* ---------- ayah ---------- */
.ayah-ar { font-family: var(--f-arabic); font-size: clamp(1.9rem, 8vw, 2.5rem); color: var(--gold); line-height: 1.6; }
.ayah-uz { font-family: var(--f-display); font-style: italic; font-size: 1.45rem; line-height: 1.4; margin-top: 10px; }
.ayah-ref { font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-top: 14px; }

/* ---------- letter ---------- */
.letter-guest { font-family: var(--f-display); font-style: italic; font-size: 1.9rem; margin-top: 10px; text-transform: none; }
.letter-text {
  font-family: var(--f-display); font-size: 1.22rem; line-height: 1.75; color: var(--ink-2);
  max-width: 440px; margin: 20px auto 0;
}
.letter-text b { font-weight: 500; color: var(--ink); }
.families { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 34px; }
.families div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.families small { font-size: .72rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-ink); }
.families span { font-family: var(--f-display); font-size: 1.25rem; }
.families i { width: 1px; height: 46px; background: var(--line); flex-shrink: 0; }

/* ---------- calendar + countdown ---------- */
.calendar {
  margin: 26px auto 0;
  max-width: 360px;
  padding: 26px 22px 20px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 243, .6);
}
.cal-month { font-family: var(--f-display); font-size: 1.6rem; margin-bottom: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head span { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-bottom: 10px; }
.cal-days span {
  position: relative;
  height: 38px; display: grid; place-items: center;
  font-size: .86rem; color: var(--ink-2);
  opacity: 0; transform: translateY(6px);
  transition: opacity .5s ease, transform .6s var(--ease);
  transition-delay: calc(var(--i) * 18ms);
}
.calendar.is-in .cal-days span { opacity: 1; transform: none; }
.cal-days span.is-day { color: var(--ink); font-weight: 500; }
.cal-days .ring {
  position: absolute; inset: 1px; margin: auto;
  width: 36px; height: 36px; overflow: visible;
  color: var(--gold);
}
.cal-days .ring circle {
  fill: none; stroke: currentColor; stroke-width: 1.2;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transform: rotate(-90deg); transform-origin: center;
  transition: stroke-dashoffset 1.6s var(--ease) 1s;
}
.calendar.is-in .ring circle { stroke-dashoffset: 0; }

.countdown { display: flex; justify-content: center; gap: 0; margin: 34px auto 26px; max-width: 380px; }
.countdown div { flex: 1; padding: 0 6px; position: relative; }
.countdown div + div::before { content: ''; position: absolute; left: 0; top: 14%; height: 56%; width: 1px; background: var(--line); }
.countdown b {
  display: block;
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(2rem, 9vw, 2.6rem); line-height: 1.1;
}
.countdown b.tick { animation: tick .5s var(--ease); }
@keyframes tick { from { opacity: .2; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.countdown small { font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.cd-done { font-family: var(--f-display); font-style: italic; font-size: 1.6rem; color: var(--gold); margin: 26px 0; }

/* ---------- timeline ---------- */
.timeline { position: relative; max-width: 400px; margin: 34px auto 0; text-align: left; }
.tl-line { position: absolute; left: 76px; top: 8px; bottom: 8px; width: 1px; background: var(--line-soft); }
.tl-line i { position: absolute; inset: 0; background: var(--gold); transform-origin: top; transform: scaleY(0); }
.timeline li {
  position: relative;
  display: grid; grid-template-columns: 76px 1fr; align-items: baseline;
  padding: 14px 0;
  opacity: .55; transition: opacity .6s ease;
}
.timeline li.on { opacity: 1; }
.timeline time { font-family: var(--f-display); font-size: 1.35rem; color: var(--gold-ink); padding-right: 20px; text-align: right; }
.timeline li::after {
  content: ''; position: absolute; left: 72px; top: 50%;
  width: 9px; height: 9px; margin-top: -4px;
  background: var(--ivory); border: 1px solid var(--gold);
  transform: rotate(45deg);
  transition: background .5s;
}
.timeline li.on::after { background: var(--gold); }
.tl-text { padding-left: 24px; }
.tl-text b { display: block; font-family: var(--f-display); font-weight: 500; font-size: 1.25rem; }
.tl-text small { font-size: .85rem; color: var(--muted); line-height: 1.5; }

/* ---------- venue ---------- */
.venue-addr { font-size: .88rem; line-height: 1.6; color: var(--muted); margin: 10px auto 0; max-width: 340px; }
.venue-frame { margin: 30px auto 0; max-width: 340px; color: var(--gold); }
.arch { width: 100%; height: auto; display: block; }
.arch path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.4s var(--ease); }
.arch path:nth-child(2) { transition-delay: .3s; }
.arch path:nth-child(3), .arch path:nth-child(4) { transition-delay: .7s; }
.venue-frame.is-in .arch path { stroke-dashoffset: 0; }
.arch-star { opacity: 0; transition: opacity 1.2s ease 1.4s; }
.venue-frame.is-in .arch-star { opacity: 1; }

/* ---------- dress ---------- */
.dress-text { font-family: var(--f-display); font-size: 1.18rem; line-height: 1.7; color: var(--ink-2); max-width: 420px; margin: 16px auto 0; }
.palette { display: flex; justify-content: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.palette li {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: 56px;
  font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); line-height: 1.3; text-align: center;
}
.palette span {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 0 0 4px var(--ivory), 0 0 0 5px var(--line);
  transform: scale(0); transition: transform .8s var(--ease);
}
.palette.is-in span { transform: scale(1); }
.palette li:nth-child(2) span { transition-delay: .1s; }
.palette li:nth-child(3) span { transition-delay: .2s; }
.palette li:nth-child(4) span { transition-delay: .3s; }
.palette li:nth-child(5) span { transition-delay: .4s; }

/* ---------- rsvp ---------- */
.rsvp-note { font-family: var(--f-display); font-size: 1.12rem; color: var(--muted); margin-top: 10px; }
.rsvp-note b { font-weight: 500; color: var(--ink); }
.rsvp-form { max-width: 400px; margin: 30px auto 0; display: grid; gap: 18px; text-align: left; }
.field span { display: block; font-size: .72rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 10px 0;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  font-family: var(--f-display); font-size: 1.25rem; color: var(--ink);
  outline: none; border-radius: 0;
  transition: border-color .3s;
}
.field input::placeholder { color: rgba(31,28,25,.32); }
.field input:focus, .field select:focus { border-color: var(--gold); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip {
  padding: 13px 8px;
  border: 1px solid var(--line);
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  transition: background .35s, color .35s, border-color .35s;
}
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--gold-ink); border-color: var(--gold-ink); color: var(--paper); }
.rsvp-msg { min-height: 1.5em; font-family: var(--f-display); font-style: italic; font-size: 1.15rem; text-align: center; color: var(--ink-2); }
.rsvp-msg.show { animation: fade-up .7s var(--ease); }

/* ---------- final ---------- */
.final { padding-bottom: 90px; }
.final-star { width: 70px; height: 70px; color: var(--gold); display: block; margin: 0 auto 22px; animation: spin 40s linear infinite; }
.final-dua { font-family: var(--f-display); font-style: italic; font-size: 1.6rem; color: var(--ink-2); }
.final-names { font-family: var(--f-display); font-weight: 300; font-size: clamp(2.2rem, 10vw, 3rem); margin: 8px 0 14px; }
.credit { margin-top: 40px; font-size: .72rem; letter-spacing: .4em; text-transform: uppercase; color: var(--muted); }

/* ---------- music + toast ---------- */
.music {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(251, 248, 243, .85);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  opacity: 0; transform: scale(.8); pointer-events: none;
  transition: opacity .5s, transform .5s var(--ease);
}
body:not(.is-locked) .music { opacity: 1; transform: none; pointer-events: auto; }
.music .bars { display: flex; align-items: flex-end; gap: 3px; height: 14px; }
.music .bars i { width: 2px; height: 3px; background: var(--gold); }
.music.playing .bars i { animation: eq .9s ease-in-out infinite; }
.music.playing .bars i:nth-child(2) { animation-delay: -.3s; }
.music.playing .bars i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 50% { height: 14px; } }

.toast {
  position: fixed; left: 50%; bottom: 80px; z-index: 60;
  transform: translate(-50%, 16px);
  background: var(--ink); color: var(--paper);
  padding: 12px 20px;
  font-size: .78rem; letter-spacing: .04em;
  opacity: 0; pointer-events: none;
  transition: opacity .35s, transform .35s var(--ease);
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   REVEAL
   ========================================================= */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1.1s ease, transform 1.2s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (min-width: 900px) {
  .page { padding: 0 40px; }
  .ornament { width: 260px; height: 260px; }
  .ornament-tl { left: -230px; top: 80px; }
  .ornament-br { right: -230px; bottom: 80px; }
}
@media (max-width: 380px) {
  .page { padding: 0 18px; }
  .sec { padding: 60px 0; }
  .families { gap: 14px; }
  .families span { font-size: 1.1rem; }
  .timeline li { grid-template-columns: 64px 1fr; }
  .tl-line { left: 64px; }
  .timeline li::after { left: 60px; }
  .timeline time { font-size: 1.2rem; padding-right: 16px; }
  .tl-text { padding-left: 20px; }
  .palette { gap: 6px; }
  .palette li { width: 52px; }
  .palette span { width: 40px; height: 40px; }
  .door-line { top: 16px; bottom: 16px; }
  .door-l .door-line { left: 16px; }
  .door-r .door-line { right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .reveal, .names .rise { opacity: 1 !important; transform: none !important; }
}
