/* ============================================================
   okurairi.com — dark-academia diagonal playground
   Palette: #E0D0E8, #B0A0C0, #D080A0, #40A0E0, #1A1420,
            #201828, #D0B070, #E04080
   Fonts:   Syne (500,700), Nunito (300,400), Caveat (400)
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    background: #1A1420;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: #B0A0C0;
    background: #1A1420;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, .section-heading, .gate-title, .exit-heading {
    font-family: 'Syne', sans-serif;
    color: #E0D0E8;
}

.chat-label {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    color: #D080A0;
    font-size: 1.1rem;
}

/* --- Bubble Floaters --- */
#bubble-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(208,128,160,0.08), rgba(64,160,224,0.04));
    border: 1px solid rgba(208,128,160,0.06);
    animation: rise var(--rise-dur, 15s) ease-in-out infinite;
    animation-delay: var(--rise-delay, 0s);
    opacity: 0;
}

@keyframes rise {
    0% {
        transform: translateY(0) translateX(0) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.06;
    }
    50% {
        opacity: 0.06;
        transform: translateY(-40vh) translateX(var(--drift, 20px)) scale(1);
    }
    90% {
        opacity: 0.03;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--drift, 20px)) scale(0.6);
        opacity: 0;
    }
}

/* --- Diagonal Section System --- */
.diagonal-section {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 8vh 0;
}

.diagonal-section:nth-child(odd) {
    background: #1A1420;
}

.diagonal-section:nth-child(even) {
    background: #201828;
}

/* Chromatic gradient overlay for palette journey */
.stacks-section::before,
.reading-section::before,
.manifesto-section::before,
.collection-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.stacks-section::before {
    background: linear-gradient(165deg, rgba(208,128,160,0.03) 0%, transparent 50%);
}

.reading-section::before {
    background: linear-gradient(195deg, rgba(64,160,224,0.02) 0%, transparent 50%);
}

.manifesto-section::before {
    background: linear-gradient(170deg, rgba(208,176,112,0.03) 0%, transparent 50%);
}

.collection-section::before {
    background: linear-gradient(185deg, rgba(224,64,128,0.02) 0%, transparent 50%);
}

/* Angled clips — staggered for rhythm */
.stacks-section {
    clip-path: polygon(0 0, 100% 4vh, 100% 100%, 0 calc(100% - 4vh));
    padding: 12vh 0 10vh;
}

.reading-section {
    clip-path: polygon(0 3vh, 100% 0, 100% calc(100% - 3vh), 0 100%);
    padding: 11vh 0 10vh;
}

.manifesto-section {
    clip-path: polygon(0 0, 100% 5vh, 100% 100%, 0 calc(100% - 5vh));
    padding: 10vh 0 9vh;
}

.collection-section {
    clip-path: polygon(0 4vh, 100% 0, 100% calc(100% - 4vh), 0 100%);
    padding: 12vh 0 11vh;
}

.exit-section {
    clip-path: polygon(0 0, 100% 3vh, 100% 100%, 0 100%);
    padding: 10vh 0 6vh;
}

/* --- Section Interior --- */
.section-interior {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 4vw, 4rem);
    position: relative;
    z-index: 1;
}

/* --- Section Headings --- */
.section-heading {
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    animation: kinetic-spacing 4s ease-in-out infinite alternate;
    margin-bottom: 0.4em;
}

@keyframes kinetic-spacing {
    0% { letter-spacing: -0.02em; }
    100% { letter-spacing: 0.02em; }
}

/* ============================================================
   SECTION 0: Gate
   ============================================================ */
.gate-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    background: #1A1420;
    overflow: hidden;
}

.gate-inner {
    position: relative;
    z-index: 2;
    padding-left: clamp(2rem, 8vw, 10rem);
    padding-right: 2rem;
    max-width: 80%;
}

.gate-title {
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #E0D0E8;
    margin-bottom: 0.3em;
    position: relative;
}

.gate-title .letter-kinetic {
    display: inline-block;
    animation: kinetic-spacing 4s ease-in-out infinite alternate;
}

.gate-title .letter-dot {
    display: inline-block;
    color: #D0B070;
}

.gate-whisper {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.3vw, 1.2rem);
    color: #B0A0C0;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.gate-chat {
    display: block;
    margin-top: 0.5rem;
    font-size: 1.25rem;
}

/* Diagonal accent stripe across gate */
.gate-diagonal-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(155deg, transparent 0%, rgba(208,128,160,0.03) 40%, rgba(64,160,224,0.02) 70%, transparent 100%);
    clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
    z-index: 1;
    pointer-events: none;
}

/* ============================================================
   SECTION 1: The Stacks
   ============================================================ */
.stacks-layout {
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: clamp(2rem, 4vw, 5rem);
    align-items: start;
}

.stacks-heading-col {
    position: sticky;
    top: 20vh;
}

.stacks-heading-col .chat-label {
    display: block;
    margin-top: 0.8rem;
}

.stacks-card-cluster {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* --- Inspect Cards --- */
.inspect-card {
    background: rgba(32, 24, 40, 0.7);
    border: 1px solid rgba(176, 160, 192, 0.1);
    padding: clamp(1.2rem, 2vw, 2rem);
    position: relative;
    transition: transform 250ms ease-out, box-shadow 250ms ease-out, border-color 250ms ease-out;
    cursor: default;
}

.inspect-card:hover {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 12px 40px rgba(26, 20, 32, 0.6), 0 0 0 1px rgba(208, 128, 160, 0.15);
    border-color: rgba(208, 128, 160, 0.2);
}

.inspect-card h3 {
    font-family: 'Syne', sans-serif;
    font-weight: 500;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: #E0D0E8;
    margin-bottom: 0.6em;
}

.inspect-card p {
    color: #B0A0C0;
    margin-bottom: 0.8em;
}

.inspect-card .chat-label {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Card accent bars — top edge colored strips */
.card-accent-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: #D080A0;
}

.card-accent-bar.accent-teal {
    background: #40A0E0;
}

.card-accent-bar.accent-gold {
    background: #D0B070;
}

/* Stagger the cards off-center */
.card-a {
    margin-right: 15%;
}

.card-b {
    margin-left: 10%;
    margin-right: 5%;
}

.card-c {
    margin-right: 20%;
}

/* ============================================================
   SECTION 2: The Reading Room
   ============================================================ */
.reading-layout {
    display: grid;
    grid-template-columns: 1fr 30%;
    gap: clamp(2rem, 5vw, 6rem);
    align-items: start;
}

.reading-text-mass .section-heading {
    margin-bottom: 0.6em;
}

.reading-body {
    margin-bottom: 1.4em;
    max-width: 42em;
}

.reading-text-mass .chat-label {
    display: block;
    margin-top: 0.5rem;
}

.reading-aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 3rem;
}

.aside-glyph-block {
    width: 120px;
    opacity: 0.6;
    transition: opacity 400ms ease, transform 400ms ease;
}

.aside-glyph-block:hover {
    opacity: 1;
    transform: scale(1.08);
}

.aside-glyph {
    width: 100%;
    height: auto;
}

.aside-caption {
    font-family: 'Caveat', cursive;
    color: #D080A0;
    font-size: 0.95rem;
    margin-top: 1rem;
    text-align: center;
    opacity: 0.7;
}

/* ============================================================
   SECTION 3: The Diagonal Manifesto
   ============================================================ */
.manifesto-layout {
    max-width: 800px;
    text-align: left;
    padding-left: clamp(2rem, 10vw, 12rem);
}

.manifesto-rule-top,
.manifesto-rule-bottom {
    height: 1px;
    background: linear-gradient(90deg, #D080A0, transparent 80%);
    opacity: 0.3;
    margin: 1.5rem 0;
}

.manifesto-text {
    border: none;
    padding: 0;
    margin: 0;
}

.manifesto-text p {
    font-family: 'Syne', sans-serif;
    font-weight: 500;
    font-size: clamp(1.2rem, 2.4vw, 1.8rem);
    line-height: 1.6;
    color: #E0D0E8;
    letter-spacing: 0.01em;
}

.manifesto-attr {
    display: block;
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* ============================================================
   SECTION 4: The Collection — scattered layout
   ============================================================ */
.collection-layout {
    position: relative;
}

.collection-layout > .section-heading {
    margin-bottom: 0.3em;
}

.collection-layout > .chat-label {
    display: block;
    margin-bottom: 3rem;
}

.collection-scatter {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto;
    gap: 1.5rem;
    min-height: 50vh;
}

/* Deliberately uneven placement */
.si-1 {
    grid-column: 1 / 6;
    grid-row: 1;
}

.si-2 {
    grid-column: 7 / 12;
    grid-row: 1;
    margin-top: 4rem;
}

.si-3 {
    grid-column: 2 / 7;
    grid-row: 2;
    margin-top: -1rem;
}

.si-4 {
    grid-column: 8 / 13;
    grid-row: 2;
}

.si-5 {
    grid-column: 3 / 9;
    grid-row: 3;
    margin-top: -0.5rem;
}

/* ============================================================
   SECTION 5: Exit
   ============================================================ */
.exit-section {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #1A1420;
}

.exit-inner {
    padding: 2rem;
}

.exit-heading {
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    animation: kinetic-spacing 4s ease-in-out infinite alternate;
    margin-bottom: 0.5em;
}

.exit-inner .chat-label {
    display: block;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.exit-sigil {
    width: 60px;
    margin: 0 auto;
    opacity: 0.5;
    transition: opacity 600ms ease, transform 600ms ease;
}

.exit-sigil:hover {
    opacity: 0.8;
    transform: rotate(45deg);
}

.exit-sigil svg {
    width: 100%;
    height: auto;
}

/* ============================================================
   Glitch Effect (applied via JS class)
   ============================================================ */
.glitch-active {
    text-shadow: -3px 0 #E04080, 3px 0 #40A0E0;
    animation: glitch-shake 200ms steps(3) forwards;
}

@keyframes glitch-shake {
    0% { transform: translate(0); }
    25% { transform: translate(-2px, 1px); }
    50% { transform: translate(2px, -1px); }
    75% { transform: translate(-1px, 2px); }
    100% { transform: translate(0); }
}

/* ============================================================
   Scroll-reveal (set by JS)
   ============================================================ */
.diagonal-section.js-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.diagonal-section.js-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.gate-section.js-reveal {
    opacity: 1;
    transform: none;
}

/* ============================================================
   Responsive adjustments
   ============================================================ */
@media (max-width: 768px) {
    .stacks-layout {
        grid-template-columns: 1fr;
    }

    .stacks-heading-col {
        position: relative;
        top: auto;
    }

    .card-a, .card-b, .card-c {
        margin-left: 0;
        margin-right: 0;
    }

    .reading-layout {
        grid-template-columns: 1fr;
    }

    .reading-aside {
        padding-top: 1rem;
    }

    .manifesto-layout {
        padding-left: clamp(1.5rem, 4vw, 3rem);
    }

    .collection-scatter {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .si-1, .si-2, .si-3, .si-4, .si-5 {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-top: 0;
    }

    .gate-inner {
        padding-left: clamp(1.5rem, 5vw, 3rem);
        max-width: 95%;
    }
}
