/* transactology.org — Surreal Full-Bleed Terracotta */

:root {
    --scorched-earth: #1a0f0a;
    --kiln-clay: #c2703e;
    --molten-sienna: #e8632b;
    --forge-amber: #f2a541;
    --dusk-violet: #4a2040;
    --star-white: #f5ede3;
    --obsidian: #0d0806;
}

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--scorched-earth);
    color: var(--star-white);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.125rem;
    letter-spacing: 0.04em;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== CHAMBERS ===== */
.chamber {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    scroll-snap-align: start;
}

.chamber-hero {
    height: 200vh;
}

/* ===== GRADIENT MESHES ===== */
.gradient-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mesh-hero {
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, var(--kiln-clay) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 80% 70%, var(--dusk-violet) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 50% 50%, var(--molten-sienna) 0%, transparent 80%),
        var(--scorched-earth);
    animation: meshDrift1 20s ease-in-out infinite alternate;
}

.mesh-hero-overlay {
    background:
        conic-gradient(from 45deg at 30% 60%, transparent, var(--forge-amber), transparent, var(--dusk-violet), transparent);
    opacity: 0.3;
    animation: meshDrift2 25s ease-in-out infinite alternate;
}

.mesh-text {
    background:
        radial-gradient(ellipse 70% 50% at 70% 40%, var(--dusk-violet) 0%, transparent 60%),
        radial-gradient(ellipse 50% 70% at 20% 80%, var(--kiln-clay) 0%, transparent 70%),
        var(--obsidian);
    animation: meshDrift3 22s ease-in-out infinite alternate;
}

.mesh-rupture {
    background:
        radial-gradient(ellipse 90% 90% at 50% 50%, var(--molten-sienna) 0%, transparent 50%),
        radial-gradient(ellipse 40% 60% at 80% 20%, var(--forge-amber) 0%, transparent 60%),
        var(--scorched-earth);
    animation: meshDrift1 18s ease-in-out infinite alternate;
}

.mesh-rupture-layer2 {
    background:
        conic-gradient(from 120deg at 40% 50%, transparent, var(--dusk-violet), transparent, var(--kiln-clay), transparent);
    opacity: 0.5;
    animation: meshDrift2 30s ease-in-out infinite alternate;
    mix-blend-mode: multiply;
}

.mesh-rupture-layer3 {
    background:
        radial-gradient(circle at 60% 60%, var(--forge-amber) 0%, transparent 40%);
    opacity: 0.4;
    animation: meshPulse 8s ease-in-out infinite;
}

.mesh-overlap {
    background:
        radial-gradient(ellipse 60% 80% at 30% 50%, var(--kiln-clay) 0%, transparent 60%),
        radial-gradient(ellipse 80% 40% at 80% 30%, var(--dusk-violet) 0%, transparent 50%),
        conic-gradient(from 200deg at 50% 80%, transparent, var(--molten-sienna), transparent),
        var(--scorched-earth);
    animation: meshDrift3 24s ease-in-out infinite alternate;
}

.mesh-terminal {
    background:
        radial-gradient(circle at 50% 50%, var(--dusk-violet) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, var(--scorched-earth) 0%, var(--obsidian) 100%);
    animation: meshDrift1 30s ease-in-out infinite alternate;
}

@keyframes meshDrift1 {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.05) translate(2%, -1%); }
    100% { transform: scale(1) translate(-1%, 2%); }
}

@keyframes meshDrift2 {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(15deg) scale(1.1); }
}

@keyframes meshDrift3 {
    0% { transform: scale(1.02) translate(-1%, 0); }
    100% { transform: scale(1) translate(1%, -1%); }
}

@keyframes meshPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

/* ===== HERO ===== */
.hero-content {
    position: absolute;
    top: 20vh;
    left: 5vw;
    z-index: 2;
}

.hero-title {
    font-family: 'Dela Gothic One', cursive;
    font-size: clamp(4rem, 12vw, 18rem);
    line-height: 0.85;
    text-transform: uppercase;
    color: var(--star-white);
    mix-blend-mode: difference;
    margin: 0;
}

.hero-annotation {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.75rem);
    color: var(--forge-amber);
    margin-top: 2rem;
    margin-left: 2vw;
}

/* ===== EMBER FIELD ===== */
.ember-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.ember {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: emberFloat linear forwards;
}

@keyframes emberFloat {
    0% { opacity: 1; transform: translateY(0) translateX(0); }
    100% { opacity: 0; transform: translateY(-200px) translateX(30px); }
}

/* ===== CRACK LINES ===== */
.crack-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.crack-lines svg {
    width: 100%;
    height: 100%;
}

.crack-path {
    fill: none;
    stroke: var(--kiln-clay);
    stroke-width: 0.5;
    opacity: 0.3;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: crackReveal 8s ease-out forwards;
}

.crack-path:nth-child(2) { animation-delay: 2s; stroke: var(--molten-sienna); opacity: 0.2; }
.crack-path:nth-child(3) { animation-delay: 4s; stroke: var(--forge-amber); opacity: 0.15; }

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

/* ===== STAR SCATTER ===== */
.star-scatter {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===== TEXT CHAMBER ===== */
.text-content {
    position: relative;
    z-index: 2;
    padding: 15vh 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.text-block {
    max-width: 60%;
}

.text-edge-left {
    padding-left: 5vw;
    align-self: flex-start;
}

.text-float-right {
    padding-right: 8vw;
    align-self: flex-end;
    margin-top: 8vh;
}

.text-annotation {
    position: absolute;
    bottom: 10vh;
    right: 5vw;
    max-width: 30%;
}

.section-headline {
    font-family: 'Dela Gothic One', cursive;
    font-size: clamp(2.5rem, 8vw, 10rem);
    line-height: 0.9;
    text-transform: uppercase;
    color: var(--star-white);
    mix-blend-mode: difference;
}

.body-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    line-height: 1.7;
    letter-spacing: 0.04em;
    color: var(--star-white);
    opacity: 0.9;
}

.annotation-text {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(0.9rem, 1.3vw, 1.25rem);
    color: var(--forge-amber);
    line-height: 1.6;
}

/* ===== HEAT SHIMMER ===== */
.heat-shimmer {
    position: absolute;
    bottom: -2vh;
    left: 0;
    width: 100%;
    height: 15vh;
    background: linear-gradient(to top, var(--scorched-earth), transparent);
    filter: url(#turbulence);
    pointer-events: none;
    z-index: 3;
    opacity: 0.6;
}

/* ===== OVERLAP CHAMBER ===== */
.chamber-overlap {
    margin-top: -15vh;
    z-index: 2;
}

.overlap-content {
    position: relative;
    z-index: 2;
    padding: 20vh 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.overlap-text {
    padding-left: 8vw;
    padding-right: 15vw;
}

.headline-overlap {
    font-size: clamp(2rem, 6vw, 8rem);
}

.overlap-body {
    max-width: 50%;
    margin-top: 6vh;
    padding-left: 20vw;
}

.overlap-aside {
    max-width: 35%;
    margin-top: 8vh;
    padding-left: 5vw;
}

/* ===== TERMINAL CHAMBER ===== */
.terminal-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.constellation-container {
    width: clamp(150px, 30vw, 300px);
    height: clamp(150px, 30vw, 300px);
}

.constellation-star {
    width: 100%;
    height: 100%;
    animation: constellationRotate 60s linear infinite;
}

.star-main {
    fill: none;
    stroke: var(--molten-sienna);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 8px var(--forge-amber));
}

.star-dot {
    fill: var(--forge-amber);
    filter: drop-shadow(0 0 4px var(--forge-amber));
}

.constellation-line {
    stroke: var(--kiln-clay);
    stroke-width: 0.5;
    opacity: 0.4;
    stroke-dasharray: 4 4;
}

@keyframes constellationRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.terminal-whisper {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.75rem);
    color: var(--forge-amber);
    margin-top: 4rem;
    opacity: 0.8;
}

/* ===== STAR NAVIGATION ===== */
.star-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.star-nav-trigger {
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    animation: starPulse 3s ease-in-out infinite;
    position: relative;
    z-index: 101;
}

.star-glyph {
    width: 48px;
    height: 48px;
}

.star-ray-long {
    fill: var(--molten-sienna);
    filter: drop-shadow(0 0 6px var(--forge-amber));
}

.star-ray-short {
    fill: var(--forge-amber);
    opacity: 0.6;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px var(--forge-amber)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 12px var(--forge-amber)); }
}

.star-nav-menu {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.star-nav-item {
    position: absolute;
    bottom: 24px;
    right: 24px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--star-white);
    text-decoration: none;
    background: var(--obsidian);
    border: 1px solid var(--kiln-clay);
    padding: 0.4rem 0.8rem;
    border-radius: 2px;
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    white-space: nowrap;
}

.star-nav.active .star-nav-item {
    opacity: 1;
    transform: translate(var(--tx), var(--ty)) scale(1);
    pointer-events: auto;
}

.star-nav-item:hover {
    color: var(--forge-amber);
    border-color: var(--molten-sienna);
    box-shadow: 0 0 8px var(--forge-amber);
}

/* ===== REVEAL SYSTEM ===== */
.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== CURSOR TRAIL ===== */
.cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
}

.cursor-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--forge-amber);
    border-radius: 50%;
    pointer-events: none;
    animation: cursorStarFade 0.4s ease-out forwards;
}

@keyframes cursorStarFade {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.3); }
}

/* ===== SCATTER STARS ===== */
.scatter-star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--forge-amber);
    clip-path: polygon(50% 0%, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0% 50%, 39% 35%);
    animation: scatterDrift 6s ease-in-out infinite alternate;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.scatter-star.visible {
    opacity: 0.6;
}

@keyframes scatterDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(10px, -10px) rotate(45deg); }
}

/* ===== SVG TURBULENCE FILTER (for heat shimmer) ===== */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(3rem, 15vw, 8rem);
    }

    .text-block {
        max-width: 90%;
    }

    .text-float-right {
        padding-right: 5vw;
    }

    .text-annotation {
        position: relative;
        bottom: auto;
        right: auto;
        max-width: 80%;
        padding-left: 5vw;
        margin-top: 4vh;
    }

    .section-headline {
        font-size: clamp(2rem, 10vw, 5rem);
    }

    .overlap-body {
        max-width: 85%;
        padding-left: 5vw;
    }

    .overlap-aside {
        max-width: 80%;
    }

    .headline-overlap {
        font-size: clamp(1.8rem, 8vw, 4rem);
    }
}