body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #f2f1ec;
    overflow: hidden;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.marquee-container {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100vw;
    transform: translateY(-50%) translateY(20px);
    overflow: hidden;
    white-space: nowrap;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.6s ease-in-out, transform 1.6s ease-in-out;
    will-change: opacity, transform;
}

.marquee-container.marquee-visible {
    opacity: 1;
    transform: translateY(-50%) translateY(0);
}

.marquee-content {
    display: inline-flex;
    animation: marquee 32s linear infinite;
    font-size: 7vw;
    letter-spacing: 0.15em;
    color: #2b2b2b;
    font-weight: 400;
}

.marquee-content span {
    padding-right: 50px;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: auto;
    cursor: grab;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    touch-action: none;
}

#canvas-container:active {
    cursor: grabbing;
}

#loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(43, 43, 43, 0.1);
    border-top: 2px solid #2b2b2b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    pointer-events: none;
    opacity: 1;
    transition: opacity 1.5s ease-in-out;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Media queries */
@media (max-width: 768px) {
    .marquee-content { font-size: 8vw; }
    #loader { width: 25px; height: 25px; border-width: 2px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .marquee-content { font-size: 6vw; }
}

/* ── Hold-progress ring ─────────────────────────────────────── */
#hold-ring {
    position: fixed;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
    transition: opacity 0.18s ease, transform 0.18s ease;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.5));
}
#hold-ring.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ── Quantum overlay ────────────────────────────────────────── */
#quantum-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16,1,0.3,1);
}
#quantum-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal card ─────────────────────────────────────────────── */
#quantum-modal {
    position: relative;
    width: min(420px, 90vw);
    padding: 48px 40px 40px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 28px;
    box-shadow:
        0 0 0 0.5px rgba(255,255,255,0.1),
        0 32px 80px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.22);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    color: #ffffff;
    text-align: center;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.45s cubic-bezier(0.16,1,0.3,1),
                opacity  0.4s  cubic-bezier(0.16,1,0.3,1);
    opacity: 0;
}
#quantum-overlay.open #quantum-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ── Close button ───────────────────────────────────────────── */
#modal-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 30px; height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    padding: 0;
}
#modal-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    transform: scale(1.1);
}

/* ── Eyebrow ────────────────────────────────────────────────── */
#modal-eyebrow {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    margin-bottom: 20px;
}

/* ── Title ──────────────────────────────────────────────────── */
#modal-title {
    margin: 0 0 18px;
    font-size: clamp(26px, 6vw, 34px);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ── Body text ──────────────────────────────────────────────── */
#modal-body {
    margin: 0 0 28px;
    font-size: 13.5px;
    line-height: 1.75;
    color: rgba(255,255,255,0.55);
}

/* ── Email input ────────────────────────────────────────────── */
#modal-input-wrap { margin-bottom: 12px; }
#modal-email {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 15px 18px;
    font-size: 14px;
    font-family: inherit;
    color: #fff;
    outline: none;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
    -webkit-appearance: none;
}
#modal-email::placeholder { color: rgba(255,255,255,0.25); }
#modal-email:focus {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.06);
}

/* ── CTA button ─────────────────────────────────────────────── */
/* ── CTA button — liquid metal ────────────────────────────────── */
#modal-cta {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 16px 24px;
    background: #ffff00;
    color: #111;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    margin-bottom: 18px;
    box-shadow: 0 4px 24px rgba(255,255,0,0.3);
    transition: background 0.25s, transform 0.15s, box-shadow 0.25s, color 0.4s, border-radius 0.2s;
}
#modal-cta:not(.liquid-morph):not(.liquid-chrome):hover {
    background: #e8e800;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 36px rgba(255,255,0,0.4);
}
#modal-cta:not(.liquid-morph):not(.liquid-chrome):active {
    transform: translateY(0) scale(0.99);
}

/* Chrome sweep shine layer */
#modal-cta::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -100%;
    width: 60%;
    height: 140%;
    background: linear-gradient(
        105deg,
        transparent 10%,
        rgba(255,255,255,0.75) 45%,
        rgba(220,230,240,0.9) 50%,
        rgba(255,255,255,0.75) 55%,
        transparent 90%
    );
    transform: skewX(-12deg);
    pointer-events: none;
    opacity: 0;
}

/* Liquid blob morphing animation */
@keyframes liquidBlob {
    0%   { border-radius: 14px;
           background: #ffff00;
           box-shadow: 0 4px 24px rgba(255,255,0,0.3); }
    8%   { border-radius: 58% 42% 52% 48% / 48% 58% 42% 52%;
           background: linear-gradient(135deg, #d4d400, #e8e000, #c8d800);
           filter: url(#liquid-filter); }
    20%  { border-radius: 40% 60% 38% 62% / 62% 40% 60% 38%;
           background: linear-gradient(160deg, #909898, #c0c8d0, #a0a8b0, #d0d8e0);
           filter: url(#liquid-filter) brightness(1.1); }
    35%  { border-radius: 62% 38% 54% 46% / 38% 62% 38% 62%;
           background: linear-gradient(200deg, #b0bcc8, #e0eaf4, #98a8b8, #c8d4e0);
           filter: url(#liquid-filter) brightness(1.25); }
    52%  { border-radius: 46% 54% 62% 38% / 54% 46% 54% 46%;
           background: linear-gradient(80deg, #c0cad4, #eaf0f8, #b0bcc8, #dce6f0);
           filter: url(#liquid-filter) brightness(1.3); }
    68%  { border-radius: 54% 46% 38% 62% / 46% 54% 62% 38%;
           background: linear-gradient(130deg, #b8c4d0, #e4ecf6, #a8b8c8, #d4e0ec);
           filter: brightness(1.2); }
    84%  { border-radius: 30% 70% 60% 40% / 50% 40% 60% 50%;
           background: linear-gradient(110deg, #c4cdd8, #eaf0f8, #b4c0cc, #dce8f4);
           filter: brightness(1.15); }
    100% { border-radius: 14px;
           background: linear-gradient(120deg, #bec8d2 0%, #e8f0f8 30%, #b0bcc8 55%, #d8e4f0 80%, #c4ced8 100%);
           box-shadow: 0 6px 28px rgba(160,180,200,0.5), inset 0 1px 0 rgba(255,255,255,0.6);
           filter: brightness(1.1); }
}

/* Chrome light sweep */
@keyframes chromeSweep {
    0%   { left: -100%; opacity: 1; }
    100% { left: 140%;  opacity: 1; }
}

/* Infinite iridescent shimmer for settled state */
@keyframes shimmerLoop {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Icon spin on morph */
@keyframes iconSpin {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.3); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Ripple from click point */
@keyframes ctaRipple {
    0%   { transform: scale(0); opacity: 0.8; }
    100% { transform: scale(5); opacity: 0; }
}
.cta-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(160,180,200,0.9) 0%, rgba(140,160,180,0.5) 40%, transparent 70%);
    transform: scale(0);
    animation: ctaRipple 0.65s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
    pointer-events: none;
}

/* Active morph state */
#modal-cta.liquid-morph {
    animation: liquidBlob 0.95s cubic-bezier(0.34, 1.1, 0.64, 1) forwards;
    cursor: default;
}
#modal-cta.liquid-morph::before {
    animation: chromeSweep 0.55s 0.28s ease-in-out forwards;
}
#modal-cta.liquid-morph #cta-icon {
    animation: iconSpin 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Settled chrome state */
#modal-cta.liquid-chrome {
    background: linear-gradient(
        90deg,
        #bec8d2 0%,
        #e8f0f8 20%,
        #b0bcc8 40%,
        #dce8f4 60%,
        #c4cfd8 80%,
        #e4eef6 100%
    );
    background-size: 200% auto;
    animation: shimmerLoop 2.2s linear infinite;
    color: #1a2030;
    box-shadow: 0 6px 28px rgba(140,165,190,0.45), inset 0 1px 0 rgba(255,255,255,0.7);
    cursor: default;
    border-radius: 14px;
}
#modal-cta.liquid-chrome:hover {
    transform: none;
}


/* ── Disclaimer ─────────────────────────────────────────────── */
#modal-disclaimer {
    margin: 0;
    font-size: 10.5px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.04em;
}

@media (max-width: 480px) {
    #quantum-modal { padding: 40px 22px 32px; border-radius: 22px; }
}
