/* Desktop artwork fills the section; mobile preserves its aspect ratio below. */
.new-launches-bg {
    min-height: 390px;
    background-color: #fcf9f2;
    background-image: url('../assets/new-launches/bottom-bg-desktop-new.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

#books-dots-container {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}
#books-dots-container > * { flex-shrink: 0; }

@media (max-width: 767px) {
    #new-launches .new-launches-content { padding-inline: 1rem; }
    #new-launches .section-title {
        font-size: clamp(23px, 6.5vw, 28px);
        white-space: nowrap;
    }
    #new-launches .mobile-book-stage {
        margin-top: 0;
        padding-bottom: 0;
    }
    /* One control row below the covers leaves all three books unobstructed. */
    #new-launches [data-books-prev],
    #new-launches [data-books-next] {
        top: auto;
        bottom: 0;
        transform: none;
    }
    #books-dots-container {
        min-height: 36px;
        max-width: calc(100% - 96px);
        margin-top: 8px;
    }
}
@media (min-width: 768px) {
    #new-launches [data-books-prev],
    #new-launches [data-books-next] { top: 45%; }
    /* Use the section's existing outer gutters for the arrows. */
    #new-launches [data-books-prev] { left: -2rem; }
    #new-launches [data-books-next] { right: -2rem; }
}
@media (min-width: 1024px) {
    #new-launches [data-books-prev] { left: -3.5rem; }
    #new-launches [data-books-next] { right: -3.5rem; }
}

/* Book stage geometry lives in css/02-book-shelf.css (carousel slots) */

/* Fix text overflow for email links and location cards */
a[href^="mailto:"] {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
}

.min-w-0 {
    min-width: 0 !important;
}

.break-all {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
}

.font-lobster {
    font-family: 'Lobster', 'Lobster Two', cursive;
    font-weight: 400;
}

/* ── Virtual-guide monitor screen ──────────────────────────────────────────
   book-image-screen-cut.webp is book-image.webp with the monitor's screen — and
   the play button that was painted onto it — knocked out to transparency. The
   thumbnail sits behind the artwork and shows through that aperture, so the
   books overlapping the screen's bottom-left still read as being in front of it.

   All three boxes below are measured off the 1536x1024 artwork, where the
   aperture spans x 495-1320 / y 169-672 and the painted disc was centred at
   (877, 431) with a 331px diameter. Regenerate those numbers if the art changes.
   Kept as plain CSS, not Tailwind arbitrary values: tailwind.min.css is a purged
   build, so new utilities would need npm run build:css to exist. */
.vg-screen-media {
    position: absolute;
    left: 31.9%;
    top: 16%;
    width: 54.4%;
    height: 50.1%;
    object-fit: cover;
    pointer-events: none;
}

/* Play disc over the screen. Painted into the artwork before the knockout, a
   real element now, and smaller than the painted one so the thumbnail behind
   it stays readable. It is centred on the aperture itself — (908, 423) —
   rather than on the painted disc's spot, which sat low and left of centre.
   The vertical centre is measured across the aperture's unoccluded columns
   (x 650-1130); outside those the books and the pencil pot clip its bottom
   edge and would drag a naive midpoint upward. The disc and its pulse ring
   have to share a box for the ring to emerge from behind the disc — hence the
   one knob on their common parent. */
[data-vg-art] {
    --vg-play-size: 11%;

    /* Whole-illustration tilt. Rotating this wrapper — not the art <img> — keeps
       the knocked-out screen, its thumbnail and the play disc rotating together,
       so the aperture stays filled. Hover scale rides on --vg-scale (set by the
       trigger's inline handlers) instead of overwriting transform, which would
       drop the tilt.

       Clockwise: the tilt runs against the aperture's own -4.1deg lean, which
       squares the monitor up rather than exaggerating its 3/4 angle. */
    --vg-tilt: 5deg;
    --vg-scale: 1;
    transform: rotate(var(--vg-tilt)) scale(var(--vg-scale));
}

/* The monitor is drawn in a 3/4 view — the aperture's top edge runs at -2.6deg
   and its verticals lean -4.1deg — and the disc painted on it followed that
   tilt: its play mark measured -5.4deg off horizontal over a -4.1deg flat edge.
   rotate(-5deg) reproduces both, so the glyph, the gradient and the inset
   highlight lie in the screen's plane instead of standing upright on it. The
   painted disc was a true circle (333x333px in the art), so nothing is squashed. */
.vg-play-btn {
    position: absolute;
    left: 59.1%;
    top: 41.3%;
    width: var(--vg-play-size);
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%) rotate(-5deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #fff;

    /* Shaded as a ball rather than a flat disc, keyed to the artwork's own
       lighting: the books, the pot and the monitor are all lit from the upper
       left, so the lit face sits at 27%/21% and the terminator rolls off to the
       lower right. Rotating with the disc keeps that light direction fixed
       relative to the screen it sits on. */
    background: radial-gradient(115% 115% at 27% 21%,
            #C7ABFF 0%, #A47CFA 20%, #8B5CF6 42%, #7C3AED 60%, #5B21B6 85%, #4A1A8F 100%);
    box-shadow:
        /* cast + contact shadow on the screen behind it */
        0 14px 24px -8px rgba(49, 12, 110, 0.5),
        0 4px 9px -3px rgba(49, 12, 110, 0.45),
        /* unlit rim curling away from the key light */
        inset -5px -7px 12px -4px rgba(49, 12, 110, 0.55),
        /* bounce light off the bright screen underneath */
        inset 0 -3px 7px -2px rgba(199, 171, 255, 0.5),
        /* lit rim along the top-left edge */
        inset 3px 4px 7px -3px rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

/* Specular blob — the soft off-centre gloss dot every 3D prop in the artwork
   carries, tilted to sit along the sphere's curve. */
.vg-play-btn::before {
    content: "";
    position: absolute;
    left: 15%;
    top: 10%;
    width: 46%;
    height: 33%;
    border-radius: 9999px;
    transform: rotate(-28deg);
    background: radial-gradient(closest-side,
            rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.3) 55%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

/* Positioned so it paints over the specular blob, which is a positioned
   element and would otherwise sit on top of the glyph. */
.vg-play-btn svg {
    position: relative;
    z-index: 1;
    width: 40%;
    height: 40%;
    margin-left: 6%;
    filter: drop-shadow(0 2px 4px rgba(49, 12, 110, 0.45));
}

/* Pulsing ring behind the virtual-guide play disc — same box, so the disc masks
   its centre and only the growing edge shows. */
.vg-play-pulse {
    position: absolute;
    left: 59.1%;
    top: 41.3%;
    width: var(--vg-play-size);
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border-radius: 9999px;
    background: rgba(124, 58, 237, 0.55);
    pointer-events: none;
    animation: vg-play-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes vg-play-ping {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.65;
    }
    75%,
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Play button on the animation-studio thumbnails. The disc is solid rather than
   frosted so the glyph stays readable over the busy artwork, and a ring pulses
   outward from behind it. */
.play-pulse-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #1E5CA3;
    box-shadow: 0 8px 22px rgba(10, 30, 60, 0.35);
}

.play-pulse-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    pointer-events: none;
    animation: play-pulse-ring 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.play-pulse-btn:hover {
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(10, 30, 60, 0.45);
}

@keyframes play-pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.85;
    }
    75%,
    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

/* Image-based 3D play button replacing the CSS-drawn one */
.vg-play-img {
    position: absolute;
    left: 59.1%;
    top: 41.3%;
    width: 14%; /* slightly larger than var(--vg-play-size) due to its 3D bevel */
    transform: translate(-50%, -50%);
    filter: drop-shadow(-8px 12px 15px rgba(49, 12, 110, 0.4));
    pointer-events: none;
    z-index: 10;
    animation: vg-img-pulse 2s infinite ease-in-out;
}

@keyframes vg-img-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
    }
}

/* ── Section rhythm ─────────────────────────────────────────────────────────
   On a laptop the gap between one section's last row and the next section's
   eyebrow was running ~90px, which read as the two blocks touching — the QA
   pass flagged it at four junctions (products/services, about/products,
   services/workshops, virtual guide/animation studio). The air is added as
   padding *inside* the following section so each backdrop keeps running
   through it; the About→Products side lives with the rest of that section's
   CSS in index.html. */
#our-services-section {
    padding-top: 24px;
}

#workshops-section {
    padding-top: 32px;
}

#animation-studio-section {
    padding-top: 32px;
}

@media (min-width: 768px) {
    #our-services-section {
        padding-top: 48px;
    }

    #workshops-section {
        padding-top: 64px;
    }

    #animation-studio-section {
        padding-top: 80px;
    }
}

/* ── Virtual guide: content inside the container ────────────────────────────
   The card ran 1320px wide with 16-24px of padding, so the copy sat hard
   against the page edge while a dead band opened up between it and the
   illustration (the art was only 75% of its own column). The card now shares
   the ~1200px grid the sections around it use, carries real padding, and the
   artwork fills its side of the row. Written as CSS rather than Tailwind
   utilities: tailwind.min.css is a purged build, so new arbitrary values
   (w-[94%] and friends) would not exist in it. */
#virtual-guide-section .vg-wrap {
    max-width: 1200px;
}

#virtual-guide-section .vg-card {
    padding: 24px;
}

#virtual-guide-section .vg-art {
    width: 92%;
    margin-top: -4%;
    margin-bottom: -4%;
}

@media (min-width: 768px) {
    #virtual-guide-section .vg-card {
        padding: 32px 40px;
    }
}

@media (min-width: 1024px) {
    #virtual-guide-section .vg-card {
        padding: 32px 56px;
    }

    #virtual-guide-section .vg-row {
        gap: 40px;
    }

    #virtual-guide-section .vg-copy {
        width: 42%;
    }

    #virtual-guide-section .vg-art-col {
        width: 55%;
        max-width: none;
    }
}

/* ── Contact field ──────────────────────────────────────────────────────────
   The email pill sits on a near-white card, and its border-gray-100 edge was
   too faint to show where the input actually is. A slightly stronger line, and
   it lifts to the brand blue while the field has focus. */
.contact-field {
    border-color: #D6DCE8;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.contact-field:focus-within {
    border-color: #1E5CA3;
    box-shadow: 0 0 0 3px rgba(30, 92, 163, 0.12);
}

/* Center service rows while preserving the responsive card widths. */
#our-services-section .our-services-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 56px 24px;
}

#our-services-section .our-services-cards > .group {
    flex: 0 0 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    #our-services-section .our-services-cards > .group {
        flex-basis: calc((100% - 24px) / 2);
    }
}

@media (min-width: 1024px) {
    #our-services-section .our-services-cards > .group {
        flex-basis: calc((100% - 72px) / 4);
    }
}

/* Blend full, proportional artwork layers through their quiet sky regions.
   Avoid rectangular crop edges across the mobile background. */
@media (max-width: 767px) {
    .new-launches-bg {
        background-color: #fcf9f2;
        background-image:
            linear-gradient(to top, #fcf9f2 0%, transparent 18%),
            radial-gradient(ellipse at 50% 42%, #fffef3 15%, transparent 75%),
            linear-gradient(120deg, #b4e4ff, #e2e8fd 45%, #ffe8db);
        background-size: 100% 100%;
        background-position: center;
    }

    .new-launches-bg::before,
    .new-launches-bg::after {
        content: '';
        position: absolute;
        left: 0;
        width: 100%;
        z-index: 0;
        pointer-events: none;
        background-image: url('../assets/new-launches/bottom-bg-desktop-new.webp');
        background-size: 100% auto;
        background-repeat: no-repeat;
    }

    .new-launches-bg::before {
        top: 0;
        aspect-ratio: 2560 / 1198;
        background-position: center top;
        mask-image: linear-gradient(to bottom,
            #000 25%, rgba(0, 0, 0, 0.85) 30%,
            rgba(0, 0, 0, 0.35) 40%, transparent 55%);
    }

    .new-launches-bg::after {
        /* Match the carousel's existing podium seat at source y=1037.
           Floor below the image continues in the section's cream background. */
        bottom: max(0px, calc(13.4391% - 6.2891vw));
        aspect-ratio: 2560 / 1198;
        background-position: center bottom;
        mask-image: linear-gradient(to bottom,
            transparent 45%, rgba(0, 0, 0, 0.2) 55%,
            rgba(0, 0, 0, 0.85) 65%, #000 70%);
    }
}
