/* =========================================================================
   BLEZA VIBE LAYER — shared design system upgrades
   Loaded by all 4 main pages alongside their per-page styles.
   ========================================================================= */

/* === Hard clamp horizontal scroll (mobile sometimes leaks via blobs/coverflow/floating photos) === */
html, body {
    overflow-x: clip !important;
    max-width: 100vw !important;
    overscroll-behavior-x: none;
}
/* For older browsers that don't support overflow: clip */
@supports not (overflow: clip) {
    html, body { overflow-x: hidden !important; }
}

/* === Block scroll while curtain is on screen === */
html.intro-locked, html.intro-locked body { overflow: hidden !important; }

/* === Page-intro curtain (split panels wipe away on load) === */
.page-curtain {
    position: fixed; inset: 0; z-index: 9800;
    pointer-events: none;
    --curtain-bg: linear-gradient(135deg, #fdfaf6 0%, #fde9dc 50%, #f7f0e6 100%);
}
.page-curtain-half {
    position: absolute; left: 0; right: 0;
    height: 50vh; background: var(--curtain-bg);
    transition: transform 1s cubic-bezier(0.85, 0, 0.15, 1) 0.45s;
    will-change: transform;
}
.page-curtain-half.top    { top: 0;    transform: translateY(0); }
.page-curtain-half.bottom { bottom: 0; transform: translateY(0); }
.page-curtain-mark {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 14px;
    transition: opacity 0.5s ease 0.15s, transform 0.5s cubic-bezier(0.85, 0, 0.15, 1) 0.15s;
}
.page-curtain-mark img {
    height: 88px; width: auto; display: block;
    animation: vibeIntroBreathe 1.4s ease-in-out infinite;
    filter: drop-shadow(0 6px 14px rgba(42, 32, 24, 0.10));
}
.page-curtain-mark .word {
    font-family: 'Fraunces', 'Playfair Display', serif;
    font-size: 0.78rem; letter-spacing: 0.5em; text-transform: uppercase;
    color: #b58a4f; padding-left: 0.5em;
    opacity: 0.8;
}
@keyframes vibeIntroBreathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.06); opacity: 0.85; }
}

body.intro-ready .page-curtain-mark        { opacity: 0; transform: scale(1.08); }
body.intro-ready .page-curtain-half.top    { transform: translateY(-101%); }
body.intro-ready .page-curtain-half.bottom { transform: translateY(101%); }
body.intro-ready .page-curtain              { pointer-events: none; }

/* === Hero/first-fold cascade — auto-runs after curtain wipes === */
.intro-fade        { opacity: 0; transform: translateY(28px); transition: opacity 0.95s cubic-bezier(0.16, 1, 0.3, 1), transform 0.95s cubic-bezier(0.16, 1, 0.3, 1); }
.intro-pop         { opacity: 0; transform: scale(0.85) translateY(36px) rotate(-1.5deg); transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
.intro-spring-l    { opacity: 0; transform: translateX(-60px) rotate(-12deg); transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1), transform 1.0s cubic-bezier(0.16, 1, 0.3, 1); }
.intro-spring-r    { opacity: 0; transform: translateX(60px)  rotate(12deg);  transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1), transform 1.0s cubic-bezier(0.16, 1, 0.3, 1); }
.intro-rise        { opacity: 0; transform: translateY(60px) scale(0.96); transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1), transform 1.0s cubic-bezier(0.16, 1, 0.3, 1); }

body.intro-ready .intro-fade,
body.intro-ready .intro-pop,
body.intro-ready .intro-rise { opacity: 1; transform: none; }
body.intro-ready .intro-spring-l,
body.intro-ready .intro-spring-r { opacity: 1; transform: translateX(0) rotate(var(--rotate-end, 0deg)); }

.intro-d-1  { transition-delay: 1.30s; }
.intro-d-2  { transition-delay: 1.45s; }
.intro-d-3  { transition-delay: 1.60s; }
.intro-d-4  { transition-delay: 1.75s; }
.intro-d-5  { transition-delay: 1.90s; }
.intro-d-6  { transition-delay: 2.05s; }
.intro-d-7  { transition-delay: 2.20s; }

/* Reduced motion fallback for the intro */
@media (prefers-reduced-motion: reduce) {
    .page-curtain { display: none; }
    .intro-fade, .intro-pop, .intro-spring-l, .intro-spring-r, .intro-rise {
        opacity: 1; transform: none; transition: none;
    }
}


/* Cursor follower removed in v2 — was a glitch source on hybrid touch/pen devices and
   could hide the native cursor during slow script loads. The native pointer is fine. */

/* === Magnetic buttons === */
.magnetic { display: inline-flex; will-change: transform; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.magnetic > * { display: inline-flex; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

/* === Card 3D depth: icon and content float on hover === */
.card-3d { transform-style: preserve-3d; perspective: 1000px; transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1); }
.card-3d > * { transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.card-3d .layer-1 { transform: translateZ(0); }
.card-3d .layer-2 { transform: translateZ(0); }
.card-3d .layer-3 { transform: translateZ(0); }
.card-3d:hover .layer-1 { transform: translateZ(28px); }
.card-3d:hover .layer-2 { transform: translateZ(18px); }
.card-3d:hover .layer-3 { transform: translateZ(10px); }

/* === Card glare (sweeping shine) === */
.card-glare { position: relative; overflow: hidden; }
.card-glare::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg,
        transparent 30%,
        rgba(255, 255, 255, 0.55) 48%,
        rgba(255, 255, 255, 0.15) 56%,
        transparent 70%);
    transform: translateX(-120%) skewX(-12deg);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: inherit;
    mix-blend-mode: overlay;
}
.card-glare:hover::after { transform: translateX(120%) skewX(-12deg); }

/* === Animated gradient border (conic rotates on hover) === */
.card-aurora {
    position: relative;
    background-clip: padding-box;
    border: 1px solid transparent !important;
    isolation: isolate;
}
.card-aurora::before {
    content: ''; position: absolute; inset: -1px;
    border-radius: inherit;
    background: conic-gradient(from var(--ang, 0deg),
        rgba(252, 215, 196, 0.0) 0deg,
        rgba(252, 215, 196, 0.6) 60deg,
        rgba(214, 236, 226, 0.5) 140deg,
        rgba(232, 224, 240, 0.55) 220deg,
        rgba(212, 167, 106, 0.6) 300deg,
        rgba(252, 215, 196, 0.0) 360deg);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.card-aurora:hover::before {
    opacity: 1;
    animation: vibeAuroraSpin 4s linear infinite;
}
@property --ang {
    syntax: '<angle>';
    initial-value: 0deg;
    inherit: false;
}
@keyframes vibeAuroraSpin {
    to { --ang: 360deg; }
}
/* Fallback for browsers without @property — animate via transform on a child wrapper */
.card-aurora.no-prop::before {
    background: conic-gradient(rgba(252, 215, 196, 0.6), rgba(214, 236, 226, 0.5), rgba(232, 224, 240, 0.55), rgba(212, 167, 106, 0.6), rgba(252, 215, 196, 0.6));
    animation: vibeAuroraSpinFallback 4s linear infinite;
}
@keyframes vibeAuroraSpinFallback {
    to { transform: rotate(360deg); }
}

/* === Letter-by-letter reveal === */
.text-reveal { display: inline-block; }
.text-reveal .word {
    display: inline-block; overflow: hidden; vertical-align: top;
    margin-right: 0.18em;
}
.text-reveal .char {
    display: inline-block; transform: translateY(108%);
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}
.text-reveal.in .char { transform: translateY(0); }

/* === Number counter === */
.vibe-count { font-variant-numeric: tabular-nums; }

/* === Back-to-top floating button === */
.vibe-top {
    position: fixed; right: 22px; bottom: 22px; z-index: 1100;
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(253, 250, 246, 0.85);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(42, 32, 24, 0.08);
    display: flex; align-items: center; justify-content: center;
    color: #2a2018; cursor: pointer;
    box-shadow: 0 12px 30px rgba(42, 32, 24, 0.08);
    opacity: 0; pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.3s, box-shadow 0.3s;
}
.vibe-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.vibe-top:hover { background: #2a2018; color: #fdfaf6; box-shadow: 0 18px 40px rgba(42, 32, 24, 0.22); }

/* === Image reveal mask (clip-path slide-in) === */
.img-mask {
    --vibe-mask: 0%;
    clip-path: inset(0 var(--vibe-mask) 0 0);
    transition: clip-path 1.1s cubic-bezier(0.85, 0, 0.15, 1);
}
.img-mask.idle { --vibe-mask: 100%; }
.img-mask.in   { --vibe-mask: 0%;  }

/* === 3D Coverflow carousel === */
.coverflow-stage {
    position: relative;
    width: 100%;
    height: 720px;
    perspective: 2000px;
    overflow: visible;
    user-select: none;
}
.coverflow-track {
    position: absolute; inset: 0;
    transform-style: preserve-3d;
}
.cover-card {
    position: absolute; top: 50%; left: 50%;
    width: 470px; height: 600px;
    transform: translate(-50%, -50%);
    border-radius: 26px;
    background: #fff;
    border: 1px solid rgba(42, 32, 24, 0.08);
    overflow: hidden;
    box-shadow: 0 40px 90px rgba(42, 32, 24, 0.24);
    transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.55s ease, filter 0.85s ease;
    cursor: pointer;
}
.cover-card.dim { filter: blur(1px) brightness(0.92); }
.cover-card .img {
    position: absolute; inset: 0; overflow: hidden;
}
.cover-card .img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.cover-card.is-center .img img { transform: scale(1.04); }
.cover-card .meta {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 32px 34px;
    background: linear-gradient(to top, rgba(20, 15, 10, 0.92) 0%, rgba(20, 15, 10, 0.72) 60%, transparent 100%);
    color: #fdfaf6;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s;
}
.cover-card.is-center .meta { transform: translateY(0); opacity: 1; }
.cover-card .meta h3 {
    font-family: 'Fraunces', serif; font-weight: 500;
    font-size: 1.85rem; margin-bottom: 6px; color: #fdfaf6;
    letter-spacing: -0.01em;
}
.cover-card .meta .row {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 14px;
    font-family: 'Inter', sans-serif; font-size: 1rem;
    color: rgba(253, 250, 246, 0.85);
}
.cover-card .meta .price {
    font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.5rem; color: #fcd7c4;
}

.coverflow-controls {
    display: flex; justify-content: center; gap: 12px;
    margin-top: 30px;
}
.coverflow-controls button {
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(14px);
    border: 1px solid rgba(42, 32, 24, 0.08);
    color: #2a2018; cursor: pointer; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.coverflow-controls button:hover {
    background: #2a2018; color: #fdfaf6; transform: scale(1.06);
    box-shadow: 0 14px 30px rgba(42, 32, 24, 0.22);
}
.coverflow-dots {
    display: flex; gap: 8px; margin: 0 12px; align-items: center;
}
.coverflow-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(42, 32, 24, 0.18);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.coverflow-dot.active {
    background: #d4a76a; transform: scale(1.5);
    box-shadow: 0 0 0 4px rgba(212, 167, 106, 0.18);
}

@media (max-width: 1200px) {
    .coverflow-stage { height: 680px; }
    .cover-card { width: 420px; height: 545px; }
}
@media (max-width: 992px) {
    .coverflow-stage { height: 640px; }
    .cover-card { width: 390px; height: 510px; }
}
@media (max-width: 768px) {
    /* Tablet: ample card + a tighter arc so the side cards stay visible */
    .coverflow-wrap { --radius: 540px !important; --spread: 0.55 !important; }
    .coverflow-stage { height: 640px; }
    .cover-card {
        width: min(420px, 86vw);
        height: min(560px, calc(86vw * 4 / 3));
    }
    .cover-card .meta h3 { font-size: 1.5rem; }
    .vibe-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}
@media (max-width: 480px) {
    /* Phone: card fills most of the screen, side neighbors peek in 3D */
    .coverflow-wrap { --radius: 360px !important; --spread: 0.55 !important; }
    .coverflow-stage { height: clamp(460px, 122vw, 600px); }
    .cover-card {
        width: 88vw;
        max-width: 380px;
        height: calc(88vw * 4 / 3);
        max-height: 500px;
        border-radius: 22px;
    }
    .cover-card .meta { padding: 22px 22px; }
    .cover-card .meta h3 { font-size: 1.35rem; }
    .cover-card .meta .price { font-size: 1.25rem; }
}
@media (max-width: 380px) {
    .coverflow-wrap { --radius: 320px !important; --spread: 0.55 !important; }
    .coverflow-stage { height: clamp(440px, 124vw, 540px); }
    .cover-card {
        width: 90vw;
        height: calc(90vw * 4 / 3);
    }
    .cover-card .meta h3 { font-size: 1.25rem; }
}

/* Drag-to-swipe affordance + smooth fractional idx during drag */
.coverflow-stage {
    cursor: grab;
    touch-action: pan-y;
    -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.coverflow-stage.is-grabbing { cursor: grabbing; }
.coverflow-track.is-dragging .cover-card {
    transition: none !important;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .card-aurora::before { animation: none; }
    .text-reveal .char { transform: none; }
    .img-mask { clip-path: none !important; }
    .cover-card { transition: none; }
}

/* High-contrast / RTL nudges */
[dir="rtl"] .text-reveal .word { margin-right: 0; margin-left: 0.18em; }

/* =========================================================================
   MOBILE TIGHTENING — applies to all 4 pages without touching their per-page CSS
   ========================================================================= */
/* === Anti-leak clamps (apply at all sizes; especially crucial on mobile) === */
.blobs { overflow: hidden !important; max-width: 100vw; }
.marquee { overflow: hidden !important; }
.coverflow-wrap { overflow: hidden !important; }
.hero-visual,
.gal-hero, .c-hero {
    max-width: 100%;
}
@media (max-width: 992px) {
    .hero-visual { overflow: hidden !important; border-radius: 18px; }
}
/* Floating hero photos: pull inside the visual on mobile so nothing pokes past */
@media (max-width: 600px) {
    .floating-photo.fp1 { right: 0 !important; top: 6% !important; }
    .floating-photo.fp2 { left: 0 !important; bottom: 6% !important; }
}

@media (max-width: 768px) {
    /* Container hugs the edges a bit more */
    .container { padding-left: 18px !important; padding-right: 18px !important; }

    /* Section breathing room — drop heavy desktop padding */
    section.section { padding: 70px 0 !important; }

    /* Hero (homepage) */
    .hero { padding: 120px 0 50px !important; min-height: auto !important; }
    .hero-grid { gap: 32px !important; }
    .hero-visual { height: 380px !important; }
    .album-3d { width: 240px !important; height: 320px !important; }
    .album-face .brand img { height: 70px !important; }
    .floating-photo { width: 130px !important; height: 160px !important; }
    .fp1 { top: 4% !important; right: -4% !important; }
    .fp2 { bottom: 4% !important; left: -6% !important; width: 115px !important; height: 140px !important; }
    .hero-meta { gap: 20px !important; margin-top: 32px !important; padding-top: 24px !important; flex-wrap: wrap; }
    .hero-meta .item .num { font-size: 1.7rem !important; }

    /* Section heads */
    .sec-head { margin-bottom: 44px !important; }

    /* Other page heroes */
    .gal-hero, .c-hero { padding: 120px 0 30px !important; }

    /* Coverflow controls easier to thumb */
    .coverflow-controls button { width: 44px !important; height: 44px !important; }

    /* Buttons */
    .btn-primary, .btn-ghost, .btn-whats { padding: 14px 22px !important; font-size: 0.92rem !important; }

    /* Footer compactness */
    footer.foot { padding: 50px 0 24px !important; }
    .foot-grid { gap: 32px !important; margin-bottom: 30px !important; }

    /* Cards padding */
    .feature, .why-card { padding: 32px 24px !important; }
    .test-card { padding: 28px 24px !important; }
    .info-card { padding: 22px 18px !important; gap: 14px !important; }
    .info-card .ico { width: 46px !important; height: 46px !important; font-size: 1.1rem !important; }

    /* Form */
    .form-card { padding: 28px 22px !important; }

    /* Filter chips */
    .filters { margin: 26px auto 36px !important; gap: 8px !important; }
    .filter-btn { padding: 9px 18px !important; font-size: 0.85rem !important; }

    /* Album-details page */
    .crumb { padding-top: 105px !important; font-size: 0.78rem !important; }
    .detail-grid { gap: 36px !important; padding: 24px 0 60px !important; }
    .book-stage { min-height: 380px !important; }
    .book { max-width: 280px !important; }
    .specs { gap: 8px !important; }
    .spec { padding: 12px !important; }
    .spec .val { font-size: 1rem !important; }
    .price-now { font-size: 1.9rem !important; }
}

@media (max-width: 480px) {
    .container { padding-left: 14px !important; padding-right: 14px !important; }
    section.section { padding: 56px 0 !important; }

    .hero { padding: 110px 0 40px !important; }
    .hero-grid { gap: 22px !important; }
    .hero h1 { margin: 18px 0 16px !important; }
    .hero p.lead { margin-bottom: 24px !important; }
    .hero-visual { height: 320px !important; }
    .album-3d { width: 200px !important; height: 270px !important; }
    .album-face .brand img { height: 56px !important; }
    .album-face .brand span { font-size: 0.78rem !important; }
    .floating-photo { width: 100px !important; height: 120px !important; }
    .fp2 { width: 90px !important; height: 110px !important; }

    .hero-meta {
        gap: 14px !important;
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .hero-meta .item .num { font-size: 1.4rem !important; }
    .hero-meta .item .lab { font-size: 10px !important; letter-spacing: 0.08em !important; }

    .sec-head { margin-bottom: 32px !important; }
    .sec-head h2 { font-size: 1.85rem !important; }

    .feature, .why-card { padding: 28px 20px !important; }
    .feature .ico, .why-card .ico { width: 50px !important; height: 50px !important; }

    .test-card { padding: 24px 22px !important; }
    .test-card .quote-mark { font-size: 3rem !important; }

    .form-card { padding: 24px 18px !important; }
    .form-card h2 { font-size: 1.5rem !important; }

    .crumb { padding-top: 100px !important; }
    .book { max-width: 220px !important; }
    .book-stage { min-height: 320px !important; }
    .specs { grid-template-columns: 1fr 1fr 1fr !important; }
    .price-now { font-size: 1.7rem !important; }
    .detail-title { font-size: 1.85rem !important; }

    .gal-hero, .c-hero { padding: 110px 0 24px !important; }
    .gal-hero h1, .c-hero h1 { font-size: 2.2rem !important; }

    .footer-content, .foot-grid, .foot-bottom { gap: 24px !important; }

    /* Coverflow — keep generous on small phones too */
    .coverflow-wrap { --radius: 360px !important; --spread: 0.55 !important; }
    .coverflow-stage { height: clamp(460px, 122vw, 600px) !important; }
    .cover-card {
        width: 88vw !important; max-width: 380px !important;
        height: calc(88vw * 4 / 3) !important; max-height: 500px !important;
    }
}

