/* Runtime token owner for both themes. Light is the first-visit default. */
:root {
  --page:#061c2d; --surface:#0c2639; --surface-hover:#123249;
  --ink:#f4f3ee; --muted:#b7c5ce; --line:#294153; --gold:#e7b961;
  --accent:#e7b961; --link:#c8dfed; --header:#061c2df5;
  --navy:#102e42; --navy-2:#173e58; --soft:var(--surface); --white:var(--surface);
  --shadow:0 18px 48px #0002; --overlay:#02111dbb;
  --scroll-thumb:#637c8b; --scroll-hover:#99adba; --scroll-track:#061c2d;
  --hero-image:url('assets/hero-dark.webp'); --hero-small:url('assets/hero-dark-mobile.webp');
  --display:Georgia,'Times New Roman',serif;
  --m-ink:var(--ink); --m-muted:var(--muted); --m-soft:var(--page); --m-border:var(--line); --m-blue:var(--accent); --m-navy:var(--ink);
  color-scheme:dark;
}
:root[data-theme="light"] {
  --page:#f6f3ed; --surface:#fffdf9; --surface-hover:#eee9df;
  --ink:#09263c; --muted:#50616c; --line:#d9d5cb; --gold:#e7b961;
  --accent:#87601f; --link:#244f68; --header:#f6f3edf5;
  --shadow:0 18px 48px #1a32400b; --overlay:#102b40aa;
  --scroll-thumb:#84929a; --scroll-hover:#526875; --scroll-track:#f6f3ed;
  --hero-image:url('assets/hero-light.webp'); --hero-small:url('assets/hero-light-mobile.webp');
  color-scheme:light;
}
html { scroll-padding-top:100px; scrollbar-gutter:stable; background:var(--page); }
* { scrollbar-color:var(--scroll-thumb) var(--scroll-track); scrollbar-width:thin; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-track { background:var(--scroll-track); }
::-webkit-scrollbar-thumb { background:var(--scroll-thumb); border:2px solid var(--scroll-track); border-radius:8px; }
::-webkit-scrollbar-thumb:hover,::-webkit-scrollbar-thumb:active { background:var(--scroll-hover); }
html[data-theme] body { background:var(--page); color:var(--ink); }
a,button { -webkit-tap-highlight-color:transparent; }
button,a[href],summary { cursor:pointer; touch-action:manipulation; }
button:disabled { cursor:not-allowed; opacity:.6; }
:focus-visible { outline:3px solid var(--accent); outline-offset:5px; }
.skip-link { position:fixed; z-index:4000; top:8px; left:16px; padding:12px 20px; background:var(--surface); color:var(--ink); transform:translateY(-150%); }
.skip-link:focus { transform:none; }
html[data-theme] .site-header { display:flex; height:82px; gap:20px; padding:0 max(28px,calc((100vw - 1320px)/2)); background:var(--header); color:var(--ink); box-shadow:none; border-color:transparent; backdrop-filter:none; }
.site-header .brand { min-width:220px; margin-right:auto; }
html[data-theme] .brand-name,html[data-theme] .brand-name b { color:var(--ink); }
html[data-theme] .brand-name small { color:var(--muted); }
.brand-logo { width:52px; height:52px; flex-basis:52px; }
.brand-name b { font-size:14px; }
.brand-name small { font-size:8px; }
html[data-theme] .nav { display:flex; gap:18px; margin:0 auto; background:none; border:0; box-shadow:none; }
html[data-theme] .nav :is(a, button) { color:var(--ink); font-size:13px; min-height:44px; white-space:nowrap; }
html[data-theme] .nav :is(a, button):hover { color:var(--accent); }
.theme-toggle { display:inline-flex; flex-shrink:0; align-items:center; justify-content:center; gap:7px; min-width:72px; min-height:44px; padding:8px 10px; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--ink); font-size:12px; }
.theme-toggle:hover { background:var(--surface-hover); }
.theme-toggle i { font-size:16px; }
html[data-theme] .site-header .account-button { order:4; min-height:44px; padding:8px 4px; max-width:140px; margin:0; border:0; border-radius:0; background:transparent; color:var(--ink); font-size:13px; }
html[data-theme] .site-header .header-cta { order:5; padding:13px 19px; background:var(--gold); color:#102e42; white-space:nowrap; border-radius:10px; }
.site-header .menu-button { order:6; color:var(--ink); min-width:44px; min-height:44px; }
html[data-theme] .hero { min-height:690px; height:calc(88svh - 82px); max-height:950px; align-items:flex-start; background:var(--page); border-radius:0; color:var(--ink); }
html[data-theme] .hero-scene { background:var(--hero-image) center bottom / cover no-repeat; }
html[data-theme] .hero-scene::after { display:none; }
html[data-theme] .hero-content { width:min(1200px,calc(100% - 48px)); padding:70px 0 200px; text-align:center; }
html[data-theme] .hero-kicker { color:var(--muted); font-size:11px; letter-spacing:.25em; margin:0 0 25px; }
html[data-theme] .hero h1 { max-width:1100px; margin:0 auto; color:var(--ink); font:400 clamp(48px,6.25vw,88px)/1.09 var(--display); letter-spacing:-.035em; text-shadow:none; }
html[data-theme] .hero-copy { color:var(--ink); margin:26px auto 32px; font-size:19px; line-height:1.6; max-width:680px; }
.hero-actions { justify-content:center; gap:18px; }
html[data-theme] .btn { border-radius:999px; min-height:48px; padding:14px 24px; font-size:14px; font-weight:650; transition:background-color .18s,transform .18s,border-color .18s; }
html[data-theme] .btn-gold { background:var(--gold); color:#102e42; }
html[data-theme] .btn-ghost { color:var(--ink); background:transparent; border:1px solid var(--muted); }
html[data-theme] .btn-navy { background:var(--gold); color:#102e42; }
.btn:hover:not(:disabled),.header-cta:hover { transform:translateY(-2px); }
.btn:active:not(:disabled),.header-cta:active { transform:translateY(0); }
.hero-scroll { position:absolute; bottom:28px; left:50%; transform:translateX(-50%); display:flex; flex-direction:column; align-items:center; gap:14px; padding:12px 20px; font-size:10px; letter-spacing:.22em; text-transform:uppercase; color:var(--ink); }
.hero-scroll i { font-size:22px; }
.faith-intro { padding:56px 0 64px; background:var(--page); border-bottom:1px solid var(--line); }
.faith-intro h2 { font:400 clamp(32px,3.4vw,48px)/1.15 var(--display); letter-spacing:-.025em; margin:12px 0; }
.faith-intro p:not(.section-label) { color:var(--muted); font-size:16px; line-height:1.65; }
html[data-theme] .text-link { color:var(--link); padding:6px 0; min-height:36px; border-bottom:1px solid var(--accent); font-weight:600; }
.text-link:hover { opacity:.8; }
html[data-theme] .section-label,html[data-theme] .eyebrow,html[data-theme] .account-kicker { color:var(--accent); }
html[data-theme] .values { background:var(--page); border-color:var(--line); }
html[data-theme] .values-grid > div { border-color:var(--line); padding:28px 12px; }
html[data-theme] .value-icon { color:var(--accent); }
html[data-theme] .values small,html[data-theme] .muted { color:var(--muted); }
.section-space { padding:84px 0; }
html[data-theme] .feature-card,html[data-theme] .devotion-card,html[data-theme] .church-life-card,html[data-theme] .visit-info,html[data-theme] .visit-map-card,html[data-theme] .ministry-card { background:var(--surface); border-color:var(--line); color:var(--ink); box-shadow:none; border-radius:16px; }
html[data-theme] .feature-card:hover,html[data-theme] .devotion-card:hover,html[data-theme] .church-life-card:hover { border-color:var(--accent); box-shadow:none; }
html[data-theme] .feature-card h3,html[data-theme] .devotion-card h3,html[data-theme] .church-life-card h3,html[data-theme] .section-heading h2,html[data-theme] .connect h2,html[data-theme] .visit-info h2,html[data-theme] .visit-expect h3 { color:var(--ink); }
.section-heading h2,.visit-info h2,.connect h2,.prayer-copy h2,.prayer-board-heading h2 { font-family:var(--display); font-weight:400; letter-spacing:-.025em; }
html[data-theme] .card-title-row button,html[data-theme] .verse-ref,html[data-theme] .event-label,html[data-theme] .visit-meta,html[data-theme] .devotion-card > span,html[data-theme] .church-life-meta,html[data-theme] .church-life-card p,html[data-theme] .devotion-card p,html[data-theme] .section-heading > p,html[data-theme] .connect p,html[data-theme] .visit-lead,html[data-theme] .visit-expect-list li,html[data-theme] .visit-map-footer p { color:var(--muted); }
html[data-theme] .devotion-card strong,html[data-theme] .church-life-meta strong { color:var(--accent); }
html[data-theme] .devotion-card i,html[data-theme] .archive-link { color:var(--link); }
html[data-theme] .devotion-archive,html[data-theme] .church-life-archive { border-color:var(--line); }
html[data-theme] .visit-section,html[data-theme] .connect,html[data-theme] footer { background:var(--page); border-color:var(--line); color:var(--ink); }
html[data-theme] footer p,html[data-theme] footer a,html[data-theme] footer button,html[data-theme] .footer-bottom { color:var(--muted); }
html[data-theme] .footer-bottom { border-color:var(--line); }
html[data-theme] .visit-fact,html[data-theme] .visit-secondary,html[data-theme] .visit-map-label { background:var(--surface); border-color:var(--line); color:var(--ink); }
html[data-theme] .visit-fact strong,html[data-theme] .visit-map-label strong { color:var(--ink); }
html[data-theme] .visit-fact span,html[data-theme] .visit-map-label span { color:var(--muted); }
/* Shared surfaces remain themed even when their feature CSS arrives asynchronously. */
html[data-theme] .prayer,html[data-theme] .prayer.prayer-hub { background:var(--page); color:var(--ink); }
html[data-theme] .prayer-visual { display:none; }
html[data-theme] .prayer-copy h2,html[data-theme] .prayer-copy p { color:var(--ink); }
html[data-theme] .prayer-hub .prayer-form,html[data-theme] .prayer-form { background:var(--surface); border-color:var(--line); color:var(--ink); box-shadow:var(--shadow); backdrop-filter:none; }
html[data-theme] .prayer-form label,html[data-theme] .prayer-choice label { color:var(--ink); }
html[data-theme] .prayer-form-title span,html[data-theme] .prayer-choice small,html[data-theme] .form-success,html[data-theme] .prayer-board-heading p { color:var(--muted); }
html[data-theme] .prayer-form input,html[data-theme] .prayer-form textarea,html[data-theme] .prayer-form select,html[data-theme] .prayer-board-filter,html[data-theme] .account-form input { background:var(--page); border-color:var(--line); color:var(--ink); font-size:16px; }
html[data-theme] input::placeholder,html[data-theme] textarea::placeholder { color:var(--muted); opacity:1; }
html[data-theme] .prayer-choice label,html[data-theme] .prayer-stat { background:var(--surface); border-color:var(--line); color:var(--muted); }
html[data-theme] .prayer-choice label:has(input:checked) { border-color:var(--accent); background:var(--surface-hover); }
html[data-theme] .prayer-board-heading h2 { color:var(--ink); }
html[data-theme] .modal,html[data-theme] .account-modal { background:var(--surface); color:var(--ink); border:1px solid var(--line); }
html[data-theme] .modal p,html[data-theme] .account-copy,html[data-theme] .account-hint,html[data-theme] .account-status,html[data-theme] .account-prayer-meta,html[data-theme] .account-prayer-row small,html[data-theme] .account-access-main small,html[data-theme] .account-credentials dt,html[data-theme] .account-credentials > p { color:var(--muted); }
html[data-theme] .modal-close,html[data-theme] .account-close,html[data-theme] .prayer-box,html[data-theme] .account-tabs,html[data-theme] .account-role,html[data-theme] .my-prayers-heading > span,html[data-theme] .account-empty { background:var(--surface-hover); color:var(--ink); }
html[data-theme] .account-modal h2,html[data-theme] .account-modal h3 { color:var(--ink); }
html[data-theme] .account-tabs button.is-active { background:var(--page); color:var(--ink); }
html[data-theme] .account-prayer-row,html[data-theme] .account-access-row { background:var(--page); border-color:var(--line); }
html[data-theme] .account-text-button { color:var(--link); }
html[data-theme] .password-change-panel,html[data-theme] .account-credentials,html[data-theme] .my-prayers,html[data-theme] .admin-panel { border-color:var(--line); }
html[data-theme="dark"] .account-status.is-error,html[data-theme="dark"] .account-empty.is-error { color:#ffb3aa; }
html[data-theme="light"] .account-status.is-error,html[data-theme="light"] .account-empty.is-error { color:#9c2f2f; }
/* Native page-to-page continuity; ordinary links, URLs and in-page scrolling are unchanged.
   Browsers without cross-document View Transitions keep regular navigation. */
@view-transition {
  navigation: auto;
}
/* A matched header avoids making the main navigation rise with every page. */
.site-header,
.seo-header {
  view-transition-name: ciy-header;
}
@keyframes ciy-page-exit {
  to { opacity: 0; }
}
@keyframes ciy-page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
::view-transition-old(root) {
  animation: 130ms ease-out both ciy-page-exit;
}
::view-transition-new(root) {
  animation: 220ms cubic-bezier(.23,1,.32,1) both ciy-page-enter;
}
::view-transition-group(ciy-header),
::view-transition-old(ciy-header),
::view-transition-new(ciy-header) {
  animation-duration: 180ms;
}

/* Motion changes composited properties only. Content works without this enhancement. */
.section-heading,.feature-card,.visit-info,.connect-grid,.values-grid { transition:opacity .65s ease,transform .65s ease; }
.reveal-ready { opacity:0; transform:translateY(18px); }
@media(prefers-reduced-motion:no-preference) {
   .hero-content { animation:welcome-in .35s cubic-bezier(.2,.65,.3,1) both; }
  @keyframes welcome-in { from { transform:translateY(6px); } to { transform:none; } }
}
@media(max-width:1200px) {
  html[data-theme] .site-header { gap:12px; padding-inline:24px; }
  .site-header .brand { min-width:190px; }
  html[data-theme] .nav { gap:12px; }
  html[data-theme] .nav :is(a, button) { font-size:12px; }
}
@media(max-width:1100px) {
  html[data-theme] .nav { display:none; position:absolute; top:82px; left:0; right:0; padding:18px 24px; background:var(--surface); border-bottom:1px solid var(--line); }
  html[data-theme] .nav.open { display:flex; flex-wrap:wrap; justify-content:center; }
  .site-header .menu-button { display:block; }
  html[data-theme] .site-header .header-cta { display:none; }
}
@media(max-width:768px) {
  html { scroll-padding-top:82px; }
  html[data-theme] .site-header { height:68px; padding:0 16px; gap:10px; }
  .site-header .brand { min-width:0; }
  .brand-logo { width:40px; height:40px; flex-basis:40px; }
  .brand-name b { font-size:12px; }.brand-name small { font-size:7px; }
  html[data-theme] .site-header .account-button { display:none; }
  .theme-toggle { min-width:66px; min-height:44px; font-size:12px; }
  html[data-theme] .nav { top:68px; }
  html[data-theme] .hero { min-height:640px; height:calc(100svh - 140px); max-height:820px; }
  html[data-theme] .hero-scene { background-image:var(--hero-small); background-position:82% bottom; }
  html[data-theme] .hero-content { width:calc(100% - 36px); padding:62px 0 180px; }
  html[data-theme] .hero-kicker { font-size:9px; letter-spacing:.18em; margin-bottom:22px; }
  html[data-theme] .hero h1 { font-size:clamp(37px,10.8vw,64px); line-height:1.12; letter-spacing:-.035em; }
  html[data-theme] .hero-copy { font-size:15px; max-width:320px; margin:24px auto; }
  .hero-actions { flex-direction:column; align-items:center; gap:12px; }
  html[data-theme] .hero-actions .btn { justify-content:center; min-height:48px; width:min(280px,100%); font-size:14px; }
  .hero-scroll { bottom:18px; font-size:9px; gap:8px; }
  .faith-intro { padding:40px 0; }
  .faith-intro p:not(.section-label) { font-size:15px; }
  .desktop-break { display:none; }
  .section-space { padding:48px 0; }
  .ciy-mobile-home { display:none; }
  .values-grid { grid-template-columns:1fr 1fr; }
  html[data-theme] .values-grid > div { padding:22px 8px; justify-content:flex-start; gap:10px; }
  .values-grid b { font-size:12px; }.values-grid small { font-size:11px; }
  .values-grid > div:nth-child(2) { border-right:0; }
  html[data-theme] .prayer-note { background:var(--surface); color:var(--ink); border-color:var(--line); }
  html[data-theme] .prayer-note blockquote { color:var(--ink); }
  html[data-theme] .prayer-note-meta,html[data-theme] .prayer-note-author,html[data-theme] .prayer-count { color:var(--muted); }
  html[data-theme] .prayer-note-footer { border-color:var(--line); }
  html[data-theme] .prayer-action { background:var(--surface-hover); color:var(--ink); }
  html[data-theme] .mobile-account-brand strong { color:var(--ink); }
}
@media(max-width:360px) { .brand-name small { display:none; }.brand-name b { font-size:10px; }.theme-toggle { min-width:60px; } }
@media(prefers-reduced-motion:reduce) {
  /* Opt out entirely: no navigation snapshot or root crossfade for reduced motion. */
  @view-transition { navigation: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation:none!important; }
  html { scroll-behavior:auto!important; }
  *,*::before,*::after { animation:none!important; transition:none!important; }
  .reveal-ready { opacity:1; transform:none; }
}
@media(forced-colors:active) {
  * { scrollbar-color:auto; }
  .hero-scene { display:none; }
  button,a { forced-color-adjust:auto; }
}
/* Crawlable About, Visit and devotion pages use the same theme preference. */
html[data-theme] { --seo-ink:var(--ink); --seo-muted:var(--muted); --seo-line:var(--line); --seo-white:var(--surface); --seo-soft:var(--surface-hover); }
html[data-theme] .seo-header { background:var(--header); border-color:var(--line); }
html[data-theme] .seo-brand strong,html[data-theme] .seo-nav a { color:var(--ink); }
html[data-theme] .seo-brand small,html[data-theme] .seo-breadcrumbs,html[data-theme] .seo-facts dt,html[data-theme] .seo-list li,html[data-theme] .seo-lead { color:var(--muted); }
html[data-theme] .seo-values article,html[data-theme] .seo-panel,html[data-theme] .seo-card,html[data-theme] .seo-article-header,html[data-theme] .seo-prayer,html[data-theme] .seo-hero,html[data-theme] .seo-cta-band { background:var(--surface); border-color:var(--line); color:var(--ink); box-shadow:none; }
html[data-theme] .seo-hero::after { display:none; }
html[data-theme] .seo-eyebrow,html[data-theme] .seo-scripture-ref { color:var(--accent); }
html[data-theme] .seo-card-ref { color:var(--accent)!important; }
html[data-theme] .seo-text-link,html[data-theme] .seo-breadcrumbs a,html[data-theme] .seo-article-nav a { color:var(--link); }
html[data-theme] .seo-button-secondary { background:var(--surface); color:var(--ink); border-color:var(--line); }
html[data-theme] .seo-facts div,html[data-theme] .seo-list li { border-color:var(--line); }
.seo-header .theme-toggle { font-family:inherit; }
.seo-hero h1,.seo-article-header h1,.seo-cta-inner h2 { font-family:var(--display); font-weight:400; }
@media(max-width:760px) {
  .seo-header-inner { flex-wrap:wrap; gap:10px; padding:10px 0; }
  .seo-brand { flex:1; }
  .seo-nav { order:3; width:100%; justify-content:center; }
  .seo-nav a { padding:10px 6px; }
  .seo-header .theme-toggle { margin-left:auto; }
}
/* Preserve the existing Prayer Hour schedule surface in both themes. */
html[data-theme] .ciy-live-event { background:var(--surface); color:var(--ink); border-color:var(--line); }
html[data-theme] .ciy-live-event__copy strong { color:var(--ink); }
html[data-theme] .ciy-live-event__copy span,html[data-theme] .ciy-live-event__meta { color:var(--muted); }
html[data-theme] .ciy-live-event__status { background:var(--surface-hover); color:var(--accent); }
@media(max-width:768px) {
  .ciy-mobile-home { display:block; width:min(calc(100% - 36px),560px); margin:0 auto; padding:24px 0 0; }
  .ciy-mobile-welcome,.ciy-mobile-actions { display:none; }
  .ciy-next-service { display:flex; align-items:center; gap:12px; width:100%; min-height:76px; padding:16px; border:1px solid var(--line); border-radius:14px; background:var(--surface); color:var(--ink); text-align:left; }
  .ciy-next-service > i { color:var(--accent); font-size:24px; }
  .ciy-next-service small,.ciy-next-service strong { display:block; }
  .ciy-next-service small { margin-bottom:4px; color:var(--muted); font-size:11px; }
  .ciy-next-service strong { font-size:15px; }
  .ciy-next-service > span { margin-left:auto; color:var(--muted); font-size:11px; }
}
