/* mybadge.page - Grainy Luxury Badge Atelier */
/* Colors: #F2E8C9 #0A0A0F #7A6532 #1A1A24 #C9A84C #B8A04A #B8868A #D4C5A0 #D4943A */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

body {
    background-color: #0A0A0F;
    color: #F2E8C9;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* SVG Filters - hidden */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Grain overlay */
.grain-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    mix-blend-mode: overlay;
}

/* Ambient lens flares */
.ambient-flares {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.flare {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0;
    transition: opacity 1.5s ease;
}

.flare-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #D4943A 0%, rgba(201,168,76,0.4) 40%, transparent 70%);
    top: 10%;
    right: -5%;
}

.flare-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #C9A84C 0%, rgba(212,148,58,0.3) 40%, transparent 70%);
    top: 50%;
    left: -3%;
}

.flare-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #B8A04A 0%, rgba(184,134,138,0.3) 40%, transparent 70%);
    bottom: 10%;
    right: 15%;
}

.flare.visible {
    opacity: 0.6;
}

/* Chamber base */
.chamber {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    scroll-snap-align: start;
    overflow: hidden;
}

/* ===== Chamber 1: The Vault Door ===== */
.chamber-vault {
    background: linear-gradient(160deg, #0A0A0F 0%, #1A1A24 40%, #0A0A0F 100%);
    justify-content: flex-start;
    padding-left: 8%;
}

.vault-content {
    display: flex;
    align-items: center;
    gap: 6vw;
    width: 100%;
    max-width: 1400px;
}

.badge-silhouette {
    position: relative;
    flex-shrink: 0;
    width: clamp(280px, 35vw, 500px);
    height: auto;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.badge-silhouette.revealed {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.badge-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 60px rgba(201,168,76,0.3));
}

.badge-flare {
    position: absolute;
    top: 20%;
    left: 50%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,148,58,0.8) 0%, rgba(201,168,76,0.3) 30%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.8s ease, opacity 0.8s ease;
    opacity: 0;
    filter: blur(20px);
    pointer-events: none;
}

.badge-silhouette:hover .badge-flare {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
}

.vault-text {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 1s ease 0.4s, transform 1s ease 0.4s;
}

.vault-text.revealed {
    opacity: 1;
    transform: translateX(0);
}

.vault-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #7A6532;
    display: block;
    margin-bottom: 16px;
}

.vault-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 128px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #F2E8C9;
    margin-bottom: 20px;
}

.title-dot {
    color: #C9A84C;
}

.vault-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(18px, 2vw, 24px);
    color: #D4C5A0;
    opacity: 0.8;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 8%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeInUp 1s ease 2s forwards;
}

.scroll-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #7A6532;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, #C9A84C, transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ===== Chamber 2: The Inscription Wall ===== */
.chamber-inscription {
    background: linear-gradient(200deg, #1A1A24 0%, #0A0A0F 60%);
    padding: 0 8%;
}

.inscription-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 8vw;
    width: 100%;
    max-width: 1400px;
    align-items: center;
}

.inscription-left,
.inscription-right {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.inscription-left.revealed,
.inscription-right.revealed {
    opacity: 1;
    transform: translateY(0);
}

.inscription-right.revealed {
    transition-delay: 0.2s;
}

.section-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #7A6532;
    display: block;
    margin-bottom: 24px;
}

.section-label-light {
    color: #B8A04A;
}

.inscription-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(36px, 4vw, 64px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #F2E8C9;
}

.inscription-prose {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    line-height: 1.7;
    color: #D4C5A0;
    margin-bottom: 20px;
}

.inscription-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, #C9A84C, transparent);
    margin: 32px 0;
}

.inscription-quote {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 22px;
    color: #B8868A;
    line-height: 1.5;
    border: none;
    padding: 0;
    position: relative;
}

.quote-mark {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    color: #C9A84C;
    opacity: 0.5;
    line-height: 0;
    position: relative;
    top: 12px;
    margin-right: 4px;
}

/* ===== Chamber 3: The Material Study ===== */
.chamber-material {
    background: linear-gradient(140deg, #0A0A0F 0%, #1A1A24 50%, #0A0A0F 100%);
    flex-direction: column;
    justify-content: center;
    padding: 80px 8%;
}

.material-content {
    width: 100%;
    max-width: 1400px;
}

.material-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(36px, 4vw, 64px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #F2E8C9;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.material-heading.revealed {
    opacity: 1;
    transform: translateY(0);
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.material-swatch {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.material-swatch.revealed {
    opacity: 1;
    transform: translateY(0);
}

.swatch-surface {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.material-swatch:hover .swatch-surface {
    transform: scale(1.03);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.swatch-gold .swatch-surface { background: linear-gradient(135deg, #D4943A, #C9A84C); }
.swatch-brass .swatch-surface { background: linear-gradient(135deg, #7A6532, #B8A04A); }
.swatch-rose .swatch-surface { background: linear-gradient(135deg, #B8868A, #D4C5A0); }
.swatch-cream .swatch-surface { background: linear-gradient(135deg, #F2E8C9, #D4C5A0); }
.swatch-midnight .swatch-surface { background: linear-gradient(135deg, #0A0A0F, #1A1A24); border: 1px solid rgba(201,168,76,0.2); }
.swatch-sand .swatch-surface { background: linear-gradient(135deg, #D4C5A0, #B8A04A); }

.swatch-surface::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px;
    mix-blend-mode: overlay;
    opacity: 0.15;
}

.swatch-name {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 16px;
    color: #D4C5A0;
    margin-top: 12px;
}

.swatch-hex {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #7A6532;
    margin-top: 4px;
}

/* ===== Chamber 4: The Archive Drawer ===== */
.chamber-archive {
    background: linear-gradient(180deg, #0A0A0F 0%, #1A1A24 100%);
    flex-direction: column;
    justify-content: center;
    padding: 80px 8%;
}

.archive-content {
    width: 100%;
    max-width: 1400px;
}

.archive-header {
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.archive-header.revealed {
    opacity: 1;
    transform: translateY(0);
}

.archive-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(36px, 4vw, 64px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #F2E8C9;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.archive-card {
    background: rgba(26,26,36,0.6);
    border: 1px solid rgba(201,168,76,0.15);
    border-radius: 4px;
    padding: 40px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

.archive-card.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.archive-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(201,168,76,0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.archive-card:hover {
    border-color: rgba(201,168,76,0.4);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.archive-card:hover::before {
    opacity: 1;
}

.card-badge-icon {
    width: 60px;
    height: 72px;
    margin-bottom: 20px;
    transition: transform 0.4s ease;
}

.archive-card:hover .card-badge-icon {
    transform: scale(1.1) translateY(-4px);
}

.mini-badge {
    width: 100%;
    height: 100%;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: #F2E8C9;
    margin-bottom: 8px;
}

.card-desc {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 15px;
    color: #7A6532;
}

/* ===== Chamber 5: The Seal ===== */
.chamber-seal {
    background: radial-gradient(ellipse at 50% 50%, #1A1A24 0%, #0A0A0F 70%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 8%;
}

.seal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
}

.seal-emblem {
    width: 160px;
    height: 160px;
    margin-bottom: 40px;
    opacity: 0;
    transform: scale(0.8) rotate(-10deg);
    transition: opacity 1s ease, transform 1s ease;
}

.seal-emblem.revealed {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.seal-svg {
    width: 100%;
    height: 100%;
    animation: sealSpin 30s linear infinite;
}

@keyframes sealSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.seal-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(36px, 5vw, 72px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #F2E8C9;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.seal-heading.revealed {
    opacity: 1;
    transform: translateY(0);
}

.seal-prose {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    line-height: 1.7;
    color: #D4C5A0;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.5s, transform 0.8s ease 0.5s;
}

.seal-prose.revealed {
    opacity: 1;
    transform: translateY(0);
}

.seal-cta {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.7s, transform 0.8s ease 0.7s;
}

.seal-cta.revealed {
    opacity: 1;
    transform: translateY(0);
}

.cta-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #C9A84C;
    transition: color 0.3s ease;
}

.seal-cta:hover .cta-text {
    color: #F2E8C9;
}

.cta-line {
    width: 60px;
    height: 2px;
    background: #C9A84C;
    transition: width 0.4s ease, background 0.4s ease;
}

.seal-cta:hover .cta-line {
    width: 100px;
    background: #F2E8C9;
}

.seal-footer {
    margin-top: 80px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.8s ease 1s;
}

.seal-footer.revealed {
    opacity: 0.5;
}

.footer-mark,
.footer-year {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: #7A6532;
}

.footer-divider {
    color: #7A6532;
    font-size: 14px;
}

/* ===== Grain animation ===== */
@keyframes grainShift {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 20%); }
    90% { transform: translate(-10%, 10%); }
}

.grain-overlay {
    animation: grainShift 0.5s steps(5) infinite;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .vault-content {
        flex-direction: column;
        gap: 40px;
        padding-top: 10vh;
    }

    .badge-silhouette {
        width: 50vw;
    }

    .inscription-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .material-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .chamber-vault {
        padding-left: 6%;
        padding-right: 6%;
    }

    .badge-silhouette {
        width: 70vw;
    }

    .material-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .archive-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .chamber-inscription,
    .chamber-material,
    .chamber-archive,
    .chamber-seal {
        padding: 60px 6%;
    }
}
