/* ============ Learning Center Experience (lcx) ============
   Click-gated full-screen navy takeover introducing the Whetstone Learning
   Center and GuideMate Brain. Native scroll inside the overlay drives a
   horizontal five-panel journey (sticky stage + tall pin spacer).
   Without JS none of this renders: the arrow and overlay keep [hidden]. */

/* ---- Entry arrow ----
   A crisp navy half-circle emerging from the right edge of the screen
   (the other half hides off-screen), with the gold arrow floating on it.
   It breathes slowly, like the takeover leaning into the page. */
.lcx-arrow {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 200px;
    padding: 0;
    border: none;
    background: none;
    color: var(--gold-400);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, color 0.2s ease;
}

.lcx-arrow::before {
    content: "";
    position: absolute;
    top: 50%;
    right: -115px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    /* Misty: a dense navy heart dissolving into the page, half off-screen. */
    background: radial-gradient(circle,
        rgba(11, 24, 46, 0.95) 0%,
        rgba(11, 24, 46, 0.8) 42%,
        rgba(13, 29, 54, 0.4) 62%,
        rgba(13, 29, 54, 0) 76%);
    filter: blur(12px);
    animation: lcx-breathe 5s ease-in-out infinite;
}

.lcx-arrow svg {
    position: relative;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
}

.lcx-arrow.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.lcx-arrow:hover {
    color: #f7f1e4;
}

.lcx-arrow:hover::before {
    animation-duration: 3s;
}

.lcx-arrow:focus-visible {
    outline: 2px solid rgba(23, 58, 100, 0.45);
    outline-offset: 4px;
    border-radius: 12px;
}

@keyframes lcx-breathe {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.07); }
}

@media (max-width: 720px) {
    .lcx-arrow {
        width: 68px;
        height: 144px;
    }

    .lcx-arrow::before {
        right: -82px;
        width: 164px;
        height: 164px;
    }

    .lcx-arrow svg {
        width: 22px;
        height: 22px;
    }
}


/* ---- Overlay shell ----
   Kept permanently laid out but parked off-screen: opening is then just a
   visibility flip + transform tween (no display:none -> block restyle of the
   whole subtree, which caused a first-frame flicker). */
.lcx {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--navy-950);
    color: #f2ead9;
    /* Parked off-screen by lcx.js at init (GSAP xPercent, or an inline
       transform without GSAP). Do NOT park via a CSS transform here: GSAP
       decomposes it into a separate pixel x component and the entrance
       tween would run 200% -> 100%, never reaching the screen. */
    visibility: hidden;
}

.lcx.is-open {
    visibility: visible;
}

/* No-JS: the hidden attribute stays on and removes it entirely. */
.lcx[hidden] {
    display: none;
}

/* Aurora backdrop (WebGL, see lcx-aurora.js): glows along the top of the
   navy takeover, behind the panels. */
.lcx-aurora {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 62%;
    z-index: 0;
    opacity: 0.75;
    pointer-events: none;
}

.lcx-aurora canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.lcx-scroller {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    scroll-snap-type: y proximity;
}

.lcx-pin {
    position: relative;
}

/* Invisible per-panel snap targets (positioned by lcx.js). */
.lcx-snap {
    position: absolute;
    left: 0;
    width: 1px;
    height: 2px;
    scroll-snap-align: start;
}

.lcx-scroller::-webkit-scrollbar {
    display: none;
}

.lcx-scroller:focus {
    outline: none;
}

.lcx-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.lcx-track {
    position: relative;
    display: flex;
    height: 100%;
    width: max-content;
    will-change: transform;
}

/* ---- Panels ---- */
.lcx-panel {
    position: relative;
    flex: 0 0 100vw;
    height: 100%;
    display: flex;
    align-items: center;
    padding: clamp(1.5rem, 6vw, 6rem);
    /* Sit the content low so the aurora along the top can shine. */
    padding-top: 17vh;
    overflow: hidden;
}

.lcx-copy {
    position: relative;
    z-index: 2;
    max-width: 34rem;
}

.lcx-kicker {
    margin: 0 0 1.1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--gold-400);
}

.lcx-panel h2 {
    margin: 0 0 1.1rem;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.4px;
    color: #f7f1e4;
}

.lcx-panel p {
    margin: 0;
    font-size: clamp(0.98rem, 1.4vw, 1.12rem);
    line-height: 1.75;
    color: rgba(242, 234, 217, 0.78);
}

/* Intro panel */
.lcx-panel--intro {
    justify-content: center;
    text-align: center;
}

.lcx-panel--intro .lcx-copy {
    max-width: 52rem;
}

.lcx-panel--intro h2 {
    font-size: clamp(2.6rem, 6vw, 4.8rem);
}

.lcx-panel .lcx-sub {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 2.6rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    line-height: 1.2;
    color: var(--gold-400);
}

.lcx-sub-icon {
    flex: 0 0 auto;
    width: 1.35em;
    height: 1.35em;
}

.lcx-hint {
    position: absolute;
    bottom: clamp(1.6rem, 5vh, 3rem);
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: rgba(242, 234, 217, 0.55);
    white-space: nowrap;
}

.lcx-hint svg {
    width: 16px;
    height: 16px;
    animation: lcx-hint-nudge 1.6s ease-in-out infinite;
}

@keyframes lcx-hint-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}

/* Feature panels: one row anchored to the bottom left, clear of the aurora.
   Numeral and copy share the bottom edge; the animated object rides the
   row's center line on the right. */
.lcx-panel--feature {
    gap: clamp(2rem, 4.5vw, 4.5rem);
    justify-content: flex-start;
    align-items: flex-end;
    padding-bottom: clamp(3.5rem, 12vh, 7rem);
}

.lcx-panel--feature .lcx-copy {
    margin-bottom: 2.4rem;
}

/* Lift the centered intro copy slightly as well. */
.lcx-panel--intro .lcx-copy {
    margin-bottom: 5vh;
}

.lcx-num {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(9rem, 24vw, 19rem);
    line-height: 0.9;
    letter-spacing: -0.02em;
    color: var(--gold-500);
    user-select: none;
    pointer-events: none;
}

/* Animated slide object (self-contained looping SVGs; keyframes below are
   lcx- namespaced). Sits in the same flex row as the numeral and copy,
   pushed to the right and centered on the numeral's midline. */
.lcx-obj {
    --acc: var(--gold-500);
    flex: 0 0 auto;
    align-self: flex-end;
    width: min(26vw, 300px);
    /* Exactly the numeral's rendered height (font-size x line-height), so the
       artwork centers on the number's midline while sharing its bottom edge. */
    height: calc(clamp(9rem, 24vw, 19rem) * 0.9);
    display: grid;
    place-items: center;
    pointer-events: none;
}

.lcx-obj svg {
    /* Render larger than the alignment box; grid centering keeps the artwork
       on the numeral's midline. */
    width: 130%;
    height: 130%;
}

@keyframes lcx-spin {
    to { transform: rotate(360deg); }
}

/* Closing panel: anchored bottom left like the feature slides,
   nudged in from the corner so it doesn't hug the edge. */
.lcx-panel--cta {
    justify-content: flex-start;
    align-items: flex-end;
    text-align: left;
    padding-left: clamp(8rem, 24vw, 26rem);
    padding-bottom: clamp(9rem, 28vh, 18rem);
}

.lcx-panel--cta .lcx-copy {
    max-width: none;
}

.lcx-panel--cta h2 {
    font-size: clamp(2rem, 4.6vw, 3.6rem);
    white-space: nowrap;
}

@media (max-width: 720px) {
    .lcx-panel--cta h2 {
        white-space: normal;
    }
}

.lcx-cta-links {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2.2rem;
    margin-top: 2.1rem;
    flex-wrap: wrap;
}

.lcx-cta-links a,
.lcx-cta-links button {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f7f1e4;
    cursor: pointer;
    text-underline-offset: 5px;
    transition: color 0.2s ease;
}

.lcx-cta-links a:hover,
.lcx-cta-links button:hover {
    color: var(--gold-400);
    text-decoration: underline;
}

.lcx-cta-links a:focus-visible,
.lcx-cta-links button:focus-visible {
    outline: 2px solid rgba(242, 234, 217, 0.6);
    outline-offset: 3px;
    border-radius: 4px;
}

.lcx-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.lcx-cta-primary svg {
    width: 16px;
    height: 16px;
}

/* ---- Chrome: close + progress ---- */
.lcx-close {
    position: absolute;
    top: clamp(1rem, 3vw, 1.8rem);
    right: clamp(1.2rem, 3vw, 2rem);
    z-index: 5;
    padding: 0.3rem 0.1rem;
    border: none;
    background: none;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(242, 234, 217, 0.7);
    cursor: pointer;
    transition: color 0.2s ease;
}

.lcx-close:hover {
    color: #f7f1e4;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.lcx-close:focus-visible {
    outline: 2px solid rgba(242, 234, 217, 0.6);
    outline-offset: 3px;
    border-radius: 4px;
}

.lcx-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    height: 2px;
    background: rgba(242, 234, 217, 0.12);
}

.lcx-progress-fill {
    height: 100%;
    width: 100%;
    background: var(--gold-500);
    transform-origin: left center;
    transform: scaleX(0);
}

/* ---- Scroll lock on the page behind ---- */
html.lcx-open,
html.lcx-open body {
    overflow: hidden;
}

/* ---- Mobile ---- */
@media (max-width: 720px) {
    .lcx-panel--feature {
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-start;
        gap: 1.2rem;
        padding-top: 4.5rem;
        padding-bottom: 3.5rem;
    }

    .lcx-num {
        flex: 0 0 auto;
        justify-content: flex-start;
        font-size: clamp(7rem, 26vw, 10rem);
    }

    .lcx-obj {
        position: absolute;
        right: 5vw;
        top: 17%;
        width: 38vw;
        height: 38vw;
    }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .lcx-arrow svg,
    .lcx-arrow::before,
    .lcx-hint svg {
        animation: none;
    }

    .lcx-obj * {
        animation: none !important;
    }
}
