/* Surabar website: everything outside the demo. Colors and fonts come from demo/demo.css. */

/* Light mode, outside the demo: a slightly darker gray for secondary text, so it's easy to read on the
   pale page (the demo keeps the app's own gray). */
:root[data-mode="light"] .site { --text-2: rgba(0, 0, 0, 0.62); }
/* Filled accent buttons with white text: in light mode, a deeper shade of the accent keeps the text
   readable (light accents like yellow are too pale behind white text). */
:root[data-mode="light"] { --accent-fill: color-mix(in srgb, var(--accent) 72%, #000); }
:root[data-mode="dark"] { --accent-fill: color-mix(in srgb, var(--accent) 72%, #2a1d80); }
:root .hero-btn, :root .site .dl-btn, :root .play-btn { background: var(--accent-fill); }
/* --accent-text: the accent for small text and links, darkened (light mode) or lightened (dark mode)
   so every accent color stays readable against the page (WCAG contrast). */
:root[data-mode="light"] { --mint-text: #1F7F63; }
:root[data-mode="dark"] { --mint-text: #9FE6CB; }
:root[data-mode="light"] { --card-bg: #fff; --card-edge: rgba(0, 0, 0, 0.07); --code-bg: rgba(0, 0, 0, 0.05); --accent-text: color-mix(in srgb, var(--accent) 58%, #000); }
:root[data-mode="dark"] { --card-bg: #17181f; --card-edge: rgba(255, 255, 255, 0.08); --code-bg: rgba(255, 255, 255, 0.08); --accent-text: color-mix(in srgb, var(--accent) 65%, #fff); }

/* ---------- Skip link: hidden until a keyboard user tabs to it ---------- */
.skip-link {
  position: fixed; top: 8px; left: 50%; z-index: 100; transform: translate(-50%, -200%);
  padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: #fff; font: 600 14px var(--font); text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); transition: transform 0.15s;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- The scroll gate's cue (bottom of the desktop, above the Dock) ---------- */
.desktop { transition: transform 380ms cubic-bezier(0.2, 0.9, 0.3, 1); }
.desktop.pulling { transition: transform 60ms linear; }
.more-cue {
  position: absolute; left: 50%; bottom: 100px; z-index: 9; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 12px;
  font-size: 12px; color: var(--text-2); white-space: nowrap;
  pointer-events: none; user-select: none; -webkit-user-select: none;
}
/* Out of the way while the Dock is magnified or the reader is open. */
.more-cue { transition: opacity 0.15s; }
.desktop:has(.dock:hover) .more-cue, .desktop:has(.panel.open) .more-cue { opacity: 0; }
.more-cue-label::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 8px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.more-cue-bar { width: 72px; height: 3px; border-radius: 3px; background: var(--fill-strong); overflow: hidden; opacity: 0; transition: opacity 0.2s; }
.more-cue-bar span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.more-cue.pulling { color: var(--text); }
.more-cue.pulling .more-cue-bar { opacity: 1; }

/* ---------- Phones and tablets: the hero swaps the Mac-only install bits for "Try the demo" ---------- */
.touch-intro { display: none; }
.touch .touch-intro { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 24px; }
.touch .hero-actions { display: none; }
.mac-note {
  display: flex; align-items: flex-start; gap: 10px; max-width: 340px; margin: 0;
  padding: 12px 16px; border-radius: 16px; text-align: left; font-size: 14px; line-height: 1.45;
  background: var(--hint-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.mac-note-ic { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--accent); }
.mac-note-ic .ic { width: 100%; height: 100%; }
.link-btn { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.cue-touch, .touch .cue-mouse { display: none; }
.touch .cue-touch { display: inline; }

/* ---------- Page ---------- */
.site {
  position: relative;
  font-size: 16px; line-height: 1.55;
  background: var(--page-bg);
  padding-bottom: 40px;
}
.site a { color: var(--accent-text); text-decoration: none; }
/* Links inside sentences are underlined too, so they don't rely on color alone. */
.site :is(p, li) a:not(.dl-btn) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.site a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site code { font: 0.88em var(--font-mono); padding: 1px 5px; border-radius: 5px; background: var(--code-bg); }
.section { max-width: 1080px; margin: 0 auto; padding: 104px 24px 0; scroll-margin-top: 0; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mint-text); }
.section h2 { margin: 8px 0 0; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
.lede { margin: 14px 0 0; max-width: 640px; font-size: 18px; color: var(--text-2); }
.card {
  padding: 24px; border-radius: 20px;
  background: var(--card-bg);
  box-shadow: 0 0 0 0.5px var(--card-edge), 0 1px 3px rgba(0, 0, 0, 0.04);
}
.card h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.card p { margin: 8px 0 0; color: var(--text-2); }
.tag {
  display: inline-block; vertical-align: 2px; margin-left: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--fill-hover); color: var(--text-2);
}
.fine { margin: 10px 0 0; font-size: 14px; color: var(--text-2); }

/* Install */
.install-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; margin-top: 36px; }
.install-grid > *, .privacy-grid > *, .feature-grid > *, .game-grid > *, .credit-grid > * { min-width: 0; }
.cmd code { min-width: 0; }
.cmd-wide { width: 100%; justify-content: space-between; margin-top: 16px; background: var(--code-bg); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.cmd-wide code { background: none; padding: 0; font-size: 13px; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; font-size: 13px; color: var(--text-3); }
.or::before, .or::after { content: ""; flex: 1; height: 0.5px; background: var(--separator); }
.site .dl-btn {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px;
  background: var(--accent); color: #fff; text-decoration: none;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.site .dl-btn:hover { filter: brightness(1.07); text-decoration: none; }
.dl-ic { width: 26px; height: 26px; flex: none; }
.dl-ic .ic { width: 100%; height: 100%; stroke-width: 2; }
.dl-btn b { display: block; font-size: 16px; }
.dl-btn small { display: block; font-size: 13px; opacity: 0.85; }
.version-line { margin: 18px 0 0; font-size: 14px; color: var(--text-2); }
.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.steps li > span {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text);
}
.alt { margin-top: 18px; padding-top: 14px; border-top: 0.5px solid var(--separator); }
.alt summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-2); }

/* Features */
.feature-grid { display: grid; gap: 20px; margin-top: 36px; }
.g-card-ic {
  display: grid; place-items: center; box-sizing: border-box; width: 46px; height: 46px; margin-bottom: 14px; border-radius: 23%;
  color: #b6edd0; font-weight: 700; font-size: 16px;
  background: linear-gradient(165deg, #7a64dc, #4332b7);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 0.5px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Reciter gallery */
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.game-card { display: flex; flex-direction: column; align-items: flex-start; }
.game-card p { flex: 1; font-size: 15px; }
.reciter-card { flex-direction: row; align-items: center; gap: 14px; padding: 18px 20px; }
.reciter-card .g-card-ic { flex: none; margin: 0; }
.reciter-card h3 { flex: 1; font-size: 16px; }
.play-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
}
.play-btn .ic { width: 13px; height: 13px; }
.play-btn:hover { filter: brightness(1.07); }
.reciter-card.playing { box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1.5px var(--accent), 0 18px 40px -24px rgba(0, 0, 0, 0.35); }

/* Privacy */
.privacy-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-top: 36px; }
.checks { list-style: none; margin: 0; display: grid; gap: 14px; }
.checks li { position: relative; padding-left: 32px; color: var(--text-2); }
.checks li b { color: var(--text); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.checks li::after {
  content: ""; position: absolute; left: 7px; top: 6px; width: 5px; height: 9px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* Credits */
.credit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.credit-grid .card { display: flex; flex-direction: column; }
.credit-grid .card p { flex: 1; font-size: 15px; }
.credit-grid .card a { margin-top: 14px; font-size: 14px; font-weight: 600; }

/* FAQ */
.faq { margin-top: 32px; max-width: 780px; border-top: 0.5px solid var(--separator); }
.faq details { border-bottom: 0.5px solid var(--separator); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative;
  font-size: 17px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 24px; width: 8px; height: 8px;
  border: solid var(--text-2); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 28px; }
.faq details p { margin: 0 0 18px; color: var(--text-2); }

/* Footer */
.footer {
  max-width: 1080px; margin: 112px auto 0; padding: 28px 24px 0;
  border-top: 0.5px solid var(--separator);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  font-size: 14px; color: var(--text-2);
}
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.footer-brand .mark-slot { width: 20px; height: 17px; color: var(--accent); }
.footer { padding-bottom: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; flex: 1; }
.site .footer-links a { color: var(--text-2); }
.site .footer-links a:hover { color: var(--text); }
.credit { width: 100%; margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.site .credit a { color: var(--text); }

/* ---------- Reveal on scroll (site.js toggles .in as things enter and leave the screen) ---------- */
/* Uses `translate`, not `transform`, so the cards' hover lift keeps working alongside it. */
:root .site .reveal {
  --d: calc(var(--i, 0) * 70ms);
  opacity: 0; translate: 0 var(--from, 28px);
  transition: opacity 0.45s ease, translate 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s;
}
:root .site .reveal.in { opacity: 1; translate: none; transition-delay: var(--d), var(--d), 0s, 0s; }
/* Whatever has keyboard focus always shows, even outside the viewing zone. */
:root .site .reveal:focus-within { opacity: 1; translate: none; transition-delay: 0s; }

/* ---------- Focus: the section in the middle of the screen stands out, the rest fade back ---------- */
.section { transition: opacity 0.5s ease, scale 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.site.has-focus .section:not(.focus):not(:focus-within) { opacity: 0.28; scale: 0.97; }

/* ---------- Glass cards over a soft accent glow (echoes the app's Liquid Glass) ---------- */
:root[data-mode="light"] { --glass-hi: rgba(255, 255, 255, 0.9); }
:root[data-mode="dark"] { --glass-hi: rgba(255, 255, 255, 0.07); }
.site { isolation: isolate; overflow: clip; }
.section { position: relative; }
.section::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 720px; height: 520px; top: 40px; left: -180px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 20%, transparent), transparent);
}
.section:nth-of-type(even)::before { left: auto; right: -200px; top: 120px; background: radial-gradient(closest-side, color-mix(in srgb, var(--mint) 22%, transparent), transparent); }
.section h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5.4vw, 56px); letter-spacing: -0.01em; }
.site .card {
  position: relative; overflow: hidden;
  background: color-mix(in srgb, var(--card-bg) 62%, transparent);
  backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 0.5px var(--card-edge), 0 18px 40px -24px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s;
}
/* A soft light that follows the pointer across the card (site.js sets --mx/--my). */
.site .card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
.site .card:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 0.5px color-mix(in srgb, var(--accent) 40%, var(--card-edge)), 0 24px 48px -24px rgba(0, 0, 0, 0.4); }
.site .card:hover::after { opacity: 1; }
.site .card > * { position: relative; z-index: 1; }

/* ---------- Features: a bento grid of mixed sizes, each with a small drawing ---------- */
.feature-grid { grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(180px, auto); }
.feature { grid-column: span 2; display: flex; flex-direction: column; }
.b-mushaf, .b-trans { grid-column: span 4; }
.b-recite { grid-row: span 2; }
.b-glass, .b-light { grid-column: span 3; }
.bento-art { flex: 1; min-height: 90px; max-height: 200px; margin-bottom: 18px; }
.b-recite .bento-art { max-height: none; }
/* Mushaf: a small page, its lines drawn as bars, one ayah lit */
.art-mushaf { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 9px; padding: 16px 20px; border-radius: 14px; background: var(--fill); }
.art-mushaf i { display: block; height: 7px; border-radius: 4px; background: var(--fill-strong); }
.art-mushaf i.title { width: 30%; margin: 0 auto; }
.art-mushaf i.short { width: 62%; margin-left: auto; }
.art-mushaf i.lit { background: color-mix(in srgb, var(--accent) 45%, transparent); }
/* Recitation: an audio waveform that moves (site.js) */
.art-wave { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 8px; border-radius: 14px; background: var(--fill); }
.art-wave i { width: 6px; border-radius: 3px; background: linear-gradient(var(--mint), var(--accent)); opacity: 0.85; height: calc(var(--h, 0.4) * 100%); transition: height 0.18s ease; }
/* Loops: a ring with a count */
.art-loop { position: relative; display: grid; place-items: center; }
.loop-ring { width: 92px; height: 92px; border-radius: 50%; border: 6px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); }
.art-loop b { position: absolute; font-size: 26px; color: var(--accent); }
/* Manzil: a week of ticks */
.art-days { display: flex; align-items: center; justify-content: center; gap: 8px; }
.art-days i { width: 26px; height: 26px; border-radius: 50%; background: var(--fill-strong); position: relative; }
.art-days i.on { background: var(--mint); }
.art-days i.on::after { content: ""; position: absolute; left: 9px; top: 6px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* Notes: a page corner with a bookmark and a highlighted line */
.art-notes { position: relative; padding: 18px 16px 14px; border-radius: 14px; background: var(--fill); }
.an-mark { position: absolute; top: 0; right: 18px; width: 16px; height: 26px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.an-line { display: block; height: 8px; margin-top: 10px; border-radius: 4px; background: var(--fill-strong); }
.an-line.hl { background: color-mix(in srgb, #ffcc00 60%, transparent); }
.an-line.short { width: 55%; }
/* Translations: language chips */
.art-langs { display: flex; flex-wrap: wrap; gap: 8px; align-content: center; }
.art-langs span { padding: 6px 12px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 600; color: var(--text-2); }
.art-langs span:first-child { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }
/* Offline: a download glyph */
.art-offline { display: grid; place-items: center; }
.art-offline span { width: 64px; height: 64px; padding: 14px; border-radius: 18px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.art-offline .ic { width: 100%; height: 100%; }
/* Liquid Glass: a glass capsule over stripes */
.art-glass { position: relative; border-radius: 12px; background: repeating-linear-gradient(115deg, color-mix(in srgb, var(--accent) 35%, transparent) 0 14px, transparent 14px 28px); }
.art-glass span { position: absolute; inset: 50% 18%; height: 44px; transform: translateY(-50%); border-radius: 22px; background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px) saturate(1.6); -webkit-backdrop-filter: blur(8px) saturate(1.6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 20px rgba(0, 0, 0, 0.15); }
/* Light on your Mac: one big number */
.art-stat { display: flex; align-items: flex-end; font-size: 22px; font-weight: 600; color: var(--text-2); }
.art-stat b { font-size: 84px; line-height: 0.85; letter-spacing: -0.04em; margin-right: 6px; color: var(--accent); }

/* ---------- Narrower windows ---------- */
@media (max-width: 900px) {
  .install-grid, .privacy-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .feature, .b-glass, .b-light { grid-column: span 1; }
  .b-mushaf, .b-trans { grid-column: span 2; }
  .b-recite { grid-row: span 1; }
  .game-grid, .credit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .section { padding-top: 80px; padding-left: 16px; padding-right: 16px; }
  .feature-grid, .game-grid, .credit-grid { grid-template-columns: 1fr; }
  .b-mushaf, .b-trans { grid-column: span 1; }
  .card { padding: 20px; }
  .footer { padding-left: 16px; padding-right: 16px; }
  /* Long commands wrap instead of being cut off. */
  .cmd-wide { height: auto; min-height: 42px; padding: 8px 6px 8px 14px; }
  .cmd-wide code { white-space: normal; overflow-wrap: anywhere; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .desktop, .desktop.pulling { transition: none; }
  .site .card, .site .card:hover { transition: none; transform: none; }
  .site.has-focus .section:not(.focus):not(:focus-within) { scale: none; }
  .art-wave i { transition: none; }
}

/* Reduce Transparency: solid cards. Increase Contrast: clear edges. */
@media (prefers-reduced-transparency: reduce) {
  .site .card { background: var(--card-bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .section::before { display: none; }
}
@media (prefers-contrast: more) {
  .site .card { box-shadow: 0 0 0 1px var(--text-3); }
  .site.has-focus .section:not(.focus):not(:focus-within) { opacity: 0.6; }
  .site .card::after { display: none; }
}
