/* ============================================
   meltdown.quest — Styles
   ============================================ */

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

:root {
    --charred-kiln: #1a1210;
    --fired-clay: #2d2118;
    --kiln-blush: #c46c3a;
    --molten-amber: #e8a45c;
    --ember-core: #d4533b;
    --calcium-ash: #f2e6d9;
    --cooled-basalt: #8a6e5a;
    --wilted-sage: #6b7c59;
    --ease-melt: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--charred-kiln);
    color: var(--calcium-ash);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* === Typography === */
h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--calcium-ash);
    text-shadow: 0 0 40px rgba(196, 108, 58, 0.3);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    margin-bottom: 0.6em;
}

p {
    max-width: 55ch;
    color: var(--calcium-ash);
    opacity: 0.88;
}

/* === Zones (sections) === */
.zone {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* === Marble BG === */
.marble-bg {
    position: absolute;
    inset: 0;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

#zone-solid .marble-bg { opacity: 0.08; }
#zone-warming .marble-bg { opacity: 0.12; }
#zone-plastic .marble-bg { opacity: 0.18; }
#zone-liquid .marble-bg { opacity: 0.25; }
#zone-resolidification .marble-bg { opacity: 0.2; }

/* === Zone 1: Solid === */
#zone-solid {
    background: var(--charred-kiln);
    display: grid;
    grid-template-columns: 62% 38%;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    padding: 0;
}

.site-title {
    position: absolute;
    top: 12vh;
    left: 8vw;
    font-size: clamp(3rem, 8vw, 6.5rem);
    z-index: 10;
    line-height: 1.05;
}

.specimen-block {
    position: absolute;
    top: 10vh;
    right: 5vw;
    width: 40vw;
    height: 50vh;
    border: 1px solid var(--kiln-blush);
    overflow: hidden;
    z-index: 5;
    transition: border-color 1200ms var(--ease-melt), border-radius 1200ms var(--ease-melt);
}

.peony-anchor {
    position: absolute;
    bottom: 8vh;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 220px;
    z-index: 10;
}

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

.z-crack {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

/* === Melting Edge Dividers === */
.melt-divider {
    position: relative;
    z-index: 20;
    margin-top: -2px;
    line-height: 0;
}

.melt-divider svg {
    display: block;
    width: 100%;
}

/* === Zone Content === */
.zone-content {
    position: relative;
    z-index: 10;
    padding: 10vh 8vw;
}

.z-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.z-layout .shard-2 {
    grid-column: 1 / -1;
    justify-self: center;
    margin-left: 30%;
}

/* === Shard Cards === */
.shard-card {
    background: var(--fired-clay);
    padding: 2.5rem 2.8rem;
    position: relative;
    clip-path: polygon(3% 0%, 98% 2%, 100% 97%, 1% 100%);
    border-left: 2px solid var(--kiln-blush);
    transition: all 1200ms var(--ease-melt);
    opacity: 0;
    transform: scale(0.85);
}

.shard-card.visible {
    opacity: 1;
    transform: scale(1) rotate(var(--rotation, 0deg));
}

.shard-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cooled-basalt);
    display: block;
    margin-bottom: 1rem;
}

.shard-wide {
    max-width: 700px;
}

.shard-offset {
    max-width: 600px;
    margin-left: auto;
    margin-top: 4rem;
}

/* === Zone 2: Warming specifics === */
#zone-warming {
    background: var(--charred-kiln);
}

/* === Zone 3: Plastic === */
#zone-plastic {
    background: var(--fired-clay);
}

.vine-motif {
    position: absolute;
    right: 8vw;
    top: 15vh;
    width: 150px;
    height: 400px;
    z-index: 5;
    pointer-events: none;
}

/* === Zone 4: Liquid === */
#zone-liquid {
    background: var(--fired-clay);
}

.heat-core {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: radial-gradient(ellipse at 50% 30%, rgba(212,83,59,0.2) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.blob-card {
    clip-path: none;
    border-radius: 50% 30% 60% 40% / 40% 50% 30% 60%;
    border-left: none;
    background: rgba(45, 33, 24, 0.85);
    max-width: 600px;
    margin-bottom: 4rem;
}

.blob-1 {
    margin-left: 5%;
}

.blob-2 {
    margin-left: auto;
    margin-right: 5%;
}

.melting-heading {
    letter-spacing: 0.08em;
    font-weight: 300;
}

.melted-peony {
    position: absolute;
    left: 50%;
    top: 20vh;
    transform: translateX(-50%);
    width: 200px;
    height: 300px;
    z-index: 5;
    pointer-events: none;
}

/* === Zone 5: Resolidification === */
#zone-resolidification {
    background: #1a1218;
}

.crystal-card {
    clip-path: polygon(5% 0%, 100% 3%, 97% 100%, 0% 96%);
    background: rgba(26, 18, 16, 0.9);
    border-left: 2px solid var(--cooled-basalt);
    max-width: 600px;
    margin-bottom: 4rem;
}

.crystal-1 {
    margin-left: 5%;
}

.crystal-2 {
    margin-left: auto;
    margin-right: 5%;
}

.crystal-peony {
    width: 200px;
    height: 220px;
    margin: 2rem auto;
    position: relative;
    z-index: 10;
}

.crystal-peony svg {
    width: 100%;
    height: 100%;
}

.final-message {
    position: absolute;
    bottom: 8vh;
    right: 8vw;
    z-index: 10;
}

.final-message p {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cooled-basalt);
    max-width: 35ch;
    text-align: right;
}

/* === Crack SVG overlay === */
#crack-svg line {
    stroke: var(--kiln-blush);
    stroke-opacity: 0.4;
    transition: stroke-opacity 2s var(--ease-melt);
}

/* === Responsive === */
@media (max-width: 768px) {
    .z-layout {
        grid-template-columns: 1fr;
    }
    .z-layout .shard-2 {
        margin-left: 0;
        grid-column: auto;
    }
    .specimen-block {
        width: 60vw;
        height: 35vh;
        right: 3vw;
    }
    .site-title {
        font-size: clamp(2rem, 10vw, 4rem);
    }
    .zone-content {
        padding: 8vh 5vw;
    }
    .vine-motif {
        display: none;
    }
}
