/*
 * GRYX revamp / phase two
 * Living-rock chapter and Gradient Blinds behavior scoped to footer slits.
 */

/* Living rock ------------------------------------------------------------ */

.phase-two-story.rock-showcase {
    --phase-two-edge: clamp(14px, 2.2vw, 38px);
    z-index: 9;
    padding: clamp(60px, 6.2vw, 98px) var(--phase-two-edge) 0;
    color: var(--revamp-ink);
    background: var(--revamp-paper);
    border-top: 1px solid var(--revamp-light-line);
}

.phase-two-story.rock-showcase::before {
    display: none;
}

.phase-two-story.rock-showcase::after {
    display: none;
}

.phase-two-story .rock-showcase__frame {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(320px, .72fr) minmax(540px, 1.28fr);
    width: 100%;
    min-height: clamp(480px, 34vw, 620px);
    overflow: hidden;
    isolation: isolate;
    background: #f1efe7;
    border: 1px solid var(--revamp-light-line);
    border-radius: clamp(22px, 2.4vw, 40px);
}

.phase-two-story .rock-showcase__frame::before {
    display: none;
}

.rock-cursor-grid {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.phase-two-story .rock-showcase__header,
.phase-two-story .rock-interaction,
.phase-two-story .phase-two-rail {
    position: relative;
    z-index: 2;
}

.phase-two-story .rock-showcase__header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    margin: 0;
    padding: clamp(36px, 4.2vw, 72px) clamp(30px, 4vw, 68px);
    overflow: hidden;
    background: rgba(248,246,239,.46);
    border-right: 1px solid var(--revamp-light-line);
}

.phase-two-story .rock-showcase__header > :not(.rock-cursor-grid) {
    position: relative;
    z-index: 1;
}

.phase-two-story .rock-showcase__lead {
    max-width: 650px;
}

.phase-two-story .rock-showcase__eyebrow {
    margin-bottom: clamp(18px, 2.2vw, 32px);
    color: var(--revamp-orange-deep);
    font-family: var(--font-mono);
    font-size: .69rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .18em;
}

.phase-two-story .rock-showcase__header h2 {
    max-width: 650px;
    margin: 0;
    color: var(--revamp-ink);
    font-family: var(--font-sans);
    font-size: clamp(3rem, 4.45vw, 5.45rem);
    font-weight: 600;
    line-height: .9;
    letter-spacing: -.066em;
}

.phase-two-story .rock-showcase__header h2 span {
    color: var(--revamp-orange);
}

.phase-two-story .rock-showcase__copy {
    max-width: 520px;
    margin-top: clamp(48px, 7vw, 112px);
    padding: clamp(18px, 2vw, 28px) 0 0;
    border-top: 1px solid var(--revamp-light-line);
    border-left: 0;
    color: var(--revamp-muted);
    font-family: var(--font-sans);
    font-size: clamp(.9rem, .98vw, 1.04rem);
    line-height: 1.58;
}

.phase-two-story .rock-showcase__copy > p:first-child {
    margin: 0;
}

.phase-two-story .rock-showcase__hint {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 18px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--revamp-light-line);
    color: var(--revamp-orange-deep);
    font-family: var(--font-mono);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .095em;
    text-transform: uppercase;
}

.phase-two-story .rock-showcase__hint b {
    color: rgba(8,10,9,.34);
    font-weight: 400;
}

.phase-two-story .rock-interaction {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    aspect-ratio: auto;
    contain: layout paint;
    isolation: isolate;
    container-type: inline-size;
    background: #f8f6ef;
    cursor: crosshair;
}

/* STRATA survey artwork: transparent blue contour lines on website background */
.phase-two-story .strata-survey {
    --strata-ink: #171713;
    --strata-blue: #264f9d;
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    color: var(--strata-ink);
    background: #f8f6ef url("../assets/strata-contour-transparent.png") center / 100% 100% no-repeat;
    pointer-events: none;
}

.phase-two-story .strata-survey::after {
    display: none;
}

.phase-two-story .strata-sidebar-right {
    position: absolute;
    top: 4.3%;
    right: 4.8%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: clamp(10px, 1.8cqi, 18px);
    width: auto;
    max-width: 38%;
    color: var(--strata-ink);
    pointer-events: none;
}

.phase-two-story .strata-title-block {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-end;
    color: var(--strata-ink);
    text-align: right;
}

.phase-two-story .strata-title-block strong {
    font-family: var(--font-sans);
    font-size: clamp(2.4rem, 8.5cqi, 5.8rem);
    font-weight: 800;
    line-height: .76;
    letter-spacing: -.075em;
}

.phase-two-story .strata-title-block > span {
    margin-top: 1.8cqi;
    font-family: var(--font-mono);
    font-size: clamp(.42rem, .68cqi, .62rem);
    font-weight: 600;
    letter-spacing: .2em;
    white-space: nowrap;
}

.phase-two-story .strata-title-block i {
    width: 78%;
    height: 1px;
    margin: 1.6cqi 0 1cqi;
    background: rgba(23,23,19,.78);
}

.phase-two-story .strata-title-block small {
    font-family: var(--font-mono);
    font-size: clamp(.42rem, .75cqi, .68rem);
    font-weight: 600;
    letter-spacing: .18em;
}

.phase-two-story .strata-title-block b {
    margin-top: 1.2cqi;
    font-family: var(--font-mono);
    font-size: clamp(.52rem, 1.1cqi, .92rem);
    font-weight: 500;
    letter-spacing: .12em;
}

.phase-two-story .strata-instrument-stack {
    display: flex;
    width: clamp(20px, 3.4cqi, 30px);
    flex-direction: column;
    align-items: center;
    gap: clamp(7px, 1.3cqi, 13px);
    color: var(--strata-ink);
    margin-right: clamp(1px, 0.4cqi, 4px);
}

.phase-two-story .strata-north-block {
    display: grid;
    justify-items: center;
    gap: .35cqi;
    font: 600 clamp(.46rem, .92cqi, .72rem)/1 var(--font-mono);
}

.phase-two-story .strata-north-block svg {
    width: 72%;
    height: auto;
}

.phase-two-story .strata-instrument-icon {
    display: block;
    width: 100%;
    height: auto;
}

.phase-two-story .strata-icon-line {
    fill: none;
    stroke: currentColor;
    stroke-width: .82;
    vector-effect: non-scaling-stroke;
}

.phase-two-story .strata-icon-line--tiny {
    stroke-width: .52;
}

.phase-two-story .strata-icon-dashed {
    stroke-dasharray: 1.7 2.1;
}

.phase-two-story .strata-icon-fill {
    fill: currentColor;
}

.phase-two-story .strata-icon-paper {
    fill: #f2eee7;
}

.phase-two-story .strata-down-marker {
    width: 88%;
}

.phase-two-story .strata-coordinates {
    position: absolute;
    top: 45%;
    left: 4.3%;
    z-index: 2;
    color: var(--strata-ink);
    font-family: var(--font-mono);
    font-size: clamp(.42rem, .72cqi, .66rem);
    font-weight: 500;
    letter-spacing: .05em;
}

.phase-two-story .strata-coordinates strong,
.phase-two-story .strata-coordinates span,
.phase-two-story .strata-coordinates small {
    display: block;
}

.phase-two-story .strata-coordinates strong {
    font-size: .92em;
    letter-spacing: .12em;
}

.phase-two-story .strata-coordinates span {
    margin-top: .75cqi;
    line-height: 1.7;
}

.phase-two-story .strata-coordinates small {
    margin-top: 1.8cqi;
    font-size: 1em;
    letter-spacing: .07em;
}

.phase-two-story .strata-sample-strip {
    position: absolute;
    bottom: 9.4%;
    left: 4.2%;
    z-index: 2;
    display: flex;
    gap: clamp(4px, .72cqi, 8px);
}

.phase-two-story .strata-sample-card {
    display: flex;
    width: clamp(58px, 10.8cqi, 94px);
    aspect-ratio: .8;
    margin: 0;
    padding: clamp(3px, .45cqi, 5px);
    flex-direction: column;
    border: 1px solid rgba(23,23,19,.62);
    background: rgba(235,231,222,.62);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.phase-two-story .strata-sample-image {
    position: relative;
    display: grid;
    height: 78%;
    overflow: hidden;
    place-items: center;
    border: 1px solid rgba(23,23,19,.56);
    color: rgba(23,23,19,.46);
    background: linear-gradient(135deg, rgba(23,23,19,.035), transparent), rgba(232,228,219,.68);
}

.phase-two-story .strata-sample-image svg {
    position: absolute;
    inset: 12%;
    width: 76%;
    height: 76%;
}

.phase-two-story .strata-placeholder-line {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.05;
    vector-effect: non-scaling-stroke;
}

.phase-two-story .strata-sample-image > span {
    position: absolute;
    bottom: .45cqi;
    font: 600 clamp(.34rem, .52cqi, .48rem)/1 var(--font-mono);
    letter-spacing: .16em;
}

.phase-two-story .strata-sample-image > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.phase-two-story .strata-sample-card figcaption {
    display: flex;
    min-height: 0;
    margin-top: auto;
    align-items: center;
    gap: clamp(3px, .5cqi, 6px);
    color: var(--strata-ink);
    font: 500 clamp(.34rem, .5cqi, .48rem)/1 var(--font-mono);
    letter-spacing: .055em;
    white-space: nowrap;
}

.phase-two-story .strata-sample-card figcaption b {
    font-weight: 500;
}

.phase-two-story .strata-survey-unit {
    position: absolute;
    bottom: 2.7%;
    left: 4.3%;
    z-index: 2;
    color: var(--strata-ink);
    font: 500 clamp(.36rem, .55cqi, .52rem)/1.5 var(--font-mono);
    letter-spacing: .08em;
}

.phase-two-story .strata-survey-unit > div {
    display: flex;
    margin-top: .45cqi;
    align-items: center;
    gap: 1cqi;
}

.phase-two-story .strata-survey-unit svg {
    width: clamp(15px, 2cqi, 22px);
    height: clamp(15px, 2cqi, 22px);
}

.phase-two-story .strata-survey-unit .strata-barcode {
    width: clamp(20px, 2.7cqi, 30px);
}

.phase-two-story .strata-grid-reference {
    position: absolute;
    right: 5.1%;
    bottom: 6.8%;
    z-index: 2;
    color: var(--strata-ink);
    font: 500 clamp(.36rem, .55cqi, .52rem)/1.55 var(--font-mono);
    letter-spacing: .08em;
}

.phase-two-story .rock-interaction::before {
    z-index: 1;
    left: 12%;
    right: 8%;
    bottom: 7%;
    height: 10%;
    background: radial-gradient(ellipse, rgba(34, 29, 24, .24), rgba(34, 29, 24, .08) 48%, transparent 74%);
    filter: blur(24px);
    opacity: .55;
    mix-blend-mode: multiply;
}

.phase-two-story #scene {
    z-index: 3;
    background: transparent !important;
    mix-blend-mode: normal;
    filter:
        saturate(1.04)
        contrast(1.04)
        drop-shadow(0 22px 30px rgba(24, 20, 16, .18));
}

.phase-two-story #waterTrail {
    z-index: 2;
    background: transparent !important;
    mix-blend-mode: normal;
    filter: saturate(.96) contrast(1.02);
}

.phase-two-story .rock-interaction:focus-visible {
    outline: 2px solid var(--revamp-orange);
    outline-offset: 8px;
}

.phase-two-story .rock-interaction::after {
    content: "DORMANT / CONTACT TO REVEAL";
    position: absolute;
    right: clamp(18px, 3.2cqi, 32px);
    bottom: clamp(16px, 2.8cqi, 26px);
    z-index: 4;
    color: rgba(8,10,9,.43);
    font-family: var(--font-mono);
    font-size: .57rem;
    letter-spacing: .11em;
    pointer-events: none;
}

.phase-two-story .rock-interaction.is-on-rock::after {
    content: "ACTIVE / LIVING SIGNAL";
    color: var(--revamp-orange-deep);
}

.phase-two-rail {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: calc(100% + (var(--phase-two-edge) * 2));
    margin: clamp(24px, 2.8vw, 42px) calc(var(--phase-two-edge) * -1) 0;
    border-top: 1px solid var(--revamp-light-line);
    border-bottom: 1px solid var(--revamp-light-line);
    background: var(--revamp-paper);
    isolation: isolate;
}

.phase-two-rail__item {
    min-width: 0;
    padding: clamp(22px, 2.4vw, 34px) clamp(22px, 3vw, 54px);
    border-right: 1px solid var(--revamp-light-line);
}

.phase-two-rail__item:last-child {
    border-right: 0;
}

.phase-two-rail__item > span {
    display: block;
    margin-bottom: 14px;
    color: var(--revamp-orange-deep);
    font-family: var(--font-mono);
    font-size: .63rem;
    font-weight: 600;
    letter-spacing: .13em;
}

.phase-two-rail__item strong {
    display: block;
    margin-bottom: 11px;
    color: var(--revamp-ink);
    font-family: var(--font-sans);
    font-size: clamp(1.3rem, 1.8vw, 2rem);
    font-weight: 600;
    letter-spacing: -.035em;
}

.phase-two-rail__item p {
    max-width: 430px;
    margin: 0;
    color: var(--revamp-muted);
    font-size: .91rem;
    line-height: 1.58;
}

.phase-two-story + .section-promise {
    margin-top: 0;
}

/* Gradient Blinds — restricted to the existing footer slit elements ------- */

.footer-dark.footer-slit,
.site-legal-bar.footer-slit {
    --slit-orange: #f04a24;
    --gb-ambient-x: 50%;
    --gb-ambient-y: 50%;
    --gb-ambient-opacity: 0;
    position: relative;
    overflow: hidden;
}

.footer-slit .footer-left {
    background: #080a09;
    border-right-color: rgba(255,255,255,.12) !important;
}

.footer-slit .footer-slits-background {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: #080a09;
}

.footer-slit .slits-ambient-bloom {
    position: absolute;
    inset: 0;
    opacity: var(--gb-ambient-opacity);
    background: radial-gradient(
        ellipse 46% 62% at var(--gb-ambient-x) var(--gb-ambient-y),
        rgba(240, 74, 36, .94) 0%,
        rgba(185, 46, 19, .62) 28%,
        rgba(92, 20, 10, .22) 54%,
        transparent 76%
    );
    pointer-events: none;
    transition: opacity 0.15s ease-out;
}

.footer-slit .slits-vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8,10,9,.94) 0%, transparent 18%, transparent 82%, rgba(8,10,9,.97) 100%),
        radial-gradient(circle at 10% 50%, rgba(8,10,9,.76) 0%, transparent 75%);
    pointer-events: none;
}

.footer-slit [data-gradient-blinds] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    perspective: 900px;
    transform-style: preserve-3d;
    pointer-events: none;
    overflow: hidden;
}

.footer-slit [data-gradient-blinds] .glass-slit {
    --gb-x: 50%;
    --gb-y: 50%;
    --gb-glow: 0;
    --gb-mid: 0;
    --gb-brightness: .68;
    --gb-tilt: 0deg;
    --gb-lift: 0px;
    z-index: 1;
    overflow: hidden;
    background:
        radial-gradient(
            circle at var(--gb-x) var(--gb-y),
            rgba(240, 74, 36, var(--gb-glow)) 0%,
            rgba(185, 46, 19, var(--gb-mid)) 34%,
            transparent 72%
        ),
        linear-gradient(
            105deg,
            rgba(2, 3, 2, .99) 0%,
            rgba(8, 10, 9, .94) 42%,
            rgba(14, 18, 17, .9) 78%,
            rgba(248, 246, 239, .07) 100%
        );
    border-right: 1px solid rgba(248,246,239,.13);
    box-shadow:
        inset 13px 0 21px rgba(0,0,0,.78),
        inset -1px 0 7px rgba(255,255,255,.06);
    filter: brightness(var(--gb-brightness));
    transform: translateY(var(--gb-lift)) rotateY(var(--gb-tilt));
    transform-origin: center;
    will-change: transform, filter, background;
}

.footer-slit [data-gradient-blinds] .glass-slit:nth-child(4n + 2) {
    box-shadow:
        inset 13px 0 21px rgba(0,0,0,.78),
        inset -1px 0 8px rgba(255,255,255,.045);
}

.footer-slit .slit-title {
    color: #ffffff;
    font-size: clamp(2.7rem, 4vw, 4rem);
    font-weight: 800;
    line-height: .92;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,.96));
}

.footer-slit .slit-title > span:first-child {
    color: #ffffff;
    opacity: 1;
    text-shadow: 0 1px 1px rgba(255,255,255,.18);
}

.footer-slit .slit-title .slit-final {
    max-width: 100%;
    margin-top: .26em;
    color: #ff4f28;
    font-size: clamp(1.35rem, 2vw, 1.95rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: .02em;
    white-space: normal;
    text-wrap: balance;
    text-shadow: 0 0 22px rgba(240,74,36,.48);
}

.footer-slit .footer-cta-clean p {
    max-width: 480px;
    margin: 0 0 28px;
    color: rgba(255,255,255,.86);
    font-size: clamp(.98rem, 1.1vw, 1.08rem);
    line-height: 1.58;
}

.footer-slit .footer-btns .btn-orange {
    color: #ffffff;
    background: #f04a24;
    box-shadow: 0 10px 28px rgba(240,74,36,.28);
}

/* Interactive earth merged beneath the round dither globe ---------------- */

.dither-compute-art {
    isolation: isolate;
}

.footer-globe-merge.hero-visual-shell {
    position: absolute;
    top: 2.3%;
    left: .42%;
    z-index: 0;
    width: 54.17%;
    height: 78.37%;
    overflow: visible;
    opacity: .8;
    filter: saturate(.64) brightness(.78) contrast(1.14);
    pointer-events: none;
    transition: opacity .5s ease, filter .5s ease;
    will-change: opacity, filter;
}

.footer-globe-merge #hero-ascii-earth-webgl {
    inset: 0;
    pointer-events: auto;
}

.footer-globe-merge #hero-ascii-earth-webgl,
.footer-globe-merge .hero-ascii-canvas {
    -webkit-mask-image: radial-gradient(
        ellipse 51% 49% at 50% 50%,
        #000 0 76%,
        rgba(0,0,0,.76) 88%,
        transparent 100%
    );
    mask-image: radial-gradient(
        ellipse 51% 49% at 50% 50%,
        #000 0 76%,
        rgba(0,0,0,.76) 88%,
        transparent 100%
    );
}

.footer-globe-merge #hero-ascii-back {
    opacity: .3;
}

.footer-globe-merge #hero-ascii-front {
    opacity: .46;
}

.footer-globe-merge .hero-coordinate {
    z-index: 7;
    color: rgba(222, 235, 239, .76);
    font-size: clamp(.46rem, .48vw, .56rem);
    letter-spacing: .035em;
    opacity: .72;
    text-shadow: 0 1px 8px rgba(1,4,13,.9);
    transition: opacity .4s ease, color .4s ease;
}

.footer-globe-merge .hero-coordinate::before {
    border-color: rgba(115,219,228,.92);
}

.footer-globe-merge .hero-coordinate::after {
    background: rgba(115,219,228,.34);
}

.dither-compute-art #blue-compute-dither {
    z-index: 1;
    object-position: left center;
    mix-blend-mode: screen;
    pointer-events: none;
    opacity: .92;
    filter:
        saturate(1.02)
        contrast(1.08)
        brightness(.96)
        drop-shadow(0 0 10px rgba(47,124,255,.2));
    transition: opacity .45s ease, filter .45s ease;
}

.dither-compute-art:hover .footer-globe-merge,
.dither-compute-art:focus-within .footer-globe-merge {
    opacity: .9;
    filter: saturate(.72) brightness(.88) contrast(1.16);
}

.dither-compute-art:hover .footer-globe-merge .hero-coordinate,
.dither-compute-art:focus-within .footer-globe-merge .hero-coordinate {
    color: rgba(222,242,246,.9);
    opacity: .96;
}

.dither-compute-art:hover #blue-compute-dither,
.dither-compute-art:focus-within #blue-compute-dither {
    opacity: 1;
    filter:
        saturate(1.14)
        contrast(1.1)
        brightness(1.04)
        drop-shadow(0 0 14px rgba(47,124,255,.28));
}

@media (max-width: 1100px) {
    .phase-two-story .rock-showcase__frame {
        grid-template-columns: minmax(300px, .86fr) minmax(410px, 1.14fr);
    }

    .phase-two-story .rock-showcase__header {
        padding-right: clamp(26px, 3.2vw, 42px);
        padding-left: clamp(26px, 3.2vw, 42px);
    }

    .phase-two-story .rock-showcase__header h2 {
        font-size: clamp(2.7rem, 5.6vw, 4.6rem);
    }
}

@media (max-width: 760px) {
    .phase-two-story.rock-showcase {
        --phase-two-edge: 18px;
        padding-top: 72px;
    }

    .phase-two-story .rock-showcase__frame {
        grid-template-columns: 1fr;
        min-height: 0;
        border-radius: 18px;
    }

    .phase-two-story .rock-showcase__header {
        display: flex;
        min-height: 390px;
        margin: 0;
        padding: 34px 24px;
        border-right: 0;
        border-bottom: 1px solid var(--revamp-light-line);
    }

    .phase-two-story .rock-showcase__header h2 {
        font-size: clamp(2.8rem, 12vw, 4.8rem);
    }

    .phase-two-story .rock-showcase__copy {
        max-width: 580px;
        margin-top: 38px;
        padding: 16px 0 0;
        border-top: 1px solid var(--revamp-light-line);
        border-left: 0;
    }

    .phase-two-story .rock-interaction::after {
        right: 0;
        font-size: .5rem;
    }

    .phase-two-story .rock-interaction {
        width: 100%;
        height: auto;
        min-height: 320px;
        aspect-ratio: 1.7 / 1;
    }

    .phase-two-rail {
        grid-template-columns: 1fr;
    }

    .phase-two-rail__item {
        border-right: 0;
        border-bottom: 1px solid var(--revamp-light-line);
    }

    .phase-two-rail__item:last-child {
        border-bottom: 0;
    }

    .footer-slit .slit-title {
        font-size: clamp(2.35rem, 10vw, 3.1rem);
    }

    .footer-slit .slit-title .slit-final {
        font-size: clamp(1.1rem, 5.4vw, 1.45rem);
    }

    .footer-slit .footer-cta-clean p {
        font-size: .98rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .footer-slit [data-gradient-blinds] .glass-slit {
        --gb-x: 50%;
        --gb-y: 50%;
        --gb-glow: 0;
        --gb-mid: 0;
        --gb-brightness: .68;
        --gb-tilt: 0deg;
        --gb-lift: 0px;
        will-change: auto;
    }

    .footer-globe-merge.hero-visual-shell,
    .footer-globe-merge .hero-coordinate,
    .dither-compute-art #blue-compute-dither {
        transition: none;
    }
}
