@import url('/fonts/display.css');

/* ------------------------------------------------------------------ fonts */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

/* ----------------------------------------------------------------- tokens */
:root {
  --night: #0a0c16;
  --night-2: #10131f;
  --night-3: #161a2b;
  --gold: #d9b25f;
  --gold-soft: #e8cf9a;
  --gold-deep: #a8823a;
  --blush: #f0d6ce;
  --ink: #f5f2ec;
  --muted: #a49f96;
  --line: rgba(217, 178, 95, .18);
  --line-soft: rgba(245, 242, 236, .08);

  --shell: min(1120px, 100% - 2.5rem);
  --rail: min(720px, 100% - 2.5rem);
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --step--1: clamp(.78rem, .74rem + .2vw, .88rem);
  --step-0: clamp(.95rem, .9rem + .25vw, 1.05rem);
  --step-1: clamp(1.1rem, 1rem + .5vw, 1.35rem);
  --step-2: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  --step-3: clamp(1.9rem, 1.5rem + 2vw, 3rem);
  --step-4: clamp(2.6rem, 1.8rem + 4.2vw, 5.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--step-0);
  line-height: 1.85;
  color: var(--ink);
  background: var(--night);
  direction: rtl;
  overflow-x: hidden;
  font-feature-settings: 'ss01';
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }

/* Persian digits everywhere numbers are shown as text */
.nums { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- decorations */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
#petals { position: fixed; inset: 0; pointer-events: none; z-index: 2; }

.khatam {
  position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23d9b25f' stroke-width='1'%3E%3Cpath d='M60 8 74 46 112 60 74 74 60 112 46 74 8 60 46 46Z'/%3E%3Crect x='26' y='26' width='68' height='68' transform='rotate(45 60 60)'/%3E%3Crect x='26' y='26' width='68' height='68'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px;
}

.rule {
  display: flex; align-items: center; justify-content: center; gap: .9rem;
  color: var(--gold); margin-inline: auto; max-width: 340px;
}
.rule::before, .rule::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.rule svg { width: 22px; height: 22px; flex: none; }

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  text-align: center; padding: 5rem 1.25rem 7rem; overflow: hidden;
  background:
    radial-gradient(120% 85% at 50% -10%, rgba(217, 178, 95, .16), transparent 60%),
    radial-gradient(90% 60% at 15% 110%, rgba(240, 214, 206, .09), transparent 65%),
    linear-gradient(180deg, #0a0c16, #11142234 60%, var(--night));
}
.hero__inner { position: relative; z-index: 1; max-width: 900px; }

.eyebrow {
  font-size: var(--step--1); color: var(--gold);
  word-spacing: .5em; margin: 0 0 1.6rem; opacity: .82;
}

.names {
  font-family: 'Gulzar', 'Vazirmatn', serif;
  font-size: var(--step-4);
  line-height: 1.75;
  margin: 0;
  background: linear-gradient(100deg, var(--gold-deep) 0%, var(--gold-soft) 35%, #fff8e8 50%, var(--gold-soft) 65%, var(--gold-deep) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 9s var(--ease) infinite;
  padding-block: .15em;
}
@keyframes shimmer { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }

.names .amp {
  display: block; font-family: 'Vazirmatn'; font-size: .28em; font-weight: 300;
  color: var(--blush); -webkit-text-fill-color: var(--blush);
  margin-block: -.2em .1em; opacity: .8;
}

.hero__verse {
  max-width: 40ch; margin: 2rem auto 0; color: var(--muted);
  font-size: var(--step-0); font-weight: 300; line-height: 2.1;
}
.hero__verse cite { display: block; font-style: normal; font-size: var(--step--1); color: var(--gold-deep); margin-top: .6rem; }

.hero__meta {
  margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .75rem 1.5rem;
  justify-content: center; color: var(--blush); font-size: var(--step-1);
}
.hero__meta span { display: inline-flex; align-items: center; gap: .5rem; }

.scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; translate: -50% 0; z-index: 1;
  color: var(--gold); opacity: .55; animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { translate: -50% 0; } 50% { translate: -50% 10px; } }

/* --------------------------------------------------------------- greeting */
.greeting {
  margin: 1.75rem auto 0; max-width: 30rem;
  border: 1px solid var(--line); border-radius: 999px;
  padding: .7rem 1.5rem; background: rgba(217, 178, 95, .07);
  backdrop-filter: blur(6px);
  font-size: var(--step-0);
}
.greeting b { color: var(--gold-soft); font-weight: 600; }
.greeting[hidden] { display: none; }

/* -------------------------------------------------------------- countdown */
.countdown {
  display: grid; grid-template-columns: repeat(4, minmax(0, 5.6rem));
  gap: .5rem; justify-content: center; margin-top: 2.75rem;
}
.cd {
  padding: .85rem .4rem .7rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .01));
  backdrop-filter: blur(8px);
}
.cd b {
  display: block; font-size: var(--step-2); font-weight: 600; color: var(--ink);
  line-height: 1.2; font-variant-numeric: tabular-nums;
}
.cd span { font-size: var(--step--1); color: var(--muted); }
.cd--done { grid-column: 1 / -1; color: var(--gold); }

/* --------------------------------------------------------------- sections */
section { position: relative; padding: clamp(4rem, 9vw, 7.5rem) 0; }
.shell { width: var(--shell); margin-inline: auto; }
.rail { width: var(--rail); margin-inline: auto; }

.sec-head { text-align: center; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.sec-head h2 {
  font-size: var(--step-3); margin: 1.1rem 0 .5rem; font-weight: 500;
}
.sec-head p { color: var(--muted); margin: 0 auto; max-width: 46ch; }
.sec-kicker { font-size: var(--step--1); word-spacing: .45em; color: var(--gold); opacity: .85; }

.band { background: linear-gradient(180deg, transparent, var(--night-2) 12%, var(--night-2) 88%, transparent); }

/* ---------------------------------------------------------------- reveals */
.rv { opacity: 0; translate: 0 26px; transition: opacity .9s var(--ease), translate .9s var(--ease); }
.rv.in { opacity: 1; translate: 0 0; }
.rv:nth-child(2) { transition-delay: .07s; }
.rv:nth-child(3) { transition-delay: .14s; }
.rv:nth-child(4) { transition-delay: .21s; }
.rv:nth-child(5) { transition-delay: .28s; }

/* --------------------------------------------------------------- schedule */
.timeline { position: relative; }
.timeline::before {
  content: ''; position: absolute; inset-block: .6rem; right: 4.6rem; width: 1px;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
}
.tl-item { position: relative; display: grid; grid-template-columns: 4.2rem 1fr; gap: 1.6rem; padding-block: 1.15rem; }
.tl-time {
  text-align: left; color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums;
  padding-top: .15rem;
}
.tl-item::after {
  content: ''; position: absolute; right: calc(4.6rem - 4px); top: 1.55rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 4px var(--night-2), 0 0 14px rgba(217, 178, 95, .6);
}
.tl-body h3 { margin: 0 0 .2rem; font-size: var(--step-1); font-weight: 500; }
.tl-body p { margin: 0; color: var(--muted); font-size: var(--step--1); line-height: 1.9; }

/* ------------------------------------------------------------------ venue */
/* Exactly two columns on wide screens. `auto-fit` produced three tracks at 1440px
   and left a dead column beside the two cards. */
.venues { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .venues { grid-template-columns: 1fr 1fr; } }
.venues--single { max-width: 620px; margin-inline: auto; grid-template-columns: 1fr; }

.venue-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: linear-gradient(180deg, rgba(217, 178, 95, .07), rgba(255, 255, 255, .01));
  display: flex; flex-direction: column; gap: 1rem;
}
.venue-side {
  align-self: flex-start;
  font-size: var(--step--1); color: var(--gold);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem 1rem; background: rgba(217, 178, 95, .1);
}
.venue-card h3 { margin: 0; font-size: var(--step-2); font-weight: 500; }
.venue-card .addr { color: var(--blush); margin: 0; opacity: .9; }
.venue-card .note { color: var(--muted); font-size: var(--step--1); margin: 0; }
.venue-card .form-note { margin: 0; }

.venue-map {
  height: 240px; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); background: var(--night-3);
}
.leaflet-container { background: var(--night-3) !important; font-family: inherit !important; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(.92) saturate(.7); }
.leaflet-control-zoom a {
  background: var(--night-3) !important; color: var(--gold) !important;
  border-color: var(--line) !important;
}
.map-fallback { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 1.5rem; text-align: center; font-size: var(--step--1); }

.nav-apps { display: flex; flex-wrap: wrap; gap: .6rem; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .8rem 1.5rem; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04); color: var(--ink); cursor: pointer;
  text-decoration: none; font-size: var(--step--1); font-weight: 500;
  transition: background .25s var(--ease), border-color .25s var(--ease), translate .25s var(--ease);
}
.btn:hover, .btn:focus-visible { background: rgba(217, 178, 95, .14); border-color: var(--gold); translate: 0 -2px; }
.btn--gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #221a06; border-color: transparent; font-weight: 700;
  box-shadow: 0 10px 30px -12px rgba(217, 178, 95, .8);
}
.btn--gold:hover { background: linear-gradient(135deg, var(--gold-soft), #fff1d4); }
.btn--lg { padding: 1rem 2.2rem; font-size: var(--step-0); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 1.05em; height: 1.05em; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* ---------------------------------------------------------------- gallery */
.gallery { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.gallery img { aspect-ratio: 3/4; object-fit: cover; border-radius: var(--r-md); cursor: zoom-in; transition: scale .4s var(--ease), filter .4s var(--ease); filter: saturate(.9); }
.gallery img:hover { scale: 1.03; filter: saturate(1.05); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(6, 7, 12, .94); display: grid; place-items: center; padding: 2rem; cursor: zoom-out; backdrop-filter: blur(4px); }
.lightbox img { max-height: 88vh; width: auto; border-radius: var(--r-md); }
.lightbox[hidden] { display: none; }

/* ------------------------------------------------------------------ share */
.share-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 720px) { .share-grid { grid-template-columns: auto 1fr; } }
#qr { background: #fff; padding: .9rem; border-radius: var(--r-md); width: fit-content; margin-inline: auto; }
#qr img, #qr canvas { display: block; width: 168px; height: 168px; image-rendering: pixelated; }

/* --------------------------------------------------------------- dock/nav */
.dock {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: flex; gap: .5rem; justify-content: center;
  padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(10, 12, 22, .92) 40%);
  backdrop-filter: blur(10px);
  translate: 0 120%; transition: translate .5s var(--ease);
}
.dock.show { translate: 0 0; }
.dock .btn { flex: 1 1 0; max-width: 13rem; padding-inline: .8rem; }
@media (min-width: 900px) { .dock { display: none; } }

/* ----------------------------------------------------------------- footer */
footer { text-align: center; padding: 4rem 1.25rem 5rem; color: var(--muted); font-size: var(--step--1); }
@media (max-width: 899px) { body { padding-bottom: 4.75rem; } }
footer .names-sm { font-family: 'Gulzar', serif; font-size: var(--step-2); color: var(--gold); line-height: 2.2; }
footer .tag { color: var(--gold-deep); }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed; z-index: 70; inset-inline: 1rem; bottom: 5.5rem; margin-inline: auto;
  max-width: 26rem; padding: .9rem 1.25rem; border-radius: var(--r-md);
  background: var(--night-3); border: 1px solid var(--gold); color: var(--ink);
  text-align: center; font-size: var(--step--1);
  translate: 0 150%; opacity: 0; transition: translate .4s var(--ease), opacity .4s var(--ease);
}
.toast.show { translate: 0 0; opacity: 1; }

/* ------------------------------------------------ forms (admin console only) */
.form { display: grid; gap: 1.15rem; }
.field { display: grid; gap: .45rem; }
.field > label { font-size: var(--step--1); color: var(--blush); }
.field input, .field textarea, .field select {
  width: 100%; padding: .85rem 1.1rem; border-radius: var(--r-sm);
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .04);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--gold); background: rgba(217, 178, 95, .07); outline: none;
}
.field textarea { min-height: 7rem; resize: vertical; line-height: 1.9; }
.row-edit input, .row-edit textarea {
  width: 100%; padding: .6rem .8rem; border-radius: var(--r-sm);
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .04);
}
.row-edit input:focus, .row-edit textarea:focus { border-color: var(--gold); outline: none; }

/* --------------------------------------------- contact numbers (in the footer) */
.contacts { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 1.5rem; }
.contact {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .7rem 1.2rem; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; font-size: var(--step--1);
}
.contact:hover { border-color: var(--gold); background: rgba(217, 178, 95, .1); }
.contact b { color: var(--gold-soft); font-weight: 500; }
.contact small { color: var(--muted); }
