/* =============================================
   historic.day - The Velvet Museum
   McBling meets historical record-keeping
   ============================================= */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Cardo', Georgia, serif;
    color: #2C1810;
    background: #1A0F0A;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === BOKEH LAYER === */
.bokeh-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bokeh-layer::before,
.bokeh-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    will-change: transform;
}

.bokeh-layer::before {
    background:
        radial-gradient(circle at 15% 20%, rgba(212,165,116,0.3) 0%, transparent 60%),
        radial-gradient(circle at 75% 30%, rgba(212,165,116,0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(232,180,184,0.15) 0%, transparent 55%),
        radial-gradient(circle at 85% 70%, rgba(212,165,116,0.25) 0%, transparent 45%),
        radial-gradient(circle at 25% 80%, rgba(184,134,11,0.2) 0%, transparent 50%),
        radial-gradient(circle at 60% 15%, rgba(212,165,116,0.18) 0%, transparent 55%),
        radial-gradient(circle at 90% 50%, rgba(232,180,184,0.12) 0%, transparent 60%),
        radial-gradient(circle at 10% 50%, rgba(212,165,116,0.22) 0%, transparent 50%);
    animation: drift 30s ease-in-out infinite alternate;
}

.bokeh-layer::after {
    background:
        radial-gradient(circle at 55% 25%, rgba(212,165,116,0.2) 0%, transparent 50%),
        radial-gradient(circle at 20% 65%, rgba(232,180,184,0.15) 0%, transparent 55%),
        radial-gradient(circle at 70% 80%, rgba(184,134,11,0.18) 0%, transparent 45%),
        radial-gradient(circle at 35% 40%, rgba(212,165,116,0.12) 0%, transparent 60%),
        radial-gradient(circle at 80% 15%, rgba(232,180,184,0.2) 0%, transparent 50%),
        radial-gradient(circle at 45% 90%, rgba(212,165,116,0.15) 0%, transparent 55%),
        radial-gradient(circle at 5% 35%, rgba(184,134,11,0.22) 0%, transparent 50%);
    animation: drift 30s ease-in-out infinite alternate-reverse;
    animation-delay: -15s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -15px) scale(1.02); }
    66% { transform: translate(-15px, 10px) scale(0.98); }
    100% { transform: translate(10px, 20px) scale(1.01); }
}

/* === ERA INDICATOR PILL === */
.era-pill {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: linear-gradient(135deg, #B8860B, #D4A574, #B8860B);
    padding: 8px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(26,15,10,0.5), inset 0 0 0 1px rgba(232,180,184,0.3);
}

.era-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 11px;
    color: #1A0F0A;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: opacity 0.4s ease;
}

/* === THE VITRINE === */
.vitrine {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1A0F0A;
    overflow: hidden;
}

.vitrine-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 0;
}

.vitrine-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vitrine-bar-top {
    flex: 0 0 auto;
    padding-top: 15vh;
}

.vitrine-title {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    font-size: clamp(48px, 10vw, 120px);
    color: #D4A574;
    text-shadow: 0 0 40px rgba(212,165,116,0.5), 0 0 80px rgba(212,165,116,0.2);
    letter-spacing: 0.05em;
    text-align: center;
}

.vitrine-bar-middle {
    flex: 1 1 auto;
    overflow: hidden;
}

.date-wheel {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    animation: spin 120s linear infinite;
}

.date-wheel-item {
    position: absolute;
    top: 50%;
    left: 50%;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #E8B4B8;
    white-space: nowrap;
    transform-origin: 0 0;
    transform: rotate(calc(var(--i) * 45deg)) translate(120px) rotate(calc(var(--i) * -45deg));
    text-shadow: 0 0 10px rgba(232,180,184,0.4);
}

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

.vitrine-bar-bottom {
    flex: 0 0 auto;
    padding-bottom: 10vh;
}

.vitrine-teaser {
    font-family: 'Cardo', serif;
    font-size: clamp(16px, 2.5vw, 22px);
    color: #FAF0E6;
    font-style: italic;
    text-align: center;
    opacity: 0.8;
    max-width: 600px;
}

/* === MOSAIC HALL === */
.mosaic-hall {
    position: relative;
    background: #2C1810;
    padding: 60px 20px;
    overflow: hidden;
}

.mosaic-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
}

/* === BLOCKS === */
.block {
    position: relative;
    overflow: hidden;
    border: 2px solid #B8860B;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(232,180,184,0.2), 0 4px 20px rgba(26,15,10,0.3);
    margin: var(--offset, 0);
    transition: border-image 0.4s ease, box-shadow 0.4s ease, transform 0.3s ease;
    min-height: 280px;
}

.block:hover {
    border-image: linear-gradient(135deg, #D4A574, #E8B4B8, #B8860B) 1;
    box-shadow: inset 0 0 0 1px rgba(232,180,184,0.4), 0 8px 30px rgba(26,15,10,0.5);
    transform: translateY(-2px);
}

.block-tall {
    grid-row: span 2;
}

.block-wide {
    grid-column: span 2;
}

.block-square {
    grid-row: span 1;
}

/* Block Backgrounds */
.block-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.block-bg-terracotta {
    background: linear-gradient(145deg, #B5651D 0%, #C65D3E 50%, #B5651D 100%);
    opacity: 0.15;
}

.block-bg-parchment {
    background: #F5E6D3;
}

.block-bg-dark {
    background: #1A0F0A;
}

/* Block Content */
.block-content {
    position: relative;
    z-index: 2;
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.block-bg-parchment + .block-content {
    color: #2C1810;
}

.block-bg-dark + .block-content,
.block-bg-terracotta + .block-content {
    color: #FAF0E6;
}

.block-bg-dark + .block-content .block-text,
.block-bg-terracotta + .block-content .block-text {
    color: rgba(250,240,230,0.85);
}

.block-bg-parchment + .block-content .block-text {
    color: #2C1810;
}

/* Medallion */
.medallion {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 8px rgba(212,165,116,0.4));
}

.medallion-svg {
    width: 100%;
    height: 100%;
}

.medallion-date {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 10px;
    fill: #FAF0E6;
    font-variant-numeric: tabular-nums;
}

/* Block Typography */
.block-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 36px);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.block-text {
    font-family: 'Cardo', serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    flex-grow: 1;
}

/* Block Motif */
.block-motif {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 60px;
    height: 60px;
    opacity: 0.4;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.block:hover .block-motif {
    opacity: 0.7;
}

.motif-svg {
    width: 100%;
    height: 100%;
}

/* === TIMELINE RIBBON === */
.timeline-ribbon {
    position: relative;
    width: 100%;
    background: linear-gradient(90deg, #B8860B, #D4A574, #CD853F, #B8860B);
    padding: 40px 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 -4px 20px rgba(26,15,10,0.5), 0 4px 20px rgba(26,15,10,0.5);
}

.ribbon-track {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 0 40px;
    min-width: max-content;
}

.ribbon-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ribbon-medallion {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 2px 8px rgba(26,15,10,0.4));
    transition: transform 0.3s ease;
}

.ribbon-marker:hover .ribbon-medallion {
    transform: scale(1.15);
}

.ribbon-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #1A0F0A;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* === ARCHIVE VAULT === */
.archive-vault {
    position: relative;
    background: #1A0F0A;
    padding: 80px 20px;
    overflow: hidden;
}

.vault-heading {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: clamp(36px, 6vw, 72px);
    color: #D4A574;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    text-shadow: 0 0 30px rgba(212,165,116,0.3);
}

.vault-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* === FLIP CARDS === */
.flip-card {
    perspective: 1000px;
    height: 340px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border: 2px solid #B8860B;
    border-radius: 2px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.flip-card-front {
    background: #2C1810;
    box-shadow: inset 0 0 0 1px rgba(232,180,184,0.2), 0 4px 20px rgba(26,15,10,0.3);
}

.flip-card-back {
    background: #F5E6D3;
    transform: rotateY(180deg);
    box-shadow: inset 0 0 0 1px rgba(181,101,29,0.3), 0 4px 20px rgba(26,15,10,0.3);
}

.card-front-motif {
    width: 100px;
    height: 100px;
    margin-bottom: 24px;
    opacity: 0.8;
}

.card-front-date {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 24px;
    color: #D4A574;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(212,165,116,0.4);
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

.card-front-label {
    font-family: 'Cardo', serif;
    font-size: 13px;
    color: rgba(250,240,230,0.4);
    font-style: italic;
}

.card-back-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #2C1810;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    text-align: center;
    line-height: 1.2;
}

.card-back-text {
    font-family: 'Cardo', serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: #2C1810;
    text-align: center;
    margin-bottom: 20px;
}

.card-back-location {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 11px;
    color: #B5651D;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* === THE SEAL === */
.the-seal {
    position: relative;
    background: #1A0F0A;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 80px 20px;
}

.seal-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

.seal-medallion {
    width: clamp(200px, 40vw, 360px);
    height: clamp(200px, 40vw, 360px);
    animation: spin 120s linear infinite;
    filter: drop-shadow(0 0 30px rgba(212,165,116,0.3));
}

.seal-svg {
    width: 100%;
    height: 100%;
}

.seal-text-main {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    font-size: 38px;
    fill: #D4A574;
    letter-spacing: 0.05em;
}

.seal-text-sub {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    font-size: 32px;
    fill: #E8B4B8;
}

.seal-text-motto {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 10px;
    fill: #D4A574;
    letter-spacing: 0.15em;
}

.seal-closing {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(18px, 3vw, 28px);
    color: #FAF0E6;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    text-align: center;
    max-width: 600px;
    opacity: 0.8;
    line-height: 1.4;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .mosaic-grid,
    .vault-grid {
        grid-template-columns: 1fr;
    }

    .block-wide {
        grid-column: span 1;
    }

    .block-tall {
        grid-row: span 1;
        min-height: 300px;
    }

    .date-wheel {
        width: 220px;
        height: 220px;
    }

    .date-wheel-item {
        transform: rotate(calc(var(--i) * 45deg)) translate(85px) rotate(calc(var(--i) * -45deg));
        font-size: 11px;
    }

    .ribbon-track {
        gap: 40px;
        padding: 0 20px;
    }

    .flip-card {
        height: 300px;
    }

    .flip-card:hover .flip-card-inner {
        transform: none;
    }

    .flip-card.flipped .flip-card-inner {
        transform: rotateY(180deg);
    }
}

@media (max-width: 480px) {
    .vitrine-title {
        font-size: 36px;
    }

    .block-text {
        font-size: 15px;
    }

    .era-pill {
        bottom: 12px;
        right: 12px;
        padding: 6px 14px;
    }
}