/* =========================================
   CINEMATIC DIALOG 2026 - ROYAL GOLD & DEEP NAVY
   Optimized for Performance & Smooth Loading
   Version: 2.0 - Lightweight & Fast
========================================= */

/* === CSS Custom Properties === */
:root {
    --gold: #d4af37;
    --gold-light: #f6e6a8;
    --gold-soft: #f3d88c;
    --navy: #071332;
    --navy-2: #08163c;
    --navy-3: #1c2f6e;
    --cream: #fdfbf6;
    --cream-2: #efe8dc;
    --white-10: rgba(255,255,255,0.10);
    --white-16: rgba(255,255,255,0.16);
    --white-35: rgba(255,255,255,0.35);
    --gold-55: rgba(212,175,55,0.55);
    --ease: cubic-bezier(0.22,0.61,0.36,1);
    --ease-pop: cubic-bezier(0.16,0.84,0.44,1);
}

/* === RESET & BASE === */
.dialog,
.dialog__overlay {
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.dialog {
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.36s var(--ease);
    will-change: opacity;
}

.dialog--open {
    opacity: 1;
    pointer-events: auto;
}

/* === OVERLAY === */
.dialog__overlay {
    z-index: 1;
    background:
        radial-gradient(ellipse at 18% 12%, rgba(212,175,55,0.16) 0%, transparent 58%),
        radial-gradient(ellipse at 82% 88%, rgba(10,40,80,0.30) 0%, transparent 68%),
        linear-gradient(145deg, rgba(1,3,10,0.88), rgba(11,26,74,0.86));
    backdrop-filter: blur(10px) saturate(145%);
    -webkit-backdrop-filter: blur(10px) saturate(145%);
    opacity: 0;
    transition: opacity 0.5s var(--ease);
    will-change: opacity;
}

.dialog--open .dialog__overlay {
    opacity: 0.82;
}

/* === POPUP CONTENT === */
.dialog__content {
    width: 32%;
    min-width: 360px;
    max-width: 420px;
    padding: 28px 24px;
    text-align: center;
    position: relative;
    z-index: 5;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--cream), var(--cream-2));
    border: 1px solid var(--gold-55);
    box-shadow:
        0 80px 120px rgba(0,0,0,0.46),
        0 28px 58px rgba(0,0,0,0.34),
        inset 0 0 0 1px rgba(255,255,255,0.18),
        0 0 55px rgba(212,175,55,0.16);
    transform: scale(0.86) translateY(36px);
    opacity: 0;
    will-change: transform, opacity;
    contain: layout style paint;
    backface-visibility: hidden;
}

/* Glow aura */
.dialog__content::before {
    content: "";
    position: absolute;
    inset: -18px;
    background: radial-gradient(circle at 50% 45%, rgba(212,175,55,0.22), transparent 68%);
    filter: blur(30px);
    z-index: -1;
    opacity: 0.62;
    pointer-events: none;
}

/* Inner shimmer */
.dialog__content::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 25px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.34), transparent 34%),
        linear-gradient(315deg, rgba(212,175,55,0.10), transparent 45%);
    pointer-events: none;
    opacity: 0.75;
}

/* === OPEN ANIMATION === */
.dialog--open .dialog__content {
    animation: popIn 0.62s var(--ease-pop) forwards;
}

@keyframes popIn {
    0%   { opacity:0; transform:scale(0.86) translateY(36px); filter:blur(7px); }
    44%  { opacity:1; transform:scale(1.018) translateY(-5px); filter:blur(0); }
    72%  { transform:scale(0.992) translateY(2px); }
    100% { opacity:1; transform:scale(1) translateY(0); filter:blur(0); }
}

/* === TOP IMAGE === */
.img-gif {
    width: 92%;
    max-width: 92%;
    border-radius: 18px;
    border: 2px solid rgba(212,175,55,0.58);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
    box-shadow: 0 18px 42px rgba(0,0,0,0.34), inset 0 0 0 1px rgba(212,175,55,0.28);
    object-fit: cover;
    aspect-ratio: 16/9;
    display: block;
    margin-inline: auto;
    will-change: transform;
    backface-visibility: hidden;
}

.img-gif:hover {
    transform: scale(1.025);
    box-shadow: 0 26px 62px rgba(0,0,0,0.44), inset 0 0 0 1px rgba(212,175,55,0.46), 0 0 30px rgba(212,175,55,0.16);
    border-color: rgba(212,175,55,0.82);
    filter: saturate(1.05) contrast(1.03);
}

/* === DESIGNER CARD === */
.designer-card {
    width: 92%;
    max-width: 380px;
    margin: 0 auto;
    padding: 24px 20px 20px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 18% 0%, rgba(212,175,55,0.18), transparent 32%),
        radial-gradient(circle at 100% 100%, rgba(255,255,255,0.08), transparent 38%),
        linear-gradient(145deg, var(--navy-2), var(--navy-3) 45%, var(--navy));
    direction: ltr;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.42);
    box-shadow:
        0 30px 70px rgba(0,0,0,0.62),
        inset 0 0 0 1px rgba(255,255,255,0.13),
        0 0 38px rgba(212,175,55,0.12);
    overflow: hidden;
    position: relative;
    contain: layout style paint;
}

/* Gold border ring */
.designer-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px;
    padding: 1.5px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light) 48%, var(--gold));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.84;
}

/* Light sweep */
.designer-card::after {
    content: "";
    position: absolute;
    inset: -40% -55%;
    background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.10) 48%, transparent 61%);
    transform: translateX(-30%) rotate(8deg);
    pointer-events: none;
    opacity: 0.55;
}

/* === TITLE === */
.designer-title {
    font: 700 22px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    margin: 0 0 16px;
    color: #fff;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.55), 0 0 18px rgba(212,175,55,0.30);
    position: relative;
    z-index: 1;
}

/* === DESIGNER IMAGE === */
.designer-image img {
    width: 100%;
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,0.62);
    transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease), border-color 0.32s var(--ease);
    box-shadow: 0 16px 36px rgba(0,0,0,0.46), 0 0 0 1px rgba(212,175,55,0.20);
    object-fit: cover;
    aspect-ratio: 16/9;
    display: block;
    z-index: 1;
    position: relative;
    will-change: transform;
    backface-visibility: hidden;
}

.designer-image img:hover {
    transform: scale(1.018);
    box-shadow: 0 22px 50px rgba(0,0,0,0.58), 0 0 0 1px rgba(212,175,55,0.42), 0 0 24px rgba(212,175,55,0.16);
    border-color: rgba(212,175,55,0.88);
    filter: saturate(1.05) contrast(1.04);
}

/* === CONTACT LIST === */
.designer-contact {
    list-style: none;
    padding: 0;
    margin: 18px 0;
    z-index: 1;
    position: relative;
}

.designer-contact li {
    margin: 10px 0;
}

.designer-contact a {
    display: flex;
    align-items: center;
    padding: 5px 5px 5px 5px;
    border-radius: 14px;
    background: rgba(255,255,255,0.075);
    border: 1px solid rgba(255,255,255,0.32);
    transition: transform 0.32s var(--ease), background 0.32s var(--ease), color 0.32s var(--ease), border-color 0.32s var(--ease), box-shadow 0.32s var(--ease);
    color: #fff;
    text-decoration: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    will-change: transform;
    position: relative;
}

.designer-contact a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.14), transparent 45%);
    opacity: 0;
    transition: opacity 0.32s var(--ease);
    pointer-events: none;
}

.designer-contact a:hover {
    background: linear-gradient(135deg, var(--gold), #f4da8a);
    border-color: rgba(255,255,255,0.15);
    color: #111;
    transform: translateX(7px) scale(1.018);
    box-shadow: 0 12px 28px rgba(0,0,0,0.50), 0 0 20px rgba(212,175,55,0.28);
}

.designer-contact a:hover::before {
    opacity: 1;
}

/* Icon */
.designer-contact .icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff, #f0f0f0);
    border-radius: 12px;
    margin-right: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.28), inset 0 0 0 1px rgba(255,255,255,0.22);
    transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease);
    z-index: 1;
    position: relative;
}

.designer-contact a:hover .icon {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.30), inset 0 0 0 1px rgba(255,255,255,0.35);
}

.designer-contact .icon img {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.18));
    display: block;
}

/* Text */
.designer-contact .text {
    font: 600 14px system-ui, sans-serif;
    color: #fff;
    letter-spacing: 0.3px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.32s var(--ease);
    z-index: 1;
    position: relative;
}

.designer-contact a:hover .text {
    color: #111;
}

/* === DESCRIPTION === */
.designer-desc {
    text-align: center;
    margin: 16px 0 0;
    color: #d8e0ff;
    font: 14px/1.7 system-ui, sans-serif;
    padding: 12px 8px;
    background: rgba(255,255,255,0.055);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035);
    z-index: 1;
    position: relative;
}

/* === CLOSE BUTTON === */
.designer-close {
    display: block;
    width: 100%;
    margin: 20px auto 0;
    padding: 12px 0;
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: #111;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font: 700 15px system-ui, sans-serif;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease), filter 0.32s var(--ease);
    box-shadow: 0 8px 24px rgba(212,175,55,0.34), inset 0 0 0 1px rgba(255,255,255,0.22);
    overflow: hidden;
    z-index: 1;
    position: relative;
}

.designer-close::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 55%;
    height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: skewX(-18deg);
    transition: left 0.55s var(--ease);
    pointer-events: none;
}

.designer-close:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(212,175,55,0.52), inset 0 0 0 1px rgba(255,255,255,0.30);
    filter: brightness(1.08);
}

.designer-close:hover::before {
    left: 125%;
}

.designer-close:active {
    transform: translateY(-1px);
}

/* === GLOBAL BUTTON (PRESERVED) === */
button {
    color: #74716D;
    text-decoration: none;
    outline: none;
    font-family: inherit;
}

button {
    padding: 1em 1em;
    outline: none;
    font-weight: 600;
    border: none;
    color: #fff;
    background: #c94e50;
    border-radius: 5px;
    margin-top: 1px;
    font-family: Tahoma, sans-serif;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

/* === FALLBACK STYLES === */
.button-wrap {
    padding: 2.5em 0 0;
    font-size: 1.25em;
}

button.trigger {
    background: #c94e50;
    color: #fff;
    border: none;
}

.codrops-header {
    padding: 2.75em 0 3em;
    letter-spacing: -1px;
}

.related {
    margin-top: 8em;
    clear: both;
    padding: 1em 0 20em;
    font-weight: bold;
}

.related > a {
    display: inline-block;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .dialog__content {
        width: 85%;
        min-width: 320px;
        padding: 24px 20px;
    }

    .designer-card {
        width: 90%;
        padding: 20px 16px;
    }

    .designer-title {
        font-size: 20px;
    }

    .designer-contact a {
        padding: 8px 10px 8px 8px;
    }

    .designer-contact .icon {
        width: 34px;
        height: 34px;
        margin-right: 12px;
    }
}

@media (max-width: 480px) {
    .dialog__content {
        width: 90%;
        min-width: 300px;
        padding: 20px 16px;
        border-radius: 22px;
    }

    .designer-card {
        padding: 18px 14px;
        border-radius: 20px;
    }

    .designer-title {
        font-size: 18px;
        margin-bottom: 14px;
    }

    .designer-desc {
        font-size: 13px;
        padding: 10px 6px;
    }
}

/* === ACCESSIBILITY: REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .dialog--open .dialog__content {
        opacity: 1;
        transform: none;
        filter: none;
    }
}
