/* =========================================
   gur.al — Wabi-Sabi Ceramic Design System
   ========================================= */

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

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

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    color: #5C4A3A;
    background-color: #E8DCC8;
    overflow-x: hidden;
    position: relative;
}

/* --- Clay Grain Texture (CSS-only) --- */
body::before {
    content: '';
    position: fixed;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-conic-gradient(
            rgba(139, 115, 85, 0.04) 0% 25%,
            transparent 0% 50%
        ),
        radial-gradient(
            circle at 20% 50%,
            rgba(59, 47, 32, 0.02) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 20%,
            rgba(139, 115, 85, 0.015) 0%,
            transparent 40%
        );
    background-size: 4px 4px, 200px 200px, 300px 300px;
    will-change: transform;
}

/* --- Typography --- */
h1, h2, h3, .section-marker {
    font-family: 'Cormorant Garamond', serif;
}

.section-marker {
    font-family: 'Noto Sans Arabic', 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: #8B7355;
    display: block;
    margin-bottom: 1.5rem;
    letter-spacing: 0.15em;
    opacity: 0.6;
}

.section-marker-light {
    color: #C4956A;
}

/* --- Crackle Glaze SVG Overlays --- */
.crackle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.crackle-sparse {
    z-index: 1;
}

.crackle-medium {
    z-index: 2;
}

.crackle-fine {
    z-index: 3;
}

.crackle-overlay path {
    fill: none;
    stroke: #8B7355;
    stroke-width: 0.5;
    opacity: 0.2;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s cubic-bezier(0.4, 0, 0.2, 1);
}

.crackle-sparse path {
    stroke-width: 0.6;
    opacity: 0.18;
}

.crackle-medium path {
    stroke-width: 0.4;
    opacity: 0.15;
}

.crackle-fine path {
    stroke-width: 0.3;
    opacity: 0.12;
}

.crackle-kiln {
    position: absolute;
    z-index: 2;
}

.crackle-kiln path {
    stroke: #C4956A;
    stroke-width: 0.4;
    opacity: 0.15;
}

.crackle-overlay.revealed path,
.crackle-kiln.revealed path {
    stroke-dashoffset: 0;
}

/* --- Sections: General --- */
section {
    position: relative;
    z-index: 5;
}

.section-light {
    background-color: transparent;
}

.section-dark {
    background-color: #1E1A15;
    color: #F5EDE0;
    position: relative;
    overflow: hidden;
}

.section-offset-left {
    padding-left: 8%;
    padding-right: 4%;
}

.section-offset-right {
    padding-left: 4%;
    padding-right: 5%;
}

.section-offset-center {
    padding-left: 5%;
    padding-right: 5%;
}

/* --- Spacers (ma-negative-space) --- */
.section-spacer {
    height: 35vh;
}

.section-spacer-large {
    height: 45vh;
}

.section-spacer-final {
    height: 30vh;
}

.kiln-space {
    height: 8vh;
}

/* --- Section 0: Opening Void --- */
#opening-void {
    height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding-bottom: 25vh;
    padding-left: 10%;
    position: relative;
    z-index: 5;
}

.void-title-container {
    position: sticky;
    top: 65vh;
}

.void-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #3B2F20;
    letter-spacing: 0.12em;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.void-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.void-title.faded {
    opacity: 0.3;
    transition: opacity 0.8s cubic-bezier(0.0, 0, 0.2, 1);
}

/* --- Tokonoma Alcove --- */
.tokonoma-alcove {
    position: relative;
    border-left: 3px solid #6B8F71;
    padding-left: clamp(1.5rem, 3vw, 3rem);
    padding-top: 2rem;
    padding-bottom: 2rem;
    background: rgba(30, 26, 21, 0.04);
    max-width: 65%;
}

.tokonoma-alcove p {
    margin-bottom: 1.2rem;
    color: #5C4A3A;
}

.tokonoma-alcove p:last-of-type {
    margin-bottom: 0;
}

.tokonoma-centered {
    max-width: 50%;
    margin-left: auto;
    margin-right: auto;
    border-left: 3px solid #6B8F71;
    border-right: 3px solid #6B8F71;
    padding-right: clamp(1.5rem, 3vw, 3rem);
    text-align: center;
}

.tokonoma-seal {
    position: absolute;
    top: -12px;
    left: -12px;
    opacity: 0.5;
}

.tokonoma-centered .tokonoma-seal {
    left: -12px;
}

/* --- Section I: The Vessel --- */
#the-vessel {
    position: relative;
    z-index: 5;
}

#the-vessel .tokonoma-alcove {
    margin-left: 3%;
}

/* --- Section II: The Kiln --- */
#the-kiln {
    min-height: 120vh;
}

.kiln-phrase {
    max-width: 60%;
    margin-left: auto;
    padding-right: 8%;
}

.kiln-phrase p {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    line-height: 1.6;
    color: #F5EDE0;
    letter-spacing: 0.04em;
}

/* --- Section III: The Repair --- */
.repair-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    line-height: 1.5;
    color: #3B2F20;
    letter-spacing: 0.04em;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    display: block;
}

.repair-quote cite {
    display: block;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.9rem;
    font-style: normal;
    color: #8B7355;
    margin-top: 0.8rem;
    letter-spacing: 0.08em;
}

/* --- Kintsugi Dividers --- */
.kintsugi-divider {
    position: relative;
    z-index: 5;
    padding: 4vh 8%;
    opacity: 0.3;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kintsugi-divider.visible {
    opacity: 0.6;
}

.kintsugi-divider svg {
    width: 100%;
    height: 20px;
}

.kintsugi-line {
    fill: none;
    stroke: #C4956A;
    stroke-width: 1;
    opacity: 0.6;
}

.kintsugi-gold {
    fill: #C4956A;
    opacity: 0.8;
}

/* --- Section IV: The Shelf --- */
.shelf-content {
    max-width: 60%;
}

.shelf-statement {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: #3B2F20;
    letter-spacing: 0.06em;
    line-height: 1.5;
    margin-bottom: 4rem;
}

/* --- Ceramic Buttons (Shelf Cluster) --- */
.ceramic-buttons-cluster {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.ceramic-button {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(165deg, #F5EDE0, #E8DCC8);
    box-shadow:
        inset 0 1px 2px rgba(196, 149, 106, 0.3),
        0 3px 8px rgba(30, 26, 21, 0.15);
    cursor: pointer;
    transition: box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.ceramic-button:hover {
    box-shadow:
        inset 0 1px 2px rgba(196, 149, 106, 0.3),
        0 0 20px rgba(196, 149, 106, 0.25),
        0 3px 8px rgba(30, 26, 21, 0.15);
    transform: translateY(-2px);
}

.ceramic-btn-1 {
    background: linear-gradient(165deg, #E8DCC8, #C4956A);
}

.ceramic-btn-2 {
    background: linear-gradient(165deg, #6B8F71, #4A8B8B);
}

.ceramic-btn-3 {
    background: linear-gradient(165deg, #8B7355, #3B2F20);
}

.ceramic-btn-4 {
    background: linear-gradient(165deg, #F5EDE0, #8B7355);
}

/* --- Fixed Navigation --- */
.ceramic-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 100;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.ceramic-nav.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ceramic-nav-btn {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(165deg, #F5EDE0, #E8DCC8);
    box-shadow:
        inset 0 1px 2px rgba(196, 149, 106, 0.3),
        0 2px 6px rgba(30, 26, 21, 0.15);
    cursor: pointer;
    transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.ceramic-nav-btn:hover {
    box-shadow:
        inset 0 1px 2px rgba(196, 149, 106, 0.3),
        0 0 15px rgba(196, 149, 106, 0.3);
    transform: scale(1.3);
}

.ceramic-nav-btn.active {
    background: linear-gradient(165deg, #C4956A, #8B7355);
    width: 14px;
    height: 14px;
}

/* --- Content Reveal Animation --- */
.reveal-block {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* --- Shelf Shadows (content blocks) --- */
.tokonoma-alcove,
.kiln-phrase,
.shelf-content {
    box-shadow:
        12px 16px 40px rgba(74, 58, 42, 0.15),
        -4px -2px 20px rgba(139, 115, 85, 0.06);
    padding: 2rem clamp(1.5rem, 3vw, 3rem);
    border-radius: 2px;
}

.kiln-phrase {
    background: rgba(245, 237, 224, 0.03);
    box-shadow:
        12px 16px 40px rgba(10, 8, 5, 0.2),
        -4px -2px 20px rgba(196, 149, 106, 0.05);
}

.shelf-content {
    background: rgba(30, 26, 21, 0.04);
    box-shadow:
        12px 16px 40px rgba(74, 58, 42, 0.12),
        -4px -2px 20px rgba(139, 115, 85, 0.05);
}

/* --- Links --- */
a {
    color: #6B8F71;
    text-decoration: none;
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

a:visited {
    color: #4A8B8B;
}

a:hover {
    color: #C4956A;
}

/* --- Selection --- */
::selection {
    background: rgba(196, 149, 106, 0.3);
    color: #3B2F20;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .tokonoma-alcove {
        max-width: 90%;
    }

    .tokonoma-centered {
        max-width: 90%;
    }

    .kiln-phrase {
        max-width: 90%;
        padding-right: 4%;
    }

    .shelf-content {
        max-width: 90%;
    }

    .section-offset-left {
        padding-left: 5%;
        padding-right: 3%;
    }

    .section-offset-right {
        padding-left: 3%;
        padding-right: 3%;
    }

    .section-spacer {
        height: 20vh;
    }

    .section-spacer-large {
        height: 25vh;
    }

    #opening-void {
        padding-left: 6%;
        padding-bottom: 30vh;
    }

    .ceramic-nav {
        bottom: 1rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .tokonoma-alcove,
    .tokonoma-centered {
        max-width: 95%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .tokonoma-centered {
        border-right: none;
    }

    .kiln-phrase {
        max-width: 95%;
    }

    .ceramic-buttons-cluster {
        gap: 1rem;
    }
}
