/* ============================================
   SSETTL.com v2 — Wabi-sabi Settling
   ============================================ */

/* --- Reset & Base --- */

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

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

body {
    background-color: #f7f3eb;
    color: #5a5048;
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.85;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Filters (hidden) --- */

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Scroll Progress Indicator --- */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 1px;
    width: 0%;
    background-color: #c4b5a2;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.scroll-progress.visible {
    opacity: 1;
}

/* --- Sediment Canvas --- */

#sedimentCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* --- Typography --- */

.display-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 5vw, 5rem);
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: #3d362e;
    line-height: 1;
}

.body-text {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.85;
    color: #5a5048;
    max-width: 38rem;
}

.body-text em {
    font-style: italic;
    letter-spacing: 0.02em;
}

.margin-note {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: #a89b8c;
    margin-bottom: 1.2rem;
    text-transform: lowercase;
}

.celadon-word {
    color: #7b8c6a;
}

/* --- Opening Viewport --- */

.opening {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 30vh;
    background-color: #f7f3eb;
    position: relative;
}

.opening-title {
    text-align: center;
    position: relative;
}

.hairline {
    position: absolute;
    left: 50%;
    top: calc(100% + 1.5rem);
    transform: translateX(-50%);
    height: 0.5px;
    width: 0;
    background-color: #a89b8c;
    transition: width 3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.hairline.extended {
    width: 40vw;
}

/* --- Content Islands --- */

.phase {
    position: relative;
}

.content-island {
    position: relative;
    padding: 2rem 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 1200ms cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 1200ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.content-island.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Phase 1: Suspension — left-of-center, shorter lines --- */

.phase-suspension .content-island {
    margin-left: 15%;
    margin-right: auto;
}

.short-line {
    max-width: 28rem;
    font-size: 1.1rem;
}

.island-1 {
    margin-left: 12% !important;
}

.island-1 .body-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.6;
    letter-spacing: 0.04em;
    color: #3d362e;
}

.island-2 {
    margin-left: 18% !important;
}

.island-3 {
    margin-left: 10% !important;
}

/* --- Phase 2: Descent — drifting rightward, mid-width lines --- */

.phase-descent .content-island {
    margin-left: 25%;
    margin-right: auto;
}

.mid-line {
    max-width: 34rem;
}

.island-4 {
    margin-left: 20% !important;
}

.island-5 {
    margin-left: 30% !important;
}

.island-6 {
    margin-left: 22% !important;
}

.island-7 {
    margin-left: 35% !important;
}

/* --- Phase 3: Rest — lower-right, wide lines --- */

.phase-rest .content-island {
    margin-left: 35%;
    margin-right: 8%;
}

.wide-line {
    max-width: 40rem;
}

.island-8 {
    margin-left: 30% !important;
}

.island-9 {
    margin-left: 38% !important;
}

.island-10 {
    margin-left: 40% !important;
}

.island-11 {
    margin-left: 42% !important;
}

.last-words {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    letter-spacing: 0.06em;
    color: #3d362e;
    line-height: 1.6;
}

/* --- Crackle-Glaze Texture --- */

.has-crackle {
    position: relative;
}

.has-crackle::before {
    content: '';
    position: absolute;
    inset: -1rem;
    background: #e8e0d2;
    filter: url(#crackleGlaze);
    opacity: 0.06;
    pointer-events: none;
    border-radius: 2px;
    z-index: -1;
}

/* --- Ink-wash Gradient Backgrounds --- */

.phase-suspension {
    background: radial-gradient(ellipse 300% 200% at 20% 30%, #f7f3eb, #faf8f4);
}

.phase-descent {
    background: radial-gradient(ellipse 400% 300% at 60% 40%, #faf8f4, #f7f3eb);
}

.phase-rest {
    background: radial-gradient(ellipse 350% 250% at 80% 60%, #f7f3eb, #faf8f4);
}

/* --- Kintsugi Seams --- */

.kintsugi-seam {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 0 auto;
    overflow: visible;
}

.kintsugi-1 {
    max-width: 400px;
    margin-left: 20%;
}

.kintsugi-2 {
    max-width: 300px;
    margin-left: 35%;
}

.kintsugi-3 {
    max-width: 500px;
    margin-left: 25%;
}

.kintsugi-4 {
    max-width: 350px;
    margin-left: 45%;
}

/* --- Spacers --- */

.spacer-10vh { height: 10vh; }
.spacer-30vh { height: 30vh; }
.spacer-35vh { height: 35vh; }
.spacer-40vh { height: 40vh; }
.spacer-50vh { height: 50vh; }
.spacer-80vh { height: 80vh; }

/* --- Terminal Dot --- */

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid #7b8c6a;
    background: transparent;
    margin: 0 auto;
}

/* --- Responsive (Mobile) --- */

@media (max-width: 768px) {

    .phase-suspension .content-island,
    .phase-descent .content-island,
    .phase-rest .content-island,
    .island-1, .island-2, .island-3,
    .island-4, .island-5, .island-6, .island-7,
    .island-8, .island-9, .island-10, .island-11 {
        margin-left: 1.5rem !important;
        margin-right: 1.5rem !important;
    }

    .short-line,
    .mid-line,
    .wide-line {
        max-width: 100%;
    }

    .body-text {
        max-width: 100%;
    }

    .kintsugi-seam {
        display: none;
    }

    .kintsugi-1,
    .kintsugi-2,
    .kintsugi-3,
    .kintsugi-4 {
        display: none;
    }

    .opening {
        padding-bottom: 35vh;
    }

    .display-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    .spacer-50vh { height: 30vh; }
    .spacer-80vh { height: 50vh; }
    .spacer-40vh { height: 25vh; }
    .spacer-35vh { height: 20vh; }
}

@media (max-width: 480px) {
    .display-title {
        font-size: clamp(1.8rem, 10vw, 3rem);
    }
}
