/* ═══════════════════════════════════════════
   op9.rs — mcbling modular showroom
   ═══════════════════════════════════════════ */

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

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

body {
    background: #101014;
    color: #9898A8;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Sparkle Canvas --- */
#sparkle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* --- Showroom Grid --- */
.showroom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 40px 32px 60px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* --- Module Base --- */
.module {
    position: relative;
    border: 1px solid #3A3A40;
    border-radius: 6px;
    background: linear-gradient(160deg, #18181C, #1E1E24);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    overflow: hidden;
    min-height: 160px;
}

.module__inner {
    position: relative;
    z-index: 2;
    padding: 28px 28px 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.module__label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #B0B0C0;
    margin-bottom: 16px;
}

.module__label--gold {
    color: #D0B870;
}

/* Sparkle container inside modules */
.module__sparkles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

/* --- Fade-Reveal --- */
.module--reveal {
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.module--reveal.revealed {
    opacity: 1;
    transform: scale(1);
}

/* --- 3D Depth --- */
.module--3d {
    perspective: 1200px;
}

.module--3d .module__inner {
    transform: rotateX(2deg);
    transform-origin: bottom center;
}

/* ═══════════════════════════════════════════
   Module Variants — Grid Placement
   ═══════════════════════════════════════════ */

/* Hero — full 3 col, tall */
.module--hero {
    grid-column: 1 / -1;
    min-height: 60vh;
    display: flex;
    align-items: flex-end;
}

.module--hero .module__inner {
    padding: 0 48px 56px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

.hero__title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(4.5rem, 12vw, 10rem);
    color: #E8E8F0;
    line-height: 0.88;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.hero__dot {
    color: #D0B870;
}

.hero__sub {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.3vw, 1.15rem);
    color: #9898A8;
    letter-spacing: 0.04em;
    max-width: 420px;
}

/* Status — 1 col */
.module--status {
    grid-column: span 1;
}

.status__indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6fcf6f;
    box-shadow: 0 0 8px rgba(111, 207, 111, 0.5);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status__text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #B0B0C0;
}

.status__metrics {
    display: flex;
    gap: 32px;
    margin-top: auto;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric__value {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: #E8E8F0;
    line-height: 1;
}

.metric__unit {
    font-size: 0.5em;
    color: #D0B870;
}

.metric__label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #9898A8;
    margin-top: 4px;
}

/* Architecture — 2 col */
.module--arch {
    grid-column: span 2;
    min-height: 280px;
}

.arch__diagram {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 16px 0;
    flex: 1;
}

.arch__node {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid #3A3A40;
}

.arch__node--core {
    width: 72px;
    height: 72px;
    color: #D0B870;
    border-color: #D0B870;
    background: rgba(208, 184, 112, 0.06);
    flex-shrink: 0;
}

.arch__connectors {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 80px;
    flex-shrink: 0;
}

.arch__line {
    height: 1px;
    background: linear-gradient(90deg, #D0B870, #3A3A40);
    opacity: 0.5;
}

.arch__ring {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.arch__node--edge {
    width: 64px;
    height: 36px;
    color: #B0B0C0;
    font-size: 0.65rem;
}

.arch__caption {
    font-size: 0.8rem;
    color: #9898A8;
    margin-top: auto;
}

/* Catalog — 1 col, tall span 2 rows */
.module--catalog {
    grid-column: span 1;
    grid-row: span 2;
}

.catalog__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

.catalog__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(58, 58, 64, 0.5);
}

.catalog__item:last-child {
    border-bottom: none;
}

.catalog__name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: #E8E8F0;
    letter-spacing: 0.02em;
}

.catalog__version {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    color: #9898A8;
    background: rgba(58, 58, 64, 0.4);
    padding: 2px 8px;
    border-radius: 3px;
}

/* Throughput — 2 col */
.module--throughput {
    grid-column: span 2;
}

.throughput__bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 12px 0;
    flex: 1;
}

.throughput__bar {
    position: relative;
    height: 28px;
    background: rgba(58, 58, 64, 0.3);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.throughput__fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(208, 184, 112, 0.25), rgba(208, 184, 112, 0.08));
    width: 0;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.throughput__bar-label {
    position: relative;
    z-index: 2;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #B0B0C0;
    padding-left: 10px;
}

.throughput__note {
    font-size: 0.8rem;
    color: #9898A8;
    margin-top: auto;
}

/* Bling accent — 1 col */
.module--bling {
    grid-column: span 1;
    background: linear-gradient(160deg, #1E1E24, #18181C);
    border-color: rgba(208, 184, 112, 0.25);
    box-shadow:
        inset 0 1px 0 rgba(208, 184, 112, 0.08),
        0 0 40px rgba(208, 184, 112, 0.04);
}

.module--bling .module__inner {
    align-items: center;
    text-align: center;
}

.bling__icon {
    margin: 8px 0 16px;
}

.bling__svg {
    width: 48px;
    height: 48px;
}

.bling__svg polygon {
    fill: none;
    stroke: #D0B870;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 6px rgba(208, 184, 112, 0.3));
}

.bling__text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #D0B870;
    letter-spacing: 0.05em;
}

.bling__sub {
    font-size: 0.8rem;
    color: #9898A8;
    margin-top: 4px;
}

/* Changelog — 1 col */
.module--changelog {
    grid-column: span 1;
}

.changelog__entries {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.changelog__entry {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(58, 58, 64, 0.3);
    align-items: baseline;
}

.changelog__entry:last-child {
    border-bottom: none;
}

.changelog__date {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    color: #D0B870;
    letter-spacing: 0.08em;
    flex-shrink: 0;
    width: 56px;
}

.changelog__msg {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.82rem;
    color: #B0B0C0;
}

/* Nodes map — full 3 col */
.module--nodes {
    grid-column: 1 / -1;
    min-height: 240px;
}

.nodes__map {
    position: relative;
    width: 100%;
    height: 180px;
    margin: 12px 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 50%, rgba(58, 58, 64, 0.15), transparent);
}

.nodes__cluster {
    position: absolute;
    left: var(--cx);
    top: var(--cy);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transform: translate(-50%, -50%);
}

.nodes__cluster::before {
    content: '';
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(208, 184, 112, 0.3);
    background: rgba(208, 184, 112, 0.04);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: node-ping 3s ease-out infinite;
}

@keyframes node-ping {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.nodes__cluster-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #B0B0C0;
    position: relative;
    z-index: 2;
}

.nodes__cluster-count {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    color: #D0B870;
    position: relative;
    z-index: 2;
}

.nodes__total {
    font-size: 0.8rem;
    color: #9898A8;
    text-align: center;
    margin-top: auto;
}

/* Protocol — 1 col */
.module--protocol {
    grid-column: span 1;
}

.protocol__spec {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
}

.protocol__line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(58, 58, 64, 0.3);
}

.protocol__line:last-child {
    border-bottom: none;
}

.protocol__key {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 0.78rem;
    color: #9898A8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.protocol__val {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #E8E8F0;
    letter-spacing: 0.04em;
}

/* Telemetry — 2 col */
.module--telemetry {
    grid-column: span 2;
}

.telemetry__wave {
    width: 100%;
    height: 80px;
    margin: 12px 0;
}

.telemetry__svg {
    width: 100%;
    height: 100%;
}

.telemetry__line {
    fill: none;
    stroke: #D0B870;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.6;
    filter: drop-shadow(0 0 4px rgba(208, 184, 112, 0.3));
}

.telemetry__readings {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: auto;
}

.telemetry__reading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9898A8;
}

.telemetry__reading strong {
    color: #E8E8F0;
    font-weight: 700;
    margin-left: 4px;
}

/* ═══════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════ */

.showroom-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    border-top: 1px solid #3A3A40;
    max-width: 1400px;
    margin: 0 auto;
}

.footer__mark {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: #E8E8F0;
}

.footer__sep {
    color: #3A3A40;
}

.footer__copy {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    color: #9898A8;
}

/* ═══════════════════════════════════════════
   Sparkle Dots (injected by JS)
   ═══════════════════════════════════════════ */

.sparkle-dot {
    position: absolute;
    width: var(--size, 4px);
    height: var(--size, 4px);
    border-radius: 50%;
    background: radial-gradient(circle, #FFFFFF, transparent);
    animation: sparkle var(--dur, 2s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    pointer-events: none;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 0.9;
        transform: scale(1);
    }
}

/* ═══════════════════════════════════════════
   Metallic Shimmer (on 3D modules)
   ═══════════════════════════════════════════ */

.module--3d::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 30%,
        rgba(255,255,255,0.02) 45%,
        rgba(255,255,255,0.04) 50%,
        rgba(255,255,255,0.02) 55%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 3;
    border-radius: 6px;
}

/* ═══════════════════════════════════════════
   Module hover state — subtle lift
   ═══════════════════════════════════════════ */

.module {
    transition: border-color 300ms ease, box-shadow 300ms ease;
}

.module:hover {
    border-color: rgba(208, 184, 112, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 0 24px rgba(208, 184, 112, 0.04);
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
    .showroom {
        grid-template-columns: repeat(2, 1fr);
        padding: 24px 16px 40px;
        gap: 12px;
    }

    .module--hero {
        grid-column: 1 / -1;
        min-height: 50vh;
    }

    .module--arch {
        grid-column: 1 / -1;
    }

    .module--throughput {
        grid-column: 1 / -1;
    }

    .module--nodes {
        grid-column: 1 / -1;
    }

    .module--telemetry {
        grid-column: 1 / -1;
    }

    .module--catalog {
        grid-row: span 1;
    }

    .hero__title {
        font-size: clamp(3rem, 10vw, 6rem);
    }
}

@media (max-width: 560px) {
    .showroom {
        grid-template-columns: 1fr;
        padding: 16px 12px 32px;
    }

    .module--hero {
        min-height: 40vh;
    }

    .module--hero .module__inner {
        padding: 0 24px 36px;
    }

    .module--arch,
    .module--throughput,
    .module--nodes,
    .module--telemetry,
    .module--catalog {
        grid-column: span 1;
        grid-row: span 1;
    }

    .status__metrics {
        gap: 20px;
    }

    .arch__diagram {
        flex-direction: column;
        align-items: flex-start;
    }

    .arch__connectors {
        width: 100%;
        flex-direction: row;
        gap: 8px;
    }

    .arch__line {
        height: 1px;
        flex: 1;
    }

    .arch__ring {
        flex-direction: row;
        gap: 8px;
    }

    .nodes__map {
        height: 140px;
    }
}
