/* SacredEcho33 — Sacred Portal layer. Additive: loaded after the app's own styles.
   Theme: liquid silver-chrome, deep slate, glowing pastel pink light paths.
   Scripture text panels are NEVER scaled, tilted, or vibrated (typography safety). */

:root {
  --sp-chrome-1: #E8E8EE;
  --sp-chrome-2: #C0C0C8;
  --sp-slate: #2A3238;
  --sp-pink: #F0A8C2;
  --sp-pink-glow: rgba(240, 168, 194, 0.55);
  --sp-glass-border: rgba(255, 255, 255, 0.15);
}

/* ── ambient chrome field sits behind everything ── */
#sp-field {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
body.sp-on > main, body.sp-on > header, body.sp-on #bottom-nav { position: relative; z-index: 1; }
body.sp-on {
  background:
    radial-gradient(120% 90% at 15% 0%, rgba(240,168,194,0.10), transparent 60%),
    conic-gradient(from 210deg at 70% 30%, #F4F4F7, #DADAE1 25%, #F7F2F4 50%, #C8C8D0 75%, #F4F4F7),
    #ECECF1;
}

/* ── frosted glass panels: cards, search, containers — NOT raw scripture text ── */
body.sp-on .card, body.sp-on .panel, body.sp-on .search-bar, body.sp-on input[type="search"],
body.sp-on .ht-tile, body.sp-on .msg-card,
body.sp-on .study-out, body.sp-on .word-hero, body.sp-on .action-bar, body.sp-on .aff-item,
body.sp-on .option, body.sp-on .welcome-step, body.sp-on .reading-content-section {
  background: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--sp-glass-border);
  transition: box-shadow .35s ease, transform .35s ease;
}
body.sp-on .card:hover, body.sp-on .ht-tile:hover, body.sp-on .option:hover {
  box-shadow: 0 6px 32px var(--sp-pink-glow), 0 2px 8px rgba(42,50,56,0.10);
  transform: perspective(700px) rotateX(1.2deg) rotateY(-1.2deg) translateY(-3px);
}

/* scripture panels stay rock-solid: no tilt, no scale, ever */
body.sp-on .scripture, body.sp-on .verse, body.sp-on [data-scripture],
body.sp-on .layer-body, body.sp-on .word-studied, body.sp-on .aff-text,
body.sp-on .scripture:hover, body.sp-on .verse:hover {
  transform: none !important; filter: none !important;
  color: var(--sp-slate);
}

/* ── the Light & Vibration progress bar ── */
#sp-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 26px; z-index: 900;
  pointer-events: none;
}
#sp-progress .sp-track { stroke: rgba(200, 200, 210, 0.45); }
#sp-progress .sp-wave {
  stroke: url(#sp-laser); stroke-width: 2.5; fill: none;
  filter: drop-shadow(0 0 6px var(--sp-pink-glow)) drop-shadow(0 0 14px var(--sp-pink-glow));
}

/* ── Zen Mode switch ── */
#sp-zen {
  position: fixed; top: 10px; right: 12px; z-index: 950;
  font: 700 12px 'Nunito', sans-serif; letter-spacing: .04em;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  color: var(--sp-slate); background: rgba(255,255,255,0.6);
  border: 1px solid var(--sp-glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(42,50,56,0.12);
}
#sp-zen[aria-pressed="true"] { background: var(--sp-pink); color: #fff; }

/* ── full-screen overlay menu ── */
body.sp-on .overlay-menu {
  -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
  background: rgba(236, 236, 241, 0.82);
}
body.sp-on .overlay-menu a {
  font-size: clamp(2rem, 6vw, 3.4rem);
  text-shadow: 0 0 22px var(--sp-pink-glow);
}

/* ── THE PRESENTED STUDY: a chrome-glass reading plate, museum quality ── */
body.sp-on .study-out {
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255,255,255,0.62), rgba(253,242,246,0.48));
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 18px 50px rgba(42,50,56,0.10);
  padding: clamp(20px, 4vw, 44px);
}
body.sp-on .word-hero {
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 20% 0%, rgba(240,168,194,0.22), transparent 55%),
    linear-gradient(160deg, rgba(255,255,255,0.7), rgba(236,236,241,0.5));
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, #DE7C9E, transparent) 1;
}
body.sp-on .layer-title {
  letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.82em;
  color: #C4577A;
  padding-bottom: 6px; margin-top: 1.6em;
  border-bottom: 1px solid rgba(196, 87, 122, 0.25);
}
body.sp-on .chip {
  background: rgba(255,255,255,0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(196,87,122,0.25); color: #3A2E33;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}

/* ── THE STUDY READS LIKE A GIFT: fine typesetting, not a printout ── */
/* THE SHEET: heavy pearl stock, SILVER-LEAF GILT EDGES like a fine Bible.
   The gilding is real metal: a polished silver band down each edge with a
   bright burnish line, so the page reads as an expensive gilt-edged volume. */
body.sp-on #out {
  position: relative;
  max-width: 760px; margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) clamp(22px, 4vw, 46px) 44px;
  border-radius: 20px;
  background:
    radial-gradient(120% 70% at 12% 0%, rgba(240,168,194,0.10), transparent 55%),
    linear-gradient(178deg, #FFFDFE 0%, #FDF7F9 55%, #FBF2F5 100%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-image: linear-gradient(180deg,
      #FFFFFF 0%, #E8E8EE 8%, #BFC0C8 20%, #FDFDFF 32%,
      #A9AAB4 46%, #F2F2F6 58%, #B7B8C2 72%, #FCFCFE 86%, #C9CAD2 100%) 1;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,1),
    inset 8px 0 12px -10px rgba(42,50,56,0.35),
    inset -8px 0 12px -10px rgba(42,50,56,0.35),
    0 1px 0 rgba(255,255,255,0.9),
    0 22px 64px rgba(42,50,56,0.13),
    0 2px 10px rgba(196,87,122,0.08);
}
/* the burnish: a fine bright line where the leaf catches the light */
body.sp-on #out::before, body.sp-on #out::after {
  content: ""; position: absolute; top: 10px; bottom: 10px; width: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.95) 18%,
              rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.95) 82%, transparent);
}
body.sp-on #out::before { left: -4px; }
body.sp-on #out::after { right: -4px; }
body.sp-on .study-out .layer, body.sp-on #out .layer {
  border-radius: 0; padding: 30px 0 34px;
  margin-bottom: 0; position: relative;
  background: none; border: none; box-shadow: none;
  border-bottom: 1px solid rgba(196,87,122,0.14);
}
body.sp-on #out .layer:last-of-type { border-bottom: none; }
body.sp-on #out .layer::before { display: none; }
body.sp-on #out .layer-ey {
  font-family: 'Nunito', sans-serif; font-size: 0.58em; font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase; color: #C4577A;
  display: block; margin-bottom: 10px;
}
body.sp-on #out .layer-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.9em; font-weight: 600; font-style: italic;
  color: #3A2E33; line-height: 1.25; margin-bottom: 18px;
  text-transform: none; letter-spacing: 0;
}
body.sp-on #out .layer::after {
  content: "✦"; position: absolute; left: 50%; bottom: -26px;
  transform: translateX(-50%); color: #DE7C9E; font-size: 13px; opacity: 0.7;
}
body.sp-on #out .layer:last-of-type::after { content: none; }
body.sp-on #out .layer-body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.22em; line-height: 1.95; color: #3A2E33;
  letter-spacing: 0.005em;
}
body.sp-on #out .layer-body em { color: #C4577A; }
body.sp-on #out .layer-body strong { color: #3A2E33; font-weight: 700; }
body.sp-on #out .layer-body blockquote {
  margin: 1.4em 0; padding: 20px 26px; border-radius: 14px;
  background: rgba(255,255,255,0.6);
  border-left: 3px solid #DE7C9E;
  font-style: italic; font-size: 1.06em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 4px 14px rgba(196,87,122,0.10);
}
body.sp-on #out .layer-body h4 {
  font-family: 'Nunito', sans-serif; font-size: 0.62em; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: #C4577A;
  margin: 1.8em 0 0.6em;
}
body.sp-on #out .word-studied { text-shadow: 0 2px 18px rgba(240,168,194,0.45); }
body.sp-on #out .aff-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.28em; line-height: 1.8;
}

/* ── THE JOURNAL: crafting something beautiful ── */
body.sp-on textarea, body.sp-on .journal-input, body.sp-on .jr-entry {
  background: linear-gradient(170deg, rgba(255,255,255,0.72), rgba(253,242,246,0.6));
  border: 1px solid var(--sp-glass-border);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 8px 26px rgba(42,50,56,0.07);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05em; line-height: 1.75; color: var(--sp-slate);
  padding: 18px 20px;
  transition: box-shadow .3s ease, border-color .3s ease;
}
body.sp-on textarea:focus, body.sp-on .journal-input:focus {
  outline: none; border-color: rgba(222,124,158,0.6);
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 0 0 4px rgba(240,168,194,0.22),
              0 10px 32px rgba(196,87,122,0.14);
}

/* ── THE LENSES: putting on a lens, entering a realm ── */
body.sp-on .mp, body.sp-on .option.theme-lens {
  position: relative; overflow: hidden;
  background:
    radial-gradient(130% 100% at 30% 0%, rgba(255,255,255,0.75), rgba(236,236,241,0.45) 60%),
    linear-gradient(160deg, rgba(240,168,194,0.10), rgba(192,192,200,0.12));
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 6px 20px rgba(42,50,56,0.08);
  transition: transform .35s ease, box-shadow .35s ease;
}
body.sp-on .mp::after, body.sp-on .option.theme-lens::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 40% at 70% 15%, rgba(255,255,255,0.55), transparent 70%);
}
body.sp-on .mp:hover, body.sp-on .option.theme-lens:hover,
body.sp-on .mp[aria-checked="true"] {
  transform: translateY(-2px);
  border-color: rgba(222,124,158,0.55);
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 0 0 3px rgba(240,168,194,0.25),
              0 14px 40px var(--sp-pink-glow);
}
/* resting pills read in plum; the CHOSEN lens fills rose so white text reads */
body.sp-on .mp { color: #3A2E33; }
body.sp-on .mp.active, body.sp-on .mp[aria-checked="true"] {
  background: radial-gradient(circle at 35% 25%, #F0A8C2, #DE7C9E 55%, #C4577A) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 6px 16px rgba(196,87,122,0.45);
}

/* ── ICONS ARE BUTTONS, NOT STICKERS: rose-gold bezel, gloss, lift, press ──
   Every brand icon gets a machined-button read: metallic rim (champagne inner,
   rose outer), top gloss, warm inner base shadow, and a real drop that lifts it
   off the page. Pressing the parent control sinks it. Covers are excluded —
   they are imagery, not controls. */
/* the machined bezel: a real rose-gold metal ring with tonal sweep, an inner
   bevel (light crest above, shadowed seat below), a gloss sweep across the
   face, and a deep lift. portal.js wraps every brand icon in .sp-icon-btn. */
.sp-icon-btn {
  position: relative; display: inline-flex; flex: none;
  padding: 4px; border-radius: 30%;
  background:
    linear-gradient(145deg, #FDF7F8 0%, #F0D6DD 18%, #D5A2B2 38%,
                    #F8E9ED 55%, #C08CA0 74%, #EBC9D2 90%, #A97487 100%);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.95),
    inset 0 -2px 4px rgba(150,84,105,0.55),
    0 1px 0 rgba(255,255,255,0.85),
    0 6px 14px rgba(196,87,122,0.35),
    0 16px 34px rgba(42,50,56,0.20);
  transition: transform .22s ease, box-shadow .22s ease;
  vertical-align: middle;
}
.sp-icon-btn > img {
  display: block; border-radius: 26%; background: #fff;
  box-shadow: 0 1px 3px rgba(42,50,56,0.30);
}
.sp-icon-btn::after {
  content: ""; position: absolute; inset: 4px; border-radius: 26%;
  pointer-events: none;
  box-shadow:
    inset 0 2px 5px rgba(255,255,255,0.9),
    inset 0 -4px 8px rgba(150,84,105,0.30);
  background: linear-gradient(172deg, rgba(255,255,255,0.55) 0%,
              rgba(255,255,255,0.12) 30%, rgba(255,255,255,0) 46%);
}
button:hover .sp-icon-btn, a:hover .sp-icon-btn, .ec:hover .sp-icon-btn,
.sp-icon-btn:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.95),
    inset 0 -2px 4px rgba(150,84,105,0.55),
    0 1px 0 rgba(255,255,255,0.9),
    0 10px 22px rgba(196,87,122,0.42),
    0 22px 44px rgba(42,50,56,0.22);
}
button:active .sp-icon-btn, .ec:active .sp-icon-btn, .sp-icon-btn:active {
  transform: translateY(2px) scale(0.96);
  box-shadow:
    inset 0 3px 8px rgba(150,84,105,0.45),
    inset 0 -1px 2px rgba(255,255,255,0.5),
    0 2px 6px rgba(196,87,122,0.28);
}

/* ── THE SHARE SHEET IS OURS, NOT THEIRS: no platform rainbow.
   Every share control is one system — silver glass pill, rose-gold rim,
   plum type; hover fills rose with white. Luxury speaks in one voice. ── */
body.sp-on .shr-btn, body.sp-on .sss-btn,
body.sp-on [class*="shr-"], body.sp-on [class*="sss-"] {
  background: linear-gradient(160deg, rgba(255,255,255,0.8), rgba(236,236,241,0.65)) !important;
  color: #3A2E33 !important;
  border: 1px solid rgba(222,124,158,0.45) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 3px 10px rgba(42,50,56,0.10),
              0 0 0 1px rgba(255,255,255,0.6);
  border-radius: 999px !important;
  letter-spacing: 1.2px;
}
body.sp-on .shr-btn:hover, body.sp-on .sss-btn:hover {
  background: radial-gradient(circle at 35% 30%, #F0A8C2, #DE7C9E 60%, #C4577A) !important;
  color: #fff !important;
  opacity: 1; transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(196,87,122,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
}
body.sp-on .shr-btn:active, body.sp-on .sss-btn:active { transform: translateY(0) scale(0.97); }

/* ── EVERY control is a physical button: raised at rest, rises on hover,
   sinks when pressed. One law, no half-baked corners. Nav items and pills
   with their own physics are excluded. ── */
body.sp-on button:not(.bn-item):not(.mp):not(.vault-tab):not(.audio-play-btn):not(.audio-stop-btn):not(.speed-btn):not(.study-pop-next-list button),
body.sp-on .btn-primary, body.sp-on .btn-outline, body.sp-on .btn-secondary,
body.sp-on .lib-action, body.sp-on .action-btn, body.sp-on .back-btn,
body.sp-on .lib-btn-header, body.sp-on .drive-header-btn, body.sp-on .btn-part2,
body.sp-on a.lib-btn-header {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.65),
    inset 0 -2px 4px rgba(150,84,105,0.14),
    0 1px 0 rgba(255,255,255,0.7),
    0 4px 10px rgba(42,50,56,0.14);
  transition: transform .18s ease, box-shadow .18s ease;
}
body.sp-on button:not(.bn-item):not(.mp):not(.vault-tab):not(.audio-play-btn):not(.audio-stop-btn):not(.speed-btn):not(.study-pop-next-list button):hover,
body.sp-on .btn-primary:hover, body.sp-on .btn-outline:hover,
body.sp-on .btn-secondary:hover, body.sp-on .lib-action:hover,
body.sp-on .action-btn:hover, body.sp-on .back-btn:hover,
body.sp-on .lib-btn-header:hover, body.sp-on .drive-header-btn:hover,
body.sp-on .btn-part2:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 -2px 4px rgba(150,84,105,0.14),
    0 1px 0 rgba(255,255,255,0.75),
    0 8px 20px rgba(196,87,122,0.28),
    0 12px 28px rgba(42,50,56,0.12);
}
body.sp-on button:not(.bn-item):not(.mp):not(.vault-tab):not(.audio-play-btn):not(.audio-stop-btn):not(.speed-btn):not(.study-pop-next-list button):active,
body.sp-on .btn-primary:active, body.sp-on .btn-outline:active,
body.sp-on .btn-secondary:active, body.sp-on .lib-action:active,
body.sp-on .action-btn:active, body.sp-on .back-btn:active,
body.sp-on .lib-btn-header:active, body.sp-on .drive-header-btn:active,
body.sp-on .btn-part2:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    inset 0 2px 6px rgba(150,84,105,0.30),
    0 1px 3px rgba(42,50,56,0.12);
}
/* no stray palettes on action buttons: save/green family joins the brand */
body.sp-on .btn-save {
  background: linear-gradient(160deg, rgba(255,255,255,0.85), rgba(253,242,246,0.7)) !important;
  color: #3A2E33 !important;
  border: 1px solid rgba(222,124,158,0.5) !important;
}
body.sp-on .btn-save.saved, body.sp-on .btn-save:hover {
  background: radial-gradient(circle at 35% 30%, #F0A8C2, #DE7C9E 60%, #C4577A) !important;
  color: #fff !important;
}

/* vault tabs keep a gentler version so the active underline still reads */
body.sp-on .vault-tab { transition: transform .18s ease; }
body.sp-on .vault-tab:hover { transform: translateY(-1px); }
body.sp-on .vault-tab:active { transform: translateY(1px); }

/* ── stillness: Zen Mode active, or the system asks for reduced motion ── */
body.sp-zen #sp-field { display: none; }
body.sp-zen .card:hover, body.sp-zen .ht-tile:hover { transform: none; }
body.sp-zen { background: linear-gradient(180deg, #F4F4F7 0%, #ECECF1 100%); }

@media (prefers-reduced-motion: reduce) {
  #sp-field { display: none !important; }
  body.sp-on .card, body.sp-on .ht-tile { transition: none; }
  body.sp-on .card:hover, body.sp-on .ht-tile:hover { transform: none; }
  body.sp-on * { animation: none !important; }
}
