/* ============================================================
   Dastur.Online — "Қыз ұзату" template
   Concept: Filigree & Candlelight — antique-silver jewelry reveal
   Palette derived from oxblood velvet saukele + silver бесжүзік +
   pearls + warm candlelit backlight.
   ============================================================ */

@font-face {
  font-family: "Ceremonious";
  src: url("assets/KZCeremoniousTwo.ttf") format("truetype");
  font-display: swap;
}

:root {
  --velvet-deep: #250c0a;
  --velvet: #43130f;
  --wine: #6c1f18;
  --gold: #c39a52;
  --gold-soft: #ddc188;
  --gold-line: rgba(196, 158, 92, 0.55);
  --silver: #bdb6a6;
  --ivory: #f5eede;
  --panel: rgba(246, 239, 224, 0.94);
  --panel-edge: rgba(151, 108, 52, 0.45);
  --ink: #402c20;
  --ink-soft: #6a5140;
  --serif: "Lora", "PT Serif", Georgia, "Times New Roman", serif;
  --script: "Ceremonious", "Lora", Georgia, serif;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --maxw: 580px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 0 160px;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--velvet-deep);
  line-height: 1.8;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Fixed background ---------- */
.fixed-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: url("assets/background-mobile.webp");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
.fixed-background::after {
  /* candlelight vignette for legibility, not a replacement gradient */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(115% 78% at 50% 30%, rgba(37,12,10,0) 42%, rgba(37,12,10,0.5) 100%),
    linear-gradient(180deg, rgba(37,12,10,0.26) 0%, rgba(37,12,10,0.04) 26%, rgba(37,12,10,0.2) 56%, rgba(37,12,10,0.72) 100%);
}
@media (min-width: 700px) {
  .fixed-background {
    background-image: url("assets/background-desktop.webp");
    background-position: center center;
  }
}

/* ---------- Layout shell ---------- */
.scroll {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

section { position: relative; }

/* ---------- Reveal system ---------- */
.reveal {
  transition: opacity 1.1s cubic-bezier(.22,.61,.36,1),
              transform 1.1s cubic-bezier(.22,.61,.36,1),
              box-shadow 1.4s ease;
}
html.anim .reveal { opacity: 0; transform: translateY(30px); will-change: opacity, transform; }
html.anim .reveal.in { opacity: 1; transform: none; }

.glow-in { box-shadow: 0 0 0 rgba(221,193,136,0); }
.glow-in.in {
  animation: candleBloom 2.2s ease-out forwards;
}
@keyframes candleBloom {
  0%   { box-shadow: 0 0 0px rgba(221,193,136,0), 0 20px 50px rgba(0,0,0,.35); }
  45%  { box-shadow: 0 0 46px rgba(221,193,136,.42), 0 20px 50px rgba(0,0,0,.35); }
  100% { box-shadow: 0 0 16px rgba(221,193,136,.14), 0 20px 50px rgba(0,0,0,.35); }
}

/* ---------- Ornamental medallion (SVG stroke-draw) ---------- */
.medallion { display: block; margin: 0 auto; }
.medallion path, .medallion circle, .medallion line, .medallion polygon {
  stroke-dasharray: var(--len, 400);
  transition: stroke-dashoffset 1.8s ease 0.15s;
}
html.anim .medallion path,
html.anim .medallion circle,
html.anim .medallion line,
html.anim .medallion polygon { stroke-dashoffset: var(--len, 400); }
html.anim .reveal.in .medallion path,
html.anim .reveal.in .medallion circle,
html.anim .reveal.in .medallion line,
html.anim .reveal.in .medallion polygon { stroke-dashoffset: 0; }

/* ---------- Filigree separator ---------- */
.sep {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px auto;
  width: 100%;
  max-width: 300px;
}
.sep .rule {
  height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold-line) 60%, var(--gold));
}
.sep .rule.rev { background: linear-gradient(270deg, transparent, var(--gold-line) 60%, var(--gold)); }
.sep .lozenge {
  width: 9px; height: 9px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  position: relative;
  flex: 0 0 auto;
}
.sep .lozenge::after {
  content: ""; position: absolute; inset: 2.5px;
  background: var(--gold); opacity: .55;
}
.sep .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }

/* ---------- Panel (jewelry-box surface) ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border-radius: 0;
  padding: 44px 30px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
}
.panel::before {
  content: ""; position: absolute; inset: 10px;
  border: 1.5px solid var(--panel-edge);
  pointer-events: none;
}
.panel::after {
  content: ""; position: absolute; inset: 15px;
  border: 1px solid rgba(151,108,52,0.22);
  pointer-events: none;
}
/* corner jewels */
.corner {
  position: absolute; width: 8px; height: 8px; z-index: 3;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 0 3px var(--panel), 0 0 0 4px rgba(151,108,52,.4);
}
.corner.tl { top: 12px; left: 12px; }
.corner.tr { top: 12px; right: 12px; }
.corner.bl { bottom: 12px; left: 12px; }
.corner.br { bottom: 12px; right: 12px; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: .72rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--wine);
  font-weight: 600;
  margin: 0 0 4px;
  padding-left: .42em;
}
.eyebrow.on-dark { color: var(--gold-soft); }
.heading {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: .02em;
  color: var(--wine);
  margin: 0;
}
.script {
  font-family: var(--script);
  font-weight: 400;
  line-height: 1.05;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 0 60px;
  position: relative;
}
.hero-glow {
  position: absolute;
  top: 34%; left: 50%;
  width: 78vw; max-width: 520px; aspect-ratio: 1;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(221,193,136,.30) 0%, rgba(221,193,136,.08) 40%, transparent 68%);
  z-index: -1;
  animation: flicker 6s ease-in-out infinite;
}
@keyframes flicker {
  0%,100% { opacity: .85; transform: translate(-50%,-50%) scale(1); }
  50%     { opacity: 1;   transform: translate(-50%,-50%) scale(1.06); }
}
.hero .eyebrow { color: var(--gold-soft); text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.hero-occasion {
  font-family: var(--display);
  font-weight: 500;
  color: var(--ivory);
  font-size: clamp(2.6rem, 12vw, 4.4rem);
  letter-spacing: .07em;
  text-transform: uppercase;
  margin: 6px 0 6px;
  text-shadow: 0 2px 22px rgba(0,0,0,.55), 0 0 40px rgba(221,193,136,.2);
  line-height: 1.05;
}
.hero-names {
  font-family: var(--script);
  color: var(--gold-soft);
  font-size: clamp(2rem, 9vw, 3.2rem);
  margin: 10px 0 0;
  text-shadow: 0 2px 18px rgba(0,0,0,.6);
}
.hero-amp { display: inline-block; color: var(--ivory); opacity: .8; font-size: .7em; margin: 0 .12em; vertical-align: middle; }
.hero-datetime {
  margin-top: 26px;
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 1.02rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0,0,0,.7);
}
.hero-datetime .vr { width: 1px; height: 30px; background: var(--gold-line); }
.hero-datetime b { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.24rem; letter-spacing: .06em; color: var(--gold-soft); }
.hero-datetime span { display: block; font-size: .66rem; letter-spacing: .3em; opacity: .75; margin-top: 3px; }
.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: var(--gold-soft); font-size: .62rem; letter-spacing: .36em; text-transform: uppercase; opacity: .7;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-cue .line { width: 1px; height: 34px; background: linear-gradient(var(--gold-soft), transparent); animation: cueMove 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes cueMove { 0%,100%{ transform: scaleY(.4); opacity:.4 } 50%{ transform: scaleY(1); opacity:1 } }

/* ============================================================
   Section spacing
   ============================================================ */
.block { padding: 46px 0; }
.block-head { text-align: center; margin-bottom: 26px; }
.block-head .medallion { margin-bottom: 12px; }
.block-head .heading { color: var(--ivory); text-shadow: 0 1px 3px rgba(0,0,0,.55); margin-top: 2px; }
.medallion-lg { width: 60px; height: 60px; }
.ornament { display: block; margin: 0 auto; overflow: visible; }
.block-head .ornament { margin-bottom: 8px; }

/* invitation text */
.invitation .panel { text-align: center; }
.invitation p { margin: 0 0 1.05em; color: var(--ink); font-size: 1.04rem; }
.invitation p:last-child { margin-bottom: 0; }
.invitation .lead { font-family: var(--serif); font-weight: 700; font-size: 1.06rem; letter-spacing: .05em; color: var(--wine); line-height: 1.5; margin-bottom: 1em; }

/* hosts */
.hosts { text-align: center; }
.hosts .panel { padding: 34px 28px; }
.hosts-label { font-size: .74rem; letter-spacing: .34em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 12px; }
.hosts-names { font-family: var(--script); font-size: clamp(1.7rem, 7vw, 2.4rem); color: var(--wine); line-height: 1.15; }

/* ============================================================
   TIMELINE — "Бағдарлама"
   ============================================================ */
.timeline .panel { padding: 40px 26px 44px; }
.tl-list { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.tl-list::before {
  content: ""; position: absolute; left: 27px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(var(--gold-line), var(--gold-line));
}
.tl-item {
  position: relative; padding: 0 0 30px 66px; min-height: 46px;
  transition: opacity .8s ease, transform .8s ease;
}
html.anim .tl-item { opacity: 0; transform: translateX(-16px); }
.tl-item:last-child { padding-bottom: 0; }
html.anim .timeline .in .tl-item { opacity: 1; transform: none; }
.tl-node {
  position: absolute; left: 12px; top: 0;
  width: 32px; height: 32px;
}
.tl-item .tl-time {
  font-family: var(--serif); font-weight: 700; color: var(--wine);
  font-size: 1.06rem; letter-spacing: .04em; line-height: 1.1;
}
.tl-item .tl-title { color: var(--ink); font-size: 1.0rem; margin-top: 2px; }

/* ============================================================
   PHOTO — "Фотосурет"
   ============================================================ */
.photo .frame {
  position: relative;
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 22px 55px rgba(0,0,0,.4);
  border-radius: 0;
}
.photo .frame::before {
  content: ""; position: absolute; inset: 10px; border: 1.5px solid var(--panel-edge); z-index: 3; pointer-events: none;
}
.photo .frame::after {
  content: ""; position: absolute; inset: 14px; border: 1px solid rgba(151,108,52,0.22); z-index: 3; pointer-events: none;
}
.photo .frame .corner { z-index: 4; }
.photo .img-wrap { position: relative; overflow: hidden; border-radius: 2px; }
.photo img {
  display: block; width: 100%; height: auto;
  filter: saturate(.92) contrast(1.02);
  transition: transform 1.8s ease, filter 1.8s ease;
}
html.anim .photo img { transform: scale(1.06); }
html.anim .photo .reveal.in img { transform: scale(1); }
.photo .veil {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(37,12,10,.15), rgba(37,12,10,.02));
  opacity: 0; transition: opacity 1.8s ease;
}
html.anim .photo .veil { opacity: 1; }
html.anim .photo .reveal.in .veil { opacity: 0; }
.photo .caption {
  text-align: center; margin-top: 16px; font-family: var(--script);
  font-size: 1.4rem; color: var(--gold-soft); text-shadow: 0 1px 10px rgba(0,0,0,.5);
}

/* ============================================================
   VENUE — "Мекен-жай"
   ============================================================ */
.venue { text-align: center; }
.venue .panel { padding: 40px 28px; }
.venue-hall { font-family: var(--script); font-size: clamp(1.9rem, 8vw, 2.6rem); color: var(--wine); line-height: 1.12; margin: 6px 0 10px; }
.venue-addr { color: var(--ink); font-size: 1.04rem; margin: 2px 0; }
.venue-city { color: var(--ink-soft); font-size: .82rem; letter-spacing: .26em; text-transform: uppercase; margin-top: 8px; }
.map-btn {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 24px; padding: 14px 30px; min-height: 48px;
  border: 1px solid var(--gold);
  background: transparent; color: var(--wine);
  font-family: var(--serif); font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 600;
  text-decoration: none; border-radius: 2px; white-space: nowrap;
  transition: background .4s ease, color .4s ease, box-shadow .4s ease;
  position: relative;
}
.map-btn::before, .map-btn::after {
  content: ""; position: absolute; width: 6px; height: 6px; border: 1px solid var(--gold); opacity: .6;
}
.map-btn::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.map-btn::after  { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }
.map-btn:hover, .map-btn:focus-visible {
  background: var(--wine); color: var(--ivory); box-shadow: 0 8px 24px rgba(108,31,24,.4); outline: none;
}
.map-btn svg { width: 15px; height: 15px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { text-align: center; padding: 56px 0 20px; }
.footer .medallion { margin-bottom: 18px; }
.footer .fnote { font-family: var(--script); font-size: 1.9rem; color: var(--gold-soft); text-shadow: 0 2px 16px rgba(0,0,0,.6); line-height: 1.1; }
.footer .fsub { color: var(--ivory); opacity: .7; font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; margin-top: 12px; }

/* ============================================================
   AUDIO PLAYER (floating)
   ============================================================ */
.audio-fab {
  position: fixed; right: 16px; bottom: 96px; z-index: 40;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(37,12,10,.82); color: var(--gold-soft);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(4px);
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.audio-fab.show { display: flex; }
.audio-fab svg { width: 22px; height: 22px; }
.audio-fab .ring {
  position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--gold-soft); opacity: 0;
}
.audio-fab.playing .ring { animation: pulseRing 1.8s ease-out infinite; }
@keyframes pulseRing { 0%{ transform: scale(1); opacity:.5 } 100%{ transform: scale(1.5); opacity:0 } }

/* ============================================================
   Responsive up-scaling
   ============================================================ */
@media (min-width: 700px) {
  :root { --maxw: 640px; }
  .panel { padding: 52px 46px; }
  .block { padding: 60px 0; }
  .invitation p { font-size: 1.1rem; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal, .tl-item, .photo img, .photo .veil { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .tl-item { opacity: 1; transform: none; }
  .photo img { transform: none; }
  .glow-in.in { animation: none; }
  .medallion path, .medallion circle, .medallion line, .medallion polygon { stroke-dashoffset: 0 !important; transition: none; }
  .hero-glow, .flicker, .scroll-cue .line, .audio-fab .ring { animation: none !important; }
}
