/* Explain: Styles for subtle animations and transitions, including dynamic artwork glow effects. */
/* ==========================================================================
   Motion layer — a quiet symphony.

   Nothing in this file performs a loud gesture on its own. Every movement is a
   small, slow breath: a pale light creeping along a gold rule, a candle-flicker
   on a small heading, a rim of warmth on a button, a faint inner glow on a
   framed print or a room. Each one runs on its own duration and its own delay,
   so no two breaths land on the same beat — the way separate instruments each
   hold their own line inside one piece, and the composition is what moves.

   Only opacity, transform, colour, or a shadow carried on its own layer is
   animated, so nothing reflows as the page breathes. The whole layer is dropped
   for anyone who prefers reduced motion.
   ========================================================================== */

/* --- 1. The gold rules come to life ------------------------------------- */

/* Each separator is a hairline of warm gold that is now awake: it takes its
   light in slowly, holds a bright highlight, lets a glint travel its length,
   and settles back — over and over, at an uneven pace, so the line never sits
   flat. The three rules behave as one family. */
.section-divider,
.curated-divider,
.bst-divider,
.bst-rule {
    position: relative;
    overflow: visible;
    border-radius: 999px;
    will-change: clip-path;
}

/* Before a rule has been drawn it is held collapsed at its own centre. The
   `nd-armed` marker is placed on the page from js/dividers.js the moment that
   script is ready, so a hairline only ever hides while there is a script
   standing by to draw it back in — with scripting off, the rule simply shows
   complete. */
.nd-armed .section-divider,
.nd-armed .curated-divider,
.nd-armed .bst-divider,
.nd-armed .bst-rule {
    -webkit-clip-path: inset(0 50% 0 50%);
    clip-path: inset(0 50% 0 50%);
}

/* The rule is laid down from the middle toward both ends in one long, unhurried
   pass, so the line truly reads as being drawn rather than simply appearing
   already complete. */
.section-divider.is-drawn,
.curated-divider.is-drawn,
.bst-divider.is-drawn,
.bst-rule.is-drawn {
    animation: ndm-divider-draw 2800ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes ndm-divider-draw {
    from {
        -webkit-clip-path: inset(0 50% 0 50%);
        clip-path: inset(0 50% 0 50%);
    }
    to {
        -webkit-clip-path: inset(0 0 0 0);
        clip-path: inset(0 0 0 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nd-armed .section-divider,
    .nd-armed .curated-divider,
    .nd-armed .bst-divider,
    .nd-armed .bst-rule {
        -webkit-clip-path: none;
        clip-path: none;
    }

    .section-divider.is-drawn,
    .curated-divider.is-drawn,
    .bst-divider.is-drawn,
    .bst-rule.is-drawn {
        animation: none;
        -webkit-clip-path: none;
        clip-path: none;
    }
}

/* The whole rule gathers a warm highlight: the hairline swells into a soft band
   of light along its full length, holds for a breath, then eases back. It rises
   on its own rhythm, so the glow is never switched straight on. */
.section-divider::before,
.curated-divider::before,
.bst-divider::before {
    display: none;
    content: '';
    position: absolute;
    top: -3px;
    bottom: -3px;
    left: 0;
    right: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255, 228, 150, 0) 0%, rgba(255, 236, 176, 0.85) 50%, rgba(255, 228, 150, 0) 100%);
    filter: blur(3px);
    opacity: 0;
    animation: ndm-rule-highlight 17s ease-in-out infinite;
    will-change: opacity;
}

/* Once a rule has finished drawing itself in, a slim highlight rides along its
   length: a narrow band of warm light slips in from one end, glides across the
   hairline, and slides away again. It sits on the line itself — no bloom, no
   blur — so it reads as a quiet moving highlight rather than a glow. */
.section-divider::after,
.curated-divider::after,
.bst-divider::after,
.bst-rule::after {
    content: '';
    position: absolute;
    top: -0.5rem;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255, 250, 226, 0) 0%, rgba(255, 250, 226, 0) 40%, rgba(255, 250, 226, 0.42) 50%, rgba(255, 250, 226, 0) 60%, rgba(255, 250, 226, 0) 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 42%, #000 58%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 42%, #000 58%, transparent 100%);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

/* The highlight only sets off once the rule has been fully drawn, so the line
   is always complete first and the glint begins to travel afterward. */
.section-divider.is-drawn::after,
.curated-divider.is-drawn::after,
.bst-divider.is-drawn::after,
.bst-rule::after {
    animation: ndm-rule-glint 19s cubic-bezier(0.45, 0, 0.55, 1) 2.9s infinite;
}

/* The highlight rises into a soft band of light along the whole rule and eases
   back on an uneven breath: it comes up quickly, gutters a little, swells again
   brighter, then sinks — so the line keeps a living pulse. */
@keyframes ndm-rule-highlight {
    0%, 100% { opacity: 0; }
    14% { opacity: 0.28; }
    32% { opacity: 0.92; }
    40% { opacity: 0.46; }
    54% { opacity: 1; }
    68% { opacity: 0.34; }
    84% { opacity: 0.7; }
}

/* The glint travels the line twice within each cycle at an uneven pace: it
   creeps in, glides across, slips out, and later returns for a shorter pass.
   The line of light is always moving, so the rule reads as alive. */
@keyframes ndm-rule-glint {
    0% { transform: translateX(-105%); opacity: 0; }
    14% { opacity: 0.3; }
    46% { transform: translateX(0%); opacity: 0.34; }
    80% { transform: translateX(105%); opacity: 0; }
    100% { transform: translateX(105%); opacity: 0; }
}

/* --- 2. The small headings flicker like distant candles ----------------- */

/* Every gold label on the page now rises on the one shared slow beat, so the
   staggered offsets that used to set each section's light running on its own
   clock are gone. */
.eyebrow {
    animation: ndm-candle 15s ease-in-out infinite;
    will-change: opacity, text-shadow;
}

@keyframes ndm-candle {
    0%, 24% { opacity: 0.86; text-shadow: 0 0 0 rgba(242, 190, 78, 0); }
    34% { opacity: 1; text-shadow: 0 0 22px rgba(242, 190, 78, 0.4); }
    44% { opacity: 0.94; text-shadow: 0 0 9px rgba(242, 190, 78, 0.16); }
    56%, 100% { opacity: 0.86; text-shadow: 0 0 0 rgba(242, 190, 78, 0); }
}

/* --- 2b. Every section headline gathers the same warm gold ------------- */

/* The light that gathers around the opening headline on the home view now
   breathes across every major section title on the site: each heading lifts
   out of the dark into a soft halo of the same gold, then eases back, so the
   page reads as lit from within wherever the eye lands. The glow is carried as
   a filter on the heading itself, so it wraps the whole line — the letters and
   their own shadows together — and never disturbs the layout. */
.story-fade {
    animation: ndm-heading-glow 13s ease-in-out infinite;
    will-change: filter;
}

@keyframes ndm-heading-glow {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(242, 190, 78, 0.1)); }
    38% {
        filter:
            drop-shadow(0 0 16px rgba(255, 228, 144, 0.42))
            drop-shadow(0 0 44px rgba(255, 210, 100, 0.28))
            drop-shadow(0 0 88px rgba(242, 190, 78, 0.16));
    }
    70% {
        filter:
            drop-shadow(0 0 11px rgba(255, 234, 154, 0.3))
            drop-shadow(0 0 32px rgba(255, 216, 112, 0.2));
    }
}

/* Each section's light rises on its own beat, so no two headings swell into
   their halo at the same moment. */
#gallery .story-fade { animation-delay: -3s; }
#interiors .story-fade { animation-delay: -6.2s; }
#studio .story-fade { animation-delay: -8.6s; }
#reel .story-fade { animation-delay: -4.4s; }
#apparel .story-fade { animation-delay: -7.1s; }
#faq .story-fade { animation-delay: -10.3s; }
#contact .story-fade { animation-delay: -5.5s; }

/* --- 3. The buttons warm their rim -------------------------------------- */

.nd-btn-primary,
.nd-btn-ghost:not(.nd-btn-ring) {
    animation: ndm-btn-warm 15s ease-in-out infinite;
    will-change: box-shadow;
}

@keyframes ndm-btn-warm {
    0%, 24% { box-shadow: 0 0 0 rgba(242, 190, 78, 0); }
    34% { box-shadow: 0 0 20px rgba(242, 190, 78, 0.26); }
    52%, 100% { box-shadow: 0 0 0 rgba(242, 190, 78, 0); }
}

/* --- 4. The framed art catches a passing light -------------------------- */

.print-frame::after,
.interior-frame::after,
.bst-card-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    pointer-events: none;
    /* The quiet light inside a framed work takes the colour of that work when
       one has been read (see js/glow.js); every other frame keeps the gold. */
    box-shadow: inset 0 0 96px var(--print-glow-inner, rgba(242, 190, 78, 0.17));
    opacity: 0;
    animation: ndm-inner-light 15s ease-in-out infinite;
    will-change: opacity;
}

/* The whole wall now catches the light at the same moment: the staggered
   offsets that sent each frame's inner light up on its own clock are gone. */

@keyframes ndm-inner-light {
    0%, 24% { opacity: 0; }
    34% { opacity: 1; }
    52%, 100% { opacity: 0; }
}

/* --- 5. The questions carry a gold inner edge --------------------------- */

.faq-item,
#inquiryForm,
#notifyForm {
    position: relative;
}

.faq-item::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(242, 190, 78, 0.3), inset 0 0 40px rgba(242, 190, 78, 0.14);
    opacity: 0;
    animation: ndm-inner-light 15s ease-in-out infinite;
    will-change: opacity;
}

/* Every question now lights with the rest of the page on the one shared beat. */

/* --- 6. The two forms keep a quiet halo --------------------------------- */

#inquiryForm::after,
#notifyForm::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(242, 190, 78, 0.24), inset 0 0 70px rgba(242, 190, 78, 0.1);
    opacity: 0;
    animation: ndm-inner-light 15s ease-in-out infinite;
    will-change: opacity;
}

/* --- 7. The studio facts light their top rule in turn ------------------- */

.studio-stat {
    animation: ndm-stat-rule 15s ease-in-out infinite;
    will-change: border-top-color;
}

@keyframes ndm-stat-rule {
    0%, 24% { border-top-color: var(--border-color); }
    34% { border-top-color: rgba(242, 190, 78, 0.6); }
    52%, 100% { border-top-color: var(--border-color); }
}

/* --- 8. The studio reel warms its own edge ------------------------------ */

.reel-video {
    animation: ndm-reel-edge 15s ease-in-out infinite;
    will-change: border-color;
}

@keyframes ndm-reel-edge {
    0%, 24% { border-color: var(--border-color); }
    34% { border-color: rgba(242, 190, 78, 0.42); }
    52%, 100% { border-color: var(--border-color); }
}

/* --- 9. The cue beside each interior steps toward its print ------------- */

.interior-cta i {
    animation: ndm-cue-nudge 6.5s ease-in-out infinite;
    will-change: transform;
}

@keyframes ndm-cue-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

/* --- 10. The print titles settle and lift in a slow rotation ------------ */

.gallery-caption h3 {
    animation: ndm-title-lift 15s ease-in-out infinite;
    will-change: opacity;
}

@keyframes ndm-title-lift {
    0%, 24% { opacity: 0.85; }
    34% { opacity: 1; }
    52%, 100% { opacity: 0.85; }
}

/* --- Reduced motion: the whole layer goes quiet ------------------------- */

@media (prefers-reduced-motion: reduce) {
    .eyebrow,
    .nd-btn-primary,
    .nd-btn-ghost:not(.nd-btn-ring),
    .studio-stat,
    .reel-video,
    .interior-cta i,
    .gallery-caption h3 {
        animation: none;
    }

    .eyebrow,
    .gallery-caption h3 {
        opacity: 1;
    }

    .section-divider::before,
    .curated-divider::before,
    .bst-divider::before,
    .section-divider::after,
    .curated-divider::after,
    .bst-divider::after,
    .bst-rule::after,
    .print-frame::after,
    .interior-frame::after,
    .bst-card-frame::after,
    .faq-item::after,
    #inquiryForm::after,
    #notifyForm::after {
        animation: none;
        opacity: 0;
    }
}