/* ============================================================
   miris.monster -- Maximalist Gold-Black Game Dev Vault
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    background: #0A0A0A;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.7;
    color: #F0F0F0;
    background: #0A0A0A;
    overflow-x: hidden;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-weight: 700;
    color: #D4A850;
    line-height: 1.2;
}

h1 {
    font-size: clamp(32px, 5vw, 72px);
    font-weight: 900;
}

h2 {
    font-size: clamp(20px, 2.5vw, 32px);
}

h3 {
    font-size: clamp(16px, 1.8vw, 24px);
}

.metric-val,
.metric-big-val,
.stat-value,
.bar-label,
.h-bar-val,
.card-date {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 400;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: #0A0A0A;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Gold border frame */
#hero-border-frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

#border-svg {
    width: 100%;
    height: 100%;
}

#border-rect {
    stroke-dasharray: 4000;
    stroke-dashoffset: 4000;
    animation: drawBorder 1.5s ease-out forwards;
}

@keyframes drawBorder {
    to {
        stroke-dashoffset: 0;
    }
}

/* Hero content */
#hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 20px;
    animation: fadeInContent 1s ease-out 0.5s both;
}

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

/* Logotype with gold shimmer */
#logotype {
    font-size: clamp(48px, 8vw, 120px);
    font-weight: 900;
    color: #D4A850;
    letter-spacing: 0.02em;
    text-shadow:
        0 0 40px rgba(212, 168, 80, 0.3),
        0 0 80px rgba(212, 168, 80, 0.1);
    animation: goldShimmer 3s ease-in-out infinite;
}

@keyframes goldShimmer {
    0%, 100% {
        text-shadow:
            0 0 40px rgba(212, 168, 80, 0.3),
            0 0 80px rgba(212, 168, 80, 0.1);
    }
    50% {
        text-shadow:
            0 0 60px rgba(240, 208, 128, 0.5),
            0 0 120px rgba(212, 168, 80, 0.2),
            0 2px 4px rgba(240, 208, 128, 0.3);
    }
}

#hero-subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(14px, 1.5vw, 20px);
    color: #8A7840;
    margin-top: 12px;
    letter-spacing: 0.05em;
}

/* Hero Bar Chart */
#hero-chart {
    margin-top: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#bar-chart {
    width: 100%;
    height: auto;
}

#bar-chart .bar-label {
    font-family: 'JetBrains Mono', monospace;
}

/* Hero Mountains */
#hero-mountains {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    line-height: 0;
}

#mountain-svg {
    width: 100%;
    height: 150px;
}

/* ============================================================
   MOUNTAIN DIVIDERS
   ============================================================ */
.mountain-divider {
    width: 100%;
    line-height: 0;
    background: #0A0A0A;
    margin: 0;
    padding: 0;
}

.mountain-divider svg {
    width: 100%;
    height: 80px;
    display: block;
}

/* ============================================================
   MASONRY GRID
   ============================================================ */
#masonry-grid {
    background: #0A0A0A;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================================================
   CARDS (Base)
   ============================================================ */
.card {
    background: #141414;
    border: 2px solid #D4A850;
    box-shadow: inset 0 0 12px rgba(212, 168, 80, 0.1);
    padding: 20px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

.card[data-span="2"] {
    grid-column: span 2;
}

.card-title {
    margin-bottom: 10px;
}

.card-desc {
    color: #F0F0F0;
    margin-bottom: 12px;
    font-size: clamp(13px, 1vw, 16px);
}

.card-badge {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #0A0A0A;
    background: #D4A850;
    padding: 3px 10px;
    margin-bottom: 12px;
}

/* Card Metrics */
.card-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.metric {
    font-size: 12px;
    color: #8A7840;
}

.metric .metric-val {
    color: #F0D080;
    font-size: 13px;
}

.card-flip-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: #3A3020;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 12px;
    transition: color 0.3s;
}

.card-flippable:hover .card-flip-hint {
    color: #8A7840;
}

/* ============================================================
   CARD FLIP
   ============================================================ */
.card-flippable {
    perspective: 1000px;
    cursor: pointer;
    padding: 0;
    overflow: visible;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

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

.card-front,
.card-back {
    backface-visibility: hidden;
    padding: 20px;
}

.card-front {
    position: relative;
}

.card-back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    background: #141414;
    overflow-y: auto;
}

.card-back-title {
    font-size: clamp(14px, 1.5vw, 20px);
    margin-bottom: 12px;
}

/* Card stats list */
.card-stats-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #3A3020;
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #8A7840;
}

.stat-value {
    font-size: 12px;
    color: #F0D080;
}

/* Card chart (inside flip cards) */
.card-chart {
    width: 100%;
    height: auto;
    margin-bottom: 12px;
}

/* ============================================================
   DEV LOG CARDS
   ============================================================ */
.card-devlog .card-date {
    display: inline-block;
    font-size: 11px;
    color: #8A7840;
    margin-bottom: 8px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #D4A850;
    border: 1px solid #3A3020;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================
   METRIC PANELS
   ============================================================ */
.card-metric-panel {
    text-align: center;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.metric-grid.compact {
    grid-template-columns: repeat(3, 1fr);
}

.metric-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border: 1px solid #3A3020;
}

.metric-big-val {
    font-size: clamp(20px, 2.5vw, 32px);
    color: #F0D080;
    line-height: 1.2;
}

.metric-big-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: #8A7840;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* ============================================================
   DATA VIZ PANELS
   ============================================================ */
.card-dataviz {
    text-align: center;
}

.card-dataviz .card-chart {
    max-width: 100%;
    margin: 12px auto 8px;
}

/* Chart legend */
.chart-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 8px;
}

.legend-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #8A7840;
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-line {
    display: inline-block;
    width: 20px;
    height: 2px;
}

.legend-primary {
    background: #D4A850;
}

.legend-secondary {
    background: #F0D080;
    background-image: repeating-linear-gradient(
        90deg,
        #F0D080 0,
        #F0D080 4px,
        transparent 4px,
        transparent 7px
    );
}

/* SVG draw-in animation */
.line-data,
.line-data-secondary {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease;
}

.card.visible .line-data,
.card.visible .line-data-secondary {
    stroke-dashoffset: 0;
}

.radar-data,
.radar-data-2 {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.2s ease;
}

.card.visible .radar-data,
.card.visible .radar-data-2 {
    stroke-dashoffset: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
    background: #0A0A0A;
    border-top: 2px solid #D4A850;
    padding: 40px 20px;
    text-align: center;
}

.footer-logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 40px);
    color: #D4A850;
    margin-bottom: 8px;
}

.footer-text {
    color: #8A7840;
    font-size: clamp(13px, 1vw, 16px);
    margin-bottom: 16px;
}

.footer-metrics {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-metric {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #8A7840;
}

.footer-metric .metric-val {
    color: #F0D080;
    font-size: 12px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    #masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    #masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card[data-span="2"] {
        grid-column: span 2;
    }

    .metric-grid.compact {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    #masonry-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 6px;
    }

    .card[data-span="2"] {
        grid-column: span 2;
    }

    .card {
        padding: 14px;
    }

    .card-front,
    .card-back {
        padding: 14px;
    }

    #logotype {
        font-size: clamp(36px, 10vw, 72px);
    }

    .footer-metrics {
        flex-direction: column;
        gap: 8px;
    }

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

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

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0A0A0A;
}

::-webkit-scrollbar-thumb {
    background: #3A3020;
    border: 1px solid #D4A850;
}

::-webkit-scrollbar-thumb:hover {
    background: #8A7840;
}

/* ============================================================
   SELECTION
   ============================================================ */
/* Mountain front layer color reference: #1A1810 */
.mountain-divider svg path:last-child {
    fill: #1A1810;
}

::selection {
    background: rgba(212, 168, 80, 0.3);
    color: #F0F0F0;
}
