/* ============================================
   tanso.center — styles.css
   Burgundy-cream, japanese-minimal, masonry
   ============================================ */

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

:root {
    --bg-primary: #1a1416;
    --bg-secondary: #2a2024;
    --accent-primary: #6b2737;
    --accent-secondary: #8a3a4a;
    --text-primary: #f5efe6;
    --text-secondary: #e8dfd4;
    --highlight: #c4848f;
    --atmospheric: #3d1a28;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.85;
    overflow-x: hidden;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: fixed;
    left: 0;
    top: 0;
    width: 2px;
    height: 0%;
    background: var(--accent-primary);
    z-index: 50;
    transition: height 0.1s linear;
}

/* --- Aurora Layer --- */
.aurora-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.aurora-ring {
    position: absolute;
    width: 150vmax;
    height: 150vmax;
    border-radius: 50%;
    will-change: transform;
}

.aurora-ring-1 {
    top: -50%;
    left: -25%;
    background: conic-gradient(from 0deg at 25% 60%, transparent 0%, rgba(107,39,55,0.08) 25%, transparent 50%, rgba(196,132,143,0.05) 75%, transparent 100%);
    animation: aurora-spin-1 20s linear infinite;
}

.aurora-ring-2 {
    top: -40%;
    left: 0%;
    background: conic-gradient(from 120deg at 75% 30%, transparent 0%, rgba(196,132,143,0.05) 30%, transparent 55%, rgba(107,39,55,0.06) 80%, transparent 100%);
    animation: aurora-spin-2 35s linear infinite;
}

.aurora-ring-3 {
    top: -30%;
    left: -20%;
    background: conic-gradient(from 240deg at 50% 80%, transparent 0%, rgba(107,39,55,0.07) 20%, transparent 45%, rgba(196,132,143,0.04) 70%, transparent 100%);
    animation: aurora-spin-3 50s linear infinite;
}

@keyframes aurora-spin-1 {
    to { transform: rotate(360deg); }
}
@keyframes aurora-spin-2 {
    to { transform: rotate(-360deg); }
}
@keyframes aurora-spin-3 {
    to { transform: rotate(360deg); }
}

/* --- Main Layout --- */
.carbon-descent {
    position: relative;
    z-index: 2;
}

/* --- Kiln Chambers --- */
.kiln-chamber {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--atmospheric);
    position: relative;
    overflow: hidden;
}

.kiln-chamber::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, var(--atmospheric) 80%);
    z-index: 1;
}

.sumi-e-illustration {
    width: clamp(200px, 40vw, 380px);
    height: auto;
    position: relative;
    z-index: 2;
    filter: url(#glow1);
}

.kiln-crystal .sumi-e-illustration { filter: url(#glow2); }
.kiln-biological .sumi-e-illustration { filter: url(#glow3); }
.kiln-atmospheric .sumi-e-illustration { filter: url(#glow4); }
.kiln-cosmic .sumi-e-illustration { filter: url(#glow5); }

/* Sumi-e drawing animation */
.sumi-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sumi-path.drawn {
    stroke-dashoffset: 0;
}

.site-title {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: 2rem;
}

.site-title .kanji {
    display: block;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 10rem);
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: 0.1em;
}

.site-title .romanji {
    display: block;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--accent-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.site-subtitle {
    position: relative;
    z-index: 2;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--accent-secondary);
    margin-top: 1rem;
    text-transform: lowercase;
}

.chamber-title {
    position: relative;
    z-index: 2;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--text-primary);
    margin-top: 2rem;
    text-align: center;
    line-height: 1;
}

.romanji-small {
    display: block;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    color: var(--accent-secondary);
    letter-spacing: 0.25em;
    margin-top: 0.5rem;
}

/* --- Masonry Clusters --- */
.masonry-cluster {
    column-count: 3;
    column-gap: clamp(1rem, 2.5vw, 2.5rem);
    padding: clamp(2rem, 4vw, 4rem) clamp(1rem, 3vw, 3rem);
    content-visibility: auto;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: clamp(1rem, 2.5vw, 2.5rem);
    padding: clamp(1.5rem, 2.5vw, 2.5rem);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.masonry-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.masonry-item[data-depth="1"] {
    background: var(--bg-primary);
    min-height: 180px;
}

.masonry-item[data-depth="2"] {
    background: var(--bg-secondary);
    min-height: 220px;
}

.masonry-item[data-depth="3"] {
    background: var(--atmospheric);
    min-height: 260px;
}

/* Aurora bleed on depth-3 items */
.masonry-item[data-depth="3"]::after {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(ellipse at 50% 50%, rgba(107,39,55,0.15), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.masonry-item.tall {
    min-height: 340px;
}

.masonry-item .label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
}

.masonry-item h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: -0.02em;
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.masonry-item p {
    color: rgba(232, 223, 212, 0.85);
    position: relative;
    z-index: 1;
}

.masonry-item p + p {
    margin-top: 1em;
}

/* --- Ripple Effect --- */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(107, 39, 55, 0.4);
    transform: scale(0);
    animation: ripple-expand 800ms ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes ripple-expand {
    from {
        transform: scale(0);
        opacity: 0.6;
    }
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* --- Lens Flare --- */
.lens-flare {
    position: absolute;
    border-radius: 50%;
    background: var(--highlight);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 3;
    filter: blur(8px);
    opacity: 0.2;
    animation: flare-pulse 8s ease-in-out infinite;
}

@keyframes flare-pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

/* --- Sumi-e glow pulse --- */
@keyframes glow-pulse {
    0%, 100% { filter: blur(2px); }
    50% { filter: blur(6px); }
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .masonry-cluster {
        column-count: 1;
    }

    .masonry-item h2 {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .site-title .kanji {
        font-size: clamp(3rem, 15vw, 6rem);
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .masonry-cluster {
        column-count: 2;
    }
}
