/* =====================================================================================================
   VYBEON BRAND 1.0.0 - the brand layer on top of 3.10.0 + Nova + Avava + Final + Enterprise + Prime + Encore.
   Created by Ashwani Kumar Sharma.

   What it adds (nothing in the existing theme, layout or behaviour is changed):
   1. One logo mark in two finishes:   Night (dark): ember gradient ring and V, gold signal arcs, glow.
                                       Day (light):  ink ring, ember V, ink arcs, paper plate (flat "print" look).
   2. The start-up / loading screen (#en-splash) redrawn with the same mark, wordmark and tagline.
   3. While a song plays, the logo's three signal arcs ripple (and on hover / keyboard focus).
   4. Everything is responsive: phones (320 px and up), tablets, desktop, landscape phones, notches.
   Kill switch for the animated header mark: localStorage.brandOff = '1' (then reload).
   Loaded LAST, so it wins over the earlier layers.
   ===================================================================================================== */

/* ---------- shared defs holder (the gradients live in index.html: <svg id="bd-defs">) ---------- */
#bd-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* ---------- the mark: Night is the default (the SVG carries its own Night colours), Day overrides ---------- */
.bd-arc.a1 { --bo: 1;   opacity: 1; }
.bd-arc.a2 { --bo: .72; opacity: .72; }
.bd-arc.a3 { --bo: .48; opacity: .48; }
.bd-shadow { display: none; }
.bd-glow { opacity: .6; }
/* the glow (Night) and the flat print shadow (Day) are drawn INSIDE the mark. The earlier layers put a CSS filter on the whole <svg>, which clips at its edge. */
.av-mark[data-bd] { filter: none !important; }
:is(html[data-theme=light], html[data-en-t=light]) .bd-shadow { display: inline; }
:is(html[data-theme=light], html[data-en-t=light]) .bd-glow { display: none; }
:is(html[data-theme=light], html[data-en-t=light]) .bd-disc { fill: #f7efe3; }
:is(html[data-theme=light], html[data-en-t=light]) .bd-ring { stroke: #2a1d16; }
:is(html[data-theme=light], html[data-en-t=light]) .bd-v    { stroke: #d9541e; }
:is(html[data-theme=light], html[data-en-t=light]) .bd-arc  { stroke: #2a1d16; }
:is(html[data-theme=light], html[data-en-t=light]) .bd-pin  { fill: #2a1d16; }
.av-mark[data-bd] { overflow: visible; }

/* the signal arcs "broadcast" while a song plays, and when the logo is hovered or focused */
@keyframes bdRipple { 0%, 100% { opacity: var(--bo, 1); } 42% { opacity: 1; } 70% { opacity: calc(var(--bo, 1) * .55); } }
html.prime-playing .av-mark[data-bd] .bd-arc,
.brand:hover .av-mark[data-bd] .bd-arc,
.brand:focus-visible .av-mark[data-bd] .bd-arc { animation: bdRipple 1.8s ease-in-out infinite; }
html.prime-playing .av-mark[data-bd] .bd-arc.a2, .brand:hover .av-mark[data-bd] .bd-arc.a2, .brand:focus-visible .av-mark[data-bd] .bd-arc.a2 { animation-delay: .16s; }
html.prime-playing .av-mark[data-bd] .bd-arc.a3, .brand:hover .av-mark[data-bd] .bd-arc.a3, .brand:focus-visible .av-mark[data-bd] .bd-arc.a3 { animation-delay: .32s; }
.brand:focus-visible { outline: 2px solid var(--vio, #ff5a36); outline-offset: 3px; border-radius: 12px; }

/* =====================================================================================================
   START-UP / LOADING SCREEN  (#en-splash is the element Enterprise already removes when the app is ready)
   Night = the app's own ember dark, Day = the app's own paper light. Same size and position in both.
   ===================================================================================================== */
html #en-splash.bd-splash {
  background: radial-gradient(62% 52% at 50% 40%, #2b1209 0%, #150b07 52%, #0d0807 100%);
  color: #f4ece4;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  overflow: hidden;
}
:is(html[data-theme=light], html[data-en-t=light]) #en-splash.bd-splash {
  background: radial-gradient(62% 52% at 50% 40%, #f6f0e8 0%, #ebe9e8 52%, #e6e8ec 100%);
  color: #2a1d16;
}
#en-splash.bd-splash .bd-s-in {
  display: grid; justify-items: center; gap: clamp(12px, 2.6vmin, 20px);
  padding: 24px; max-width: 100vw; box-sizing: border-box; text-align: center;
}
#en-splash.bd-splash .bd-s-art { position: relative; display: block; width: clamp(88px, 24vmin, 156px); aspect-ratio: 1 / 1; }
#en-splash.bd-splash .bd-s-halo {
  position: absolute; inset: -42%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, #ff4a1f4d 0%, #ff4a1f1a 52%, transparent 74%);
  animation: bdHalo 2.8s ease-in-out infinite;
}
:is(html[data-theme=light], html[data-en-t=light]) #en-splash.bd-splash .bd-s-halo {
  background: radial-gradient(closest-side, #e8682c30 0%, #e8682c10 52%, transparent 74%);
}
/* beats Enterprise's "#en-splash svg { 92px; pulse }" */
html #en-splash.bd-splash svg.bd-mark { position: relative; display: block; width: 100%; height: 100%; overflow: visible; animation: none; filter: none; }
#en-splash.bd-splash .bd-glow { opacity: .85; }

#en-splash.bd-splash .bd-s-word {
  display: block; font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif; font-weight: 900;
  font-size: clamp(19px, 4.6vmin, 28px); line-height: 1; letter-spacing: .42em; margin-right: -.42em; padding-top: 4px;
  background: linear-gradient(95deg, #fff4ea 0%, #ffc79a 44%, #ff6a3c 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: bdUp .6s ease-out .5s backwards;
}
:is(html[data-theme=light], html[data-en-t=light]) #en-splash.bd-splash .bd-s-word {
  font-family: var(--av-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif); letter-spacing: .16em; margin-right: -.16em;
  background: none; color: #2a1d16; -webkit-text-fill-color: #2a1d16; text-shadow: 2px 2px 0 #d9541e55;
}
#en-splash.bd-splash .bd-s-tag {
  display: block; font-family: var(--av-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); font-weight: 600;
  font-size: clamp(9px, 2.5vmin, 11px); line-height: 1.5; letter-spacing: .26em; margin-right: -.26em; text-transform: uppercase; opacity: .66; max-width: 92vw;
  animation: bdUp .6s ease-out .68s backwards;
}
:is(html[data-theme=light], html[data-en-t=light]) #en-splash.bd-splash .bd-s-tag {
  font-family: var(--av-serif, Georgia, serif); font-style: italic; letter-spacing: .1em; margin-right: -.1em; text-transform: none; font-size: clamp(11px, 3vmin, 13.5px); opacity: .72;
}
#en-splash.bd-splash .bd-s-bar { display: block; width: clamp(96px, 30vmin, 150px); height: 3px; border-radius: 3px; background: rgba(127, 127, 127, .25); overflow: hidden; margin-top: 2px; animation: bdUp .6s ease-out .8s backwards; }
#en-splash.bd-splash .bd-s-bar::after { content: ""; display: block; height: 100%; width: 42%; border-radius: 3px; background: linear-gradient(90deg, #ff4a1f, #ff8a4c, #f5b942); animation: bdBar 1.25s ease-in-out infinite; }
:is(html[data-theme=light], html[data-en-t=light]) #en-splash.bd-splash .bd-s-bar::after { background: linear-gradient(90deg, #e8682c, #d9541e); }

/* the mark draws itself, then the arcs broadcast (everything is visible without animation) */
#en-splash.bd-splash .bd-ring { animation: bdDraw .9s cubic-bezier(.4, 0, .2, 1) backwards; }
#en-splash.bd-splash .bd-v    { animation: bdDraw .7s cubic-bezier(.4, 0, .2, 1) .38s backwards; }
#en-splash.bd-splash .bd-pin  { transform-box: fill-box; transform-origin: center; animation: bdPop .45s cubic-bezier(.3, 1.6, .5, 1) .85s backwards; }
#en-splash.bd-splash .bd-arc.a1 { animation: bdArcIn .45s ease-out .8s backwards,  bdRipple 2.2s ease-in-out 1.7s infinite; }
#en-splash.bd-splash .bd-arc.a2 { animation: bdArcIn .45s ease-out .95s backwards, bdRipple 2.2s ease-in-out 1.88s infinite; }
#en-splash.bd-splash .bd-arc.a3 { animation: bdArcIn .45s ease-out 1.1s backwards, bdRipple 2.2s ease-in-out 2.06s infinite; }

/* the dash is only set while drawing, so the finished ring has no seam */
@keyframes bdDraw  { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes bdPop   { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bdArcIn { from { opacity: 0; } }
@keyframes bdUp    { from { opacity: 0; transform: translateY(8px); } }
@keyframes bdHalo  { 0%, 100% { transform: scale(.92); opacity: .75; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes bdBar   { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

/* short screens (landscape phones): mark on the left, text on the right */
@media (max-height: 440px) and (orientation: landscape) {
  #en-splash.bd-splash .bd-s-in { grid-template-columns: auto auto; grid-template-areas: "art word" "art tag" "art bar"; justify-items: start; align-items: center; column-gap: clamp(18px, 5vw, 32px); row-gap: 10px; text-align: left; }
  #en-splash.bd-splash .bd-s-art { grid-area: art; width: clamp(72px, 34vh, 112px); }
  #en-splash.bd-splash .bd-s-word { grid-area: word; align-self: end; }
  #en-splash.bd-splash .bd-s-tag { grid-area: tag; margin-right: 0; }
  #en-splash.bd-splash .bd-s-bar { grid-area: bar; align-self: start; }
}
/* very narrow phones */
@media (max-width: 340px) {
  #en-splash.bd-splash .bd-s-word { letter-spacing: .3em; margin-right: -.3em; }
  #en-splash.bd-splash .bd-s-tag { letter-spacing: .16em; margin-right: -.16em; }
}

@media (prefers-reduced-motion: reduce) {
  #en-splash.bd-splash *, #en-splash.bd-splash *::after,
  html.prime-playing .av-mark[data-bd] .bd-arc, .brand:hover .av-mark[data-bd] .bd-arc, .brand:focus-visible .av-mark[data-bd] .bd-arc { animation: none !important; }
}


/* VYBEON-HOMEPAGE-LOGO-TRANSPARENT-FIX */
/* Homepage splash logo only: remove the dark disc and external glow. */
#en-splash.bd-splash .bd-glow,
#en-splash.bd-splash .bd-s-halo {
    display: none !important;
    opacity: 0 !important;
    filter: none !important;
}
#en-splash.bd-splash .bd-disc {
    fill: transparent !important;
}
#en-splash.bd-splash svg.bd-mark {
    filter: none !important;
    background: transparent !important;
}
