/* XCaptions home page (loaded only on /, after site.css). */

:root {
  --home-ink: #14151a;
  --home-muted: #5b5f6b;
  --home-lime: #d1fa70;
  --home-lime-ink: #14151a;
  --home-surface: #ffffff;
  --home-surface-alt: #f8f9fa;
  --home-border: #e4e6eb;
  --home-border-strong: #c4c7d0;
  --caption-font: 'Anton', Impact, 'Arial Black', 'Franklin Gothic Bold', sans-serif;
  --caption-font-ur: 'Noto Nastaliq Urdu', 'Urdu Typesetting', 'Jameel Noori Nastaleeq', 'Noto Naskh Arabic', 'Segoe UI', serif;
}

body {
  background:
    radial-gradient(ellipse 900px 380px at 50% -30px, rgba(209, 250, 112, 0.16), transparent 70%),
    #ffffff;
  color: var(--home-ink);
  overflow-x: clip;
}

/* Sticky, blurred header with scroll shadow ------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--home-border);
  transition: box-shadow .2s ease;
}
@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-scroll-shadow linear both;
    animation-timeline: scroll();
    animation-range: 0px 80px;
  }
}
@keyframes header-scroll-shadow {
  from {
    box-shadow: 0 1px 0 var(--home-border);
  }
  to {
    box-shadow: 0 6px 20px -2px rgba(20, 21, 26, 0.08), 0 1px 0 var(--home-border);
  }
}

.skip-link { z-index: 120; }

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

/* Hero (tightened so demo frame peeks into first viewport on 1440x900) ---- */
.home-hero {
  padding: clamp(16px, 2.5vw, 26px) 0 0;
  text-align: center;
}
.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--home-muted);
  font-weight: 700;
  margin-bottom: 10px;
}
.home-hero h1 {
  font-size: clamp(1.95rem, 4.8vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.08;
  max-width: 17ch;
  margin: 0 auto .25em;
  text-wrap: balance;
  color: var(--home-ink);
}
.wm {
  display: inline-block;
  padding: .04em .18em;
  border-radius: .18em;
  line-height: 1.08;
  white-space: nowrap;
  background: var(--home-lime);
  color: var(--home-lime-ink);
}
.wm-lime {
  transform: rotate(-2.5deg);
  animation: wm-pop-a 2.6s ease-in-out infinite;
}
.wm-pink {
  transform: rotate(2deg);
  animation: wm-pop-b 3.1s ease-in-out infinite;
}
@keyframes wm-pop-a { 0%, 100% { transform: rotate(-2.5deg) scale(1); } 50% { transform: rotate(-2.5deg) scale(1.06); } }
@keyframes wm-pop-b { 0%, 100% { transform: rotate(2deg) scale(1); } 50% { transform: rotate(2deg) scale(1.06); } }

.home-sub {
  color: var(--home-muted);
  font-size: 1.03rem;
  line-height: 1.5;
  max-width: 58ch;
  margin: 0 auto 16px;
}
.home-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .98rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.home-btn:hover {
  transform: translateY(-1px);
}
.home-btn-primary {
  background: var(--home-ink);
  color: #ffffff;
  border-color: var(--home-ink);
}
.home-btn-primary:hover {
  background: var(--home-lime);
  color: var(--home-ink);
  border-color: var(--home-lime);
}
.home-btn-ghost {
  border-color: var(--home-border);
  background: #ffffff;
  color: var(--home-ink);
}
.home-btn-ghost:hover {
  border-color: var(--home-border-strong);
  background: var(--home-surface-alt);
  color: var(--home-ink);
}
.home-btn-big {
  min-height: 52px;
  padding: 0 32px;
  font-size: 1.04rem;
}

/* Trust strip ------------------------------------------------------------- */
.home-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 16px;
  margin: 16px auto 0;
  max-width: 760px;
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .84rem;
  color: var(--home-muted);
  font-weight: 500;
  white-space: nowrap;
}
.trust-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--home-ink);
}

/* Alternating sections --------------------------------------------------- */
.home-demo,
.features,
.home-faq {
  background: var(--home-surface-alt);
  border-top: 1px solid var(--home-border);
  border-bottom: 1px solid var(--home-border);
  margin-left: calc(-1 * ((100vw - min(100vw, var(--wrap))) / 2 + 20px));
  margin-right: calc(-1 * ((100vw - min(100vw, var(--wrap))) / 2 + 20px));
  padding-left: calc((100vw - min(100vw, var(--wrap))) / 2 + 20px);
  padding-right: calc((100vw - min(100vw, var(--wrap))) / 2 + 20px);
  padding-top: clamp(22px, 3vw, 36px);
  padding-bottom: clamp(34px, 4.5vw, 56px);
  margin-top: clamp(18px, 2.5vw, 30px);
}

.frames,
.privacy,
.home-final {
  margin-top: clamp(48px, 6vw, 72px);
}

.frames h2, .features h2, .privacy h2, .home-faq h2, .home-final h2 {
  margin-top: 0;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--home-ink);
  margin-bottom: 24px;
}

/* Live caption demo video player ----------------------------------------- */
.demo {
  max-width: 800px;
  margin: 0 auto;
}
.demo-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  background: #0d0e14;
  box-shadow: 0 24px 60px -14px rgba(20, 21, 26, .35), 0 10px 24px -6px rgba(20, 21, 26, .18), 0 0 0 1px rgba(20, 21, 26, .08);
  animation: demo-float-in 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes demo-float-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .demo-frame {
    animation: none !important;
  }
}

.demo-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(13, 14, 20, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.demo-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.demo-dots .dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.demo-tag {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  font-family: var(--font);
}

.demo-scene {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 120% at 12% 8%, rgba(209, 250, 112, .16), transparent 42%),
    radial-gradient(130% 130% at 88% 92%, rgba(255, 79, 163, .2), transparent 46%),
    linear-gradient(160deg, #16161f, #0b0b0f 72%);
}
.scene-orb { position: absolute; border-radius: 50%; filter: blur(1px); }
.scene-orb-lime { width: 34%; aspect-ratio: 1; left: 6%; top: 10%; background: radial-gradient(circle at 32% 32%, rgba(209, 250, 112, .9), rgba(209, 250, 112, .02) 70%); opacity: .5; }
.scene-orb-pink { width: 30%; aspect-ratio: 1; right: 8%; bottom: 4%; background: radial-gradient(circle at 32% 32%, rgba(255, 79, 163, .9), rgba(255, 79, 163, .02) 70%); opacity: .55; }
.scene-streak { position: absolute; height: 2px; border-radius: 999px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent); }
.scene-streak-1 { width: 54%; left: 12%; top: 30%; transform: rotate(-8deg); }
.scene-streak-2 { width: 38%; right: 10%; top: 56%; transform: rotate(6deg); }

.demo-caption { position: absolute; left: 50%; bottom: 16%; transform: translateX(-50%); white-space: nowrap; text-align: center; max-width: 92%; }
.demo-caption .w { display: inline-block; transition: transform .16s ease, color .16s ease, text-shadow .16s ease, background .16s ease; }

/* Caption styles: Pink/yellow are permitted ONLY inside demo caption styles */
/* Pop */
.demo[data-style="pop"] .demo-caption { font-family: var(--caption-font); font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: .01em; }
.demo[data-style="pop"] .w { color: #fff; -webkit-text-stroke: 1.5px rgba(0, 0, 0, .85); text-shadow: 0 2px 0 rgba(0, 0, 0, .55); }
.demo[data-style="pop"] .w.is-active { color: #ffe24d; transform: scale(1.22); }

/* Neon */
.demo[data-style="neon"] .demo-caption { font-family: var(--caption-font); font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 700; }
.demo[data-style="neon"] .w { color: #edf9d6; text-shadow: 0 0 6px rgba(209, 250, 112, .35); }
.demo[data-style="neon"] .w.is-active { color: var(--home-lime); text-shadow: 0 0 8px var(--home-lime), 0 0 22px var(--home-lime), 0 0 44px #ff4fa3; }

/* Box */
.demo[data-style="box"] .demo-caption { font-family: var(--caption-font); font-size: clamp(1.4rem, 3.6vw, 2.2rem); font-weight: 700; }
.demo[data-style="box"] .w { background: rgba(11, 11, 15, .88); color: #fff; padding: .06em .12em; border-radius: .12em; }
.demo[data-style="box"] .w.is-active { background: #ffe24d; color: #111210; }

/* Urdu */
.demo-words-ur { display: none; }
.demo[data-style="ur"] .demo-words:not(.demo-words-ur) { display: none; }
.demo[data-style="ur"] .demo-words-ur { display: inline; }
.demo[data-style="ur"] .demo-caption { font-family: var(--caption-font-ur); font-size: clamp(1.6rem, 4.4vw, 2.6rem); font-weight: 700; direction: rtl; }
.demo[data-style="ur"] .w { color: #fff; }
.demo[data-style="ur"] .w.is-active { color: var(--home-lime); text-shadow: 0 0 14px rgba(209, 250, 112, .75); }

/* Waveform */
.demo-wave { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; height: 24px; }
.demo-wave i { display: block; width: 3px; height: 30%; border-radius: 999px; background: linear-gradient(180deg, var(--home-lime), #ff4fa3); opacity: .8; animation: wave 1.1s ease-in-out infinite; }
.demo-wave i:nth-child(odd) { height: 55%; }
.demo-wave i:nth-child(3n) { height: 82%; animation-delay: -.35s; }
.demo-wave i:nth-child(4n) { animation-delay: -.7s; }
@keyframes wave { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

.demo-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.style-chip {
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--home-border);
  background: #ffffff;
  color: var(--home-muted);
  cursor: pointer;
  font: 600 .95rem var(--font);
  transition: all .15s ease;
}
.style-chip:hover { border-color: var(--home-border-strong); color: var(--home-ink); }
.style-chip[aria-pressed="true"] {
  background: var(--home-lime);
  border-color: #b5e655;
  color: var(--home-lime-ink);
  font-weight: 700;
}
.demo-note { color: var(--home-muted); font-size: .88rem; text-align: center; margin: 12px 0 0; }

/* Three frames (card grid with 1px border, 14px radius and hover lift) -- */
.film {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.film-frame {
  background: var(--home-surface);
  border: 1px solid var(--home-border);
  border-radius: 14px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.film-frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -6px rgba(20, 21, 26, .08);
  border-color: var(--home-border-strong);
}
.film-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--home-lime);
  color: var(--home-ink);
  font-size: .95rem;
  font-weight: 800;
  line-height: 1;
}
.film-frame h3 { margin: 0 0 6px; font-size: 1.18rem; color: var(--home-ink); font-weight: 750; }
.film-frame p { margin: 0; color: var(--home-muted); font-size: .95rem; line-height: 1.55; }
.frames-more { margin-top: 22px; color: var(--home-muted); font-size: .95rem; }
.frames-more a { color: var(--home-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.frames-more a:hover { color: #000000; text-decoration-color: var(--home-lime); }

/* Features (pills with 1px border and hover lift) ------------------------ */
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.pills li {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--home-border);
  background: #ffffff;
  color: var(--home-ink);
  font-weight: 600;
  font-size: .96rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pills li:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -4px rgba(20, 21, 26, .08);
  border-color: var(--home-border-strong);
}
.pills li:nth-child(3n+1) { transform: rotate(-1.4deg); }
.pills li:nth-child(3n+2) { transform: rotate(1.2deg); }
.pills li:nth-child(3n) { transform: rotate(-.6deg); }
.pills li:hover { transform: translateY(-2px) scale(1.02); }

/* Privacy panel (1px border, 14px radius, hover lift) -------------------- */
.privacy-panel {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--home-surface);
  border: 1px solid var(--home-border);
  border-radius: 14px;
  padding: 28px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.privacy-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -6px rgba(20, 21, 26, .08);
  border-color: var(--home-border-strong);
}
.privacy-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--home-lime);
  color: var(--home-ink);
}
.privacy-icon svg { width: 24px; height: 24px; }
.privacy-panel strong { display: block; font-size: 1.15rem; margin-bottom: 6px; color: var(--home-ink); }
.privacy-panel p { margin: 0 0 12px; color: var(--home-muted); line-height: 1.6; }
.privacy-panel a { font-weight: 600; color: var(--home-ink); text-decoration: underline; text-underline-offset: 3px; }
.privacy-panel a:hover { color: #000000; text-decoration-color: var(--home-lime); }

/* FAQ (details) ----------------------------------------------------------- */
.home-faq details { border-top: 1px solid var(--home-border); transition: background-color .15s ease; }
.home-faq details:last-of-type { border-bottom: 1px solid var(--home-border); }
.home-faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 16px 4px;
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--home-ink);
  transition: color .15s ease;
}
.home-faq summary:hover { color: #000000; }
.home-faq summary::-webkit-details-marker { display: none; }
.home-faq summary::after { content: "+"; font-size: 1.35rem; font-weight: 400; color: var(--home-ink); transition: transform .2s ease; }
.home-faq details[open] summary::after { transform: rotate(45deg); }
.home-faq details p { margin: 0 0 16px; color: var(--home-muted); max-width: 72ch; line-height: 1.6; }
.home-faq-more { margin-top: 22px; }
.home-faq-more a { color: var(--home-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.home-faq-more a:hover { color: #000000; text-decoration-color: var(--home-lime); }

/* Final CTA card (1px border, 14px radius, hover lift) ------------------- */
.home-final {
  margin-top: clamp(48px, 6vw, 72px);
  text-align: center;
  padding: clamp(36px, 5vw, 56px) 24px;
  background: radial-gradient(ellipse 700px 300px at 50% 100%, rgba(209, 250, 112, 0.16), transparent 70%), var(--home-surface-alt);
  border: 1px solid var(--home-border);
  border-radius: 14px;
  margin-bottom: 24px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.home-final:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -6px rgba(20, 21, 26, .08);
  border-color: var(--home-border-strong);
}
.home-final h2 { font-size: clamp(1.8rem, 4.4vw, 2.8rem); margin-top: 0; margin-bottom: 12px; color: var(--home-ink); font-weight: 800; }
.home-final p { color: var(--home-muted); max-width: 52ch; margin: 0 auto 24px; line-height: 1.6; }

/* Motion + responsive ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .wm-lime, .wm-pink, .demo-wave i, .demo-frame { animation: none !important; }
}

@media (max-width: 800px) {
  .film {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 720px) {
  .site-nav a:not(.nav-cta) { display: none; }
  .site-nav { gap: 0; }
  .home-hero h1 { max-width: 100%; }
  .privacy-panel { flex-direction: column; padding: 22px; }
}

@media (max-width: 520px) {
  .home-cta {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .home-cta .home-btn {
    width: 100%;
  }
  .home-trust {
    gap: 8px 10px;
    max-width: 350px;
  }
  .trust-item {
    font-size: .78rem;
    gap: 5px;
  }
  .trust-icon {
    width: 13px;
    height: 13px;
  }
}
