/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    background: #0f0a1a;
    color: #f4f0eb;
    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;
}

/* ===== PAPER GRAIN OVERLAY ===== */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    filter: url(#paper-grain);
    background: #808080;
    mix-blend-mode: multiply;
    opacity: 0.06;
}

.section--dark .grain-overlay-local {
    mix-blend-mode: screen;
}

/* ===== TYPOGRAPHY ===== */

/* Display / Headings */
.title-svg {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
}

h2, h3, .seal-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* Body / Reading */
p, .pigment-text, .band-text, .facet-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* Accent / Labels */
.subtitle, .band-label, .section-label, .facet-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ===== SECTIONS (Shared) ===== */
.section {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8vh 6vw;
}

.section--dark {
    background: #0f0a1a;
    color: #f4f0eb;
}

.section--light {
    background: #f4f0eb;
    color: #0f0a1a;
}

/* ===== MARBLE BACKGROUNDS ===== */
.marble-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.marble-bg--dark {
    filter: url(#marble-dark);
    background: #0f0a1a;
    opacity: 0.5;
}

.marble-bg--light {
    filter: url(#marble-light);
    background: #f4f0eb;
    opacity: 0.4;
}

/* ===== SECTION 1: THE VESTIBULE ===== */
.vestibule-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.title-svg {
    width: clamp(320px, 70vw, 900px);
    height: auto;
    overflow: visible;
}

.title-stroke {
    fill: none;
    stroke: #c4952a;
    stroke-width: 1.5;
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
}

.title-fill {
    fill: url(#watercolor-fill);
    opacity: 0;
}

.subtitle {
    color: #b8b0a8;
    letter-spacing: 0.3em;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SECTION DIVIDERS ===== */
.section-divider {
    position: absolute;
    bottom: 2vh;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 600px;
    z-index: 2;
    overflow: visible;
}

.section-divider--dark .divider-path {
    stroke: #c4952a;
}

.divider-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.5s ease-out;
}

.divider-path.drawn {
    stroke-dashoffset: 0;
}

/* ===== SECTION 2: THE LAPIDARY ===== */
.lapidary-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.diagonal-band {
    position: absolute;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.diagonal-band.visible {
    opacity: 1;
    transform: translateX(0);
}

.band--sapphire {
    clip-path: polygon(0 5%, 100% 0%, 100% 35%, 0 40%);
    background: rgba(26, 58, 110, 0.9);
    top: 0;
    left: 0;
    height: 100%;
    transition-delay: 0s;
}

.band--ruby {
    clip-path: polygon(0 35%, 100% 30%, 100% 65%, 0 70%);
    background: rgba(139, 26, 43, 0.9);
    top: 0;
    left: 0;
    height: 100%;
    transition-delay: 0.2s;
}

.band--emerald {
    clip-path: polygon(0 65%, 100% 60%, 100% 95%, 0 100%);
    background: rgba(26, 92, 58, 0.9);
    top: 0;
    left: 0;
    height: 100%;
    transition-delay: 0.4s;
}

.band-content {
    transform: rotate(-15deg);
    text-align: center;
    padding: 2rem 4rem;
    max-width: 600px;
}

.band-label {
    color: #c4952a;
    display: block;
    margin-bottom: 0.5rem;
}

.band-heading {
    font-size: clamp(2rem, 5vw, 4rem);
    color: #f4f0eb;
    margin-bottom: 0.75rem;
    line-height: 0.95;
}

.band-text {
    color: rgba(244, 240, 235, 0.85);
    max-width: 38ch;
}

/* ===== SECTION 3: THE PIGMENT CHAMBER ===== */
.watercolor-wash-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.wash {
    position: absolute;
    filter: blur(40px);
    pointer-events: none;
}

.wash--sapphire-amethyst {
    width: 60vw;
    height: 50vh;
    top: 5%;
    left: -10%;
    border-radius: 30% 70% 60% 40% / 50% 60% 40% 70%;
    background: radial-gradient(ellipse, rgba(26, 58, 110, 0.3), transparent 70%);
}

.wash--emerald-sapphire {
    width: 50vw;
    height: 45vh;
    top: 30%;
    right: -5%;
    border-radius: 60% 40% 30% 70% / 40% 70% 50% 60%;
    background: radial-gradient(ellipse, rgba(26, 92, 58, 0.25), transparent 70%);
}

.wash--ruby-topaz {
    width: 45vw;
    height: 40vh;
    bottom: 10%;
    left: 15%;
    border-radius: 50% 50% 70% 30% / 60% 40% 60% 40%;
    background: radial-gradient(ellipse, rgba(139, 26, 43, 0.2), transparent 70%);
}

.wash--amethyst-deep {
    width: 40vw;
    height: 35vh;
    top: 15%;
    right: 20%;
    border-radius: 40% 60% 50% 50% / 70% 30% 60% 40%;
    background: radial-gradient(ellipse, rgba(107, 47, 160, 0.25), transparent 70%);
}

.pigment-content {
    position: relative;
    z-index: 1;
    max-width: 38ch;
    text-align: left;
}

.section-label {
    display: block;
    color: #6b2fa0;
    margin-bottom: 2rem;
}

.pigment-text {
    color: #0f0a1a;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    line-height: 1.7;
}

.pigment-text em {
    color: #c4952a;
    font-style: italic;
}

/* ===== SECTION 4: THE FACET WALL ===== */
.facet-wall-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5vh;
    width: 100%;
    max-width: 1100px;
    height: auto;
    max-height: 85vh;
    overflow: visible;
}

.facet-container {
    position: relative;
    border-radius: 12px;
    padding: 2.5rem 3rem;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    /* gem-cut corner notches */
    clip-path: polygon(
        12px 0%, calc(100% - 12px) 0%,
        100% 12px, 100% calc(100% - 12px),
        calc(100% - 12px) 100%, 12px 100%,
        0% calc(100% - 12px), 0% 12px
    );
}

.facet-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.facet--left {
    align-self: flex-start;
    width: 65%;
}

.facet--right {
    align-self: flex-end;
    width: 65%;
}

.facet--center-left {
    align-self: flex-start;
    margin-left: 10%;
    width: 60%;
}

.facet--center-right {
    align-self: flex-end;
    margin-right: 10%;
    width: 60%;
}

.facet--sapphire-border {
    border: 2px solid #1a3a6e;
    background: rgba(26, 58, 110, 0.08);
}

.facet--ruby-border {
    border: 2px solid #8b1a2b;
    background: rgba(139, 26, 43, 0.08);
}

.facet--emerald-border {
    border: 2px solid #1a5c3a;
    background: rgba(26, 92, 58, 0.08);
}

.facet--amethyst-border {
    border: 2px solid #6b2fa0;
    background: rgba(107, 47, 160, 0.08);
}

.facet-inner {
    position: relative;
    z-index: 1;
}

.facet-label {
    color: #c4952a;
    display: block;
    margin-bottom: 0.5rem;
}

.facet-heading {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: #f4f0eb;
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.facet-text {
    color: rgba(244, 240, 235, 0.8);
    max-width: 45ch;
}

/* Watercolor bleed hover effect */
.facet-hover-wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.facet-hover-wash::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 30% 70% 60% 40% / 50% 60% 40% 70%;
    background: radial-gradient(circle, rgba(196, 149, 42, 0.15), transparent 60%);
    filter: blur(20px);
    transform: scale(0);
    transition: transform 0.6s ease-out;
    top: var(--mouse-y, 50%);
    left: var(--mouse-x, 50%);
    translate: -50% -50%;
}

.facet-container:hover .facet-hover-wash::after {
    transform: scale(1);
}

/* ===== SECTION 5: THE SEAL ===== */
.seal-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gemstone-svg {
    width: clamp(180px, 30vw, 300px);
    height: auto;
    margin-bottom: 3rem;
}

.gem-outline {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 3s ease-out;
}

.gem-outline.drawn {
    stroke-dashoffset: 0;
}

.gem-facet {
    stroke: #c4952a;
    stroke-width: 0.8;
    stroke-opacity: 0.4;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 2s ease-out;
}

.gem-facet.drawn {
    stroke-dashoffset: 0;
}

.gem-fill {
    opacity: 0;
    transition: opacity 1.5s ease-in;
}

.gem-fill.visible {
    opacity: 0.6;
}

.seal-text {
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #f4f0eb;
    letter-spacing: -0.02em;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.seal-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SCROLL TRANSITION ANIMATIONS ===== */
.section-content-fade {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.section-content-fade.fading-out {
    opacity: 0.3;
    transform: translateY(-30px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .section {
        padding: 6vh 4vw;
    }

    .band-content {
        padding: 1rem 2rem;
        transform: rotate(-10deg);
    }

    .band-heading {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }

    .facet--left,
    .facet--right,
    .facet--center-left,
    .facet--center-right {
        width: 90%;
        align-self: center;
        margin-left: 0;
        margin-right: 0;
    }

    .facet-container {
        padding: 1.5rem 2rem;
    }

    .diagonal-band {
        clip-path: none;
        position: relative;
        height: auto;
        padding: 2rem 0;
    }

    .band--sapphire,
    .band--ruby,
    .band--emerald {
        clip-path: none;
    }

    .band-content {
        transform: none;
    }
}

@media (max-width: 480px) {
    html {
        scroll-snap-type: none;
    }

    .section {
        min-height: 100vh;
        height: auto;
    }

    .facet-wall-content {
        max-height: none;
    }
}
