/*!
 * Festival Greeting Website — core stylesheet
 * Mobile-first. Theme driven by CSS custom properties set in includes/header.php.
 *
 * Design language: traditional Indian motif — an Ashoka Chakra wheel (built
 * with pure CSS conic-gradients, no image asset) and a saffron/white/green
 * "tricolor" rule used as a structural accent across the header, section
 * eyebrows and cards, layered on a deep chakra-navy (dark) / warm ivory
 * (light) neutral palette in place of the previous generic violet theme.
 */

/* ---------------------------------------------------------------------
   Reset & base
--------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
  --theme-color: #ff6b35;
  --accent-color: #ffd23f;
  --gradient-start: #3a0ca3;
  --gradient-end: #ff6b35;
  --text-on-theme: #ffffff;

  /* tricolor rule — derives from the two festival brand colors plus a
     fixed neutral "white" band, so it stays config-driven per festival */
  --tricolor: linear-gradient(90deg, var(--theme-color) 0%, var(--theme-color) 32%, #fbfbf6 32%, #fbfbf6 68%, var(--accent-color) 68%, var(--accent-color) 100%);

  --font-display: Georgia, 'Noto Serif', 'Times New Roman', serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, Roboto, 'Noto Sans', 'Noto Sans Devanagari', sans-serif;

  /* deep chakra-navy neutral base (replaces generic violet) */
  --bg: #060a1a;
  --bg-alt: #0d1530;
  --text: #f4f2ea;
  --text-muted: rgba(244, 242, 234, 0.72);
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.16);
  --chakra-line: rgba(255, 255, 255, 0.5);
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --max-width: 960px;
}

:root[data-theme="light"] {
  --bg: #fdf8ee;
  --bg-alt: #f8ecd4;
  --text: #241a10;
  --text-muted: rgba(36, 26, 16, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(36, 26, 16, 0.12);
  --chakra-line: rgba(36, 26, 16, 0.55);
}

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.05), transparent 40%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* RTL (Urdu) support — flip directional spacing, keep layout mirrored via dir="rtl" on <html> */
[dir="rtl"] .site-footer__legal,
[dir="rtl"] .hero__cta,
[dir="rtl"] .generate__form,
[dir="rtl"] .share-bar {
  direction: rtl;
}
[dir="rtl"] .typing-name {
  border-right: none;
  border-left: 2px solid var(--accent-color);
  padding-right: 0;
  padding-left: 4px;
}
[dir="rtl"] .generate__link-row input {
  text-align: right;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.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;
}

.skip-link {
  position: absolute;
  top: -100px; left: 0;
  background: var(--theme-color);
  color: var(--text-on-theme);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ---------------------------------------------------------------------
   Tricolor rule — thin saffron/white/green strip used structurally
--------------------------------------------------------------------- */
.tricolor-bar {
  height: 4px;
  width: 100%;
  background: var(--tricolor);
}

.accent-top {
  position: relative;
}
.accent-top::before {
  content: "";
  position: absolute;
  top: 0; left: 14%; right: 14%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--tricolor);
}

/* ---------------------------------------------------------------------
   Ashoka Chakra motif — pure CSS 24-spoke wheel (no image asset)
--------------------------------------------------------------------- */
.chakra {
  --chakra-color: var(--accent-color);
  position: relative;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--chakra-color) 0deg 2.4deg, transparent 2.4deg 15deg);
  -webkit-mask-image: radial-gradient(circle, transparent 34%, #000 35% 88%, transparent 89%);
  mask-image: radial-gradient(circle, transparent 34%, #000 35% 88%, transparent 89%);
}
.chakra::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 13%;
  height: 13%;
  border-radius: 50%;
  background: var(--chakra-color);
}
.chakra::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--chakra-color);
}
.chakra--spin { animation: chakraSpin 90s linear infinite; }
@keyframes chakraSpin { to { transform: rotate(360deg); } }

.hero__chakra {
  position: absolute;
  width: min(620px, 88vw);
  aspect-ratio: 1 / 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0.1;
  pointer-events: none;
}

.section-motif {
  --chakra-color: var(--theme-color);
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto 0.85rem;
  opacity: 0.85;
}

/* ---------------------------------------------------------------------
   Glassmorphism
--------------------------------------------------------------------- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------------
   Header
--------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 10, 26, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}
:root[data-theme="light"] .site-header { background: rgba(253, 248, 238, 0.75); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.75rem;
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { border-radius: 8px; }
.brand__name {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.site-header__actions { display: flex; gap: 0.5rem; }

.icon-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { border-color: var(--theme-color); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn__off { display: none; }
.icon-btn[aria-pressed="true"] .icon-btn__on { display: none; }
.icon-btn[aria-pressed="true"] .icon-btn__off { display: inline; }

.lang-select {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  max-width: 120px;
}

/* ---------------------------------------------------------------------
   Hero
--------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: 3rem;
}

.hero__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  filter: saturate(1.1);
  z-index: 0;
}

.hero__overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(0,0,0,0.2), rgba(0,0,0,0.6)),
    linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  opacity: 0.85;
  z-index: 1;
}

/* ---------------------------------------------------------------------
   Tricolor wave — gently rippling saffron/white/green bands along the
   bottom of the hero, standing in for the flag without animating the
   flag itself.
--------------------------------------------------------------------- */
.hero__tricolor-wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  z-index: 2;
  line-height: 0;
  pointer-events: none;
}
.hero__tricolor-wave svg {
  display: block;
  width: 100%;
  height: clamp(56px, 12vh, 130px);
}
.hero__tricolor-wave-path--saffron {
  fill: var(--theme-color);
  opacity: 0.55;
  animation: tricolorRipple 9s ease-in-out infinite;
}
.hero__tricolor-wave-path--white {
  fill: #ffffff;
  opacity: 0.4;
  animation: tricolorRipple 12s ease-in-out infinite reverse;
}
.hero__tricolor-wave-path--green {
  fill: var(--accent-color);
  opacity: 0.6;
  animation: tricolorRipple 15s ease-in-out infinite;
}
@keyframes tricolorRipple {
  0%, 100% { transform: translateX(-3%); }
  50%      { transform: translateX(3%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__tricolor-wave-path--saffron,
  .hero__tricolor-wave-path--white,
  .hero__tricolor-wave-path--green {
    animation: none;
  }
}

.hero__content {
  position: relative;
  z-index: 5;
  text-align: center;
  color: var(--text-on-theme);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  min-width: 0;
}

.hero__image {
  width: min(260px, 60vw);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.35));
  animation: floatY 5s ease-in-out infinite;
}

.hero__lottie {
  width: min(260px, 62vw);
  aspect-ratio: 1 / 1;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.35));
  /* the animation has its own "Happy Independence Day" text baked in —
     extra bottom margin keeps it from crowding the H1 right below it */
  margin-bottom: 0.5rem;
}
.hero__lottie[hidden] { display: none; }
.hero__lottie svg { width: 100%; height: 100%; }

.lottie-confetti-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}
.lottie-confetti-overlay svg { width: 100%; height: 100%; }

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.6rem);
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0.005em;
  text-shadow: 0 4px 18px rgba(0,0,0,0.45);
}
.hero__emoji { display: inline-block; animation: pulse 1.8s ease-in-out infinite; }

.hero__from,
.hero__subtitle {
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  max-width: 40ch;
  margin: 0;
  color: rgba(255,255,255,0.92);
}

.typing-name {
  display: inline-block;
  border-right: 2px solid var(--accent-color);
  padding-right: 4px;
  white-space: nowrap;
  overflow: hidden;
  animation: blinkCaret 0.8s step-end infinite;
}

@keyframes blinkCaret {
  0%, 100% { border-color: transparent; }
  50% { border-color: var(--accent-color); }
}

.hero__blessing {
  padding: 0.9rem 1.4rem;
  max-width: 46ch;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-on-theme);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ---------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.96); }

.btn--primary {
  background: linear-gradient(135deg, var(--theme-color), var(--accent-color));
  color: var(--text-on-theme);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.btn--primary:hover { box-shadow: 0 10px 28px rgba(0,0,0,0.4); }

.btn--pulse { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.55); }
  50% { box-shadow: 0 0 0 14px rgba(255, 210, 63, 0); }
}

.btn--ghost {
  background: rgba(255,255,255,0.12);
  color: var(--text-on-theme);
  border: 1px solid rgba(255,255,255,0.4);
}

.btn--secondary {
  background: var(--theme-color);
  color: var(--text-on-theme);
}

/* ---------------------------------------------------------------------
   Share bar
--------------------------------------------------------------------- */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 1rem;
  margin-top: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.share-btn {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  color: #fff;
  transition: transform 0.15s ease;
}
.share-btn:active { transform: scale(0.94); }

.share-btn--whatsapp { background: #25D366; }
.share-btn--facebook { background: #1877F2; }
.share-btn--telegram { background: #229ED9; }
.share-btn--twitter  { background: #14171A; }
.share-btn--sms      { background: #6c5ce7; }
.share-btn--email    { background: #ea4335; }
.share-btn--copy     { background: #444; }
.share-btn--native   { background: var(--theme-color); }

/* ---------------------------------------------------------------------
   Countdown
--------------------------------------------------------------------- */
.countdown {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  color: var(--text-on-theme);
  max-width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
  justify-content: center;
}
.countdown__unit { text-align: center; min-width: 52px; }
.countdown__unit span { display: block; font-size: 1.5rem; font-weight: 700; }
.countdown__unit small { font-size: 0.7rem; opacity: 0.8; }

/* ---------------------------------------------------------------------
   Generate section
--------------------------------------------------------------------- */
.generate {
  margin: 2.5rem auto;
  max-width: var(--max-width);
  width: calc(100% - 2.5rem);
}
.generate__inner { padding: 2.25rem 1.5rem; text-align: center; }
.generate h2 { margin-top: 0; font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 2rem); }
.generate p { color: var(--text-muted); }

.generate__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.generate__form input {
  flex: 1 1 240px;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 1rem;
}
:root[data-theme="light"] .generate__form input { background: rgba(0,0,0,0.04); }
.generate__form input::placeholder { color: var(--text-muted); }

.generate__result { margin-top: 1.5rem; }
.generate__link-row {
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
  margin-inline: auto;
}
.generate__link-row input {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

/* ---------------------------------------------------------------------
   Section heading rhythm (shared by significance/flag/celebrations/
   fighters/facts/faq/closing)
--------------------------------------------------------------------- */
.significance h2,
.flag h2,
.celebrations h2,
.fighters h2,
.facts h2,
.faq h2 {
  font-family: var(--font-display);
}

/* ---------------------------------------------------------------------
   Significance
--------------------------------------------------------------------- */
.significance { padding: 2.5rem 0; }
.significance h2 { text-align: center; font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 1.5rem; }
.significance__body {
  max-width: 720px;
  margin-inline: auto;
  padding: 2rem 2rem 1.75rem;
  line-height: 1.8;
  color: var(--text-muted);
  text-align: left;
}
.significance__body p { margin: 0; }
.significance__body p + p { margin-top: 1.1rem; }

/* ---------------------------------------------------------------------
   Indian National Flag
--------------------------------------------------------------------- */
.flag { padding: 2.5rem 0; }
.flag h2 { text-align: center; font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 1rem; }
.flag__intro {
  max-width: 700px;
  margin: 0 auto 1.5rem;
  text-align: left;
  color: var(--text-muted);
  line-height: 1.7;
}
.flag__list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  max-width: 720px;
  margin-inline: auto;
}
@media (min-width: 640px) {
  .flag__list { grid-template-columns: repeat(2, 1fr); }
}
.flag__list li {
  position: relative;
  padding: 1.2rem 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-left: 3px solid var(--theme-color);
}
.flag__list li:nth-child(2) { border-left-color: var(--accent-color); }
.flag__list li:nth-child(3) { border-left-color: var(--chakra-line); }
.flag__list li:nth-child(4) { border-left-color: var(--accent-color); }
.flag__label { color: var(--accent-color); font-family: var(--font-display); }
.flag__list li span { color: var(--text-muted); }

/* ---------------------------------------------------------------------
   Celebrations
--------------------------------------------------------------------- */
.celebrations { padding: 2.5rem 0; }
.celebrations h2 { text-align: center; font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 1rem; }
.celebrations__intro {
  max-width: 700px;
  margin: 0 auto 1.25rem;
  text-align: left;
  color: var(--text-muted);
  line-height: 1.7;
}
.celebrations__list {
  max-width: 640px;
  margin-inline: auto;
  padding-inline-start: 1.25rem;
  color: var(--text-muted);
  line-height: 1.9;
}
.celebrations__list li::marker { color: var(--theme-color); }

/* ---------------------------------------------------------------------
   Freedom Fighters
--------------------------------------------------------------------- */
.fighters { padding: 2.5rem 0; }
.fighters h2 { text-align: center; font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 1rem; }
.fighters__intro {
  max-width: 700px;
  margin: 0 auto 1.5rem;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.7;
}
.fighters__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  max-width: 800px;
  margin-inline: auto;
}
.fighters__chip {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.fighters__chip:hover { border-color: var(--theme-color); transform: translateY(-2px); }

/* ---------------------------------------------------------------------
   Closing message
--------------------------------------------------------------------- */
.closing { padding: 1rem 0 2.5rem; }
.closing__text {
  max-width: 700px;
  margin-inline: auto;
  padding: 1.85rem 2rem 1.75rem;
  text-align: left;
  font-family: var(--font-display);
  font-style: italic;
  line-height: 1.8;
  color: var(--text-muted);
}
.closing__signoff {
  display: block;
  margin-top: 1rem;
  text-align: center;
  font-style: normal;
  font-weight: 700;
  color: var(--text);
}

/* ---------------------------------------------------------------------
   Facts / FAQ
--------------------------------------------------------------------- */
.facts, .faq { padding: 2.5rem 0; }
.facts h2, .faq h2 { text-align: center; font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 1.5rem; }

.facts__list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .facts__list { grid-template-columns: repeat(2, 1fr); }
}
.facts__list li { padding: 1.1rem 1.25rem; }

.faq__list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 700px; margin-inline: auto; }
.faq__item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}
.faq__item summary { cursor: pointer; font-weight: 600; }
.faq__item p { color: var(--text-muted); margin-bottom: 0; }

/* ---------------------------------------------------------------------
   Footer
--------------------------------------------------------------------- */
.site-footer {
  position: relative;
  padding: 2.25rem 0 4rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer__legal {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  font-size: 0.85rem;
}
.site-footer__legal a { text-decoration: underline; }
.site-footer__legal a:hover { color: var(--text); }

.back-to-top {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--theme-color);
  color: var(--text-on-theme);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 60;
}

/* ---------------------------------------------------------------------
   Toast
--------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------------------------------------------------------------------
   Loading overlay
--------------------------------------------------------------------- */
.loading-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.loading-overlay.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loading-overlay__spinner {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 4px solid var(--glass-border);
  border-top-color: var(--theme-color);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
   Animation layers (confetti burst, fired on greeting creation/share)
--------------------------------------------------------------------- */
.confetti-container {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 8px; height: 14px;
  opacity: 0.9;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.4; }
}

/* ---------------------------------------------------------------------
   Fade / slide utility animations
--------------------------------------------------------------------- */
.fade-in-up {
  animation: fadeInUp 0.8s ease both;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------
   Ads
--------------------------------------------------------------------- */
.ad-slot {
  max-width: var(--max-width);
  margin: 1.5rem auto;
  padding: 0.5rem;
  text-align: center;
}

.ad-slot--placeholder {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius);
  background: var(--glass-bg);
}
.ad-slot--placeholder.ad-slot--middle {
  min-height: 250px;
}
.ad-slot__label {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   Legal pages (terms.php / privacy.php)
--------------------------------------------------------------------- */
.legal-page {
  padding: 2.5rem 0 4rem;
}
.legal-page__inner {
  padding: 2rem 1.75rem;
  max-width: 760px;
  margin-inline: auto;
  line-height: 1.7;
}
.legal-page__inner h1 { font-family: var(--font-display); margin-top: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.legal-page__inner h2 { font-size: 1.15rem; margin-top: 2rem; }
.legal-page__inner h3 { font-size: 1rem; margin-top: 1.25rem; }
.legal-page__inner p, .legal-page__inner li { color: var(--text-muted); }
.legal-page__inner ul { padding-inline-start: 1.25rem; }
.legal-page__inner code {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}
.legal-page__meta { font-size: 0.85rem; }
.legal-page__notice {
  font-size: 0.85rem;
  font-style: italic;
  border-left: 3px solid var(--theme-color);
  padding-left: 0.75rem;
}
[dir="rtl"] .legal-page__notice {
  border-left: none;
  border-right: 3px solid var(--theme-color);
  padding-left: 0;
  padding-right: 0.75rem;
}

/* ---------------------------------------------------------------------
   Reduced motion
--------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
