:root {
  color-scheme: dark;
  --bg: #060a12;
  --surface: #0c1320;
  --surface-2: #121d2d;
  --surface-3: #19263a;
  --text: #f7f9fc;
  --muted: #9eacc0;
  --line: rgba(255, 255, 255, 0.1);
  --blue: #4a8dff;
  --blue-bright: #72a7ff;
  --red: #ff5b62;
  --green: #4ed6a0;
  --amber: #f2b84b;
  --violet: #a97aff;
  --cyan: #49cddd;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #edf2f8;
  --surface-3: #e2eaf4;
  --text: #101827;
  --muted: #58677a;
  --line: rgba(16, 24, 39, 0.12);
  --shadow: 0 24px 70px rgba(33, 57, 93, 0.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); min-width: 320px; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; background: radial-gradient(circle at 78% -10%, rgba(74, 141, 255, 0.17), transparent 35%), radial-gradient(circle at 10% 50%, rgba(73, 205, 221, 0.05), transparent 28%); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: white; color: black; padding: .8rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.topbar { position: sticky; top: 0; z-index: 50; min-height: 72px; padding: 0 clamp(1rem, 4vw, 4rem); display: flex; align-items: center; justify-content: space-between; gap: 2rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: .7rem; letter-spacing: -.035em; font-size: 1.08rem; font-weight: 700; white-space: nowrap; }
.brand strong { color: var(--blue-bright); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(114,167,255,.5); border-radius: 50%; color: var(--blue-bright); font-size: .72rem; letter-spacing: -.04em; box-shadow: inset 0 0 18px rgba(74,141,255,.2); }
.desktop-nav { display: flex; gap: clamp(1rem, 2vw, 2rem); align-items: center; font-size: .9rem; color: var(--muted); }
.desktop-nav a { padding: 1.7rem 0; border-bottom: 2px solid transparent; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--text); border-bottom-color: var(--blue); }
.top-actions, .button-row, .featured-meta, .page-title-row { display: flex; align-items: center; gap: .7rem; }
.icon { display: inline-grid; place-items: center; min-width: 1em; }
.icon-button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 50%; }
.icon-button:hover { background: var(--surface-2); }
.button { border: 1px solid var(--blue); background: var(--blue); color: white; min-height: 44px; padding: .7rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border-radius: 999px; font-weight: 700; transition: transform .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); background: #377ef4; }
.button.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.button.secondary:hover { background: var(--surface-2); }
.mobile-only, .mobile-tabs { display: none; }
.mobile-menu { position: fixed; inset: 0; z-index: 80; padding: 5rem 2rem; background: var(--bg); }
.mobile-menu a { display: block; border-bottom: 1px solid var(--line); padding: 1rem 0; font-size: 1.35rem; }
.close-menu { position: absolute; top: 1rem; right: 1rem; }

main { min-height: calc(100vh - 72px); }
.page-shell, .channel-page { max-width: 1380px; margin: auto; padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 4vw, 4rem) 7rem; }
.page-shell.narrow { max-width: 900px; }
.eyebrow { margin: 0 0 .65rem; color: var(--blue-bright); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
.page-title { margin: 0; font-size: clamp(2.3rem, 5vw, 5rem); line-height: .97; letter-spacing: -.055em; }
.lede { max-width: 760px; margin: 1.2rem 0 2.2rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.18rem); line-height: 1.75; }
.muted { color: var(--muted); }

.featured { min-height: min(780px, calc(100vh - 72px)); padding: clamp(3rem, 7vw, 7rem) clamp(1rem, 7vw, 7rem); display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: clamp(2rem, 6vw, 7rem); border-bottom: 1px solid var(--line); }
.featured-copy { max-width: 700px; }
.featured h1 { margin: .8rem 0 1.3rem; font-size: clamp(3.2rem, 7vw, 7.5rem); line-height: .88; letter-spacing: -.065em; }
.featured-copy > p:not(.eyebrow) { color: var(--muted); font-size: 1.12rem; line-height: 1.75; max-width: 620px; }
.live-badge, .live-pill, .viewer-pill, .badge { display: inline-flex; align-items: center; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .07em; }
.live-badge { color: #ff777c; margin-bottom: 1.5rem; }
.featured-meta { flex-wrap: wrap; margin: 1.8rem 0; color: var(--muted); font-size: .85rem; }
.featured-visual { aspect-ratio: 1.05; position: relative; display: grid; place-items: center; overflow: hidden; isolation: isolate; border: 1px solid rgba(114,167,255,.2); border-radius: 48% 52% 46% 54%; background: radial-gradient(circle, #194b91 0, #10284b 35%, #09111f 72%); box-shadow: var(--shadow), inset 0 0 100px rgba(73,205,221,.12); }
.featured-visual > span { position: absolute; bottom: 8%; color: #cad8eb; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; }
.orbit { position: absolute; border: 1px solid rgba(114,167,255,.3); border-radius: 50%; }
.orbit.one { width: 62%; height: 62%; }
.orbit.two { width: 87%; height: 87%; border-style: dashed; transform: rotate(20deg); }
.signal-core { width: 122px; height: 122px; display: grid; place-items: center; align-content: center; border-radius: 50%; background: rgba(4,11,24,.78); box-shadow: 0 0 70px rgba(74,141,255,.55); color: white; }
.signal-core .icon { font-size: 2.1rem; }
.signal-core span { font-size: .7rem; letter-spacing: .2em; }

.content-section { max-width: 1500px; margin: auto; padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 4vw, 4rem); }
.content-section.compact { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.6rem; }
.section-heading h2, .network-preview h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 3rem); letter-spacing: -.04em; }
.section-heading > a { color: var(--blue-bright); font-size: .9rem; }
.category-row { display: flex; gap: .65rem; margin: 1.5rem 0 2rem; padding-bottom: .4rem; overflow-x: auto; }
.category-row a, .category-row button { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: .65rem 1rem; }
.category-row a:hover, .category-row button:hover { border-color: var(--blue); }
.stream-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 2rem); }
.stream-card { min-width: 0; }
.thumbnail { aspect-ratio: 16/9; position: relative; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.thumbnail::before { content: ""; position: absolute; width: 65%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; box-shadow: 0 0 80px rgba(255,255,255,.1); }
.accent-blue { background: linear-gradient(145deg, #132d56, #0a101c 70%); }
.accent-amber { background: linear-gradient(145deg, #5b3515, #111017 70%); }
.accent-violet { background: linear-gradient(145deg, #34235d, #0d101a 70%); }
.accent-cyan { background: linear-gradient(145deg, #123f48, #0a1118 70%); }
.live-pill { position: absolute; top: .8rem; left: .8rem; z-index: 2; background: var(--red); color: white; padding: .35rem .55rem; }
.viewer-pill { position: absolute; bottom: .8rem; left: .8rem; z-index: 2; background: rgba(0,0,0,.7); color: white; padding: .35rem .55rem; }
.large-play { position: relative; z-index: 2; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.92); color: #101827; transition: transform .2s ease; }
.thumbnail:hover .large-play { transform: scale(1.08); }
.stream-info { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: .8rem; padding: 1rem .15rem; align-items: start; }
.avatar, .channel-avatar { display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--blue-bright); font-weight: 800; }
.avatar { width: 42px; height: 42px; }
.stream-info h3 { margin: 0 0 .32rem; font-size: .97rem; line-height: 1.35; }
.stream-info p, .stream-info span { margin: 0; color: var(--muted); font-size: .79rem; }
.verified { color: var(--blue-bright) !important; }
.follow-button { border: 1px solid var(--line); color: var(--text); background: transparent; border-radius: 999px; padding: .4rem .65rem; font-size: .72rem; }
.follow-button.active { background: var(--surface-3); color: var(--blue-bright); }
.network-preview { display: grid; grid-template-columns: .85fr 1.15fr; gap: 4rem; border-top: 1px solid var(--line); }
.network-preview > div > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.network-lines { border-top: 1px solid var(--line); }
.network-lines > div { display: grid; grid-template-columns: 70px 150px 1fr; gap: 1rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.network-lines p { margin: 0; }
.status-live { color: var(--red); font-weight: 800; }

.search-box { max-width: 680px; margin: 2rem 0; display: flex; align-items: center; gap: .65rem; border: 1px solid var(--line); border-radius: 999px; padding: 0 1rem; background: var(--surface); }
.search-box input { flex: 1; min-width: 0; height: 50px; border: 0; outline: 0; background: transparent; color: var(--text); }
.empty-state, .foundation-panel, .success-panel { min-height: 360px; padding: 3rem; display: grid; place-items: center; align-content: center; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.empty-state .icon, .foundation-panel > .icon, .success-panel > .icon { font-size: 2.2rem; color: var(--blue-bright); }
.empty-state h2, .foundation-panel h1, .success-panel h1 { margin-bottom: .4rem; }
.empty-state p, .foundation-panel p:not(.eyebrow), .success-panel p { color: var(--muted); max-width: 590px; line-height: 1.65; }

.schedule { margin-top: 2.4rem; border-top: 1px solid var(--line); }
.schedule article { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; padding: 1.5rem .2rem; border-bottom: 1px solid var(--line); }
.schedule h2 { margin: .3rem 0 0; font-size: clamp(1.1rem, 2vw, 1.55rem); }
.schedule-time { display: grid; gap: .35rem; }
.schedule-time small { color: var(--muted); }
.prayer-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.safety-note, .adapter-note, .timestamp { display: flex; gap: .9rem; border: 1px solid rgba(114,167,255,.25); border-radius: 14px; padding: 1rem; background: rgba(74,141,255,.07); }
.safety-note p, .adapter-note p { margin: .35rem 0 0; color: var(--muted); line-height: 1.55; }
.form-card { display: grid; gap: 1.35rem; padding: clamp(1.2rem, 4vw, 2.4rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.form-card label:not(.choice) { display: grid; gap: .55rem; color: var(--muted); font-size: .86rem; font-weight: 700; }
.form-card input, .form-card textarea, .form-card select, .chat-entry input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); padding: .85rem .95rem; }
.form-card textarea { resize: vertical; }
.form-card fieldset { display: grid; gap: .75rem; margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.form-card legend { padding: 0 .5rem; font-weight: 800; }
.choice { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.choice input { width: auto; accent-color: var(--blue); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.inline-success { margin-bottom: 1rem; padding: 1rem; border-radius: 10px; color: #082b1e; background: var(--green); font-weight: 800; }

.channel-banner { height: clamp(190px, 27vw, 360px); display: grid; place-items: center; border-radius: 0 0 32px 32px; background: radial-gradient(circle, rgba(73,205,221,.25), transparent 30%), linear-gradient(135deg, #0d2d57, #07101d 75%); color: rgba(255,255,255,.35); font-size: clamp(2.5rem, 8vw, 7rem); font-weight: 900; letter-spacing: .18em; }
.channel-header { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center; padding: 2rem 0; }
.channel-avatar { width: 76px; height: 76px; font-size: 1.8rem; }
.channel-header h1 { margin: 0 0 .35rem; }
.channel-header p { margin: 0; color: var(--muted); }
.channel-tabs { display: flex; gap: 1.5rem; overflow-x: auto; border-bottom: 1px solid var(--line); }
.channel-tabs a { padding: 1rem 0; white-space: nowrap; }
.channel-content { display: grid; grid-template-columns: 1.35fr .65fr; gap: 2rem; padding: 3rem 0; align-items: center; }
.video-stage, .video-player { aspect-ratio: 16/9; position: relative; display: grid; place-items: center; border: 1px solid var(--line); background: radial-gradient(circle, #1c426d, #080c14 65%); border-radius: var(--radius); }
.video-stage { gap: .7rem; align-content: center; color: white; }
.video-stage .icon { font-size: 2.5rem; }
.channel-content p { color: var(--muted); line-height: 1.7; }

.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; min-height: calc(100vh - 72px); }
.watch-layout > div { padding: 1rem; }
.video-player { border-radius: 8px; min-height: 420px; }
.player-center { display: grid; place-items: center; gap: .5rem; text-align: center; color: white; }
.player-center .icon { width: 70px; height: 70px; border-radius: 50%; background: white; color: #101827; font-size: 1.6rem; }
.player-center span { color: #aebdd1; font-size: .8rem; }
.watch-details { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem 0; }
.watch-details h1 { margin: .35rem 0; font-size: clamp(1.5rem, 3vw, 2.5rem); }
.watch-details p { margin: 0; color: var(--muted); }
.scripture-card { width: 100%; display: flex; align-items: center; gap: .9rem; border: 1px solid rgba(114,167,255,.25); border-radius: 12px; padding: 1rem; background: rgba(74,141,255,.08); color: var(--text); text-align: left; }
.scripture-card span:nth-child(2) { flex: 1; display: grid; gap: .25rem; }
.scripture-card small { color: var(--muted); }
.passage { margin-top: .7rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); }
.interaction-panel { min-height: calc(100vh - 72px); display: grid; grid-template-rows: auto 1fr auto; border-left: 1px solid var(--line); background: var(--surface); }
.panel-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.panel-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 1rem .5rem; background: transparent; color: var(--muted); }
.panel-tabs button.active { color: var(--text); border-bottom-color: var(--blue); }
.messages { padding: 1rem; overflow-y: auto; }
.messages p { line-height: 1.5; }
.moderator-message { margin: 1rem 0; padding: 1rem; border-radius: 10px; color: var(--muted); background: var(--surface-2); font-size: .85rem; }
.chat-entry { display: flex; gap: .5rem; padding: 1rem; border-top: 1px solid var(--line); }

.page-title-row { justify-content: space-between; align-items: end; margin-bottom: 2rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.metric-grid article, .dashboard-card { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.metric-grid strong { display: block; font-size: clamp(1.7rem, 4vw, 3.3rem); letter-spacing: -.05em; }
.metric-grid span { color: var(--muted); font-size: .82rem; }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr .75fr; gap: 1rem; margin-top: 1rem; }
.dashboard-card h2 { margin-top: 0; }
.dashboard-card p { color: var(--muted); }
.health-score { margin: 1.2rem 0; color: var(--green); font-size: 4rem; font-weight: 900; }
.health-score small { font-size: 1rem; color: var(--muted); }
.badge { padding: .35rem .55rem; background: var(--surface-3); color: var(--muted); }
.badge.danger { color: #ff9297; background: rgba(255,91,98,.12); }

.trust-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; margin-top: 2rem; }
.trust-grid > aside { height: fit-content; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.trust-grid > aside div { display: grid; grid-template-columns: 45px 1fr; padding: 1rem; border-bottom: 1px solid var(--line); }
.trust-grid > aside div:last-child { border-bottom: 0; }
.trust-grid > aside strong { color: var(--blue-bright); }
.trust-grid > aside span { color: var(--muted); }
.case-list { display: grid; gap: 1rem; }
.case-list article { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.case-list article.resolved { opacity: .6; border-color: var(--green); }
.case-list article > div:first-child { display: flex; justify-content: space-between; color: var(--muted); }
.case-list blockquote { margin: 1rem 0; padding: 1rem; border-left: 3px solid var(--red); background: var(--surface-2); color: var(--muted); }

.mobile-tabs { position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(18px); }
.mobile-tabs a { display: grid; place-items: center; gap: .2rem; padding: .65rem .2rem; color: var(--muted); font-size: .68rem; }

@media (max-width: 1050px) {
  .desktop-nav, .studio-button { display: none; }
  .mobile-only { display: grid; }
  .featured { grid-template-columns: 1fr; }
  .featured-visual { max-width: 650px; width: 100%; margin: auto; }
  .stream-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-layout { grid-template-columns: 1fr; }
  .interaction-panel { min-height: 520px; border: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .topbar { min-height: 62px; padding: 0 1rem; }
  .search-link { display: none; }
  .mobile-tabs { display: grid; }
  main { min-height: calc(100vh - 62px); }
  .page-shell, .channel-page { padding: 2.5rem 1rem 6rem; }
  .featured { min-height: auto; padding: 3.5rem 1rem 2.5rem; }
  .featured h1 { font-size: clamp(3rem, 16vw, 5rem); }
  .featured-visual { border-radius: 26px; }
  .content-section { padding: 3rem 1rem; }
  .section-heading, .watch-details, .page-title-row { align-items: flex-start; flex-direction: column; }
  .stream-grid { grid-template-columns: 1fr; }
  .network-preview, .prayer-layout, .channel-content { grid-template-columns: 1fr; gap: 2rem; }
  .network-lines > div { grid-template-columns: 58px 1fr; }
  .network-lines p { grid-column: 2; }
  .schedule article { grid-template-columns: 74px minmax(0, 1fr); }
  .schedule article .button { grid-column: 1 / -1; }
  .field-grid, .metric-grid, .dashboard-grid, .trust-grid { grid-template-columns: 1fr; }
  .channel-banner { border-radius: 0 0 18px 18px; }
  .channel-header { grid-template-columns: auto 1fr; }
  .channel-header > .button { grid-column: 1 / -1; }
  .watch-layout > div { padding: .5rem; }
  .video-player { min-height: 240px; }
  .interaction-panel { margin-bottom: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
