/* ============================================================
   yome.cam — Coastal Avant-Garde Design System
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --angle: 7deg;

    /* Palette — Coastal Blend */
    --color-limestone:   #F4F1EC;  /* Tide-bleached limestone — primary bg */
    --color-slate:       #2C3E47;  /* Deep coastal slate — primary text */
    --color-sea-mist:    #8BA8B5;  /* Sea-mist — secondary/atmosphere */
    --color-warm-stone:  #D4C9B8;  /* Warm stone — panel backgrounds */
    --color-amber-shore: #E8A87C;  /* Amber shore — accent (≤2% usage) */
    --color-abyss:       #1A2A33;  /* Abyssal tide — deepest sections */

    /* Typography */
    --font-primary: 'Nunito', sans-serif;
    --font-secondary: 'DM Sans', sans-serif;

    /* Spacing baseline: 12px grid */
    --base: 12px;
    --s1:  calc(var(--base) * 1);
    --s2:  calc(var(--base) * 2);
    --s3:  calc(var(--base) * 3);
    --s4:  calc(var(--base) * 4);
    --s8:  calc(var(--base) * 8);
    --s12: calc(var(--base) * 12);
    --s16: calc(var(--base) * 16);

    /* Z-index strata */
    --z-bg:      1;
    --z-mid:     2;
    --z-content: 3;
    --z-deco:    4;
    --z-nav:     100;

    /* Transition */
    --ease-water: cubic-bezier(0.7, 0, 0.3, 1);
    --ease-entry: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 18px;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    background-color: var(--color-limestone);
    color: var(--color-slate);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Noise SVG Filter (hidden) --- */
.noise-filter {
    position: fixed;
    width: 0;
    height: 0;
    pointer-events: none;
    opacity: 0;
}

/* ============================================================
   Depth Gauge Navigation
   ============================================================ */
.depth-gauge {
    position: fixed;
    right: 24px;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: var(--z-nav);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.depth-gauge__line {
    position: absolute;
    right: 12px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--color-warm-stone);
    opacity: 0.6;
}

.depth-gauge__diamond {
    position: absolute;
    right: 9px;
    width: 7px;
    height: 7px;
    background: var(--color-amber-shore);
    transform: rotate(45deg) translateY(0);
    transition: top 0.3s var(--ease-entry);
    top: 50%;
    z-index: var(--z-nav);
}

.depth-gauge__labels {
    position: absolute;
    right: 24px;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10vh 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.depth-gauge:hover .depth-gauge__labels {
    opacity: 1;
}

.depth-gauge__label {
    font-family: var(--font-secondary);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-sea-mist);
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    white-space: nowrap;
}

/* ============================================================
   Page Strata Container
   ============================================================ */
.page-strata {
    width: 100%;
}

/* ============================================================
   Stratum Base Styles
   ============================================================ */
.stratum {
    position: sticky;
    top: 0;
    min-height: 100vh;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: auto;
    overflow: hidden;
    contain: layout style;
}

/* Strata z-index layering */
#stratum-0 { z-index: 10; }
#stratum-1 { z-index: 20; }
#stratum-2 { z-index: 30; }
#stratum-3 { z-index: 40; }
#stratum-4 { z-index: 50; }

/* Stratum height wrappers for scroll space */
.page-strata {
    /* Each section needs scroll space for the sticky effect */
}

/* Scroll space wrappers around strata */
.stratum--surface {
    background-color: var(--color-limestone);
}

.stratum--warm-stone {
    background-color: var(--color-warm-stone);
}

.stratum--slate {
    background-color: var(--color-slate);
}

.stratum--depth {
    background-color: #243641; /* between slate and abyss */
}

.stratum--abyss {
    background-color: var(--color-abyss);
}

/* --- Noise Overlay --- */
.stratum__noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.1'/%3E%3C/svg%3E");
    background-size: 300px 300px;
    opacity: 0.1;
    pointer-events: none;
    z-index: var(--z-bg);
    mix-blend-mode: multiply;
}

/* --- Background Words --- */
.stratum__bg-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 5%;
    pointer-events: none;
    z-index: var(--z-bg);
    overflow: hidden;
}

.bg-word {
    font-family: var(--font-primary);
    font-weight: 200;
    font-size: clamp(80px, 18vw, 220px);
    letter-spacing: -0.02em;
    line-height: 0.9;
    opacity: 0.06;
    color: currentColor;
    white-space: nowrap;
    user-select: none;
    will-change: transform;
}

.stratum--slate .bg-word,
.stratum--depth .bg-word,
.stratum--abyss .bg-word {
    opacity: 0.08;
    color: var(--color-sea-mist);
}

.bg-word--1 { transform: translateX(-2%); }
.bg-word--2 { transform: translateX(8%); }
.bg-word--3 { transform: translateX(-5%); font-size: clamp(60px, 14vw, 180px); }
.bg-word--4 { transform: translateX(12%); }
.bg-word--5 { transform: translateX(-3%); font-size: clamp(60px, 14vw, 180px); }
.bg-word--6 { transform: translateX(6%); }
.bg-word--7 { transform: translateX(-1%); font-size: clamp(80px, 20vw, 260px); }
.bg-word--8 { transform: translateX(-2%); font-size: clamp(80px, 18vw, 240px); }
.bg-word--9 { transform: translateX(10%); font-size: clamp(50px, 12vw, 160px); }

/* ============================================================
   Stratum Content
   ============================================================ */
.stratum__content {
    position: relative;
    z-index: var(--z-content);
    padding: var(--s8) var(--s4);
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    align-self: center;
}

.stratum__content--left {
    grid-column: 1 / 10;
    padding-left: clamp(var(--s4), 8vw, var(--s16));
    padding-top: var(--s16);
    padding-bottom: var(--s16);
}

.stratum__content--right {
    grid-column: 8 / 17;
    padding-right: clamp(var(--s4), 8vw, var(--s16));
    padding-top: var(--s16);
    padding-bottom: var(--s16);
    align-items: flex-end;
    text-align: right;
}

.stratum__content--abyss {
    grid-column: 1 / 10;
    padding-left: clamp(var(--s4), 8vw, var(--s16));
    padding-top: var(--s12);
    padding-bottom: var(--s12);
}

/* --- Section Labels --- */
.stratum__label {
    font-family: var(--font-secondary);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-sea-mist);
    margin-bottom: var(--s2);
}

/* --- Headings --- */
.stratum__heading {
    font-family: var(--font-primary);
    font-weight: 200;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--color-slate);
}

.hero-heading {
    font-size: clamp(56px, 9vw, 120px);
    font-weight: 200;
}

.section-heading {
    font-size: clamp(40px, 6vw, 88px);
    font-weight: 300;
}

.section-heading--abyss {
    font-size: clamp(48px, 7vw, 100px);
    font-weight: 200;
    color: var(--color-limestone);
}

.stratum--warm-stone .stratum__heading {
    color: var(--color-slate);
}

.stratum--slate .stratum__heading {
    color: var(--color-limestone);
}

.stratum--depth .stratum__heading {
    color: var(--color-limestone);
}

.stratum--abyss .stratum__heading {
    color: var(--color-limestone);
}

/* Word animation — individual words */
.word-animate {
    display: inline-block;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease-entry), transform 0.6s var(--ease-entry);
}

.word-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Body Text --- */
.stratum__body {
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.75;
    max-width: 52ch;
    color: var(--color-slate);
}

.stratum--slate .stratum__body,
.stratum--depth .stratum__body,
.stratum--abyss .stratum__body {
    color: var(--color-warm-stone);
}

/* ============================================================
   Parallelogram Text Containers
   ============================================================ */
.parallelogram-container {
    position: relative;
    padding: var(--s3) var(--s4);
    clip-path: polygon(3% 0%, 100% 0%, 97% 100%, 0% 100%);
    background-color: rgba(212, 201, 184, 0.15);
    backdrop-filter: blur(2px);
}

.stratum--slate .parallelogram-container,
.stratum--depth .parallelogram-container,
.stratum--abyss .parallelogram-container {
    background-color: rgba(139, 168, 181, 0.1);
}

/* ============================================================
   Angled Section Dividers
   ============================================================ */
.stratum__angle-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    z-index: var(--z-deco);
    pointer-events: none;
}

.stratum--surface .stratum__angle-divider {
    clip-path: polygon(0 100%, 100% calc(100% - 40px), 100% 100%, 0 100%);
    background-color: var(--color-warm-stone);
    bottom: -1px;
}

.stratum--warm-stone .stratum__angle-divider {
    clip-path: polygon(0 calc(100% - 40px), 100% 100%, 100% 100%, 0 100%);
    background-color: var(--color-slate);
    bottom: -1px;
}

.stratum--slate .stratum__angle-divider {
    clip-path: polygon(0 100%, 100% calc(100% - 40px), 100% 100%, 0 100%);
    background-color: #243641;
    bottom: -1px;
}

.stratum--depth .stratum__angle-divider {
    clip-path: polygon(0 calc(100% - 40px), 100% 100%, 100% 100%, 0 100%);
    background-color: var(--color-abyss);
    bottom: -1px;
}

/* ============================================================
   Lottie Animation Containers
   ============================================================ */
.lottie-container {
    width: 100%;
    overflow: hidden;
    pointer-events: none;
}

.lottie-hero {
    position: absolute;
    right: 0;
    top: 0;
    width: 55%;
    height: 100%;
    z-index: var(--z-mid);
    mix-blend-mode: multiply;
    opacity: 0;
    transition: opacity 0.8s var(--ease-water);
}

.lottie-hero.is-visible {
    opacity: 1;
}

.lottie-section {
    width: 100%;
    height: clamp(280px, 50vh, 480px);
    border-radius: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-water), transform 0.8s var(--ease-water);
}

.lottie-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.lottie--blend-multiply {
    mix-blend-mode: multiply;
}

.lottie--blend-screen {
    mix-blend-mode: screen;
}

/* ============================================================
   Decorative SVG Elements
   ============================================================ */
.stratum__deco {
    position: absolute;
    pointer-events: none;
    z-index: var(--z-bg);
    opacity: 0.6;
}

.deco-trapezoid {
    right: 5%;
    top: 8%;
    width: clamp(120px, 18vw, 220px);
}

.deco-triangle {
    left: 5%;
    bottom: 12%;
    width: clamp(80px, 12vw, 160px);
}

.deco-elongated {
    left: 50%;
    bottom: 5%;
    transform: translateX(-50%);
    width: clamp(200px, 50vw, 500px);
}

.deco-trapezoid-outline {
    right: 4%;
    top: 15%;
    width: clamp(200px, 40vw, 480px);
}

.deco-acute {
    right: 10%;
    top: 10%;
    width: clamp(100px, 14vw, 200px);
}

/* ============================================================
   Bioluminescent Glow
   ============================================================ */
.biolum-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 168, 181, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: var(--z-bg);
}

.biolum-glow--left {
    left: -100px;
    top: 20%;
}

.biolum-glow--right {
    right: -100px;
    top: 30%;
}

.biolum-glow--right-bottom {
    right: 5%;
    bottom: 15%;
}

.biolum-glow--center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
}

/* ============================================================
   Footer (within Abyss section)
   ============================================================ */
.abyss-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    grid-column: 1 / -1;
    border-top: 1px solid rgba(139, 168, 181, 0.2);
    padding: var(--s4) clamp(var(--s4), 8vw, var(--s16));
    z-index: var(--z-content);
}

.abyss-footer__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    flex-wrap: wrap;
}

.abyss-footer__brand {
    display: flex;
    flex-direction: column;
    gap: var(--s1);
}

.abyss-footer__logo {
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 200;
    letter-spacing: -0.02em;
    color: var(--color-limestone);
}

.abyss-footer__tagline {
    font-family: var(--font-secondary);
    font-size: 11px;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.06em;
    color: var(--color-sea-mist);
}

.abyss-footer__nav {
    display: flex;
    gap: var(--s4);
}

.footer-link {
    font-family: var(--font-secondary);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-sea-mist);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-amber-shore);
    transform: scaleX(0) rotate(-0.5deg);
    transform-origin: left center;
    transition: transform 0.3s var(--ease-entry);
}

.footer-link:hover {
    color: var(--color-limestone);
}

.footer-link:hover::after {
    transform: scaleX(1) rotate(-0.5deg);
}

.abyss-footer__meta {
    opacity: 0.4;
}

.footer-meta-text {
    font-family: var(--font-secondary);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--color-sea-mist);
}

/* ============================================================
   Scroll Space — each section needs scroll room
   ============================================================ */
/* Sticky stacking: wraps each section in scroll room */
.stratum-scroll-wrapper {
    height: 200vh;
    position: relative;
}

.stratum-scroll-wrapper:last-child {
    height: 100vh;
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */
@media (max-width: 900px) {
    .stratum__content--left,
    .stratum__content--right {
        grid-column: 1 / -1;
        padding: var(--s8) var(--s4);
        align-items: flex-start;
        text-align: left;
    }

    .stratum__content--abyss {
        grid-column: 1 / -1;
        padding: var(--s8) var(--s4);
    }

    .lottie-hero {
        width: 100%;
        height: 50%;
        top: auto;
        bottom: 0;
        opacity: 0.4;
    }

    .bg-word {
        font-size: clamp(50px, 15vw, 120px);
    }

    .depth-gauge {
        right: 8px;
    }

    .abyss-footer__content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s3);
    }
}

@media (max-width: 600px) {
    .hero-heading {
        font-size: clamp(40px, 12vw, 72px);
    }

    .section-heading {
        font-size: clamp(32px, 10vw, 56px);
    }

    .depth-gauge__labels {
        display: none;
    }

    .abyss-footer__nav {
        flex-wrap: wrap;
        gap: var(--s2);
    }
}

/* ============================================================
   Keyframe Animations
   ============================================================ */
@keyframes word-rise {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.12;
        transform: scale(1);
    }
    50% {
        opacity: 0.2;
        transform: scale(1.1);
    }
}

.biolum-glow {
    animation: glow-pulse 6s ease-in-out infinite;
}

.biolum-glow--right {
    animation-delay: -3s;
}

.biolum-glow--right-bottom {
    animation-delay: -1.5s;
}

/* ============================================================
   Animation States (JS-controlled)
   ============================================================ */
.stratum-enter .stratum__label {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease-entry) 0.1s, transform 0.5s var(--ease-entry) 0.1s;
}

.stratum-visible .stratum__label {
    opacity: 1;
    transform: translateY(0);
}

.stratum-enter .parallelogram-container {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s var(--ease-entry) 0.4s, transform 0.7s var(--ease-entry) 0.4s;
}

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

/* Gauge color adaptation */
.depth-gauge.gauge--dark .depth-gauge__line {
    background: var(--color-sea-mist);
}

.depth-gauge.gauge--dark .depth-gauge__label {
    color: var(--color-warm-stone);
}
