/* ============================================================
   bada.moe - Frutiger Aero Fossilized
   Crystalline Geology / Diagonal Sections / Tilt-3D
   ============================================================ */

/* --- Palette Variables --- */
:root {
    --crystal-white: #f0f4f8;
    --slate-mist: #d1d9e2;
    --steel-fog: #8a9bae;
    --deep-shale: #2c3440;
    --glacial-blue: #5b8fa8;
    --quartz-rose: #c4a0a0;
    --mineral-gold: #b8a06a;
    --frost-shadow: rgba(58, 74, 92, 0.4);
    --frost-shadow-hex: #3a4a5c;
    --caption-gray: #6a7b8e;
    --light-gray: #e8ecf0;

    --font-display: 'Epilogue', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-mono: 'Azeret Mono', monospace;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--deep-shale);
    background-color: var(--crystal-white);
    overflow-x: hidden;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================================
   HERO: Crystal Canopy
   ============================================================ */
.crystal-canopy {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--crystal-white);
    z-index: 10;
}

/* Entry line animation */
.hero-entry-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--glacial-blue);
    transform: scaleX(0);
    transform-origin: center;
    z-index: 5;
    animation: drawLine 600ms ease-out forwards;
}

@keyframes drawLine {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

/* Landscape background */
.hero-landscape {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg,
            rgba(91, 143, 168, 0.08) 0%,
            transparent 50%
        ),
        linear-gradient(180deg,
            #7ba6b8 0%,
            #9bbcc8 15%,
            #a8c4cf 25%,
            #b5cdd6 35%,
            #8aab8e 45%,
            #6e9872 50%,
            #7da47f 55%,
            #8fb490 62%,
            #9dbf9c 70%,
            #7a8f6d 78%,
            #6b7d5e 85%,
            #5d6e52 92%,
            #4f6045 100%
        );
    filter: saturate(0.7);
    opacity: 0;
    animation: fadeInLandscape 800ms ease-out 600ms forwards;
    z-index: 1;
}

/* Cool-blue overlay for photo treatment */
.hero-landscape::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glacial-blue);
    mix-blend-mode: color;
    opacity: 0.08;
}

@keyframes fadeInLandscape {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Crystal Overlay SVG */
.crystal-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.crystal-poly {
    fill: var(--glacial-blue);
    fill-opacity: 0.08;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 1;
    filter: drop-shadow(2px 3px 4px rgba(58, 74, 92, 0.15));
    opacity: 0;
    transition: opacity 400ms ease-out;
    backdrop-filter: blur(4px);
}

.crystal-poly:nth-child(odd) {
    fill: var(--steel-fog);
    fill-opacity: 0.1;
}

.crystal-poly:nth-child(3n) {
    fill: var(--quartz-rose);
    fill-opacity: 0.07;
}

.crystal-poly:nth-child(5n) {
    fill: var(--mineral-gold);
    fill-opacity: 0.06;
}

.crystal-poly.visible {
    opacity: 0.9;
}

/* Hero Title */
.hero-title-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.8rem, 7vw, 5.2rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--deep-shale);
    text-shadow: 0 2px 8px rgba(58, 74, 92, 0.2);
}

.hero-title .char {
    display: inline-block;
    transform: scaleY(0);
    transform-origin: bottom;
    opacity: 0;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms ease;
}

.hero-title .char.grown {
    transform: scaleY(1);
    opacity: 1;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 7;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeIn 500ms ease-out 2200ms forwards;
}

.scroll-label {
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6a7b8e;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--glacial-blue);
    animation: scrollPulse 2s ease-in-out infinite 2700ms;
}

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(1); opacity: 0.5; }
    50% { transform: scaleY(0.5); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================================
   STRATUM BANDS (Content Sections)
   ============================================================ */
.stratum {
    position: relative;
    min-height: 80vh;
    padding: 120px 0;
    overflow: hidden;
}

/* Frost grain texture on light backgrounds */
.stratum::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Beveled top edge - highlight over shadow (#3a4a5c) */
.stratum::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), rgba(58,74,92,0.2));
    z-index: 2;
    border-bottom: 0 solid #3a4a5c;
}

/* Diagonal clip-path sections */
.stratum-1 {
    background-color: #e8ecf0;
    clip-path: polygon(0 40px, 100% 0, 100% calc(100% - 30px), 0 100%);
    z-index: 9;
    margin-top: -60px;
}

.stratum-2 {
    background-color: var(--slate-mist);
    clip-path: polygon(0 0, 100% 50px, 100% 100%, 0 calc(100% - 40px));
    z-index: 8;
    margin-top: -60px;
}

.stratum-3 {
    background-color: var(--crystal-white);
    clip-path: polygon(0 35px, 100% 0, 100% calc(100% - 45px), 0 100%);
    z-index: 7;
    margin-top: -60px;
}

.stratum-4 {
    background-color: var(--slate-mist);
    clip-path: polygon(0 0, 100% 40px, 100% 100%, 0 calc(100% - 35px));
    z-index: 6;
    margin-top: -60px;
}

.stratum-inner {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    z-index: 1;
}

/* Grid: 16-column, text left (cols 2-8), visual right (cols 10-15) */
.stratum-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 24px;
    align-items: center;
    min-height: 50vh;
}

.stratum-text {
    grid-column: 2 / 9;
}

.stratum-visual {
    grid-column: 10 / 16;
    position: relative;
}

/* Section headings */
.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--deep-shale);
    margin-bottom: 32px;
    font-variation-settings: 'wght' 400;
    transition: font-variation-settings 500ms ease-out;
}

.section-heading.solidified {
    font-variation-settings: 'wght' 700;
}

/* Body text */
.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--deep-shale);
    max-width: 62ch;
}

/* Photography reveal */
.photo-reveal {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 2px 3px 12px var(--frost-shadow);
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: var(--slate-mist);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transition: clip-path 600ms ease-out;
    z-index: 2;
}

.photo-reveal.revealed .photo-overlay {
    clip-path: polygon(100% 0, 110% 0, 110% 110%, 92% 110%);
}

.photo-image {
    position: absolute;
    inset: 0;
    filter: saturate(0.7);
    z-index: 1;
}

/* Cool-blue overlay on photos */
.photo-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glacial-blue);
    mix-blend-mode: color;
    opacity: 0.08;
}

/* Photo gradient backgrounds (landscape imagery) */
.photo-1 {
    background: linear-gradient(160deg,
        #7ba6b8 0%, #a8c4cf 30%, #c8d5dc 50%,
        #b0bfaa 60%, #8aab8e 75%, #6e9872 100%
    );
}

.photo-2 {
    background: linear-gradient(145deg,
        #8a9bae 0%, #b0bcc8 25%,
        #c4cdd6 45%, #a8b0a0 60%,
        #8f9f86 80%, #7a8f6d 100%
    );
}

.photo-3 {
    background: linear-gradient(170deg,
        #6a8fa0 0%, #9ab8c6 20%,
        #c0cdd4 40%, #d1d9e2 55%,
        #b5c0aa 70%, #8fa890 85%, #6e8e6a 100%
    );
}

.photo-4 {
    background: linear-gradient(155deg,
        #5b7d8e 0%, #8aa8b8 25%,
        #a8bcc6 45%, #b8c4be 60%,
        #a0b498 80%, #7e9a76 100%
    );
}

/* Section crystal decorations */
.section-crystals {
    position: absolute;
    top: -20px;
    right: -30px;
    width: 200px;
    height: 200px;
    z-index: 3;
    pointer-events: none;
}

.section-crystals polygon {
    fill: var(--glacial-blue);
    fill-opacity: 0.1;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 1;
    filter: drop-shadow(2px 3px 4px rgba(58, 74, 92, 0.15));
}

.section-crystals polygon:nth-child(even) {
    fill: var(--quartz-rose);
    fill-opacity: 0.08;
}

.section-crystals polygon:nth-child(3n) {
    fill: var(--mineral-gold);
    fill-opacity: 0.06;
}

/* ============================================================
   CRYSTAL PANEL - Tilt-3D Interaction
   ============================================================ */
.crystal-panel {
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* ============================================================
   MINERAL SHELF (Footer)
   ============================================================ */
.mineral-shelf {
    position: relative;
    background-color: var(--deep-shale);
    padding: 120px 40px 60px;
    clip-path: polygon(0 60px, 50% 0, 100% 60px, 100% 100%, 0 100%);
    margin-top: -60px;
    z-index: 5;
    overflow: hidden;
}

/* Diamond cross-hatch texture */
.mineral-shelf::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 30px,
            rgba(255, 255, 255, 0.03) 30px,
            rgba(255, 255, 255, 0.03) 31px
        ),
        repeating-linear-gradient(
            120deg,
            transparent,
            transparent 30px,
            rgba(255, 255, 255, 0.03) 30px,
            rgba(255, 255, 255, 0.03) 31px
        );
    pointer-events: none;
    z-index: 0;
}

.footer-inner {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    z-index: 1;
    padding: 80px 0;
}

.footer-title {
    display: inline-block;
}

.footer-heading {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3.6rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: #e0e6ec;
    margin-bottom: 16px;
}

.footer-caption {
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6a7b8e;
}

.footer-bottom {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-label {
    font-family: var(--font-mono);
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--steel-fog);
    opacity: 0.5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .stratum-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .stratum-text {
        grid-column: 1;
        padding: 0 20px;
    }

    .stratum-visual {
        grid-column: 1;
        padding: 0 20px;
    }

    .stratum-inner {
        padding: 0 24px;
    }
}

@media (max-width: 768px) {
    .stratum {
        padding: 80px 0;
        min-height: auto;
    }

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

    .section-crystals {
        display: none;
    }

    .mineral-shelf {
        padding: 80px 24px 40px;
    }
}
