/* ============================================
   Hananeh’s 18th Birthday Invitation
   Elegant minimalism × tiny magical floral dream
   ============================================ */

:root {
  /* Color palette */
  --weldon-blue: #7C98AB;
  --weldon-blue-soft: #A3B8C5;
  --weldon-blue-deep: #5A7A8C;
  --cloud-white: #F7F9FB;
  --cloud-white-pure: #FFFFFF;
  --deep-navy: #1E2A3A;
  --pale-blue: #E8F0F5;
  --soft-silver: #C5D0D8;
  --glow: rgba(124, 152, 171, 0.25);

  /* Typography */
  --font-main: "Vazirmatn", "Tahoma", "Segoe UI", sans-serif;
  --fs-xs: clamp(0.75rem, 2vw, 0.85rem);
  --fs-sm: clamp(0.875rem, 2.2vw, 0.95rem);
  --fs-base: clamp(0.95rem, 2.5vw, 1.05rem);
  --fs-md: clamp(1.05rem, 2.8vw, 1.2rem);
  --fs-lg: clamp(1.25rem, 3.5vw, 1.6rem);
  --fs-xl: clamp(1.8rem, 6vw, 2.6rem);
  --fs-hero: clamp(2.4rem, 9vw, 3.6rem);
  --fs-number: clamp(3.2rem, 14vw, 5.5rem);

  /* Spacing & layout */
  --space-xs: 0.4rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --max-w: 26rem;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.7s;
}

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-main);
  font-weight: 400;
  background: var(--cloud-white);
  color: var(--deep-navy);
  line-height: 1.75;
  min-height: 100dvh;
  overflow-x: hidden;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

/* Soft gradient background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 152, 171, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(163, 184, 197, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 30% at 10% 70%, rgba(124, 152, 171, 0.06), transparent 50%),
    var(--cloud-white);
  z-index: -2;
  pointer-events: none;
}

/* Particles & petals containers */
.particles, .petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--weldon-blue-soft);
  opacity: 0;
  animation: floatParticle linear infinite;
}

.petal {
  position: absolute;
  width: 8px;
  height: 10px;
  background: var(--weldon-blue-soft);
  border-radius: 50% 0 50% 50%;
  opacity: 0;
  transform-origin: center;
  animation: driftPetal linear infinite;
}

@keyframes floatParticle {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { opacity: 0.35; }
  85% { opacity: 0.2; }
  100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

@keyframes driftPetal {
  0% { transform: translateY(0) rotate(0deg) translateX(0); opacity: 0; }
  10% { opacity: 0.45; }
  90% { opacity: 0.25; }
  100% { transform: translateY(-110vh) rotate(360deg) translateX(30px); opacity: 0; }
}

/* Music button */
.music-btn {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: max(1rem, env(safe-area-inset-left));
  z-index: 100;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--soft-silver);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  color: var(--weldon-blue-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(30, 42, 58, 0.06);
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s;
}

.music-btn:hover {
  background: var(--cloud-white-pure);
  box-shadow: 0 4px 16px rgba(30, 42, 58, 0.1);
}

.music-btn:active { transform: scale(0.94); }

.music-btn:focus-visible {
  outline: 2px solid var(--weldon-blue);
  outline-offset: 3px;
}

.music-btn.playing .icon-play { display: none; }
.music-btn.playing .icon-pause { display: block; }

/* Page container */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: max(2.5rem, env(safe-area-inset-top)) 1.25rem max(3rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding-top: 1.5rem;
  position: relative;
  width: 100%;
}

.floral-corner {
  position: absolute;
  width: 48px;
  height: 48px;
  opacity: 0;
  background: no-repeat center / contain;
}

.floral-tl {
  top: 0;
  right: 0.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none'%3E%3Cpath d='M24 8c-2 6-8 10-14 10 4 2 6 8 4 14 6-2 12 0 16 4 2-6 8-10 14-10-4-2-6-8-4-14-6 2-12 0-16-4z' fill='%237C98AB' opacity='0.35'/%3E%3Ccircle cx='24' cy='22' r='3' fill='%237C98AB' opacity='0.5'/%3E%3C/svg%3E");
}

.floral-tr {
  top: 0.5rem;
  left: 0.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none'%3E%3Cpath d='M24 6c1.5 5 7 8 12 8-3 2-5 7-3 12 5-1.5 10 1 13 4-1.5-5-6-9-11-9 3-2 5-7 3-12-5 1.5-10-1-14-3z' fill='%237C98AB' opacity='0.3'/%3E%3C/svg%3E");
  transform: scaleX(-1);
}

.hero-label {
  font-size: var(--fs-sm);
  color: var(--weldon-blue-deep);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-sm);
  opacity: 0;
  transform: translateY(12px);
}

.name {
  font-size: var(--fs-hero);
  font-weight: 600;
  color: var(--deep-navy);
  line-height: 1.2;
  margin-bottom: 0.15em;
  opacity: 0;
  transform: translateY(16px);
}

.number-wrap {
  position: relative;
  display: inline-block;
  margin: 0.2rem 0 0.6rem;
}

.number {
  font-size: var(--fs-number);
  font-weight: 700;
  color: var(--weldon-blue);
  line-height: 1;
  letter-spacing: -0.02em;
  display: inline-block;
  opacity: 0;
  transform: scale(0.85);
  position: relative;
}

.number::after {
  content: "";
  position: absolute;
  inset: -10% -15%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.55) 50%, transparent 60%);
  opacity: 0;
  pointer-events: none;
}

.hero-sub {
  font-size: var(--fs-sm);
  color: var(--weldon-blue-deep);
  opacity: 0;
  transform: translateY(10px);
}

/* ===== Invitation Card ===== */
.card-section {
  width: 100%;
}

.invite-card {
  background: var(--cloud-white-pure);
  border-radius: var(--radius);
  border: 1px solid var(--soft-silver);
  box-shadow:
    0 4px 24px rgba(30, 42, 58, 0.04),
    0 1px 3px rgba(30, 42, 58, 0.03);
  padding: 1.75rem 1.35rem;
  position: relative;
  overflow: hidden;
}

.invite-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(124, 152, 171, 0.18);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}

.card-ornament {
  height: 18px;
  background: no-repeat center / contain;
  opacity: 0.45;
  margin: 0 auto 0.75rem;
}

.card-ornament.top {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='18' viewBox='0 0 80 18'%3E%3Cpath d='M0 9h28M52 9h28' stroke='%237C98AB' stroke-width='0.8' opacity='0.5'/%3E%3Ccircle cx='40' cy='9' r='3.5' fill='none' stroke='%237C98AB' stroke-width='0.9'/%3E%3Ccircle cx='40' cy='9' r='1.5' fill='%237C98AB' opacity='0.6'/%3E%3C/svg%3E");
}

.card-ornament.bottom {
  margin: 1rem auto 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='12' viewBox='0 0 60 12'%3E%3Cpath d='M10 6c4-4 12-4 16 0s12 4 16 0' fill='none' stroke='%237C98AB' stroke-width='0.9' opacity='0.5'/%3E%3C/svg%3E");
}

.invite-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.invite-p {
  font-size: var(--fs-base);
  color: var(--deep-navy);
  line-height: 1.85;
  opacity: 0;
  transform: translateY(14px);
}

.invite-p:first-child {
  font-weight: 500;
  color: var(--weldon-blue-deep);
}

/* ===== Details ===== */
.details-section {
  width: 100%;
}

.details-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--pale-blue);
  border-radius: var(--radius);
  padding: 1.35rem 1.2rem;
  border: 1px solid rgba(124, 152, 171, 0.15);
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  opacity: 0;
  transform: translateY(12px);
}

.detail-icon {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--cloud-white-pure);
  color: var(--weldon-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(30, 42, 58, 0.05);
}

.detail-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--weldon-blue-deep);
  margin-bottom: 0.15rem;
}

.detail-value {
  font-size: var(--fs-sm);
  color: var(--deep-navy);
  font-weight: 500;
  line-height: 1.5;
}

/* ===== Countdown ===== */
.countdown-section {
  width: 100%;
  text-align: center;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(12px);
}

.count-unit {
  background: var(--cloud-white-pure);
  border: 1px solid var(--soft-silver);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.count-num {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--weldon-blue);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  min-width: 2ch;
}

.count-label {
  font-size: var(--fs-xs);
  color: var(--weldon-blue-deep);
}

.event-message {
  font-size: var(--fs-md);
  color: var(--weldon-blue-deep);
  padding: 1.2rem 1rem;
  background: var(--pale-blue);
  border-radius: var(--radius);
  border: 1px solid rgba(124, 152, 171, 0.2);
  line-height: 1.6;
}

/* ===== Map button ===== */
.nav-section {
  width: 100%;
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
}

.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  background: var(--weldon-blue);
  color: var(--cloud-white-pure);
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  border: none;
  box-shadow: 0 4px 14px rgba(124, 152, 171, 0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
  min-height: 48px;
}

.map-btn:hover {
  background: var(--weldon-blue-deep);
  box-shadow: 0 6px 18px rgba(124, 152, 171, 0.4);
  transform: translateY(-1px);
}

.map-btn:active {
  transform: scale(0.97) translateY(0);
}

.map-btn:focus-visible {
  outline: 2px solid var(--deep-navy);
  outline-offset: 3px;
}

/* ===== Closing ===== */
.closing {
  text-align: center;
  padding-top: 0.5rem;
  opacity: 0;
  transform: translateY(10px);
}

.closing-line {
  width: 40px;
  height: 1px;
  background: var(--soft-silver);
  margin: 0 auto 1rem;
}

.closing-text {
  font-size: var(--fs-sm);
  color: var(--weldon-blue-deep);
  line-height: 1.7;
  max-width: 18rem;
  margin: 0 auto;
}

.tiny-flower {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--weldon-blue-soft);
  opacity: 0.7;
}

/* ===== Entrance animation classes ===== */
.ready .floral-corner { animation: fadeIn 1s var(--ease) 0.2s forwards; }
.ready .hero-label { animation: riseFade 0.8s var(--ease) 0.35s forwards; }
.ready .name { animation: riseFade 0.9s var(--ease) 0.5s forwards; }
.ready .number { animation: scaleFade 1s var(--ease) 0.7s forwards; }
.ready .number::after { animation: shimmer 1.4s var(--ease) 1.3s forwards; }
.ready .hero-sub { animation: riseFade 0.8s var(--ease) 0.95s forwards; }

.ready .invite-p[data-order="1"] { animation: riseFade 0.7s var(--ease) 1.15s forwards; }
.ready .invite-p[data-order="2"] { animation: riseFade 0.7s var(--ease) 1.4s forwards; }
.ready .invite-p[data-order="3"] { animation: riseFade 0.7s var(--ease) 1.65s forwards; }
.ready .invite-p[data-order="4"] { animation: riseFade 0.7s var(--ease) 1.9s forwards; }

.ready .detail-item:nth-child(1) { animation: riseFade 0.65s var(--ease) 2.15s forwards; }
.ready .detail-item:nth-child(2) { animation: riseFade 0.65s var(--ease) 2.3s forwards; }
.ready .detail-item:nth-child(3) { animation: riseFade 0.65s var(--ease) 2.45s forwards; }

.ready .countdown { animation: riseFade 0.7s var(--ease) 2.65s forwards; }
.ready .nav-section { animation: riseFade 0.7s var(--ease) 2.85s forwards; }
.ready .closing { animation: riseFade 0.7s var(--ease) 3.05s forwards; }

@keyframes riseFade {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleFade {
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes shimmer {
  0% { opacity: 0; transform: translateX(-30%); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateX(30%); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-label, .name, .number, .hero-sub,
  .invite-p, .detail-item, .countdown,
  .nav-section, .closing, .floral-corner {
    opacity: 1 !important;
    transform: none !important;
  }
  .particle, .petal { display: none; }
}

/* Larger screens */
@media (min-width: 480px) {
  .page { padding-left: 1.75rem; padding-right: 1.75rem; }
  .invite-card { padding: 2rem 1.75rem; }
  .countdown { gap: 0.75rem; }
  .count-unit { padding: 1rem 0.5rem; }
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
