/* ============================================================
   Dastur.Online — Мерейтой (70 жас) invitation template
   Concept: "Kiіз үй дастарханы" — a warm ornamental scroll.
   Sections reveal like embroidered panels on parchment.
   ============================================================ */

/* ---------- Fonts (local, from assets) ---------- */
@font-face {
  font-family: "Cera Round Pro";
  src: url("assets/fonts/CeraRoundPro-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cera Round Pro";
  src: url("assets/fonts/CeraRoundPro-Thin.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens (extracted from the reference artwork) ---------- */
:root {
  --cream:      #f4ecda;   /* parchment / felt */
  --cream-deep: #ece0c6;
  --panel:      #fbf6ea;   /* card surface */
  --navy:       #1b2447;   /* chapan indigo */
  --navy-soft:  #2c3560;
  --ink:        #33291b;   /* warm text */
  --ink-soft:   #6a5c45;
  --gold:       #b0842f;   /* ornament gold */
  --gold-2:     #c9a24f;
  --gold-soft:  #e4d0a1;
  --terra:      #9c3a28;   /* carpet red */
  --terra-2:    #b8492f;

  --maxw: 620px;

  --f-display: "Cera Round Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-body:    "Cera Round Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

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

body {
  font-family: var(--f-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  overflow-x: hidden;
  padding-bottom: 160px;               /* room for injected RSVP / pay bar */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

/* ============================================================
   Fixed ornamental background (no photographic bg supplied)
   ============================================================ */
.fixed-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: var(--cream);
  background-image:
    radial-gradient(120% 90% at 50% -10%, #f8f1e2 0%, var(--cream) 45%, var(--cream-deep) 100%);
}
/* faint woven-felt texture */
.fixed-background::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg,  rgba(155,58,40,.035) 0 2px, transparent 2px 12px),
    repeating-linear-gradient(-45deg, rgba(27,36,71,.03)  0 2px, transparent 2px 12px);
  opacity: .6;
}
/* faint horizontal ornament watermark behind the hero */
.fixed-background::after {
  content: "";
  position: absolute;
  left: 50%; top: 96px;
  width: min(560px, 84%); aspect-ratio: 484/137;
  transform: translateX(-50%);
  background: url("assets/ornaments/h3.svg") center/contain no-repeat;
  opacity: .05;
}

@media (min-width: 600px) {
  .fixed-background::after { top: 120px; }
}

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

section {
  padding: 56px 0;
}

/* ---------- Ornament helper (mask = recolourable) ---------- */
.orn {
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.orn--h3   { width: min(230px, 62%); aspect-ratio: 484/137; margin: 0 auto; }
.orn--h4   { width: min(300px, 78%); aspect-ratio: 472/133; margin: 0 auto; }
.orn--round{ width: 46px; aspect-ratio: 1; }
.h3 { background-image: url("assets/ornaments/h3.svg"); }
.h4 { background-image: url("assets/ornaments/h4.svg"); }
.rnd{ background-image: url("assets/ornaments/round.svg"); background-repeat: no-repeat; background-position: center; background-size: contain; }

/* small gold rule with centre medallion */
.rule {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin: 22px auto; width: min(320px, 86%);
}
.rule::before, .rule::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold) 60%);
}
.rule::after { transform: scaleX(-1); }
.rule .rnd { width: 28px; height: 28px; flex: 0 0 auto; }

/* eyebrow / label */
.eyebrow {
  font-weight: 300;
  font-size: 13px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--gold);
  text-indent: .42em;
}

.section-title {
  font-weight: 300;
  font-size: 15px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--terra);
  text-align: center;
  text-indent: .34em;
  margin-bottom: 4px;
}

.sec-head { text-align: center; }
.sec-head .flourish { width: min(184px, 62%); aspect-ratio: 472/133; margin: 12px auto 0; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 84px 0 64px;
  gap: 4px;
}
.hero .orn--h3 { margin-bottom: 26px; }

.hero__eyebrow { margin-bottom: 26px; }

.hero__name {
  font-weight: 100;
  font-size: clamp(40px, 12vw, 74px);
  line-height: 1.02;
  letter-spacing: .01em;
  color: var(--navy);
  margin: 6px 0 4px;
}

/* age medallion */
.badge {
  position: relative;
  width: 168px; height: 168px;
  margin: 30px auto 8px;
  display: grid;
  place-items: center;
}
.badge__ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid var(--gold);
  box-shadow: 0 0 0 6px var(--panel), 0 0 0 7px rgba(176,132,47,.35),
              0 22px 44px -26px rgba(27,36,71,.5);
}
.badge__ring--inner {
  inset: 12px;
  border-style: dashed;
  border-color: rgba(176,132,47,.55);
  box-shadow: none;
}
.badge__val { display: flex; flex-direction: column; align-items: center; }
.badge__num {
  font-weight: 100;
  font-size: 72px;
  line-height: 1;
  color: var(--terra);
  letter-spacing: .01em;
}
.badge__unit {
  font-weight: 300;
  font-size: 12px;
  letter-spacing: .5em;
  text-indent: .5em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 4px;
}
.badge .rnd {
  position: absolute; width: 20px; height: 20px;
}
.badge .rnd.t { top: -4px;  left: 50%; transform: translateX(-50%); }
.badge .rnd.b { bottom: -4px; left: 50%; transform: translateX(-50%); }
.badge .rnd.l { left: -4px; top: 50%; transform: translateY(-50%); }
.badge .rnd.r { right: -4px; top: 50%; transform: translateY(-50%); }

.hero__when {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; margin-top: 22px;
  font-weight: 300;
}
.hero__date { font-size: 20px; color: var(--ink); letter-spacing: .02em; }
.hero__time { font-size: 20px; color: var(--ink); letter-spacing: .1em; }
.hero__when .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

.scroll-cue {
  margin-top: 40px;
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-cue span.arrow {
  width: 1px; height: 34px;
  background: linear-gradient(var(--gold), transparent);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { 0%,100%{ transform: scaleY(.5); opacity:.4 } 50%{ transform: scaleY(1); opacity:1 } }

/* ============================================================
   PANEL (shared card)
   ============================================================ */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(176,132,47,.4);
  border-radius: 3px;
  padding: 46px 30px;
  text-align: center;
  box-shadow: 0 30px 60px -40px rgba(27,36,71,.45);
}
.panel::before {
  content: "";
  position: absolute; inset: 7px;
  border: 1px solid rgba(176,132,47,.28);
  border-radius: 2px;
  pointer-events: none;
}
/* corner medallions */
.panel .corner {
  position: absolute; width: 22px; height: 22px;
  background: url("assets/ornaments/round.svg") center/contain no-repeat;
  opacity: .8;
}
.panel .corner.tl { top: -11px; left: -11px; }
.panel .corner.tr { top: -11px; right: -11px; }
.panel .corner.bl { bottom: -11px; left: -11px; }
.panel .corner.br { bottom: -11px; right: -11px; }

/* ---------- Invitation text ---------- */
.invite__text {
  font-weight: 300;
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  white-space: pre-line;
  max-width: 46ch;
  margin: 0 auto;
  text-wrap: pretty;
}
.invite__lead {
  font-weight: 300;
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 20px;
}

/* ---------- Hosts ---------- */
.hosts { text-align: center; }
.hosts__label {
  font-size: 14px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px;
}
.hosts__names {
  font-weight: 100;
  font-size: clamp(24px, 7vw, 34px);
  color: var(--navy);
  line-height: 1.4;
}

/* ============================================================
   TIMELINE — Бағдарлама
   ============================================================ */
.timeline { position: relative; margin-top: 34px; padding-left: 6px; }
.timeline::before {
  content: "";
  position: absolute; left: 21px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(var(--gold-soft), var(--gold), var(--gold-soft));
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: baseline;
  gap: 18px;
  padding: 16px 0;
}
.tl-item__node {
  position: relative;
  z-index: 1;
  width: 12px; height: 12px;
  align-self: center;
  margin: 0 auto;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 0 4px var(--panel), 0 0 0 5px rgba(176,132,47,.5);
}
.tl-item__body {
  text-align: left;
  padding-top: 3px;
}
.tl-item__time {
  font-weight: 300;
  font-size: 20px;
  color: var(--terra);
  letter-spacing: .04em;
}
.tl-item__title {
  font-weight: 300;
  font-size: 16px;
  color: var(--ink);
  margin-top: 2px;
}

/* ============================================================
   PHOTO — Фотосурет
   ============================================================ */
.photo-frame {
  position: relative;
  margin: 34px auto 0;
  padding: 12px;
  background: var(--panel);
  border: 1px solid rgba(176,132,47,.45);
  box-shadow: 0 30px 64px -38px rgba(27,36,71,.55);
}
.photo-frame::before {
  content: "";
  position: absolute; inset: 5px;
  border: 1px solid rgba(176,132,47,.35);
  pointer-events: none; z-index: 2;
}
.photo-frame img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(1.02);
}
.photo-frame .corner {
  position: absolute; width: 26px; height: 26px;
  z-index: 3;
  background: url("assets/ornaments/round.svg") center/contain no-repeat;
}
.photo-frame .corner.tl { top: -13px; left: -13px; }
.photo-frame .corner.tr { top: -13px; right: -13px; }
.photo-frame .corner.bl { bottom: -13px; left: -13px; }
.photo-frame .corner.br { bottom: -13px; right: -13px; }

/* ============================================================
   VENUE — Мекен-жай
   ============================================================ */
.venue { text-align: center; }
.venue__hall {
  font-weight: 100;
  font-size: clamp(24px, 7vw, 32px);
  color: var(--navy);
  margin-bottom: 8px;
}
.venue__line { font-size: 16px; color: var(--ink-soft); }
.venue__city { font-size: 16px; color: var(--ink); margin-top: 2px; letter-spacing: .02em; }

.map-btn {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 26px;
  padding: 14px 30px;
  min-height: 48px;
  border: 1px solid var(--gold);
  border-radius: 40px;
  background: transparent;
  color: var(--navy);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .3s ease, color .3s ease, transform .3s ease;
}
.map-btn:hover { background: var(--navy); color: var(--panel); transform: translateY(-2px); }
.map-btn svg { width: 17px; height: 17px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 40px 0 20px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.footer .orn--h4 { opacity: .85; }

/* ============================================================
   AUDIO PLAYER
   ============================================================ */
.audio {
  position: fixed;
  right: 18px; bottom: 176px;
  z-index: 40;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--panel);
  color: var(--navy);
  display: none;                 /* shown by JS when track present */
  align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 26px -12px rgba(27,36,71,.6);
}
.audio.is-visible { display: flex; }
.audio__disc {
  width: 26px; height: 26px;
  background: url("assets/ornaments/round.svg") center/contain no-repeat;
  animation: spin 6s linear infinite;
  animation-play-state: paused;
}
.audio.is-playing .audio__disc { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

/* hidden util */
.is-hidden { display: none !important; }

/* ============================================================
   Scroll-reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

.badge { opacity: 0; transform: scale(.86) rotate(-6deg); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.8,.2,1); }
.badge.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .badge { opacity: 1 !important; transform: none !important; transition: none !important; }
  .scroll-cue span.arrow, .audio__disc { animation: none !important; }
}

/* ============================================================
   Larger screens — keep single elegant column
   ============================================================ */
@media (min-width: 600px) {
  section { padding: 70px 0; }
  .panel { padding: 58px 46px; }
  .invite__text { font-size: 18px; }
}
