/* =========================================================================
   miris.monster — maximalist gold-black vault
   Palette:
     #0A0A0A True Black     (primary background)
     #141414 Card Dark      (masonry card backgrounds)
     #1A1810 Mountain Front (deepest mountain layer)
     #3A3020 Dark Gold      (mountains, subtle elements)
     #8A7840 Muted Gold     (secondary text and labels)
     #D4A850 Rich Gold      (primary accent, borders, logotype)
     #F0D080 Bright Gold    (highlights, interactive states)
     #F0F0F0 Pure White     (body text)
   Fonts: Playfair Display, Source Serif 4, JetBrains Mono
   ========================================================================= */

:root {
    --black:        #0A0A0A;
    --card-dark:    #141414;
    --mt-front:     #1A1810;
    --mt-back:      #3A3020;
    --gold-muted:   #8A7840;
    --gold-rich:    #D4A850;
    --gold-bright:  #F0D080;
    --white:        #F0F0F0;

    --serif-display: "Playfair Display", "Source Serif 4", Georgia, serif;
    --serif-body:    "Source Serif 4", "Playfair Display", Georgia, serif;
    --mono:          "JetBrains Mono", "Consolas", monospace;
}

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

html, body {
    margin: 0;
    padding: 0;
    background: var(--black);
    color: var(--white);
    font-family: var(--serif-body);
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.7;
}

body {
    overflow-x: hidden;
}

a {
    color: var(--gold-bright);
    text-decoration: none;
    border-bottom: 1px dotted var(--mt-back);
    transition: color .25s, border-color .25s;
}
a:hover { color: var(--white); border-bottom-color: var(--gold-rich); }

h1, h2, h3, h4 {
    font-family: var(--serif-display);
    font-weight: 700;
    color: var(--gold-rich);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

em {
    font-style: italic;
    color: var(--gold-bright);
}

/* ============================== */
/* viewport gold gradient frame   */
/* ============================== */
.viewport-frame {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}
.frame-edge {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--gold-rich), var(--gold-bright), var(--gold-rich), transparent);
    background-size: 200% 100%;
    transform-origin: left center;
}
.frame-top, .frame-bottom { left: 0; right: 0; height: 2px; transform: scaleX(0); }
.frame-top    { top: 0;    animation: frame-draw 1.5s .15s ease-out forwards, gold-shimmer 6s 1.6s linear infinite; }
.frame-bottom { bottom: 0; animation: frame-draw 1.5s .35s ease-out forwards, gold-shimmer 6s 1.8s linear infinite; }
.frame-left, .frame-right {
    top: 0; bottom: 0; width: 2px; transform: scaleY(0); transform-origin: top center;
    background: linear-gradient(180deg, transparent, var(--gold-rich), var(--gold-bright), var(--gold-rich), transparent);
    background-size: 100% 200%;
}
.frame-left  { left: 0;  animation: frame-draw-v 1.5s .55s ease-out forwards, gold-shimmer-v 6s 1.6s linear infinite; }
.frame-right { right: 0; animation: frame-draw-v 1.5s .75s ease-out forwards, gold-shimmer-v 6s 1.8s linear infinite; }

@keyframes frame-draw   { to { transform: scaleX(1); } }
@keyframes frame-draw-v { to { transform: scaleY(1); } }
@keyframes gold-shimmer    { 0% { background-position:   0% 0%; } 100% { background-position: 200% 0%; } }
@keyframes gold-shimmer-v  { 0% { background-position: 0%   0%; } 100% { background-position: 0% 200%; } }

/* ============================== */
/* HERO                           */
/* ============================== */
.hero {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 0;
    background: radial-gradient(ellipse at center, #11100A 0%, #0A0A0A 60%, #050504 100%);
    overflow: hidden;
}

.hero-inner {
    width: 100%;
    max-width: 1320px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.4em;
    color: var(--gold-muted);
    margin: 0 0 18px;
    opacity: 0;
    animation: fade-up .8s .4s ease-out forwards;
}

.logotype {
    font-family: var(--serif-display);
    font-weight: 900;
    font-size: clamp(48px, 11vw, 168px);
    letter-spacing: -0.03em;
    color: var(--gold-rich);
    line-height: 0.95;
    margin: 0 0 14px;
    text-shadow:
        0 0 12px rgba(212,168,80,0.18),
        0 0 32px rgba(212,168,80,0.08);
    animation: fade-up .9s .5s ease-out both, gold-shimmer-text 4.5s 1.5s ease-in-out infinite;
}
@keyframes gold-shimmer-text {
    0%, 100% { text-shadow: 0 0 12px rgba(212,168,80,0.18), 0 0 32px rgba(212,168,80,0.08); }
    50%      { text-shadow: 0 0 20px rgba(240,208,128,0.32), 0 0 56px rgba(212,168,80,0.20); }
}

.hero-tagline {
    font-family: var(--serif-body);
    font-size: clamp(15px, 1.4vw, 20px);
    line-height: 1.5;
    color: var(--white);
    max-width: 720px;
    margin: 0 auto 36px;
    opacity: 0;
    animation: fade-up .9s .8s ease-out forwards;
}

.hero-chart-wrap {
    width: min(960px, 92vw);
    margin: 0 auto;
    padding: 16px 18px 14px;
    border: 2px solid var(--gold-rich);
    border-radius: 2px;
    background: rgba(10,10,10,0.6);
    box-shadow: inset 0 0 18px rgba(212,168,80,0.10), 0 0 32px rgba(212,168,80,0.04);
    opacity: 0;
    animation: fade-up .9s 1.1s ease-out forwards;
}

.hero-chart {
    width: 100%;
    height: 220px;
    display: block;
}

.hero-chart .axis-label {
    font-family: var(--mono);
    font-size: 10px;
    fill: var(--gold-muted);
    letter-spacing: 0.05em;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--gold-muted);
    text-transform: uppercase;
}
.chart-legend .dot {
    display: inline-block;
    width: 8px; height: 8px; border-radius: 50%;
    margin-right: 6px; vertical-align: middle;
}
.dot-gold   { background: var(--gold-rich); }
.dot-bright { background: var(--gold-bright); }
.dot-white  { background: var(--white); }

/* hero mountains */
.mountains {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 240px;
    display: block;
    z-index: 1;
}
.hero-mountains { opacity: 0.92; }

/* ============================== */
/* METRIC BAND                    */
/* ============================== */
.metric-band {
    background: var(--black);
    border-top: 2px solid var(--gold-rich);
    border-bottom: 2px solid var(--gold-rich);
    box-shadow:
        inset 0 0 18px rgba(212,168,80,0.06);
}
.metric-band-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 0;
}
.metric {
    text-align: center;
    padding: 22px 12px;
    border-right: 1px solid #1F1A10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.metric:last-child { border-right: 0; }
.metric-num {
    font-family: var(--serif-display);
    font-weight: 900;
    font-size: clamp(28px, 3.4vw, 48px);
    color: var(--gold-rich);
    line-height: 1;
    letter-spacing: -0.02em;
}
.metric-unit {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.32em;
    color: var(--gold-muted);
    text-transform: uppercase;
}

/* ============================== */
/* SECTION HEADER (vault)         */
/* ============================== */
.vault-header {
    max-width: 1320px;
    margin: 0 auto;
    padding: 64px 24px 24px;
    text-align: left;
}
.section-title {
    font-size: clamp(32px, 4.4vw, 64px);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--gold-rich);
    margin: 0 0 6px;
}
.section-sub {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold-muted);
    margin: 0;
}

/* ============================== */
/* MASONRY VAULT                  */
/* ============================== */
.vault {
    background: var(--black);
    padding-bottom: 48px;
}
.masonry {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 8px;
    gap: 8px;
}

.card {
    position: relative;
    background: var(--card-dark);
    border: 2px solid var(--gold-rich);
    box-shadow: inset 0 0 12px rgba(212,168,80,0.10);
    padding: 18px 18px 18px;
    color: var(--white);
    overflow: hidden;
    grid-row: span 30;     /* default; JS overrides per-card */
    opacity: 0;
    transform: translateY(14px);
    transition: box-shadow .35s, transform .35s, border-color .25s;
}
.card.in-view {
    opacity: 1;
    transform: translateY(0);
}
.card:hover {
    box-shadow: inset 0 0 18px rgba(212,168,80,0.18), 0 0 18px rgba(212,168,80,0.18);
    border-color: var(--gold-bright);
}

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

.card-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--gold-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.card-title {
    font-size: clamp(20px, 2vw, 32px);
    color: var(--gold-rich);
    margin: 0 0 6px;
    line-height: 1.05;
}

.card-meta {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-bright);
    margin: 0 0 12px;
}

.card-desc {
    font-family: var(--serif-body);
    font-size: clamp(13px, 0.95vw, 16px);
    color: var(--white);
    margin: 0 0 14px;
    line-height: 1.6;
}

.card-foot {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-muted);
    margin: auto 0 0;
}

/* card flip */
.card-flip {
    perspective: 1200px;
    cursor: pointer;
}
.card-flip .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.7,0,0.2,1);
    transform-style: preserve-3d;
}
.card-flip.flipped .card-inner {
    transform: rotateY(180deg);
}
.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    padding: 18px;
    display: flex;
    flex-direction: column;
    background: var(--card-dark);
}
.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #181410 0%, #141414 100%);
}
.card-flip-hint {
    margin-top: auto;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.32em;
    color: var(--gold-muted);
    text-transform: uppercase;
}

/* tech list */
.tech-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tech-list.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
}
.tech-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 4px;
    border-bottom: 1px dashed #2A2218;
    font-family: var(--mono);
    font-size: 11px;
}
.tech-list .k {
    color: var(--gold-muted);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.tech-list .v {
    color: var(--gold-bright);
    font-weight: 500;
}

/* charts inside cards */
.bar-svg, .line-svg, .donut-svg, .team-radar, .mini-radar, .bestiary-grid, .mini-line {
    width: 100%;
    height: auto;
    display: block;
    margin: 6px 0 10px;
}
.axis-label {
    font-family: var(--mono);
    font-size: 9px;
    fill: var(--gold-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.donut-label {
    font-family: var(--mono);
    font-size: 11px;
    fill: var(--gold-bright);
    letter-spacing: 0.2em;
}
.donut-seg {
    transition: stroke-dashoffset 1.2s ease-out, stroke .3s;
}

.code-block {
    background: var(--black);
    border: 1px solid var(--mt-back);
    color: var(--gold-bright);
    font-family: var(--mono);
    font-size: 11px;
    padding: 10px 12px;
    margin: 0 0 12px;
    overflow: auto;
    line-height: 1.5;
    box-shadow: inset 0 0 8px rgba(212,168,80,0.08);
}
.code-block code { color: inherit; font-family: inherit; }

.pull-quote {
    font-family: var(--serif-display);
    font-style: italic;
    font-size: clamp(18px, 1.6vw, 24px);
    color: var(--gold-bright);
    margin: 0 0 14px;
    line-height: 1.3;
    border-left: 3px solid var(--gold-rich);
    padding-left: 14px;
}

/* lang bars */
.lang-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lang-bars li {
    display: grid;
    grid-template-columns: 60px 1fr 36px;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-muted);
}
.lang-name { color: var(--gold-bright); }
.lang-track {
    height: 6px;
    background: #1F1A10;
    border: 1px solid var(--mt-back);
    overflow: hidden;
}
.lang-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-rich), var(--gold-bright));
    transition: width 1.2s ease-out;
}
.lang-pct { color: var(--gold-bright); text-align: right; }

/* heat strip */
.heat-strip {
    margin: 8px 0 12px;
    display: grid;
    grid-template-columns: repeat(30, 1fr);
    grid-auto-rows: 12px;
    gap: 2px;
}
.heat-cell {
    background: #1A1610;
    border: 1px solid #1F1A10;
    transform: scale(0);
    transform-origin: center;
}
.heat-cell.in {
    transform: scale(1);
    transition: transform .25s ease-out;
}
.heat-cell.h1 { background: #3A3020; }
.heat-cell.h2 { background: #5A4830; }
.heat-cell.h3 { background: var(--gold-muted); }
.heat-cell.h4 { background: var(--gold-rich); }
.heat-cell.h5 { background: var(--gold-bright); }

/* ============================== */
/* MOUNTAIN DIVIDER               */
/* ============================== */
.mountain-divider {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--black);
    overflow: hidden;
    border-top: 1px solid #1A1610;
    margin-top: 32px;
}
.mountain-divider svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================== */
/* METRIC PANEL (big charts)      */
/* ============================== */
.metric-panel {
    background: var(--black);
    padding-bottom: 64px;
}
.viz-row {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.viz-block {
    background: var(--card-dark);
    border: 2px solid var(--gold-rich);
    box-shadow: inset 0 0 12px rgba(212,168,80,0.10);
    padding: 18px;
}
.viz-title {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--gold-bright);
    text-transform: uppercase;
    margin: 0 0 12px;
}
.big-line, .big-bars {
    width: 100%;
    height: auto;
    display: block;
}
.big-line .grid-lines line,
.big-bars .grid-lines line { stroke-dasharray: 2 4; }

#bigLineDots circle {
    fill: var(--gold-bright);
    stroke: var(--black);
    stroke-width: 1;
    opacity: 0;
    transition: opacity .3s, r .2s;
}
#bigLineDots circle.in { opacity: 1; }
#bigLineDots circle:hover { r: 5; fill: var(--white); }

#bigBarsGroup rect {
    fill: var(--gold-rich);
    transition: fill .25s, transform .25s;
    transform-origin: bottom;
}
#bigBarsGroup rect:hover { fill: var(--gold-bright); }

/* ============================== */
/* FOOTER                         */
/* ============================== */
.site-footer {
    background: linear-gradient(180deg, #050504 0%, var(--black) 100%);
    border-top: 2px solid var(--gold-rich);
    padding: 56px 24px 32px;
    box-shadow: inset 0 12px 32px rgba(212,168,80,0.04);
}
.footer-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
}
.footer-title {
    font-family: var(--serif-display);
    font-size: 18px;
    color: var(--gold-rich);
    margin: 0 0 12px;
    letter-spacing: 0;
}
.footer-text {
    font-family: var(--serif-body);
    font-size: 14px;
    color: var(--white);
    margin: 0;
    max-width: 36ch;
    line-height: 1.6;
}
.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.footer-list a {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--gold-bright);
    text-transform: uppercase;
    border-bottom: 0;
}
.footer-list a:hover { color: var(--white); }
.stamp-line {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--gold-muted);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 4px;
}

/* ============================== */
/* shared keyframes               */
/* ============================== */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================== */
/* RESPONSIVE                     */
/* ============================== */
@media (max-width: 980px) {
    .masonry { grid-template-columns: repeat(2, 1fr); }
    .viz-row { grid-template-columns: 1fr; }
    .metric-band-inner { grid-template-columns: repeat(5, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .masonry { grid-template-columns: repeat(2, 1fr); padding: 0 12px; }
    .span-2  { grid-column: span 2; }
    .vault-header { padding: 48px 16px 18px; }
    .metric-band-inner { grid-template-columns: repeat(2, 1fr); }
    .metric { border-right: 1px solid #1F1A10; border-bottom: 1px solid #1F1A10; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .hero-chart-wrap { padding: 12px 10px 10px; }
    .heat-strip { grid-template-columns: repeat(15, 1fr); }
    .tech-list.two-col { grid-template-columns: 1fr; }
}
