/* =====================================================
   simai.quest — Corporate Reverie Design System
   Chamber III: No borders between columns — negative space defines them.
   Grain: repeating (2% opacity) noise-overlay base64 encoded `<img>` using `<feTurbulence>`
   SC" (Google Fonts) Playfair Display SC
   `position: absolute` behind the text column
   ===================================================== */

/* --- Color Variables --- */
:root {
    --ash-field:    #E8E6E0;
    --carbon:       #1C1A18;
    --ash-ink:      #2A2620;
    --linen:        #F0EDE8;
    --slate-ash:    #5A5450;
    --dust:         #9A9490;
    --ruled-line:   #B8B0A4;
    --pale-field:   #D4CFCA;
    --amber-trace:  #C8A882;
    --cold-blue:    #7AACCC;
    --near-black:   #141210;
    --edeae4:       #EDEAE4;
    --grid-stroke:  #3A3830;
}

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

html {
    font-size: 16px;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scrollbar-width: none;
    height: 100%;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background-color: var(--ash-field);
    color: var(--ash-ink);
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* --- Grain Membrane (full-page analog texture) --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><filter id='noise'><feTurbulence baseFrequency='0.65' numOctaves='3'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23noise)'/></svg>");
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

/* --- Scroll Container --- */
#scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

#scroll-container::-webkit-scrollbar {
    display: none;
}

/* --- Chambers --- */
.chamber {
    height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chamber-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* =====================================================
   Chamber I: Threshold
   ===================================================== */
.chamber-threshold {
    background-color: var(--ash-field);
}

.logotype {
    font-family: 'Playfair Display SC', serif;
    font-size: 96px;
    font-weight: 400;
    color: var(--ash-ink);
    letter-spacing: 0.08em;
    line-height: 1;
    text-align: center;
    margin-bottom: 32px;
}

.rule-extend {
    width: 0;
    height: 1px;
    background: var(--ruled-line);
    margin: 0 auto;
    animation: extend-rule 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s forwards;
}

@keyframes extend-rule {
    to {
        width: 320px;
    }
}

/* =====================================================
   Chamber II: Signal
   ===================================================== */
.chamber-signal {
    background-color: var(--carbon);
}

.arch-grid-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.arch-grid {
    width: 100%;
    height: 100%;
    opacity: 1;
}

.grid-lines line {
    stroke: var(--grid-stroke);
    stroke-width: 1px;
    opacity: 0.4;
}

.signal-text {
    position: relative;
    z-index: 2;
    max-width: 45ch;
    text-align: center;
    color: var(--linen);
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.04em;
}

.signal-text p + p {
    margin-top: 1.5em;
}

/* =====================================================
   Chamber III: Structure
   ===================================================== */
.chamber-structure {
    background-color: var(--edeae4);
}

/* Faint grain (already covered by body::before) */

.type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 80px;
    max-width: 900px;
    width: 90%;
    align-items: start;
    padding: 40px 0;
}

.type-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--ash-ink);
}

.type-col-1 { padding-top: 0; }
.type-col-2 { padding-top: 60px; }
.type-col-3 { padding-top: 20px; }

.type-col span {
    font-family: 'Playfair Display SC', serif;
    font-weight: 400;
    color: var(--ash-ink);
    line-height: 1.1;
    display: block;
}

.t-14 { font-size: 14px; color: var(--dust); font-family: 'Cormorant Garamond', serif; font-style: italic; letter-spacing: 0.08em; }
.t-16 { font-size: 16px; color: var(--slate-ash); }
.t-28 { font-size: 28px; }
.t-36 { font-size: 36px; }
.t-48 { font-size: 48px; }

/* =====================================================
   Chamber IV: Disruption
   ===================================================== */
.chamber-disruption {
    background-color: var(--near-black);
    color: var(--linen);
}

.glitch-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Glitch bands — each clips a horizontal strip */
.band-top,
.band-mid,
.band-low {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
    will-change: transform;
}

.band-top {
    clip-path: inset(0 0 66% 0);
}

.band-mid {
    clip-path: inset(33% 0 33% 0);
}

.band-low {
    clip-path: inset(66% 0 0 0);
}

.disruption-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-style: italic;
    color: var(--linen);
    max-width: 45ch;
    text-align: center;
    line-height: 1.6;
}

/* Chromatic aberration applied during glitch */
.glitch-active .disruption-text {
    text-shadow: -2px 0 var(--amber-trace), 2px 0 var(--cold-blue);
}

/* Central unmoved text */
.disruption-center {
    position: relative;
    z-index: 2;
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-style: italic;
    color: var(--linen);
    max-width: 45ch;
    text-align: center;
    line-height: 1.6;
}

/* =====================================================
   Chamber V: Resolution
   ===================================================== */
.chamber-resolution {
    background-color: var(--ash-field);
}

.resolution-statement {
    font-family: 'Playfair Display SC', serif;
    font-size: 48px;
    font-weight: 400;
    color: var(--ash-ink);
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-align: center;
    margin-bottom: 48px;
}

.contact-line {
    font-family: 'Cormorant Garamond', serif;
    font-size: 14px;
    font-weight: 300;
    color: var(--dust);
    letter-spacing: 0.08em;
    text-align: center;
}

/* =====================================================
   Elastic Entry Reveals (IntersectionObserver)
   ===================================================== */
.elastic-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 600ms ease, transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 768px) {
    .logotype {
        font-size: 64px;
    }

    .resolution-statement {
        font-size: 32px;
        letter-spacing: 0.08em;
    }

    .type-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .type-col-2,
    .type-col-3 {
        padding-top: 0;
    }

    .t-48 { font-size: 36px; }
    .t-36 { font-size: 28px; }
    .t-28 { font-size: 22px; }

    .signal-text {
        font-size: 16px;
        padding: 0 24px;
    }
}
