/* LiveKhutbah landing page.
   Colours: brand/colors.md (Zellige Teal). Type: brand/typography.md (Readex Pro + Amiri Quran). */

/* ---------------------------------------------------------------- Fonts + tokens */
@font-face { font-family: "Readex Pro"; src: url("../assets/fonts/ReadexPro.ttf") format("truetype"); font-weight: 160 700; font-display: swap; }
@font-face { font-family: "Amiri Quran"; src: url("../assets/fonts/AmiriQuran.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #F7F3EC; --surface: #EAE3D7; --primary: #0E5E6F; --accent: #E07A3F;
  --live: #D7263D; --error: #B42318; --dark: #08343D; --ink: #0B2F37; --on-dark: #F7F3EC;
  --line: #0B2F371F; --muted: #0B2F37A6;
  --font-ui: "Readex Pro", system-ui, sans-serif;
  --font-quran: "Amiri Quran", "Readex Pro", serif;
}

/* ---------------------------------------------------------------- Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 400 17px/1.55 var(--font-ui); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.muted { color: var(--muted); }
.label { font: 600 12px/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }

/* ---------------------------------------------------------------- Components */
.nav { display: flex; justify-content: space-between; align-items: center; height: 84px; }
.nav .logo { height: 34px; width: auto; display: block; }
.nav-end { display: flex; align-items: center; gap: 16px; }
/* EN | FR switch: links to the same page in the other language (/ and /fr/) */
.lang-switch { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); }
.lang-switch a { display: grid; place-items: center; min-width: 38px; height: 32px; padding: 0 10px; border-radius: 999px;
  font: 600 12px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: #0B2F37CC; text-decoration: none; transition: color .2s, background .2s; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px #0B2F371F; }
.lang-switch a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--primary); color: var(--on-dark); font: 500 16px/1 var(--font-ui); text-decoration: none; cursor: pointer; transition: background .2s, transform .2s; }
.btn:hover { background: #0B4E5D; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn.sm { height: 40px; padding: 0 18px; font-size: 15px; }

.live { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--live); color: #fff; font: 600 11px/1 var(--font-ui); letter-spacing: .08em; }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* Quran verse, "chapter break" style: two hairlines + title, centred teal Arabic, a small star to close. Used in the phone feed and the band. */
.quran { text-align: center; }
.quran .rule { display: flex; align-items: center; gap: 10px; font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.quran .rule i { flex: 1; height: 1px; background: #0B2F3729; }
.quran .q { margin-top: 12px; font-family: var(--font-quran); direction: rtl; text-align: center; font-size: 20px; line-height: 1.95; color: var(--primary); text-wrap: balance; }
.quran .qt { margin: 8px auto 0; max-width: 232px; font-size: 14.5px; line-height: 1.5; text-wrap: pretty; }
.quran .end { margin-top: 12px; color: var(--accent); line-height: 0; }
.quran-lg .rule { font-size: 13px; }
.quran-lg .q { font-size: 34px; margin-top: 18px; }
.quran-lg .qt { max-width: 380px; font-size: 17px; margin-top: 10px; }
.quran-lg .end { margin-top: 18px; }

/* FAQ accordion: one answer open at a time (js/main.js animates the height) */
.accordion details { border-top: 1px solid var(--line); }
.accordion details:last-child { border-bottom: 1px solid var(--line); }
.accordion summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 20px 0; font-size: 18px; font-weight: 500; transition: color .2s; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { color: var(--primary); }
.accordion summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 4px; }
/* plus that turns into a minus: the vertical bar shrinks */
.accordion summary::after { content: ""; flex: none; width: 14px; height: 14px; transition: background-size .25s ease;
  background: linear-gradient(var(--primary), var(--primary)) center / 14px 2px no-repeat, linear-gradient(var(--primary), var(--primary)) center / 2px 14px no-repeat; }
.accordion details[open] summary::after { background-size: 14px 2px, 2px 0; }
.accordion .answer { overflow: hidden; }
.accordion .answer p { padding-bottom: 22px; color: var(--muted); max-width: 640px; }

/* hidden from people, kept for bots; clipped in place so it never widens the page (also right-to-left) */

footer.wrap { padding-top: 40px; padding-bottom: 40px; font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- Sections */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; padding-top: 56px; padding-bottom: 40px; min-height: calc(100vh - 84px); }
.hero h1 { font-size: clamp(42px, 5.4vw, 68px); margin-top: 16px; }
.hero .sub { font-size: 19px; color: var(--muted); margin-top: 22px; max-width: 500px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn { white-space: nowrap; }
.hero .iphone { margin-inline-start: auto; margin-inline-end: 24px; }

section.wrap { margin-top: 110px; }
.head h2 { font-size: 42px; margin-top: 14px; max-width: 640px; }
.faq-head h2 { margin-bottom: 32px; }

.steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: #fff; border-radius: 20px; padding: 28px; }
.steps .n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--primary); font-weight: 600; font-size: 14px; }
.steps h3 { font-size: 20px; margin: 22px 0 8px; }

.band { background: #fff; border-radius: 28px; padding: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.band h2 { font-size: 40px; margin-top: 14px; }
.band .muted { margin-top: 16px; }

.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.photo { position: relative; margin: 0; border-radius: 28px; overflow: hidden; background: var(--surface); }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
/* Fades in the brand's deep teal-black so the caption stays readable */
.photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.photo-bottom::after { background: linear-gradient(to top, #051A1FD9 0%, #051A1F80 26%, #051A1F00 52%); }
/* corner fade on the end side: top-right in English and French, top-left in Arabic */
.photo-top-end::after { --fade-x: 100%; background: radial-gradient(ellipse 115% 60% at var(--fade-x) 0%, #051A1FE0 0%, #051A1F99 38%, #051A1F00 78%); }
.photo figcaption { position: absolute; z-index: 1; left: 32px; right: 32px; color: var(--on-dark); font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: -.015em; }
.photo-bottom figcaption { bottom: 32px; }
.photo-top-end figcaption { top: 32px; text-align: end; }

.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; margin-top: 48px; align-items: start; }
.price-card { background: #fff; border-radius: 28px; padding: 40px; }
.price-card .amount { font-size: 64px; font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.price-card .amount span { font-size: 20px; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-inline-start: 6px; }
.price-card > .muted { margin-top: 14px; max-width: 380px; }
.rates { width: 100%; border-collapse: collapse; margin-top: 28px; font-size: 16px; }
.rates th, .rates td { padding: 12px 0; border-top: 1px solid var(--line); }
.rates th { text-align: start; font-weight: 400; }
.rates td { text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; }
.rates-note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.credit { list-style: none; padding: 0; margin: 0; }
.credit li { padding: 22px 0; border-top: 1px solid var(--line); }
.credit li:first-child { padding-top: 4px; border-top: 0; }
.credit h3 { font-size: 20px; }
.credit p { margin-top: 6px; }

.start { display: grid; justify-items: center; text-align: center; gap: 0; padding-bottom: 72px; }
.start h2 { font-size: 42px; margin-top: 14px; max-width: 720px; }
.start .muted { margin-top: 16px; max-width: 600px; }
.start .btn { margin-top: 28px; }

/* ---------------------------------------------------------------- iPhone 15 Pro mock (71.6 x 146.6 mm): titanium band, bezel, Dynamic Island, side buttons */
.iphone { position: relative; z-index: 2; width: 300px; height: 614px; border-radius: 55px; padding: 3px;
  background: linear-gradient(135deg, #d8d4cc 0%, #8b877f 18%, #c9c4bb 40%, #77736c 62%, #bcb7ae 82%, #8f8b84 100%);
  box-shadow: 0 0 0 1px #00000099, 0 60px 100px -30px #000d, 0 20px 40px -20px #000a; }
.iphone .bezel { height: 100%; border-radius: 52px; background: #030303; padding: 9px; box-shadow: inset 0 0 0 1px #ffffff14; }
.iphone .display { position: relative; height: 100%; border-radius: 43px; overflow: hidden; background: var(--bg); color: var(--ink); }
.iphone .k { position: absolute; width: 4px; border-radius: 2px; background: linear-gradient(90deg, #6f6b64, #cfcac1 60%, #8a867f); }
.iphone .k.act { left: -3px; top: 118px; height: 30px; }
.iphone .k.vu { left: -3px; top: 170px; height: 52px; }
.iphone .k.vd { left: -3px; top: 232px; height: 52px; }
.iphone .k.pw { right: -3px; top: 190px; height: 82px; }
.iphone .island { position: absolute; top: 11px; left: 50%; width: 94px; height: 28px; margin-left: -47px; border-radius: 20px; background: #000; z-index: 3; }
.iphone .island::after { content: ""; position: absolute; right: 16px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #2a3550, #05070c 60%); }
.iphone .status { position: relative; height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 2px 22px 0 32px;
  font: 600 15px/1 -apple-system, "SF Pro Text", "Readex Pro", sans-serif; letter-spacing: -.01em; }
.iphone .status .ic { display: flex; gap: 5px; align-items: center; fill: currentColor; }
.iphone .status svg { display: block; height: 11px; width: auto; }
.iphone .app { position: absolute; inset: 50px 0 0; display: flex; flex-direction: column; padding: 4px 0 26px; }
.iphone .ah { margin: 0 18px; }
.iphone .ah { display: flex; align-items: center; gap: 8px; padding: 6px 0 12px; }
.iphone .ah img { height: 30px; }
.iphone .ah > div { min-width: 0; }
.iphone .ah b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone .ah small { display: block; font-size: 11px; color: var(--muted); }
.iphone .ah .live { margin-inline-start: auto; }
.iphone .langs { display: flex; gap: 6px; padding: 0 18px 6px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 18px;
  scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.iphone .langs::-webkit-scrollbar { display: none; }
.iphone .pill { flex: none; scroll-snap-align: start; height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink);
  font: 500 13px/1 var(--font-ui); cursor: pointer; transition: background .2s, color .2s; }
.iphone .pill:hover { background: #E0D7C8; }
.iphone .pill[aria-pressed="true"] { background: var(--primary); color: var(--on-dark); }
.iphone .pill:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.iphone .home { position: absolute; bottom: 8px; left: 50%; width: 108px; height: 5px; margin-left: -54px; border-radius: 3px; background: var(--ink); }

/* Live caption feed: lines stack at the bottom, old lines fade, js/main.js scrolls to the newest */
.feed { flex: 1; padding: 0 18px; overflow-y: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28%); mask-image: linear-gradient(to bottom, transparent 0, #000 28%); }
.feed::-webkit-scrollbar { display: none; }
.feed-list { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.fi { padding: 9px 0; transition: opacity .5s; animation: rise .45s ease-out; }
.fi.old { opacity: .4; }
.fi.quran { padding: 16px 0 8px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.fi .ts { font-size: 11px; letter-spacing: .06em; opacity: .55; font-variant-numeric: tabular-nums; }
.fi .far { direction: rtl; opacity: .6; font-size: 13px; line-height: 1.6; }
.fi .fen { font-weight: 500; font-size: 16px; line-height: 1.38; }
.fi .fen span { opacity: 0; transition: opacity .25s; }
.fi .fen span.on { opacity: 1; }
/* Transcription mode: the Arabic is the main line, so the small Arabic line and the verse translation hide */
.fi[data-mode="source"] .far, .fi.quran[data-mode="source"] .qt { display: none; }
.fi[data-mode="source"] .fen { line-height: 1.7; letter-spacing: 0; }

/* ---------------------------------------------------------------- Small screens */
/* ---------------------------------------------------------------- Arabic (dir="rtl", /ar/)
   Layout mirrors through start/end properties above. Arabic letters join, so no letter-spacing
   and no uppercase; taller letters need more line height. */
[dir="rtl"] body { line-height: 1.75; }
[dir="rtl"] *, [dir="rtl"] :is(h1, h2, h3, .label, .btn, .lang-switch a, .live, .photo figcaption, .price-card .amount, summary) { letter-spacing: 0; text-transform: none; }
[dir="rtl"] :is(h1, h2, h3) { line-height: 1.35; }
[dir="rtl"] .label { font-size: 13px; }
[dir="rtl"] .photo-top-end::after { --fade-x: 0%; }

@media (max-width: 860px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .hero, .band, .steps, .pricing { grid-template-columns: 1fr; }
  .pricing { gap: 32px; }
  .price-card { padding: 28px; }
  .hero { min-height: 0; gap: 48px; }
  .hero .iphone { margin: 0 auto; }
  .nav .logo { height: 28px; }
  .nav-end .btn { display: none; }  /* the hero has the same button; keeps the bar on one line */
  .band { padding: 28px; }
}

@media (max-width: 600px) {
  .photos { grid-template-columns: 1fr; gap: 16px; }
  .photo { border-radius: 20px; }
  .photo figcaption { left: 24px; right: 24px; font-size: 24px; }
  .photo-bottom figcaption { bottom: 24px; }
  .photo-top-end figcaption { top: 24px; }
  }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fi, .live::before { animation: none; }
}
