/* ============================================================
   Dastur.Online — Мерейтой (70 жас) invitation template
   Concept: "Алтын той" — a festive golden celebration.
   Content floats on soft ivory glass over a shimmering gold
   backdrop while gilded ribbons drift down the page.
   ============================================================ */

/* ---------- 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 golden reference artwork) ---------- */
:root {
  --gold-deep: #8a6414;   /* darkest gilt */
  --gold:      #a9791f;   /* ornament gold */
  --gold-2:    #c79a2f;   /* mid gold */
  --gold-lite: #e6c569;   /* highlight */
  --gold-soft: #f0dca6;

  --navy:      #1b2447;   /* chapan indigo — headings */
  --ink:       #4a3a1c;   /* warm text */
  --ink-soft:  #7a6640;

  --panel:      rgba(255, 253, 246, .82);   /* ivory glass surface */
  --panel-solid:#fffdf6;
  --line:       rgba(169, 121, 31, .45);
  --line-soft:  rgba(169, 121, 31, .28);

  --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: #f6e6b8;
  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 golden background (uploaded artwork)
   ============================================================ */
.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;
}
/* soft ivory veil so text stays readable without washing out the gold */
.fixed-background::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 50% 8%, rgba(255,255,255,.35), transparent 55%),
    linear-gradient(180deg, rgba(255,250,235,.12), rgba(255,248,228,.28));
}

@media (min-width: 600px) {
  .fixed-background {
    background-image: url("assets/background-desktop.webp");
    background-position: center center;
  }
}

/* ============================================================
   Falling golden ribbons
   ============================================================ */
.ribbons {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.ribbon {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  animation: ribbon-drift linear infinite;
}
.ribbon__i {
  display: block;
  width: 9px;
  height: 30px;
  border-radius: 45%;
  background: linear-gradient(160deg, var(--gold-lite) 0%, var(--gold-2) 38%, var(--gold-deep) 66%, var(--gold-lite) 100%);
  box-shadow: 0 1px 3px rgba(120, 86, 20, .35);
  transform-origin: 50% 25%;
  animation: ribbon-curl linear infinite;
}
@keyframes ribbon-drift {
  0%   { transform: translate(0, -18vh) rotate(0deg); }
  50%  { transform: translate(var(--sway, 40px), 52vh) rotate(180deg); }
  100% { transform: translate(0, 122vh) rotate(360deg); }
}
@keyframes ribbon-curl {
  0%   { transform: scaleX(1)  rotate(0deg); }
  50%  { transform: scaleX(.35) rotate(180deg); }
  100% { transform: scaleX(1)  rotate(360deg); }
}

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

section {
  padding: 56px 0;
}

/* ---------- Ornaments (mask = recolourable gold) ---------- */
.orn {
  display: block;
  background-color: var(--gold);
  -webkit-mask-repeat: no-repeat;   mask-repeat: no-repeat;
  -webkit-mask-position: center;    mask-position: center;
  -webkit-mask-size: contain;       mask-size: contain;
}
.orn--h1 { width: min(280px, 74%); aspect-ratio: 294/74;  margin: 0 auto; }
.orn--h4 { width: min(300px, 78%); aspect-ratio: 472/133; margin: 0 auto; }
.h1 { -webkit-mask-image: url("assets/ornaments/h1.svg");  mask-image: url("assets/ornaments/h1.svg"); }
.h4b{ -webkit-mask-image: url("assets/ornaments/h4b.svg"); mask-image: url("assets/ornaments/h4b.svg"); }
.m6 { -webkit-mask-image: url("assets/ornaments/m6.svg");  mask-image: url("assets/ornaments/m6.svg"); }
.m5 { -webkit-mask-image: url("assets/ornaments/m5.svg");  mask-image: url("assets/ornaments/m5.svg"); }

/* 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 .m6 { width: 44px; height: 26px; flex: 0 0 auto; }

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

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

.sec-head { text-align: center; }
.sec-head .flourish { width: min(200px, 64%); aspect-ratio: 472/133; margin: 10px auto 0; opacity: .9; }

/* ============================================================
   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--h1 { margin-bottom: 26px; }

.hero__eyebrow { margin-bottom: 24px; text-shadow: 0 1px 0 rgba(255,255,255,.6); }

.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;
  text-shadow: 0 2px 14px rgba(255,255,255,.55);
}

/* age medallion */
.badge {
  position: relative;
  width: 200px; height: 200px;
  margin: 34px auto 8px;
  display: grid;
  place-items: center;
}
/* ornamental medallion halo behind the ring */
.badge__halo {
  position: absolute; inset: -14px;
  background-color: var(--gold);
  opacity: .16;
  -webkit-mask: url("assets/ornaments/m5.svg") center/contain no-repeat;
          mask: url("assets/ornaments/m5.svg") center/contain no-repeat;
}
.badge__ring {
  position: absolute; inset: 20px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: radial-gradient(circle at 50% 34%, rgba(255,255,255,.85), rgba(255,251,240,.55));
  box-shadow: 0 0 0 6px rgba(255,253,246,.6), 0 0 0 7px rgba(169,121,31,.35),
              0 22px 44px -26px rgba(27,36,71,.5);
}
.badge__ring--inner {
  inset: 32px;
  border-style: dashed;
  border-color: rgba(169,121,31,.55);
  background: none;
  box-shadow: none;
}
.badge__val { position: relative; display: flex; flex-direction: column; align-items: center; }
.badge__num {
  font-weight: 100;
  font-size: 76px;
  line-height: 1;
  color: var(--gold-deep);
  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;
}

.hero__when {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; margin-top: 22px;
  font-weight: 300;
}
.hero__date, .hero__time { font-size: 20px; color: var(--ink); letter-spacing: .02em; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.hero__time { 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);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 46px 30px;
  text-align: center;
  box-shadow: 0 30px 60px -38px rgba(27,36,71,.5);
}
.panel::before {
  content: "";
  position: absolute; inset: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  pointer-events: none;
}
/* corner medallions */
.panel .corner {
  position: absolute; width: 34px; height: 20px;
  background-color: var(--gold);
  -webkit-mask: url("assets/ornaments/m6.svg") center/contain no-repeat;
          mask: url("assets/ornaments/m6.svg") center/contain no-repeat;
  opacity: .85;
}
.panel .corner.tl { top: -12px; left: 14px; }
.panel .corner.tr { top: -12px; right: 14px; }
.panel .corner.bl { bottom: -12px; left: 14px; transform: scaleY(-1); }
.panel .corner.br { bottom: -12px; right: 14px; transform: scaleY(-1); }

/* ---------- 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(--navy);
  margin-bottom: 20px;
}

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

/* ============================================================
   TIMELINE — Бағдарлама
   ============================================================ */
.timeline {
  position: relative;
  margin-top: 30px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 26px 26px 26px 12px;
  box-shadow: 0 30px 60px -40px rgba(27,36,71,.45);
}
.timeline::before {
  content: "";
  position: absolute; left: 33px; top: 34px; bottom: 34px;
  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: 14px 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-solid), 0 0 0 5px rgba(169,121,31,.5);
}
.tl-item__body {
  text-align: left;
  padding-top: 3px;
}
.tl-item__time {
  font-weight: 300;
  font-size: 20px;
  color: var(--gold-deep);
  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-solid);
  border: 1px solid var(--line);
  box-shadow: 0 30px 64px -38px rgba(27,36,71,.55);
}
.photo-frame::before {
  content: "";
  position: absolute; inset: 5px;
  border: 1px solid var(--line-soft);
  pointer-events: none; z-index: 2;
}
.photo-frame img {
  width: 100%;
  height: auto;
  display: block;
}
.photo-frame .corner {
  position: absolute; width: 40px; height: 24px;
  z-index: 3;
  background-color: var(--gold);
  -webkit-mask: url("assets/ornaments/m6.svg") center/contain no-repeat;
          mask: url("assets/ornaments/m6.svg") center/contain no-repeat;
}
.photo-frame .corner.tl { top: -14px; left: 14px; }
.photo-frame .corner.tr { top: -14px; right: 14px; }
.photo-frame .corner.bl { bottom: -14px; left: 14px; transform: scaleY(-1); }
.photo-frame .corner.br { bottom: -14px; right: 14px; transform: scaleY(-1); }

/* ============================================================
   VENUE — Мекен-жай
   ============================================================ */
.venue { text-align: center; }
.venue__hall {
  font-weight: 100;
  font-size: clamp(24px, 7vw, 32px);
  color: var(--navy);
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(255,255,255,.5);
}
.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: rgba(255,253,246,.7);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  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-solid); 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--h1 { opacity: .85; }

/* ============================================================
   CALENDAR — month view with the event date marked
   ============================================================ */
.cal {
  width: min(320px, 100%);
  margin: 30px auto 0;
  background: var(--panel);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px 20px 22px;
  box-shadow: 0 24px 50px -34px rgba(27,36,71,.5);
}
.cal__head {
  font-weight: 300;
  font-size: 15px;
  letter-spacing: .26em;
  text-transform: uppercase;
  text-indent: .26em;
  color: var(--navy);
  text-align: center;
  margin-bottom: 16px;
}
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal__dow {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-align: center;
  padding-bottom: 6px;
}
.cal__cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 300;
  color: var(--ink);
  border-radius: 50%;
}
.cal__cell.is-empty { visibility: hidden; }
.cal__cell.is-wknd { color: var(--ink-soft); }
.cal__cell.is-event {
  color: var(--panel-solid);
  font-weight: 300;
  background: radial-gradient(circle at 50% 38%, var(--gold-2), var(--gold-deep));
  box-shadow: 0 0 0 1px var(--gold), 0 6px 14px -6px rgba(138,100,20,.8);
}

/* ============================================================
   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-solid);
  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-color: var(--gold);
  -webkit-mask: url("assets/ornaments/m6.svg") center/contain no-repeat;
          mask: url("assets/ornaments/m6.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; }
  .ribbons { display: 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; }
}
