:root {
  --paper: #F5F6FA;
  --ink: #161824;
  --frame: #1E2131;
  --caption: #FFD23F;
  --action: #2B55E6;
  --muted: #5A6075;
  --line: #DCDFE8;
  --white: #FFFFFF;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem);
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--action); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.6em; letter-spacing: -0.015em; }
h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: var(--step-2); font-weight: 800; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.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 { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--white); padding: 0.6rem 1rem; border-radius: 6px; z-index: 10; }
.skip:focus { top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; }
.nav { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--action); }
@media (max-width: 640px) { .nav { display: none; } }

/* Hero */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1fr 1.1fr; gap: 4rem; } }
.hero-copy h1 { max-width: 15ch; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 34rem; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 1.75rem; margin-top: 2rem; }
.store-btn { display: inline-flex; align-items: center; gap: 0.7rem; background: var(--ink); color: var(--white); padding: 0.7rem 1.3rem 0.7rem 1rem; border-radius: 10px; line-height: 1.15; font-weight: 700; font-size: 1.125rem; }
.store-btn small { display: block; font-weight: 400; font-size: 0.75rem; opacity: 0.8; }
.text-link { font-weight: 600; }

/* Player: the one bold element */
.player { margin: 0; background: var(--frame); border-radius: 18px; padding: 0.75rem 0.75rem 1rem; box-shadow: 0 30px 60px -30px rgba(30, 33, 49, 0.55); }
.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 30% 20%, #3a4266 0%, transparent 60%),
    radial-gradient(80% 70% at 85% 80%, #2b3352 0%, transparent 65%),
    #232740;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 4% 6%;
}
.caption {
  margin: 0;
  color: var(--caption);
  background: rgba(10, 11, 18, 0.62);
  padding: 0.25em 0.6em;
  border-radius: 6px;
  font-family: "Noto Sans", var(--font);
  font-weight: 500;
  font-size: clamp(1.05rem, 0.75rem + 1.6vw, 1.7rem);
  line-height: 1.5;
  text-align: center;
  max-width: 100%;
  transition: opacity 0.35s ease;
}
.caption.is-out { opacity: 0; }
.caption:lang(ur) { font-family: "Noto Nastaliq Urdu", serif; line-height: 2.1; font-size: clamp(1rem, 0.7rem + 1.5vw, 1.6rem); }
.caption:lang(ar), .naskh { font-family: "Noto Naskh Arabic", serif; }
.caption:lang(hi), .deva { font-family: "Noto Sans Devanagari", sans-serif; }
.caption:lang(bn), .beng { font-family: "Noto Sans Bengali", sans-serif; }
.nast { font-family: "Noto Nastaliq Urdu", serif; }
.lang-tag { position: absolute; top: 0.75rem; left: 0.75rem; color: var(--white); background: rgba(255,255,255,0.12); padding: 0.2rem 0.6rem; border-radius: 999px; font-size: var(--step--1); font-weight: 500; }
.pause { position: absolute; top: 0.6rem; right: 0.6rem; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border: 0; border-radius: 999px; background: rgba(255,255,255,0.12); color: var(--white); cursor: pointer; }
.pause:hover { background: rgba(255,255,255,0.22); }
.pause .i-play { display: none; }
.pause[aria-pressed="true"] .i-play { display: block; }
.pause[aria-pressed="true"] .i-pause { display: none; }
.scrub { height: 4px; background: rgba(255,255,255,0.15); border-radius: 4px; margin: 0.9rem 0.25rem 0.7rem; overflow: hidden; }
.scrub-fill { display: block; height: 100%; width: 38%; background: var(--caption); }
.srt { display: flex; gap: 1rem; color: #A9AEC4; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.8125rem; padding: 0 0.25rem; }

/* Bands */
.band { padding: clamp(3rem, 6vw, 5rem) 0; border-top: 1px solid var(--line); }
.band h2 { max-width: 24ch; }
.sub { color: var(--muted); }

.steps { list-style: none; counter-reset: step; margin: 2rem 0 0; padding: 0; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; background: var(--caption); color: var(--ink); font-weight: 800; margin-bottom: 1rem; }
.steps p { color: var(--muted); max-width: 32ch; }

.privacy-band { background: var(--frame); color: var(--white); padding: clamp(3rem, 6vw, 5rem) 0; }
.privacy-band h2 { color: var(--caption); font-size: var(--step-3); letter-spacing: -0.03em; max-width: 13ch; }
.privacy-band p { color: #D3D6E4; font-size: var(--step-1); line-height: 1.5; max-width: 36rem; }
.split { display: grid; gap: 2rem; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; } }

.features { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 2rem 0 0; }
.features dt { font-weight: 700; font-size: var(--step-1); margin-bottom: 0.3rem; }
.features dd { margin: 0; color: var(--muted); max-width: 34ch; }

.use-list { display: grid; gap: 0; margin-top: 1.5rem; }
@media (min-width: 760px) { .use-list { grid-template-columns: 1fr 1fr; column-gap: 3rem; } }
.use-list article { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.use-list p { color: var(--muted); margin: 0; max-width: 40ch; }

.lang-cloud { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 0.6rem 0.7rem; }
.lang-cloud li { background: var(--white); border: 1px solid var(--line); padding: 0.35rem 1rem; border-radius: 999px; font-size: var(--step-1); line-height: 1.6; }
.lang-cloud .nast { line-height: 2; font-size: 1.15rem; }

.faq details { border-top: 1px solid var(--line); max-width: 46rem; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 1.1rem 2rem 1.1rem 0; font-weight: 700; font-size: var(--step-1); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.95rem; font-size: 1.5rem; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); padding-bottom: 0.5rem; }

/* Footer */
.site-footer { background: var(--ink); color: #C9CCD8; padding: 2.5rem 0; }
.footer-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.footer-row p { margin: 0; }
.footer-row ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0; padding: 0; }
.footer-row a { color: var(--white); }

/* Online tool */
.tool-hero { padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem; }
.tool-hero h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); max-width: 18ch; }
.tool-hero .lede { max-width: 40rem; }
.tool { padding-bottom: clamp(3rem, 6vw, 5rem); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.25rem, 3vw, 2rem); box-shadow: 0 20px 40px -32px rgba(30, 33, 49, 0.45); }
.drop { display: grid; justify-items: center; gap: 0.5rem; text-align: center; padding: clamp(2.5rem, 6vw, 4rem) 1rem; border: 2px dashed #B9BFD3; border-radius: 14px; cursor: pointer; color: var(--muted); background: var(--paper); transition: border-color 0.15s, background 0.15s; }
.drop:hover, .drop.is-over { border-color: var(--action); background: #EEF2FE; color: var(--action); }
.drop:focus-within { outline: 3px solid var(--action); outline-offset: 3px; }
.drop-title { font-weight: 800; font-size: var(--step-1); color: var(--ink); }
.drop-sub { font-size: var(--step--1); max-width: 34ch; }

.tool-msg { margin: 1rem 0 0; padding: 0.75rem 1rem; border-radius: 10px; background: #FFF6D6; color: var(--ink); }
.tool-msg.is-error { background: #FDECEC; color: #8A1C1C; }

.file-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.file-name { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.file-meta { margin: 0; color: var(--muted); font-size: var(--step--1); }

.options { display: grid; gap: 1.25rem 2rem; margin: 1.5rem 0; }
@media (min-width: 760px) { .options { grid-template-columns: 1fr 1fr; } .options fieldset { grid-column: 1 / -1; } }
.field { display: grid; gap: 0.4rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field legend { font-weight: 700; padding: 0; margin-bottom: 0.4rem; }
.field select { font: inherit; padding: 0.7rem 0.8rem; border: 1px solid #B9BFD3; border-radius: 10px; background: var(--white); color: var(--ink); width: 100%; }
.radio { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--action); background: #EEF2FE; }
.radio input { margin-top: 0.35rem; accent-color: var(--action); }
.radio small { display: block; color: var(--muted); font-size: var(--step--1); }

.btn, .btn-quiet { font: inherit; font-weight: 700; border-radius: 10px; padding: 0.8rem 1.4rem; cursor: pointer; border: 1px solid transparent; }
.btn { background: var(--action); color: var(--white); }
.btn:hover { background: #1F43C4; }
.btn:disabled, .btn-quiet:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--ink); border-color: #B9BFD3; }
.btn-quiet:hover { border-color: var(--ink); }

.work-stage { font-weight: 800; font-size: var(--step-1); margin-bottom: 1rem; }
.bar { height: 12px; background: var(--paper); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar span { display: block; height: 100%; width: 0; background: var(--caption); transition: width 0.3s ease; }
.work-meta { margin: 0.75rem 0 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.work-tip { color: var(--muted); font-size: var(--step--1); margin: 0.5rem 0 1.25rem; }

.result-top { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .result-top { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.player-wrap video, .player-wrap audio { width: 100%; border-radius: 12px; background: var(--frame); }
.player-wrap video { aspect-ratio: 16 / 9; }
.result-actions { display: grid; gap: 0.75rem; align-content: start; }
.result-summary { margin: 0; font-weight: 700; }
.app-plug { color: var(--muted); font-size: var(--step--1); margin: 0.5rem 0 0; }
.editor-title { margin-top: 2rem; font-size: var(--step-1); }
.editor-help { color: var(--muted); font-size: var(--step--1); }
.cue-list { list-style: none; margin: 0; padding: 0; max-height: 28rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.cue { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); align-items: start; }
.cue:last-child { border-bottom: 0; }
.cue-time { font: 600 0.8125rem ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--action); background: #EEF2FE; border: 0; border-radius: 6px; padding: 0.3rem 0.5rem; cursor: pointer; }
.cue-text { padding: 0.2rem 0.4rem; border-radius: 6px; min-height: 1.6em; }
.cue-text:hover { background: var(--paper); }
.cue-text:focus { background: #FFFBEA; outline: 2px solid var(--caption); }
.cue-text:lang(ur) { font-family: "Noto Nastaliq Urdu", serif; line-height: 2.2; }
.cue-text:lang(ar), .cue-text:lang(fa) { font-family: "Noto Naskh Arabic", serif; }
.tool-link { font-weight: 700; }
.btn-link { display: inline-block; background: var(--caption); color: var(--ink); font-weight: 800; text-decoration: none; padding: 0.8rem 1.4rem; border-radius: 10px; }
.btn-link:hover { background: #FFE07A; }
.web-tool-band h2 { max-width: 18ch; }

/* Long-form pages (privacy, terms, guides) */
.doc { padding: clamp(2.5rem, 5vw, 4rem) 0 4rem; }
.doc .wrap { max-width: 44rem; }
.doc h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
.doc h2 { font-size: var(--step-1); margin-top: 2.2em; }
.doc .meta { color: var(--muted); }
.doc li { margin-bottom: 0.4em; }
.crumbs { font-size: var(--step--1); color: var(--muted); margin-bottom: 1.5rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--line); }
.callout { background: var(--white); border-left: 4px solid var(--caption); padding: 1rem 1.25rem; border-radius: 0 8px 8px 0; margin: 1.5rem 0; }
.guide-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.guide-list li { border-top: 1px solid var(--line); padding: 1rem 0; }
.guide-list a { font-weight: 700; font-size: var(--step-1); }
