/* ============================================================
   bada.moe - Luxury Atelier / Deep-Space Marble HUD
   ============================================================ */

/* --- Design Palette Reference --- */
/* #F5F0E8 Alabaster Veil (Primary Background)      */
/* #D8CFC2 Smoky Travertine (Secondary Background)  */
/* #2A2520 Obsidian Warm (Deep Ground)               */
/* #3B3530 Charred Umber (Text Primary)              */
/* #8A7E72 Fossil Grey (Text Secondary)              */
/* #C9A96E Honeyed Gold (Accent / HUD Glow)          */
/* #E8D5A3 Champagne Flash (Accent Bright)           */
/* #B8978A Rose Onyx (Marble Vein)                   */

:root {
    --color-alabaster: #F5F0E8;
    --color-travertine: #D8CFC2;
    --color-obsidian: #2A2520;
    --color-umber: #3B3530;
    --color-fossil: #8A7E72;
    --color-gold: #C9A96E;
    --color-champagne: #E8D5A3;
    --color-rose: #B8978A;
}

/* --- Reset & Base --- */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    font-weight: 400;
    line-height: 1.85;
    letter-spacing: 0.02em;
    color: var(--color-umber);
    background: var(--color-alabaster);
    overflow-x: hidden;
}

/* --- Typography --- */

.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-fossil);
    display: block;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(2.2rem, 4.5vw, 4.4rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.15;
    color: var(--color-umber);
    margin-bottom: 2rem;
}

.section-text {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    font-weight: 400;
    line-height: 1.85;
    letter-spacing: 0.02em;
    color: var(--color-umber);
    max-width: 62ch;
}

/* Dark section text inversion */
.section-dark .section-title,
.section-dark .section-text {
    color: var(--color-alabaster);
}

.section-dark .section-label {
    color: var(--color-rose);
}

/* --- HUD Coordinate Readouts --- */

.hud-coord {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    opacity: 0.5;
    color: var(--color-gold);
    position: absolute;
    pointer-events: none;
    white-space: nowrap;
}

.hud-coord-top {
    top: 5%;
    right: 12%;
}

.hud-coord-bottom {
    bottom: 5%;
    left: 12%;
}

/* --- Parallax Section Container --- */

.parallax-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    clip-path: inset(0);
}

/* --- Parallax Background Layer (marble) --- */

.parallax-bg {
    position: absolute;
    top: -15%;
    left: -5%;
    width: 110%;
    height: 130%;
    will-change: transform;
    transform: scale(1.15);
    transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.parallax-section.in-view .parallax-bg {
    transform: scale(1.0);
}

/* --- Marble Variant 1: Calacatta White --- */

.marble-calacatta,
.marble-calacatta-alt,
.marble-calacatta-close {
    background-color: var(--color-alabaster);
    background-image:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(216, 207, 194, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 70% 60%, rgba(184, 151, 138, 0.10) 0%, transparent 65%),
        radial-gradient(ellipse 400px 300px at 45% 80%, rgba(216, 207, 194, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 550px 250px at 80% 20%, rgba(184, 151, 138, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 300px 500px at 10% 70%, rgba(216, 207, 194, 0.09) 0%, transparent 50%),
        conic-gradient(from 45deg at 35% 45%, rgba(184, 151, 138, 0.04) 0deg, transparent 40deg, rgba(216, 207, 194, 0.03) 120deg, transparent 180deg);
}

.marble-calacatta-alt {
    background-image:
        radial-gradient(ellipse 500px 350px at 60% 25%, rgba(184, 151, 138, 0.11) 0%, transparent 65%),
        radial-gradient(ellipse 400px 450px at 25% 70%, rgba(216, 207, 194, 0.13) 0%, transparent 60%),
        radial-gradient(ellipse 350px 300px at 85% 50%, rgba(184, 151, 138, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 600px 200px at 40% 15%, rgba(216, 207, 194, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 450px 380px at 15% 40%, rgba(184, 151, 138, 0.06) 0%, transparent 50%),
        conic-gradient(from 120deg at 70% 55%, rgba(216, 207, 194, 0.05) 0deg, transparent 60deg, rgba(184, 151, 138, 0.03) 180deg, transparent 270deg);
}

.marble-calacatta-close {
    background-image:
        radial-gradient(ellipse 550px 300px at 50% 40%, rgba(216, 207, 194, 0.14) 0%, transparent 65%),
        radial-gradient(ellipse 400px 500px at 20% 20%, rgba(184, 151, 138, 0.09) 0%, transparent 60%),
        radial-gradient(ellipse 600px 250px at 75% 75%, rgba(216, 207, 194, 0.11) 0%, transparent 55%),
        radial-gradient(ellipse 300px 400px at 90% 30%, rgba(184, 151, 138, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse 500px 350px at 35% 85%, rgba(216, 207, 194, 0.08) 0%, transparent 45%),
        conic-gradient(from 200deg at 50% 50%, rgba(184, 151, 138, 0.03) 0deg, transparent 50deg, rgba(216, 207, 194, 0.04) 150deg, transparent 220deg);
}

/* --- Marble Variant 2: Honey Onyx --- */

.marble-onyx,
.marble-onyx-alt {
    background-color: var(--color-alabaster);
    background-image:
        radial-gradient(ellipse 500px 400px at 30% 40%, rgba(201, 169, 110, 0.12) 0%, transparent 65%),
        radial-gradient(ellipse 600px 300px at 70% 25%, rgba(232, 213, 163, 0.14) 0%, transparent 60%),
        radial-gradient(ellipse 400px 350px at 50% 75%, rgba(138, 126, 114, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 350px 500px at 15% 60%, rgba(201, 169, 110, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse 550px 250px at 85% 80%, rgba(232, 213, 163, 0.09) 0%, transparent 45%),
        conic-gradient(from 80deg at 45% 50%, rgba(201, 169, 110, 0.05) 0deg, transparent 45deg, rgba(232, 213, 163, 0.04) 130deg, transparent 200deg);
}

.marble-onyx-alt {
    background-image:
        radial-gradient(ellipse 450px 350px at 65% 35%, rgba(232, 213, 163, 0.13) 0%, transparent 65%),
        radial-gradient(ellipse 500px 400px at 20% 65%, rgba(201, 169, 110, 0.11) 0%, transparent 60%),
        radial-gradient(ellipse 350px 300px at 80% 70%, rgba(138, 126, 114, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 600px 250px at 40% 20%, rgba(201, 169, 110, 0.09) 0%, transparent 50%),
        radial-gradient(ellipse 400px 450px at 10% 85%, rgba(232, 213, 163, 0.10) 0%, transparent 45%),
        conic-gradient(from 250deg at 60% 40%, rgba(232, 213, 163, 0.04) 0deg, transparent 55deg, rgba(201, 169, 110, 0.03) 160deg, transparent 240deg);
}

/* --- Marble Variant 3: Smoky Travertine (dark) --- */

.marble-travertine,
.marble-travertine-alt {
    background-color: var(--color-obsidian);
    background-image:
        radial-gradient(ellipse 600px 150px at 30% 35%, rgba(59, 53, 48, 0.35) 0%, transparent 70%),
        radial-gradient(ellipse 500px 100px at 60% 55%, rgba(59, 53, 48, 0.25) 0%, transparent 65%),
        radial-gradient(ellipse 700px 120px at 20% 75%, rgba(201, 169, 110, 0.05) 0%, transparent 55%),
        radial-gradient(ellipse 550px 80px at 80% 25%, rgba(59, 53, 48, 0.30) 0%, transparent 50%),
        radial-gradient(ellipse 400px 100px at 45% 90%, rgba(59, 53, 48, 0.20) 0%, transparent 45%),
        conic-gradient(from 10deg at 50% 50%, rgba(59, 53, 48, 0.06) 0deg, transparent 30deg, rgba(201, 169, 110, 0.02) 90deg, transparent 150deg);
}

.marble-travertine-alt {
    background-image:
        radial-gradient(ellipse 500px 120px at 50% 30%, rgba(59, 53, 48, 0.30) 0%, transparent 65%),
        radial-gradient(ellipse 600px 100px at 25% 60%, rgba(59, 53, 48, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 450px 90px at 75% 80%, rgba(201, 169, 110, 0.05) 0%, transparent 55%),
        radial-gradient(ellipse 550px 130px at 40% 45%, rgba(59, 53, 48, 0.28) 0%, transparent 50%),
        radial-gradient(ellipse 400px 110px at 85% 15%, rgba(59, 53, 48, 0.22) 0%, transparent 45%),
        conic-gradient(from 170deg at 55% 60%, rgba(59, 53, 48, 0.05) 0deg, transparent 40deg, rgba(201, 169, 110, 0.02) 120deg, transparent 180deg);
}

/* --- Parallax Midground Layer (HUD) --- */

.parallax-mid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
    z-index: 2;
    pointer-events: none;
}

/* --- HUD Arc Segments (SVG) --- */

.hud-arc {
    position: absolute;
    width: 200px;
    height: 200px;
    color: rgba(201, 169, 110, 0.4);
    animation: hudRotate 60s linear infinite;
}

.hud-arc-tl {
    top: 8%;
    left: 6%;
}

.hud-arc-tr {
    top: 8%;
    right: 6%;
}

.hud-arc-bl {
    bottom: 8%;
    left: 6%;
}

.hud-arc-br {
    bottom: 8%;
    right: 6%;
}

@keyframes hudRotate {
    to { transform: rotate(360deg); }
}

/* --- HUD Targeting Reticles (SVG) --- */

.hud-reticle {
    position: absolute;
    width: 160px;
    height: 160px;
    color: rgba(201, 169, 110, 0.6);
    opacity: 0.3;
    animation: hudPulse 4s ease-in-out infinite;
}

.reticle-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hud-reticle-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hud-reticle-left {
    top: 50%;
    left: 15%;
    transform: translateY(-50%);
}

.hud-reticle-right {
    top: 50%;
    right: 15%;
    transform: translateY(-50%);
}

@keyframes hudPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* --- HUD Scan Lines --- */

.hud-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(201, 169, 110, 0.15);
    animation: hudScan 12s linear infinite;
    pointer-events: none;
}

@keyframes hudScan {
    from { transform: translateY(0); }
    to { transform: translateY(100vh); }
}

/* --- Grid Registration Marks --- */

.grid-mark {
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0.08;
    pointer-events: none;
}

.grid-mark::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--color-fossil);
    transform: translateY(-50%);
}

.grid-mark::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: var(--color-fossil);
    transform: translateX(-50%);
}

/* --- Parallax Foreground Layer (content) --- */

.parallax-fg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 3;
}

.section-content {
    padding-left: 8%;
    padding-right: 8%;
    max-width: 58.33%;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 200ms,
                transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 200ms;
}

.parallax-section.in-view .section-content {
    opacity: 1;
    transform: scale(1.0);
}

/* Wider margin on large screens */
@media (min-width: 1440px) {
    .section-content {
        padding-left: 12%;
        padding-right: 12%;
    }
}

/* --- Scroll Progress Indicator --- */

.progress-indicator {
    position: fixed;
    top: 0;
    right: 24px;
    width: 1px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

.progress-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: rgba(201, 169, 110, 0.12);
}

.progress-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 0%;
    background: var(--color-gold);
    transform-origin: top;
    transition: height 100ms linear;
}

.progress-diamond {
    position: absolute;
    left: -3px;
    width: 6px;
    height: 6px;
    background: var(--color-gold);
    transform: rotate(45deg);
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.progress-diamond.active {
    opacity: 1;
}

/* --- Dark Section HUD Enhancement --- */

.section-dark .hud-arc {
    color: rgba(201, 169, 110, 0.6);
}

.section-dark .hud-reticle {
    color: rgba(201, 169, 110, 0.7);
}

.section-dark .hud-coord {
    opacity: 0.6;
}

.section-dark .hud-scanline {
    background: rgba(201, 169, 110, 0.2);
}

.section-dark .grid-mark::before,
.section-dark .grid-mark::after {
    background: rgba(245, 240, 232, 0.08);
}

/* --- Section Transition Overlap Effect (HUD pulse at section boundaries) --- */

.parallax-section.transition-zone .hud-arc {
    color: rgba(201, 169, 110, 0.7);
    transition: color 400ms ease;
}

.parallax-section.transition-zone .hud-reticle {
    opacity: 0.7;
    transition: opacity 400ms ease;
}

.parallax-section.transition-zone .hud-coord {
    opacity: 0.7;
    transition: opacity 400ms ease;
}

/* --- Prefers Reduced Motion --- */

@media (prefers-reduced-motion: reduce) {
    .hud-arc {
        animation: none;
    }

    .hud-reticle {
        animation: none;
        opacity: 0.3;
    }

    .hud-scanline {
        animation: none;
        display: none;
    }

    .parallax-bg {
        transition: none;
        transform: scale(1.0);
    }

    .section-content {
        transition: none;
        opacity: 1;
        transform: scale(1.0);
    }
}

/* --- Responsive Adjustments --- */

@media (max-width: 768px) {
    .section-content {
        max-width: 100%;
        padding-left: 6%;
        padding-right: 6%;
    }

    .section-title {
        font-size: clamp(1.6rem, 6vw, 2.4rem);
    }

    .hud-arc {
        width: 120px;
        height: 120px;
    }

    .hud-reticle {
        width: 100px;
        height: 100px;
    }

    .progress-indicator {
        right: 12px;
    }

    .hud-coord-top {
        right: 4%;
        font-size: 0.65rem;
    }

    .hud-coord-bottom {
        left: 4%;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: clamp(1.3rem, 7vw, 1.8rem);
    }

    .section-label {
        font-size: 0.85rem;
    }

    .hud-arc {
        width: 80px;
        height: 80px;
    }

    .hud-reticle {
        display: none;
    }
}

/* --- Selection Color --- */

::selection {
    background: rgba(201, 169, 110, 0.3);
    color: var(--color-obsidian);
}

/* --- Scrollbar Styling --- */

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--color-alabaster);
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 110, 0.4);
}
