/* Flair: a second layer of motion on top of the home page. Everything here decorates content
   that already works on its own; assets/js/flair.js adds the classes it needs. */


/* ---------- Gold light that travels across italic headline words ---------- */
.fl-shine {
    background: linear-gradient(100deg, var(--gold-soft) 0%, var(--gold-soft) 38%, #FFF8E2 47%, #FFFFFF 50%, #FFF8E2 53%, var(--gold-soft) 62%, var(--gold-soft) 100%);
    background-size: 260% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-right: 0.06em;
    margin-right: -0.06em;
}
.fl-shine.is-shining { animation: fl-shine 5s cubic-bezier(0.6, 0, 0.3, 1) 0.5s forwards; }
.fl-shine.is-looping { animation: fl-shine 7s cubic-bezier(0.6, 0, 0.3, 1) 1.2s infinite; }
@keyframes fl-shine { from { background-position: 100% 0; } 26%, to { background-position: 0 0; } }

/* ---------- Labels: the star turns slowly, a hairline draws after the words ---------- */
.label .star { animation: fl-turn 14s linear infinite; }
.label.fl-line::after {
    content: "";
    width: 42px;
    height: 1px;
    margin-left: 4px;
    background: linear-gradient(90deg, currentColor, transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}
.label.fl-line.is-in::after { transform: scaleX(1); }
@keyframes fl-turn { to { rotate: 360deg; } }

/* ---------- Hero: what is on the shelf, one title at a time ---------- */
.hero-ticker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    padding: 9px 18px 9px 14px;
    border-radius: 999px;
    background: rgba(5, 17, 12, 0.55);
    border: 1px solid rgba(240, 219, 162, 0.18);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: 13.5px;
    color: var(--ink-2);
    max-width: 100%;
}
.ht-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.ht-eq i { width: 2.5px; height: 100%; border-radius: 2px; background: var(--mint); transform-origin: bottom; animation: fl-eq 0.9s ease-in-out infinite; }
.ht-eq i:nth-child(2) { animation-delay: -0.3s; background: var(--gold); }
.ht-eq i:nth-child(3) { animation-delay: -0.6s; }
.ht-eq i:nth-child(4) { animation-delay: -0.15s; background: var(--gold); }
.ht-eq i:nth-child(5) { animation-delay: -0.45s; }
@keyframes fl-eq { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }
.ht-label { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 10.5px; color: var(--gold); white-space: nowrap; }
.ht-window { position: relative; display: inline-block; overflow: hidden; height: 1.45em; min-width: 12em; text-align: left; }
.ht-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26em; color: var(--ink); font-weight: 600; line-height: 1.45; }
.ht-title .c { display: inline-block; white-space: pre; }

/* ---------- Scholars: faces brighten under the cursor ---------- */
.niche-frame { transition: filter 0.4s ease, translate 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.niche:hover .niche-frame { filter: brightness(1.15); translate: 0 -10px; }
.arcade-hint { display: flex; align-items: center; justify-content: center; gap: 12px; }
.arcade-hint::before, .arcade-hint::after { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); animation: fl-nudge 2.2s ease-in-out infinite; }
.arcade-hint::after { transform: scaleX(-1); animation-name: fl-nudge-r; }
@keyframes fl-nudge { 0%, 100% { translate: 0 0; } 50% { translate: -10px 0; } }
@keyframes fl-nudge-r { 0%, 100% { translate: 0 0; } 50% { translate: 10px 0; } }

/* ---------- Why listen: each reason's star spins in ---------- */
.mint-list li .star { transition: rotate 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
.mint-list li:hover .star { rotate: 180deg; }
.mint-list li { transition: translate 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.mint-list li:hover { translate: 8px 0; }

/* ---------- Inside the app: the points tick in one by one ---------- */
.story.is-live .story-step .points li { opacity: 0; translate: -14px 0; transition: opacity 0.5s ease, translate 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.story.is-live .story-step.is-active .points li { opacity: 1; translate: 0 0; }
.story.is-live .story-step.is-active .points li:nth-child(1) { transition-delay: 0.25s; }
.story.is-live .story-step.is-active .points li:nth-child(2) { transition-delay: 0.37s; }
.story.is-live .story-step.is-active .points li:nth-child(3) { transition-delay: 0.49s; }
.story-step .points li svg polyline { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 0.6s ease; }
.story-step.is-active .points li svg polyline,
.story:not(.is-live) .story-step .points li svg polyline { stroke-dashoffset: 0; }
.story.is-live .story-step.is-active .points li:nth-child(1) svg polyline { transition-delay: 0.45s; }
.story.is-live .story-step.is-active .points li:nth-child(2) svg polyline { transition-delay: 0.57s; }
.story.is-live .story-step.is-active .points li:nth-child(3) svg polyline { transition-delay: 0.69s; }

/* ---------- Questions: answers open smoothly, the open one carries a live voice ---------- */
.faq summary { transition: color 0.3s ease, padding-left 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.faq summary:hover { padding-left: 10px; }
.fl-voice { display: inline-flex; align-items: center; gap: 2px; height: 16px; margin-left: auto; margin-right: 14px; opacity: 0; transition: opacity 0.35s ease; }
.fl-voice i { width: 2.5px; height: 100%; border-radius: 2px; background: var(--mint); transform: scaleY(0.2); }
.faq details[open] .fl-voice { opacity: 1; }
.faq details[open] .fl-voice i { animation: fl-eq 0.8s ease-in-out infinite; }
.faq details[open] .fl-voice i:nth-child(2n) { background: var(--gold); animation-delay: -0.35s; }
.faq details[open] .fl-voice i:nth-child(3n) { animation-delay: -0.6s; }

/* ---------- Closing: light turns behind the phone, covers drift, buttons catch the light ---------- */
.closing-device::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 34%;
    width: 760px;
    height: 760px;
    margin: -380px 0 0 -380px;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.22) 0deg 5deg, transparent 5deg 18deg);
    -webkit-mask: radial-gradient(closest-side, #000 20%, transparent 100%);
    mask: radial-gradient(closest-side, #000 20%, transparent 100%);
    animation: fl-turn 40s linear infinite;
    pointer-events: none;
    z-index: 0;
}
.float-cover { animation: fl-bob 6s ease-in-out infinite; }
.fc-1 { animation-delay: -1.5s; animation-duration: 7s; }
.fc-2 { animation-delay: -3s; animation-duration: 5.5s; }
.fc-3 { animation-delay: -4.5s; animation-duration: 6.5s; }
@keyframes fl-bob { 0%, 100% { translate: 0 0; rotate: -2deg; } 50% { translate: 0 -16px; rotate: 3deg; } }
.store { position: relative; overflow: hidden; }
.store::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
    background-size: 250% 100%;
    background-position: 130% 0;
    animation: fl-glint 5s ease-in-out infinite;
    pointer-events: none;
}
.store:nth-child(2)::after { animation-delay: 0.25s; }
.store:nth-child(3)::after { animation-delay: 0.5s; }
@keyframes fl-glint { 0%, 70% { background-position: 130% 0; } 100% { background-position: -30% 0; } }

/* ---------- Footer links underline from the left ---------- */
.site-footer a:not(.store):not(.brand) { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.45s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s ease; }
.site-footer a:not(.store):not(.brand):hover { background-size: 100% 1px; }

@media (prefers-reduced-motion: reduce) {
    .label .star, .ht-eq i, .arcade-hint::before, .arcade-hint::after,
    .faq details[open] .fl-voice i,
    .closing-device::before, .float-cover, .store::after, .fl-shine { animation: none !important; }
}
