/* ==========================================================================
   magIA — Meet
   A lit stage where she steps into the spotlight and speaks. Shared by the
   home page and the magIA page, so it lives outside either page sheet.
   Layers, back to front: spotlight cone -> gold dust -> wordmark -> her -> UI
   ========================================================================== */

/* ── Meet — a lit stage: she steps into the spotlight and speaks ──
   The scene is built in layers so the alpha video has real depth behind it:
   spotlight cone → gold dust → wordmark → her → interface  */
.section.magia-meet {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100vw;
    min-height: 46rem;
    /* Breathing room before the colour flips to black, so the seam with the
       hero reads as a pause and not as a cut */
    margin-top: 0;
    margin-left: calc(-50vw + 50%);
    padding-block: var(--space-24) var(--space-10);
    overflow: hidden;
    /* Solid night surface: the scene is dark in both themes, and a solid colour
       is also what lets the nav measure it and turn its icons light. */
    background-color: var(--surface-night);
    background-image: radial-gradient(ellipse 90% 42% at 50% 46%,
        color-mix(in srgb, var(--color-primary) 12%, transparent) 0%,
        transparent 70%);
    color: var(--text-on-primary);
}

/* In the dark theme the page is already this same night colour, so the scene can
   fade in and out at its edges and the seam disappears. In light it cannot: the
   page behind is white, and fading would open a pale gap under the artwork. */
[data-theme="dark"] .section.magia-meet {
    background-color: transparent;
    background-image:
        radial-gradient(ellipse 90% 42% at 50% 46%,
            color-mix(in srgb, var(--color-primary) 12%, transparent) 0%,
            transparent 70%),
        linear-gradient(to bottom,
            transparent 0%,
            var(--surface-night) 12%,
            var(--surface-night) 88%,
            transparent 100%);
}

/* Spotlight — a cone falling from the top of the frame. It is what makes the
   section read as a stage instead of a black box */
.magia-meet__spot {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 0;
    width: 120%;
    max-width: 60rem;
    height: 88%;
    pointer-events: none;
    opacity: 0.55;
    /* Starts at nothing: at full strength on the very first pixel the cone drew
       a bright band along the top edge, which read as the seam itself */
    background: linear-gradient(to bottom,
        transparent 0%,
        color-mix(in srgb, var(--text-on-primary) 13%, transparent) 14%,
        color-mix(in srgb, var(--text-on-primary) 5%, transparent) 50%,
        transparent 92%);
    clip-path: polygon(38% 0%, 62% 0%, 100% 100%, 0% 100%);
    transform: translateX(-50%);
    filter: blur(28px);
    transition: opacity var(--duration-slower) var(--ease-smooth);
}

/* Gold dust — specks of light, no shapes. Two layers drifting out of sync
   so the field never reads as a repeating pattern */
/* Twice as tall as the section, with the speck field tiled twice inside it, so
   travelling half its own height loops without a visible seam */
.magia-meet__dust {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    height: 200%;
    pointer-events: none;
    opacity: 0.95;
    background-repeat: repeat-y;
    background-size: 100% 50%;
    /* Each speck is a lit point, not a dot: the wide soft stop around the core
       is what makes it read as a mote catching the spotlight */
    background-image:
        radial-gradient(circle 3px at 14% 22%, var(--magia-gold) 0 35%, color-mix(in srgb, var(--magia-gold) 22%, transparent) 55%, transparent),
        radial-gradient(circle 2px at 27% 68%, var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 4px at 41% 12%, var(--magia-gold) 0 28%, color-mix(in srgb, var(--magia-gold) 20%, transparent) 52%, transparent),
        radial-gradient(circle 2px at 56% 82%, var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 3px at 68% 34%, var(--magia-gold) 0 35%, color-mix(in srgb, var(--magia-gold) 22%, transparent) 55%, transparent),
        radial-gradient(circle 2px at 83% 58%, var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 4px at 91% 18%, var(--magia-gold) 0 28%, color-mix(in srgb, var(--magia-gold) 20%, transparent) 52%, transparent),
        radial-gradient(circle 3px at 22% 44%, var(--magia-gold) 0 35%, transparent),
        radial-gradient(circle 2px at 49% 58%, var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 4px at 74% 88%, var(--magia-gold) 0 28%, color-mix(in srgb, var(--magia-gold) 20%, transparent) 52%, transparent),
        radial-gradient(circle 2px at 35% 30%, var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 3px at 61% 66%, var(--magia-gold) 0 35%, transparent);
    animation: dust-rise 26s linear infinite;
    /* Specks popped in at full strength on the first pixel, drawing a line along
       the seam. They now rise into view and fade out again at the far end. */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

/* Far layer — smaller, blurred, slower. Depth comes from the two speeds */
.magia-meet__dust--far {
    opacity: 0.6;
    background-image:
        radial-gradient(circle 2px at 8% 47%,  var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 3px at 33% 88%, var(--magia-gold) 0 35%, transparent),
        radial-gradient(circle 2px at 48% 38%, var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 2px at 62% 8%,  var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 3px at 77% 72%, var(--magia-gold) 0 35%, transparent),
        radial-gradient(circle 2px at 95% 42%, var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 3px at 18% 12%, var(--magia-gold) 0 35%, transparent),
        radial-gradient(circle 2px at 88% 92%, var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 2px at 44% 74%, var(--magia-gold) 0 40%, transparent),
        radial-gradient(circle 3px at 70% 24%, var(--magia-gold) 0 35%, transparent);
    animation-duration: 41s;
    animation-delay: -12s;
    filter: blur(1.5px);
}

/* Wordmark — the name of the product, set enormous, sitting behind her.
   It is scenery, not a heading: never read out, never competing for contrast */
.magia-meet__wordmark {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 100%;
    pointer-events: none;
    text-align: center;
    font-size: clamp(5rem, 22vw, 24rem);
    font-weight: var(--fw-extrabold);
    line-height: 1;
    letter-spacing: var(--tracking-tight);
    /* Brand blue, not gold: the wordmark is the product's name, while the gold
       in this scene belongs to her — the helmet, the embroidery, her voice */
    color: color-mix(in srgb, var(--color-primary) 26%, transparent);
    /* Pulled up off the baseline: at this size its descender would otherwise
       land on the copy below it */
    transform: translate(-50%, -62%);
    transition: color var(--duration-slower) var(--ease-smooth),
                opacity var(--duration-slower) var(--ease-smooth);
}

/* Stage — she is the point of the section, so she gets the middle of the frame */
.magia-meet__stage {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: var(--space-8);
    pointer-events: none;
}

.magia-meet__video {
    display: block;
    width: 100%;
    max-width: 30rem;
    height: auto;
    background-color: transparent;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.6));
    transition: transform var(--duration-slower) var(--ease-spring),
                filter var(--duration-slower) var(--ease-smooth);
}

/* Interface — anchored to the floor of the scene, never floating in the middle */
.magia-meet__ui {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    align-items: flex-start;
}

.magia-meet__title {
    font-size: var(--text-3xl);
    font-weight: var(--fw-extrabold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

/* Two accents, one rule each: gold is hers — her voice, her helmet — and blue
   is the product's name, wherever it appears */
.magia-meet__accent {
    color: var(--magia-gold);
}

.magia-meet__brand {
    color: var(--color-primary);
}

.magia-meet__lead {
    max-width: 30rem;
    margin-top: var(--space-3);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: color-mix(in srgb, var(--text-on-primary) 62%, transparent);
    transition: opacity var(--duration-slower) var(--ease-smooth);
}

/* Her own line, in her own voice — set apart by weight, not by a box */
.magia-meet__quote {
    max-width: 32rem;
    margin-top: var(--space-6);
    font-size: var(--text-lg);
    font-weight: var(--fw-semibold);
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-tight);
    transition: opacity var(--duration-slower) var(--ease-smooth);
}

/* CTA — only rendered on the home page, where the section is a doorway into
   the magIA page. A line of type with an arrow, never a button */
.magia-meet__cta {
    display: inline-flex;
    gap: var(--space-2);
    align-items: center;
    margin-top: var(--space-6);
    color: var(--magia-gold);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-wide);
    text-decoration: none;
    transition: gap var(--duration-normal) var(--ease-spring),
                opacity var(--duration-slower) var(--ease-smooth);
}

.magia-meet__cta:hover,
.magia-meet__cta:focus-visible {
    /* Global link styles turn this blue on hover, which fights the scene: it
       stays gold and answers with movement instead of colour */
    color: var(--magia-gold);
    gap: var(--space-3);
}

.magia-meet.is-playing .magia-meet__cta {
    opacity: 0.45;
}

/* Play — one gold orb, the only warm light the interface is allowed */
.magia-meet__play {
    display: inline-flex;
    /* Never lets the label wrap: it is a control, and a control that breaks
       across three lines stops reading as one */
    flex-shrink: 0;
    gap: var(--space-4);
    align-items: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-on-primary);
    text-align: left;
    cursor: pointer;
}

.magia-meet__orb {
    position: relative;
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: var(--radius-full);
    background-color: var(--magia-gold);
    color: var(--surface-night);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--magia-gold) 40%, transparent),
                0 10px 30px color-mix(in srgb, var(--magia-gold) 32%, transparent);
    transition: transform var(--duration-normal) var(--ease-spring),
                box-shadow var(--duration-normal) var(--ease-smooth);
}

.magia-meet__orb-icon {
    grid-area: 1 / 1;
    transition: opacity var(--duration-fast) var(--ease-smooth);
}

.magia-meet__orb-icon--pause,
.magia-meet.is-playing .magia-meet__orb-icon--play {
    opacity: 0;
}

.magia-meet.is-playing .magia-meet__orb-icon--pause {
    opacity: 1;
}

.magia-meet__play:hover .magia-meet__orb,
.magia-meet__play:focus-visible .magia-meet__orb {
    box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--magia-gold) 14%, transparent),
                0 12px 36px color-mix(in srgb, var(--magia-gold) 44%, transparent);
    transform: scale(1.06);
}

.magia-meet__play-copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.magia-meet__play-label {
    white-space: nowrap;
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-wide);
}

.magia-meet__play-hint {
    white-space: nowrap;
    font-size: var(--text-xs);
    color: color-mix(in srgb, var(--text-on-primary) 50%, transparent);
}

/* Wave — her voice, drawn. Driven by the real audio signal, so it rises and
   falls with what she is saying. Not a progress bar: there is nothing to seek */
.magia-meet__wave {
    position: relative;
    z-index: 4;
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 22rem;
    height: 2.25rem;
    margin-top: var(--space-10);
    margin-inline: auto;
}

.magia-meet__wave-bar {
    width: 2px;
    height: 100%;
    border-radius: var(--radius-full);
    background-color: var(--magia-gold);
    opacity: 0.35;
    transform: scaleY(0.06);
    transition: transform var(--duration-fast) var(--ease-smooth),
                opacity var(--duration-normal) var(--ease-smooth);
}

.magia-meet.is-playing .magia-meet__wave-bar {
    opacity: 1;
    box-shadow: 0 0 10px color-mix(in srgb, var(--magia-gold) 55%, transparent);
    transition: transform 80ms linear,
                opacity var(--duration-normal) var(--ease-smooth);
}

/* Playing — the room dims around her: the scenery recedes, the light rises,
   and she comes forward. Nothing moves position, only presence */
.magia-meet.is-playing .magia-meet__spot {
    opacity: 1;
}

.magia-meet.is-playing .magia-meet__wordmark {
    opacity: 0.35;
}

.magia-meet.is-playing .magia-meet__lead,
.magia-meet.is-playing .magia-meet__quote {
    opacity: 0.45;
}

.magia-meet.is-playing .magia-meet__video {
    transform: scale(1.04);
    filter: drop-shadow(0 30px 70px rgba(0, 0, 0, 0.7));
}

/* ── Tablet  (>= 640px) ──────────────────────────────── */
@media (min-width: 640px) {
    .magia-meet__title {
        font-size: var(--text-4xl);
    }

    .magia-meet__video {
        max-width: 34rem;
    }

}

/* ── Desktop  (>= 1024px) ────────────────────────────── */
@media (min-width: 1024px) {
    .section.magia-meet {
        min-height: 112dvh;
        margin-top: var(--space-24);
        padding-block: var(--space-24) var(--space-10);
    }

    /* Desktop — she owns the centre of the stage and the interface sits on the
       floor beneath her, so the full width of the frame is scene, not margin */
    .magia-meet__stage {
        position: absolute;
        inset: 0;
        align-items: center;
        margin-bottom: 0;
    }

    /* She sits high in the frame: the interface below her needs clear air, and
       the wordmark behind her has to stay legible as scenery */
    .magia-meet__video {
        width: auto;
        max-width: 84%;
        height: 54dvh;
        margin-bottom: 34dvh;
    }

    .magia-meet__track {
        padding-inline: var(--space-10);
    }

    .magia-meet__wordmark {
        transform: translate(-50%, -78%);
    }

    .magia-meet__ui {
        flex-direction: row;
        gap: var(--space-10);
        align-items: flex-end;
        justify-content: space-between;
    }

    .magia-meet__play {
        padding-bottom: var(--space-2);
    }

    .magia-meet__title {
        font-size: var(--text-5xl);
    }


}

/* ----------------------------------------------------------------------
   Home variant
   Same scene, different job: here it is a doorway, not a presentation. The
   block is narrower and sits lower so it never climbs over her.
   ---------------------------------------------------------------------- */
/* Only the supporting line is narrowed — capping the whole block would wrap
   the heading onto three lines and push it back over her */
.magia-meet--home .magia-meet__lead,
.magia-meet--home .magia-meet__quote {
    max-width: 28rem;
}

.magia-meet--home .magia-meet__wave {
    margin-top: var(--space-6);
}

@media (min-width: 1024px) {
    /* The control sits with the copy, not flung to the far edge */
    .magia-meet--home .magia-meet__ui {
        gap: var(--space-16);
        justify-content: flex-start;
    }

    /* Lower in the frame: less air under the block, so the words clear her */
    .section.magia-meet--home {
        padding-bottom: var(--space-6);
    }
}
