/* rinji.dev — Corporate Zen Dissolution */
/* Color Palette */
/* Corporate Bone: #e8e4df */
/* Moss Anchor: #2d4a3e */
/* Ember Signal: #a0522d */
/* Stone Bridge: #c9b99a */
/* Void Ground: #1a1f1c */
/* Ghost Text: #5a6b60 */
/* Paper White: #f5f0e8 */
/* Dark Text: #2c2c2c */
/* Light Text: #d4cfc6 */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Commissioner', sans-serif;
    background-color: #e8e4df;
    color: #2c2c2c;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   WASHI TEXTURE OVERLAY
   =========================== */
#washi-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ===========================
   LAYER 1: THE BOARDROOM
   =========================== */
#layer-1 {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #e8e4df;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: skewY(-0.15deg);
    overflow: hidden;
    z-index: 10;
}

.layer-1-content {
    text-align: center;
    transform: skewY(0.15deg);
}

.domain-name {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #2c2c2c;
    margin: 0;
}

.subtitle {
    font-family: 'Noto Sans JP', 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.08em;
    color: #5a6b60;
    margin-top: 0.8rem;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.subtitle.visible {
    opacity: 1;
}

/* ===========================
   LAYER 2: THE DISSOLUTION
   =========================== */
#layer-2 {
    position: relative;
    width: 100vw;
    min-height: 250vh;
    padding-block: 10vh;
    z-index: 5;
    transition: background-color 0.1s linear;
}

/* Grid Pattern Background */
.grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-image:
        linear-gradient(to right, rgba(201, 185, 154, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(201, 185, 154, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 1;
    clip-path: url(#erosion-clip);
}

.grid-pattern.visible {
    opacity: 1;
}

.grid-pattern.eroding {
    background-image:
        linear-gradient(to right, rgba(201, 185, 154, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(201, 185, 154, 0.12) 1px, transparent 1px);
    background-size: 60px 60px;
}

.erosion-svg {
    position: absolute;
    width: 0;
    height: 0;
}

/* Kanji Watermark */
.kanji-watermark {
    position: absolute;
    top: 20%;
    right: -5%;
    font-family: 'Noto Sans JP', serif;
    font-size: 40vw;
    font-weight: 300;
    opacity: 0;
    color: #c9b99a;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
    transition: opacity 0.5s ease;
    will-change: transform;
}

/* Text Fragments */
.fragment {
    position: relative;
    z-index: 10;
    max-width: 45%;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fragment.visible {
    opacity: 1;
}

.fragment p {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    letter-spacing: 0.005em;
    line-height: 1.65;
    color: #2c2c2c;
    transition: color 0.3s ease;
}

.fragment-1 {
    margin-left: 10%;
    margin-top: 8vh;
    box-shadow: 0 40px 80px rgba(26, 31, 28, 0.025);
}

.fragment-2 {
    margin-left: 45%;
    margin-top: 12vh;
    max-width: 40%;
    box-shadow: 0 60px 100px rgba(26, 31, 28, 0.03);
}

.fragment-2 p {
    font-weight: 200;
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    line-height: 1.8;
}

.fragment-3 {
    margin-left: 20%;
    margin-top: 15vh;
    max-width: 50%;
    box-shadow: 0 80px 120px rgba(26, 31, 28, 0.025);
}

.fragment-4 {
    margin-left: 55%;
    margin-top: 12vh;
    max-width: 38%;
    box-shadow: 0 50px 90px rgba(26, 31, 28, 0.03);
}

.fragment-4 p {
    font-weight: 200;
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    line-height: 1.8;
}

.fragment-5 {
    margin-left: 8%;
    margin-top: 15vh;
    max-width: 48%;
    box-shadow: 0 60px 100px rgba(26, 31, 28, 0.025);
}

/* Fragment states in dark zone */
.fragment.dark-zone p {
    color: #d4cfc6;
}

/* ===========================
   LAYER 3: THE GARDEN
   =========================== */
#layer-3 {
    position: relative;
    width: 100vw;
    min-height: 150vh;
    background-color: #1a1f1c;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 3;
}

/* Ambient glow - triadic blue-violet */
#layer-3::before {
    content: '';
    position: absolute;
    top: 30%;
    left: 40%;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, #3d2d5a08 0%, transparent 70%);
    pointer-events: none;
}

/* Breathing Circles */
.breathing-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.circle-1 {
    width: 200px;
    height: 200px;
    top: 15%;
    left: 20%;
    background: radial-gradient(circle, rgba(201, 185, 154, 0.04) 0%, transparent 70%);
    animation: breathe 6s ease-in-out infinite;
}

.circle-2 {
    width: 160px;
    height: 160px;
    top: 40%;
    right: 15%;
    background: radial-gradient(circle, rgba(201, 185, 154, 0.04) 0%, transparent 70%);
    animation: breathe 7.5s ease-in-out infinite;
}

.circle-3 {
    width: 120px;
    height: 120px;
    top: 65%;
    left: 35%;
    background: radial-gradient(circle, rgba(201, 185, 154, 0.04) 0%, transparent 70%);
    animation: breathe 9s ease-in-out infinite;
}

.circle-4 {
    width: 180px;
    height: 180px;
    top: 25%;
    right: 35%;
    background: radial-gradient(circle, rgba(201, 185, 154, 0.04) 0%, transparent 70%);
    animation: breathe 10.5s ease-in-out infinite;
}

.circle-5 {
    width: 100px;
    height: 100px;
    top: 75%;
    left: 60%;
    background: radial-gradient(circle, rgba(201, 185, 154, 0.04) 0%, transparent 70%);
    animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.04;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.06;
    }
}

/* Garden Content */
.garden-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
}

.haiku {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: clamp(1rem, 2vw, 1.5rem);
    line-height: 2;
    letter-spacing: 0.03em;
    color: #c9b99a;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.haiku.visible {
    opacity: 1;
}

/* Final Domain Name */
.final-domain {
    position: relative;
    z-index: 10;
    margin-top: 20vh;
    text-align: center;
}

.domain-ghost {
    font-family: 'Commissioner', sans-serif;
    font-weight: 100;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5a6b60;
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

.domain-ghost.visible {
    opacity: 0.6;
}

/* ===========================
   MIXED BLEND MODES
   =========================== */
#layer-2 .grid-pattern {
    mix-blend-mode: multiply;
}

#layer-3 .breathing-circle {
    mix-blend-mode: screen;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    .fragment {
        max-width: 80% !important;
        margin-left: 10% !important;
    }

    .fragment-2,
    .fragment-4 {
        margin-left: 15% !important;
    }

    .kanji-watermark {
        font-size: 60vw;
        right: -15%;
    }

    .circle-1 { width: 140px; height: 140px; }
    .circle-2 { width: 110px; height: 110px; }
    .circle-3 { width: 80px; height: 80px; }
    .circle-4 { width: 120px; height: 120px; }
    .circle-5 { width: 70px; height: 70px; }
}
