/* =============================================
   miris.bar — Avant-Garde Lounge Speakeasy
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #12101A;
    color: #C4B8A8;
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 400;
    overflow-x: hidden;
    position: relative;
}

/* --- Cultural Background Pattern --- */
#cultural-bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M20 10l4 8-4 8-4-8z' fill='%235B2C6F'/%3E%3Crect x='50' y='12' width='8' height='8' rx='1' fill='%235B2C6F'/%3E%3Ccircle cx='15' cy='55' r='3' fill='%235B2C6F'/%3E%3Ccircle cx='15' cy='55' r='1.5' fill='none' stroke='%235B2C6F' stroke-width='0.5'/%3E%3Cpath d='M55 50l3-3 3 3-3 3z' fill='%235B2C6F'/%3E%3Cpath d='M60 65l2 0 0-4-4 0 0 2 2 0z' fill='%235B2C6F'/%3E%3Cpath d='M35 40l1-1 1 1-1 1z' fill='%235B2C6F'/%3E%3Cpath d='M38 42l1-1 1 1-1 1z' fill='%235B2C6F'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Bar-Top Header --- */
#bar-top {
    position: relative;
    width: 100%;
    height: 35vh;
    min-height: 280px;
    background: linear-gradient(135deg, #2A2433 0%, #1C1826 50%, #2A2433 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

/* Marble noise texture overlay */
.bar-surface-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.06;
    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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    pointer-events: none;
}

/* Facets container for header */
.facets-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.facet {
    position: absolute;
    width: 10px;
    height: 10px;
    transform: rotate(45deg);
    opacity: 0;
    animation: facetAppear 600ms ease-out forwards;
}

.facet.ruby {
    background: #8B2252;
    box-shadow: 0 0 8px rgba(139, 34, 82, 0.3);
}

.facet.sapphire {
    background: #1B3A5C;
    box-shadow: 0 0 8px rgba(27, 58, 92, 0.3);
}

.facet.emerald {
    background: #1B5E3B;
    box-shadow: 0 0 8px rgba(27, 94, 59, 0.3);
}

.facet.amethyst {
    background: #5B2C6F;
    box-shadow: 0 0 8px rgba(91, 44, 111, 0.3);
}

@keyframes facetAppear {
    0% {
        opacity: 0;
        transform: rotate(45deg) scale(0);
    }
    60% {
        opacity: 1;
        transform: rotate(45deg) scale(1.2);
    }
    100% {
        opacity: 0.8;
        transform: rotate(45deg) scale(1);
    }
}

/* Bar-Top Content */
.bar-top-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

#site-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 4.5vw, 4rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #E8D5B7;
    min-height: 1.2em;
}

#site-title .letter {
    display: inline-block;
    opacity: 0;
    animation: letterReveal 200ms ease-out forwards;
}

#site-title .letter.dot {
    color: #8B2252;
}

@keyframes letterReveal {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Letter sparkle */
.letter-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    transform: rotate(45deg);
    pointer-events: none;
    animation: sparkleFlash 400ms ease-out forwards;
}

@keyframes sparkleFlash {
    0% {
        opacity: 1;
        transform: rotate(45deg) scale(0);
    }
    50% {
        opacity: 1;
        transform: rotate(45deg) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: rotate(45deg) scale(0.5);
    }
}

.tagline {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 1.1rem;
    color: #C4B8A8;
    opacity: 0;
    transform: translateY(10px);
    margin-top: 0.75rem;
    letter-spacing: 0.02em;
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Ambient Speaker Icon */
#ambient-speaker {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #5B2C6F;
    cursor: pointer;
    z-index: 3;
    animation: speakerPulse 3s ease-in-out infinite;
}

@keyframes speakerPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* --- Navigation (Coaster Tabs) --- */
#coaster-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    background: #12101A;
    border-bottom: 1px solid rgba(42, 36, 51, 0.6);
    flex-wrap: wrap;
}

.coaster-tab {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #C4B8A8;
    background: rgba(91, 44, 111, 0.15);
    border: 1px solid rgba(91, 44, 111, 0.2);
    border-radius: 8px;
    padding: 8px 20px;
    cursor: pointer;
    transition: background 200ms ease, transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), border-color 200ms ease;
    transform: scale(1);
}

.coaster-tab:hover {
    background: rgba(91, 44, 111, 0.3);
    border-color: rgba(91, 44, 111, 0.4);
    transform: scale(1.03);
}

.coaster-tab.active {
    background: rgba(91, 44, 111, 0.35);
    border-color: #5B2C6F;
    color: #E8D5B7;
    transform: scale(1);
}

.nav-facet {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #5B2C6F;
    transform: rotate(45deg);
    box-shadow: 0 0 6px rgba(91, 44, 111, 0.3);
    margin-left: 4px;
}

/* --- Masonry Grid --- */
#masonry-grid {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    column-count: 3;
    column-gap: 24px;
}

/* --- Masonry Cards --- */
.masonry-card {
    break-inside: avoid;
    background: #1C1826;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    border-left: 2px solid transparent;
    transition: transform 300ms ease, box-shadow 300ms ease, border-left-width 200ms ease;
    opacity: 0;
    transform: translateY(40px) scale(0.96);
}

.masonry-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: cardBounceIn 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cardBounceIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.masonry-card:hover {
    transform: translateY(-4px) scale(1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-left-width: 4px;
}

.masonry-card.hidden {
    display: none;
}

/* Jewel tone accents */
.jewel-ruby {
    border-left-color: #8B2252;
}

.jewel-sapphire {
    border-left-color: #1B3A5C;
}

.jewel-emerald {
    border-left-color: #1B5E3B;
}

.jewel-amethyst {
    border-left-color: #5B2C6F;
}

/* Card height variations */
.masonry-card.tall {
    min-height: 380px;
}

/* Card facet decorations */
.card-facet {
    position: absolute;
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
}

.card-facet.top-right {
    top: -4px;
    right: -4px;
}

.card-facet.bottom-left {
    bottom: -4px;
    left: -4px;
}

.jewel-ruby .card-facet {
    background: #8B2252;
    box-shadow: 0 0 6px rgba(139, 34, 82, 0.3);
}

.jewel-sapphire .card-facet {
    background: #1B3A5C;
    box-shadow: 0 0 6px rgba(27, 58, 92, 0.3);
}

.jewel-emerald .card-facet {
    background: #1B5E3B;
    box-shadow: 0 0 6px rgba(27, 94, 59, 0.3);
}

.jewel-amethyst .card-facet {
    background: #5B2C6F;
    box-shadow: 0 0 6px rgba(91, 44, 111, 0.3);
}

/* Card Content */
.card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #E8D5B7;
    margin-bottom: 12px;
    line-height: 1.3;
}

.card-body {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: #C4B8A8;
    margin-bottom: 16px;
}

.card-tag {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    display: inline-block;
    padding: 2px 0;
    opacity: 0.7;
}

.jewel-ruby .card-tag {
    color: #8B2252;
}

.jewel-sapphire .card-tag {
    color: #1B3A5C;
}

.jewel-emerald .card-tag {
    color: #1B5E3B;
}

.jewel-amethyst .card-tag {
    color: #5B2C6F;
}

/* Card Data Visualizations */
.card-dataviz {
    margin: 12px 0;
    max-height: 60px;
    display: flex;
    align-items: center;
}

.sparkline {
    width: 100%;
    height: 40px;
}

.progress-ring {
    width: 50px;
    height: 50px;
}

.bar-chart {
    width: 100%;
    height: 50px;
}

/* --- Footer --- */
#bar-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 50px 20px 40px;
    background: linear-gradient(to top, #12101A 0%, #1C1826 100%);
    border-top: 1px solid rgba(42, 36, 51, 0.6);
}

.footer-facets {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
}

.footer-facets .facet-dot {
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    display: inline-block;
}

.footer-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #E8D5B7;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.footer-divider {
    color: #5B2C6F;
    margin: 0 4px;
}

.footer-sub {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 0.9rem;
    color: #C4B8A8;
    opacity: 0.6;
}

/* --- Responsive: Tablet --- */
@media (max-width: 900px) {
    #masonry-grid {
        column-count: 2;
        column-gap: 20px;
        padding: 24px 16px 50px;
    }

    #bar-top {
        height: 30vh;
        min-height: 240px;
    }
}

/* --- Responsive: Mobile --- */
@media (max-width: 600px) {
    #masonry-grid {
        column-count: 1;
        column-gap: 0;
        padding: 20px 16px 40px;
    }

    #bar-top {
        height: 25vh;
        min-height: 200px;
    }

    #site-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
    }

    .coaster-tab {
        padding: 6px 14px;
        font-size: 0.85rem;
    }

    #coaster-nav {
        gap: 8px;
        padding: 12px 12px;
    }

    .nav-facet {
        display: none;
    }

    .masonry-card {
        padding: 20px;
        margin-bottom: 16px;
    }
}

/* --- Scrollbar styling --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #12101A;
}

::-webkit-scrollbar-thumb {
    background: #2A2433;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5B2C6F;
}
