/* tanso.day — Carbon Transformation */
/* Fonts: Cinzel Decorative, Cormorant Garamond, Outfit, JetBrains Mono */

:root {
    --carbon-void: #0a0a0a;
    --graphite: #1a1a1f;
    --pressure-blue: #0d0d1a;
    --molten-gold: #c9a84c;
    --candlelight: #e8c86e;
    --diamond-light: #f5e6b8;
    --stellar-teal: #2dd4bf;
    --nebula-rose: #c850c0;
    --ash: #3a3a3a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--carbon-void);
    color: var(--diamond-light);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ========== BOKEH BACKGROUND ========== */

#bokeh-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.bokeh {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

/* ========== SCROLL PROGRESS FILAMENT ========== */

#scroll-progress {
    position: fixed;
    right: 16px;
    top: 10vh;
    width: 1px;
    height: 80vh;
    z-index: 100;
}

#scroll-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: rgba(58, 58, 58, 0.12);
}

#scroll-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 0%;
    background: var(--molten-gold);
    transition: height 100ms linear;
}

#scroll-diamond {
    position: absolute;
    bottom: -2px;
    left: -1.5px;
    width: 4px;
    height: 4px;
    background: var(--molten-gold);
    transform: rotate(45deg);
}

/* ========== STRATUM 0 — THE VOID ========== */

#stratum-0 {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--carbon-void);
    position: relative;
}

.stratum-0-content {
    text-align: center;
    position: relative;
}

#hero-kanji {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    font-size: clamp(5rem, 15vw, 12rem);
    color: var(--molten-gold);
    letter-spacing: 0.08em;
    text-shadow: 0 0 60px rgba(201, 168, 76, 0.12), 0 0 120px rgba(201, 168, 76, 0.06);
    animation: heroPulse 4s ease-in-out infinite;
    line-height: 1.1;
}

@keyframes heroPulse {
    0%, 100% { text-shadow: 0 0 60px rgba(201, 168, 76, 0.1), 0 0 120px rgba(201, 168, 76, 0.05); }
    50% { text-shadow: 0 0 60px rgba(201, 168, 76, 0.25), 0 0 120px rgba(201, 168, 76, 0.12), 0 0 200px rgba(201, 168, 76, 0.06); }
}

#hero-domain {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    color: var(--diamond-light);
    letter-spacing: 0.3em;
    margin-top: 1.5rem;
    text-transform: uppercase;
}

#scroll-indicator {
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#scroll-line {
    width: 1px;
    height: 40px;
    background: rgba(201, 168, 76, 0.25);
}

#scroll-indicator-diamond {
    width: 4px;
    height: 4px;
    background: rgba(201, 168, 76, 0.4);
    transform: rotate(45deg);
    animation: indicatorPulse 2s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ========== STRATUM HEADINGS ========== */

.stratum-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    letter-spacing: 0.04em;
    line-height: 1.2;
    color: var(--molten-gold);
    text-align: center;
    padding: clamp(40px, 6vw, 80px) 0 clamp(24px, 4vw, 48px);
    text-transform: uppercase;
}

/* ========== MASONRY GRID ========== */

.masonry-grid {
    columns: 3;
    column-gap: clamp(12px, 2vw, 24px);
    padding: 0 clamp(20px, 4vw, 60px);
    max-width: 1400px;
    margin: 0 auto;
}

.masonry-block {
    break-inside: avoid;
    margin-bottom: clamp(12px, 2vw, 24px);
    background: var(--graphite);
    padding: clamp(20px, 3vw, 40px);
    border: 1px solid transparent;
    opacity: 0;
    transition: opacity 0.1s ease, border-color 1.2s ease-in-out;
}

.masonry-block.visible {
    opacity: 1;
    animation: crystallize 1.2s ease-in-out forwards;
}

@keyframes crystallize {
    0% { border-color: transparent; }
    15% { border-color: var(--molten-gold); }
    100% { border-color: var(--ash); }
}

.masonry-block p {
    color: var(--diamond-light);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    line-height: 1.75;
}

.block-tall {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-wide {
    column-span: none;
}

.mono-accent {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85em;
    color: var(--stellar-teal);
}

/* ========== NATURE MOTIFS ========== */

.nature-motif {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nature-motif svg {
    width: 100%;
    max-width: 180px;
    height: auto;
}

.nature-motif-visible svg {
    max-width: 160px;
}

/* ========== STRATUM 1 — SOOT AND ORIGIN ========== */

#stratum-1 {
    background: var(--carbon-void);
    min-height: 120vh;
    padding-bottom: clamp(40px, 6vw, 80px);
    position: relative;
}

/* ========== STRATUM 2 — PRESSURE ========== */

#stratum-2 {
    background: linear-gradient(180deg, var(--carbon-void) 0%, var(--graphite) 100%);
    min-height: 100vh;
    padding-bottom: clamp(40px, 6vw, 80px);
    position: relative;
}

.masonry-compressed {
    column-gap: clamp(8px, 1.2vw, 16px);
}

#stratum-2 .masonry-block {
    border-color: transparent;
}

#stratum-2 .masonry-block.visible {
    animation: crystallizeSubtle 1.2s ease-in-out forwards;
}

@keyframes crystallizeSubtle {
    0% { border-color: transparent; }
    15% { border-color: var(--molten-gold); }
    100% { border-color: rgba(58, 58, 58, 0.5); }
}

/* ========== STRATUM 3 — CRYSTALLIZATION ========== */

#stratum-3 {
    background: var(--pressure-blue);
    min-height: 120vh;
    padding-bottom: clamp(40px, 6vw, 80px);
    position: relative;
}

.masonry-crystallized {
    column-gap: clamp(16px, 2.5vw, 32px);
}

.crystal-shard {
    box-shadow: inset 0 0 40px rgba(201, 168, 76, 0.03);
    background: rgba(26, 26, 31, 0.8);
}

.shard-1 { clip-path: polygon(5% 0%, 95% 0%, 100% 8%, 100% 92%, 95% 100%, 5% 100%, 0% 92%, 0% 8%); }
.shard-2 { clip-path: polygon(0% 3%, 100% 0%, 97% 100%, 3% 97%); }
.shard-3 { clip-path: polygon(8% 0%, 100% 5%, 92% 100%, 0% 95%); }
.shard-4 { clip-path: polygon(0% 0%, 100% 4%, 96% 100%, 4% 96%); }
.shard-5 { clip-path: polygon(3% 0%, 97% 0%, 100% 5%, 100% 95%, 97% 100%, 3% 100%, 0% 95%, 0% 5%); }
.shard-6 { clip-path: polygon(5% 0%, 95% 3%, 100% 100%, 0% 97%); }
.shard-7 { clip-path: polygon(0% 0%, 100% 0%, 95% 100%, 5% 95%); }
.shard-8 { clip-path: polygon(4% 0%, 96% 0%, 100% 6%, 100% 94%, 96% 100%, 4% 100%, 0% 94%, 0% 6%); }

#stratum-3 .masonry-block.visible {
    animation: crystallizeRadiant 1.2s ease-in-out forwards;
}

@keyframes crystallizeRadiant {
    0% { border-color: transparent; box-shadow: inset 0 0 40px rgba(201, 168, 76, 0.03); }
    15% { border-color: var(--candlelight); box-shadow: inset 0 0 60px rgba(201, 168, 76, 0.08); }
    100% { border-color: rgba(201, 168, 76, 0.15); box-shadow: inset 0 0 40px rgba(201, 168, 76, 0.03); }
}

/* ========== STRATUM 4 — RADIANCE ========== */

#stratum-4 {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--carbon-void);
    position: relative;
    overflow: hidden;
}

.stratum-4-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

#radiance-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150vmax;
    height: 150vmax;
    background: radial-gradient(ellipse at center, rgba(201, 168, 76, 0.09) 0%, rgba(201, 168, 76, 0.03) 30%, transparent 70%);
    opacity: 0;
    transition: opacity 3s ease-in-out;
    z-index: 1;
    pointer-events: none;
}

#radiance-glow.active {
    opacity: 1;
}

#final-kanji {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    font-size: clamp(6rem, 18vw, 14rem);
    -webkit-text-stroke: 1px rgba(201, 168, 76, 0.25);
    color: transparent;
    letter-spacing: 0.08em;
    line-height: 1.1;
    position: relative;
    z-index: 2;
}

#final-domain {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    color: var(--diamond-light);
    letter-spacing: 0.08em;
    margin-top: 1rem;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 1024px) {
    .masonry-grid {
        columns: 2;
    }
}

@media (max-width: 640px) {
    .masonry-grid {
        columns: 1;
    }

    .crystal-shard {
        clip-path: none;
    }

    #scroll-progress {
        right: 8px;
    }
}

/* ========== BOKEH KEYFRAMES ========== */

@keyframes bokehDrift1 {
    0% { transform: translate(0, 0); }
    33% { transform: translate(40px, -30px); }
    66% { transform: translate(-20px, 20px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokehDrift2 {
    0% { transform: translate(0, 0); }
    33% { transform: translate(-50px, 25px); }
    66% { transform: translate(30px, -40px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokehDrift3 {
    0% { transform: translate(0, 0); }
    33% { transform: translate(25px, 45px); }
    66% { transform: translate(-35px, -15px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokehDrift4 {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-30px, -50px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokehDrift5 {
    0% { transform: translate(0, 0); }
    50% { transform: translate(45px, 30px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokehDrift6 {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-20px, 35px); }
    75% { transform: translate(35px, -25px); }
    100% { transform: translate(0, 0); }
}