/* ============================================================
   Dastur.Online — "Пергамент" (Pressed Botanical Keepsake)
   Handmade deckled-paper invitation template
   Derived from: warm ivory handmade-paper reference imagery
   ============================================================ */

@font-face {
  font-family: "Shelley";
  src: url("assets/AsylbekM02Shelley.kz.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper:      #f5efe2;
  --paper-hi:   #fdfbf5;
  --paper-lo:   #ece2cf;
  --ink:        #3b352a;
  --ink-soft:   #6d6353;
  --ink-faint:  #948873;
  --gold:       #a8834e;
  --gold-deep:  #8a6636;
  --gold-line:  rgba(168, 131, 78, 0.42);
  --gold-line-s:rgba(168, 131, 78, 0.22);
  --textile:    #e6ddce;

  --serif:  "Cormorant Garamond", "PT Serif", Georgia, "Times New Roman", serif;
  --body:   "PT Serif", Georgia, "Times New Roman", serif;
  --script: "Shelley", "Cormorant Garamond", cursive;

  --ease: cubic-bezier(.2, .68, .16, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0 0 160px;               /* room for injected RSVP / payment bars */
  font-family: var(--body);
  color: var(--ink);
  background: var(--textile);
  line-height: 1.62;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Fixed background layer ---------- */
.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 {          /* gentle readability veil, keeps artwork visible */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
              rgba(240,233,221,.20) 0%,
              rgba(238,230,217,.30) 45%,
              rgba(230,221,205,.42) 100%);
}
@media (min-width: 640px) {
  .fixed-background {
    background-image: url("assets/background-desktop.webp");
    background-position: center center;
  }
}

/* deckle displacement filter host (0-size) */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Layout shell ---------- */
.shell {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 46px 20px 40px;
}

/* ---------- Deckled paper card ---------- */
.paper {
  position: relative;
  padding: 44px 30px;
  margin: 0 auto 40px;
  color: var(--ink);
}
.paper::before {                    /* torn ivory sheet */
  content: "";
  position: absolute;
  inset: -4px;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 30% 0%, var(--paper-hi) 0%, var(--paper) 46%, var(--paper-lo) 100%);
  filter: url(#deckle) drop-shadow(0 16px 30px rgba(84, 66, 44, .22));
}
.paper::after {                     /* faint fibre tone */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(96deg, rgba(148,124,86,.035) 0 2px, transparent 2px 7px);
  filter: url(#deckle);
  opacity: .7;
  pointer-events: none;
}
/* thin engraved gold frame */
.frame {
  position: relative;
  padding: 30px 22px;
  border: 1px solid var(--gold-line);
  outline: 1px solid var(--gold-line-s);
  outline-offset: 5px;
}
.paper.plain .frame { border: none; outline: none; padding: 6px 8px; }

/* ---------- Shared type ---------- */
.eyebrow {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .42em;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-deep);
  margin: 0 0 6px;
  padding-left: .42em;
}
.section-title {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .34em;
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
  margin: 0 0 22px;
  padding-left: .34em;
}
.lead {
  font-family: var(--serif);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

/* ---------- Ornamental divider ---------- */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px auto;
  color: var(--gold);
}
.ornament .rule {
  height: 1px;
  width: min(72px, 22vw);
  background: linear-gradient(90deg, transparent, var(--gold-line) 40%, var(--gold));
}
.ornament .rule.rt {
  background: linear-gradient(270deg, transparent, var(--gold-line) 40%, var(--gold));
}
.ornament .dot {
  width: 8px; height: 8px;
  transform: rotate(45deg);
  border: 1px solid var(--gold);
  position: relative;
}
.ornament .dot::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--gold);
}
.ornament.sm .rule { width: min(46px, 16vw); }

/* ============================================================
   HERO
   ============================================================ */
.hero { text-align: center; }
.hero .paper { padding-top: 52px; padding-bottom: 52px; }
.hero .frame { padding: 40px 22px 42px; }

.hero .together {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .3em;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 4px 0 0;
}
.names {
  font-family: var(--script);
  font-weight: 400;
  color: var(--gold-deep);
  line-height: .98;
  margin: 14px 0 6px;
  font-size: clamp(52px, 15vw, 90px);
}
.names .amp {
  display: block;
  font-size: .52em;
  color: var(--gold);
  margin: -2px 0;
}
.names .n2 { display: block; }

.datetime {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin: 6px auto 2px;
  max-width: 400px;
}
.dt-cell {
  flex: 1;
  padding: 6px 14px;
}
.dt-cell + .dt-cell { border-left: 1px solid var(--gold-line); }
.dt-k {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 11px;
  color: var(--gold-deep);
  margin: 0 0 6px;
}
.dt-v {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.15;
}

/* ============================================================
   INVITATION TEXT
   ============================================================ */
.invite { text-align: center; }
.invite .body-text p {
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 14px;
  text-wrap: pretty;
}
.invite .body-text p:first-child {
  font-family: var(--serif);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 15px;
  color: var(--gold-deep);
}

/* ============================================================
   HOSTS
   ============================================================ */
.hosts { text-align: center; }
.hosts .hosts-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.hosts .host-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
  margin: 2px 0;
}

/* ============================================================
   TIMELINE  (Бағдарлама) — pressed stem
   ============================================================ */
.timeline { text-align: center; }
.tl-wrap {
  position: relative;
  max-width: 400px;
  margin: 8px auto 0;
  padding-left: 30px;
  text-align: left;
}
.tl-stem {
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 1.5px;
  background: linear-gradient(var(--gold), var(--gold-line));
  transform: scaleY(1);
  transform-origin: top;
}
.timeline.in .tl-stem { animation: drawstem 1.15s var(--ease); }
@keyframes drawstem { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.tl-item {
  position: relative;
  padding: 12px 0 14px 24px;
}
.tl-item::before {                  /* diamond node on stem */
  content: "";
  position: absolute;
  left: -23.5px; top: 20px;
  width: 11px; height: 11px;
  background: var(--paper);
  border: 1.5px solid var(--gold);
  transform: rotate(45deg);
}
.tl-item::after {
  content: "";
  position: absolute;
  left: -19px; top: 24.5px;
  width: 3px; height: 3px;
  background: var(--gold);
}
.timeline.in .tl-item::before { animation: pop .5s var(--ease) backwards; }
@keyframes pop { from { transform: rotate(45deg) scale(0); } to { transform: rotate(45deg) scale(1); } }
.timeline.in .tl-item:nth-child(2)::before { animation-delay: .16s; }
.timeline.in .tl-item:nth-child(3)::before { animation-delay: .32s; }
.timeline.in .tl-item:nth-child(4)::before { animation-delay: .48s; }
.timeline.in .tl-item:nth-child(5)::before { animation-delay: .64s; }
.timeline.in .tl-item:nth-child(6)::before { animation-delay: .8s; }

.tl-time {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--gold-deep);
  letter-spacing: .04em;
}
.tl-title {
  font-size: 16px;
  color: var(--ink);
  margin-top: 1px;
}

/* ============================================================
   PHOTO  (Фотосурет) — mounted keepsake
   ============================================================ */
.photo { text-align: center; }
.photo-mount {
  position: relative;
  margin: 6px auto 0;
  max-width: 360px;
  padding: 12px;
  background:
    linear-gradient(150deg, #fefdf9, #efe6d5);
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 14px 28px rgba(84,66,44,.22);
}
.photo-mount::before {              /* inner gold rule */
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--gold-line);
  pointer-events: none;
  z-index: 2;
}
.photo-frame {
  position: relative;
  overflow: hidden;
}
.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: saturate(.96) contrast(1.02);
}
/* paper corner mounts (album feel) */
.photo-mount .corner {
  position: absolute;
  width: 26px; height: 26px;
  z-index: 3;
  background: linear-gradient(135deg, rgba(160,140,104,.55), rgba(160,140,104,.15));
}
.photo-mount .corner.tl { top: 3px;  left: 3px;  clip-path: polygon(0 0,100% 0,0 100%); }
.photo-mount .corner.tr { top: 3px;  right: 3px; clip-path: polygon(0 0,100% 0,100% 100%); }
.photo-mount .corner.bl { bottom: 3px;left: 3px;  clip-path: polygon(0 0,0 100%,100% 100%); }
.photo-mount .corner.br { bottom: 3px;right: 3px; clip-path: polygon(100% 0,100% 100%,0 100%); }
.photo-cap {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  margin: 16px 0 0;
}

/* ============================================================
   VENUE  (Мекен-жай)
   ============================================================ */
.venue { text-align: center; }
.venue .v-hall {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--ink);
  margin: 0 0 4px;
}
.venue .v-line {
  font-size: 16.5px;
  color: var(--ink-soft);
  margin: 2px 0;
}
.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 14px 30px;
  min-height: 48px;
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--paper-hi);
  background: linear-gradient(var(--gold), var(--gold-deep));
  border: none;
  border-radius: 2px;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(138,102,54,.30);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.map-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(138,102,54,.38); }
.map-btn:active { transform: translateY(0); }
.map-btn .pin {
  width: 9px; height: 9px; transform: rotate(45deg);
  border: 1.5px solid currentColor; border-radius: 50% 50% 50% 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 8px 0 6px;
  color: var(--gold);
}
.footer .sig {
  font-family: var(--script);
  font-size: 34px;
  color: var(--gold-deep);
  line-height: 1;
  margin: 10px 0 0;
}

/* ============================================================
   AUDIO PLAYER
   ============================================================ */
.audio-btn {
  position: fixed;
  right: 16px;
  bottom: 176px;
  z-index: 40;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: rgba(245,239,226,.94);
  color: var(--gold-deep);
  box-shadow: 0 8px 20px rgba(84,66,44,.24);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.audio-btn.show { display: flex; }
.audio-btn svg { width: 22px; height: 22px; }
.audio-btn .bars rect { transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.audio-btn.paused .bars rect { animation-play-state: paused; }
.audio-btn .bars rect:nth-child(2) { animation-delay: .2s; }
.audio-btn .bars rect:nth-child(3) { animation-delay: .4s; }
@keyframes eq {
  0%,100% { transform: scaleY(.4); }
  50%     { transform: scaleY(1); }
}

/* ============================================================
   REVEAL ANIMATIONS  (transform-only: content stays legible even
   if a browser throttles transitions; motion enhances, never hides)
   ============================================================ */
.reveal {
  transform: translateY(30px);
  transition: transform 1.05s var(--ease);
  will-change: transform;
}
.reveal.in { transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .18s; }
.reveal.d3 { transition-delay: .28s; }

.hero .paper { animation: settle 1.3s var(--ease) both; }
@keyframes settle {
  from { transform: translateY(-16px) scale(.986); }
  to   { transform: none; }
}

@media (min-width: 640px) {
  .shell { padding-top: 64px; }
  .paper { padding: 52px 42px; }
  .frame { padding: 36px 34px; }
  .invite .body-text p { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .hero .paper, .tl-stem, .tl-item::before, .tl-item::after,
  .audio-btn .bars rect {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
  .tl-stem { transform: scaleY(1); }
  .tl-item::before { transform: rotate(45deg) scale(1); }
}
