/* =========================================
   desca.work - McBling Honeycomb Design
   Deep Burgundy Palette | Hexagonal Grid
   Fonts: Fredoka, Nunito, Bungee Shade
   ========================================= */

/* --- CSS Custom Properties --- */
:root {
    --deep-void: #0A0406;
    --burgundy-velvet: #4A0E1E;
    --oxblood: #6B1A2A;
    --chrome-rose: #D4A0B0;
    --rhinestone-gold: #C8A84E;
    --hot-magenta: #E8154F;
    --blush-white: #F2E4E8;
    --dusty-mauve: #9A7585;
    --deep-burgundy: #2E0B14;
    --pure-black: #000000;
    --chrome-light: #B0B0B0;
    --chrome-white: #FFFFFF;
    --chrome-mid: #808080;

    --hex-clip: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    --sparkle-clip: polygon(50% 0%, 55% 40%, 100% 50%, 55% 60%, 50% 100%, 45% 60%, 0% 50%, 45% 40%);
    --hex-width: clamp(180px, 22vw, 320px);
    --hex-gap: 6px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-void);
    color: var(--blush-white);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--chrome-rose);
}

.hero-title {
    font-family: 'Bungee Shade', cursive;
    font-size: clamp(3.5rem, 10vw + 0.5rem, 9rem);
    color: var(--chrome-rose);
    text-transform: uppercase;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-shadow:
        0 0 20px rgba(200, 168, 78, 0.4),
        0 0 40px rgba(232, 21, 79, 0.2),
        2px 2px 0 var(--deep-burgundy);
    white-space: nowrap;
}

.hex-heading {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hex-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.1vw, 1rem);
    color: var(--blush-white);
    line-height: 1.55;
}

.final-heading {
    font-family: 'Bungee Shade', cursive;
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    color: var(--chrome-rose);
    text-shadow:
        0 0 30px rgba(200, 168, 78, 0.5),
        0 0 60px rgba(232, 21, 79, 0.3);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.final-subtext {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: var(--dusty-mauve);
}

/* --- Hex Navigation (fixed left strip) --- */
.hex-nav {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0 8px 4px;
}

.hex-nav-item {
    display: block;
    width: 48px;
    height: 55px;
    position: relative;
    text-decoration: none;
    color: var(--burgundy-velvet);
    transition: color 0.3s ease;
}

.hex-nav-item.active {
    color: var(--rhinestone-gold);
}

.hex-nav-item:hover {
    color: var(--oxblood);
}

/* Active nav sparkle pulse */
.hex-nav-item.active .hex-nav-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%);
    clip-path: var(--sparkle-clip);
    background: var(--rhinestone-gold);
    animation: navSparkle 1.5s ease-in-out infinite;
}

.hex-nav-icon {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.nav-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Bungee Shade', cursive;
    font-size: 0.55rem;
    color: var(--blush-white);
    z-index: 2;
    pointer-events: none;
}

@keyframes navSparkle {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.5) rotate(0deg); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(45deg); }
}

/* --- Angular Overlay Lines (30deg/150deg diagonals) --- */
.angular-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.angle-line {
    position: absolute;
    width: 200%;
    height: 1px;
    background: var(--rhinestone-gold);
    opacity: 0.08;
    transform-origin: center center;
}

.angle-line-1 { top: 12%; left: -50%; transform: rotate(30deg); }
.angle-line-2 { top: 30%; left: -50%; transform: rotate(-30deg); }
.angle-line-3 { top: 48%; left: -50%; transform: rotate(30deg); }
.angle-line-4 { top: 66%; left: -50%; transform: rotate(-30deg); }
.angle-line-5 { top: 22%; left: -50%; transform: rotate(150deg); }
.angle-line-6 { top: 56%; left: -50%; transform: rotate(150deg); }
.angle-line-7 { top: 80%; left: -50%; transform: rotate(30deg); }
.angle-line-8 { top: 90%; left: -50%; transform: rotate(150deg); }

/* --- Sections --- */
.section {
    position: relative;
    width: 100%;
    z-index: 2;
}

.section-entry {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.section-expansion {
    padding: 80px 0 60px;
}

.section-density {
    padding: 60px 0;
}

.section-deep {
    padding: 60px 0;
}

.section-resolution {
    padding: 80px 0 120px;
    background: linear-gradient(to bottom, var(--deep-void), var(--pure-black));
}

/* --- Hero Hex Frame --- */
.hero-hex-frame {
    position: relative;
    width: 70vw;
    max-width: 700px;
    aspect-ratio: 1 / 1.155;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-blob {
    position: absolute;
    width: 100%;
    height: 100%;
    filter: blur(2px);
    mix-blend-mode: screen;
}

.hero-hex-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-hex-border svg {
    width: 100%;
    height: 100%;
}

.hero-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 11;
}

.sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    clip-path: var(--sparkle-clip);
    animation: sparkleBurst 2s ease-out forwards;
    opacity: 0;
}

.sparkle-1 { top: 30%; left: 20%; background: var(--rhinestone-gold); animation-delay: 0.2s; }
.sparkle-2 { top: 18%; left: 48%; background: var(--chrome-white); animation-delay: 0.4s; width: 10px; height: 10px; }
.sparkle-3 { top: 32%; left: 72%; background: var(--rhinestone-gold); animation-delay: 0.6s; }
.sparkle-4 { top: 55%; left: 28%; background: var(--chrome-white); animation-delay: 0.8s; width: 8px; height: 8px; }
.sparkle-5 { top: 62%; left: 68%; background: var(--rhinestone-gold); animation-delay: 1.0s; }
.sparkle-6 { top: 42%; left: 42%; background: var(--chrome-white); animation-delay: 0.3s; width: 14px; height: 14px; }
.sparkle-7 { top: 48%; left: 58%; background: var(--rhinestone-gold); animation-delay: 0.7s; width: 10px; height: 10px; }
.sparkle-8 { top: 72%; left: 50%; background: var(--chrome-white); animation-delay: 1.1s; width: 8px; height: 8px; }

@keyframes sparkleBurst {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    25% { opacity: 1; transform: scale(1.4) rotate(20deg); }
    50% { opacity: 0.9; transform: scale(0.7) rotate(35deg); }
    75% { opacity: 0.5; transform: scale(1.1) rotate(45deg); }
    100% { opacity: 0; transform: scale(0) rotate(60deg); }
}

/* --- Chevron Down (pulsing) --- */
.chevron-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: chevronPulse 2s ease-in-out infinite;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(8px); }
}

/* --- Section Chevrons (transition markers) --- */
.section-chevrons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 40px 0;
    animation: chevronPulse 2.5s ease-in-out infinite;
}

/* --- Honeycomb Grid --- */
.honeycomb-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hex-gap);
    padding: 0 60px;
}

.hex-row {
    display: flex;
    justify-content: center;
    gap: var(--hex-gap);
}

/* Stagger offset for even rows (honeycomb interlock) */
.hex-row:nth-child(even) {
    transform: translateX(calc(var(--hex-width) / 2 + var(--hex-gap) / 2));
}

/* Negative margin to create honeycomb overlap */
.hex-row + .hex-row {
    margin-top: calc(var(--hex-width) * -0.14);
}

/* --- Hex Cells --- */
.hex-cell {
    width: var(--hex-width);
    aspect-ratio: 1 / 1.155;
    clip-path: var(--hex-clip);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    flex-shrink: 0;
}

.hex-cell:hover {
    transform: scale(1.03);
    z-index: 5;
}

.hex-cell:hover .hex-inner {
    border-color: var(--rhinestone-gold);
}

/* Sparkle pseudo-elements on hover */
.hex-cell:hover::before,
.hex-cell:hover::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    clip-path: var(--sparkle-clip);
    background: var(--rhinestone-gold);
    z-index: 20;
    animation: hoverSparkle 0.4s ease-out forwards;
}

.hex-cell:hover::before {
    top: var(--sparkle-y1, 20%);
    right: var(--sparkle-x1, 20%);
}

.hex-cell:hover::after {
    bottom: var(--sparkle-y2, 25%);
    left: var(--sparkle-x2, 25%);
    background: var(--chrome-white);
    animation-delay: 0.1s;
    width: 8px;
    height: 8px;
}

@keyframes hoverSparkle {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(22deg); }
    100% { opacity: 0; transform: scale(0) rotate(45deg); }
}

.hex-inner {
    width: 100%;
    height: 100%;
    background: var(--burgundy-velvet);
    clip-path: var(--hex-clip);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15%;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

/* Content cells */
.hex-cell-content .hex-inner {
    background: var(--burgundy-velvet);
    box-shadow: inset 0 0 30px rgba(46, 11, 20, 0.5);
}

/* Magenta accent cells (Hot Magenta intensifying in density section) */
.hex-cell-magenta .hex-inner {
    background: linear-gradient(135deg, var(--burgundy-velvet) 0%, var(--hot-magenta) 100%);
    box-shadow: inset 0 0 40px rgba(232, 21, 79, 0.3);
}

.hex-cell-magenta .hex-heading {
    color: var(--chrome-white);
}

/* Blob cells */
.hex-cell-blob .hex-inner {
    background: var(--deep-burgundy);
    padding: 0;
}

.cell-blob {
    width: 100%;
    height: 100%;
    filter: blur(2px);
    mix-blend-mode: screen;
}

/* Chrome / mirror reflective cells (1 in 8 approx) */
.hex-chrome {
    background: linear-gradient(135deg, #B0B0B0 0%, #FFFFFF 25%, #808080 50%, #FFFFFF 75%, #B0B0B0 100%) !important;
    background-size: 200% 200% !important;
    animation: chromeShift 8s ease-in-out infinite alternate;
}

@keyframes chromeShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* Decorative pattern cells (angular cross-hatch) */
.hex-decorative-pattern {
    background:
        repeating-linear-gradient(
            30deg,
            transparent,
            transparent 8px,
            rgba(200, 168, 78, 0.08) 8px,
            rgba(200, 168, 78, 0.08) 9px
        ),
        repeating-linear-gradient(
            150deg,
            transparent,
            transparent 8px,
            rgba(212, 160, 176, 0.06) 8px,
            rgba(212, 160, 176, 0.06) 9px
        ),
        var(--burgundy-velvet) !important;
}

/* Angular cut overlay on select cells */
.hex-cell-decorative .hex-inner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 40%;
    clip-path: polygon(100% 0%, 0% 0%, 100% 100%);
    background: linear-gradient(135deg, var(--chrome-light) 0%, var(--chrome-mid) 50%, var(--chrome-light) 100%);
    opacity: 0.15;
}

/* Final cell (large, resolution section) */
.hex-cell-final {
    width: calc(var(--hex-width) * 2.5);
    aspect-ratio: 1 / 1.155;
}

.hex-cell-final .hex-inner {
    background: radial-gradient(ellipse at center, var(--burgundy-velvet), var(--deep-void));
}

.final-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    width: 80%;
}

.blob-final {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: blur(3px);
    mix-blend-mode: screen;
}

/* --- Fade In (Intersection Observer controlled) --- */
.fade-in {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fade-in.visible {
    opacity: 1;
}

/* --- Ripple Effect (JS-created elements) --- */
#ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.hex-ripple {
    position: absolute;
    clip-path: var(--hex-clip);
    border: 2px solid var(--rhinestone-gold);
    pointer-events: none;
    animation: hexRippleExpand 0.6s ease-out forwards;
}

@keyframes hexRippleExpand {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* --- Ambient Sparkles (JS-created elements) --- */
#ambient-sparkles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 60;
}

.ambient-sparkle {
    position: absolute;
    clip-path: var(--sparkle-clip);
    animation: ambientSparkleAnim 0.4s ease-out forwards;
}

@keyframes ambientSparkleAnim {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    40% { opacity: 1; transform: scale(1) rotate(22deg); }
    100% { opacity: 0; transform: scale(0) rotate(45deg); }
}

/* --- Mobile Responsive (below 640px: single-column hex stack) --- */
@media (max-width: 640px) {
    :root {
        --hex-width: 90vw;
    }

    .hex-nav {
        display: none;
    }

    .hex-row {
        flex-direction: column;
        align-items: center;
    }

    .hex-row:nth-child(even) {
        transform: none;
    }

    .hex-row + .hex-row {
        margin-top: var(--hex-gap);
    }

    .honeycomb-grid {
        padding: 0 10px;
    }

    .hero-hex-frame {
        width: 90vw;
    }

    .hex-cell-final {
        width: 90vw;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .angular-lines {
        display: none;
    }
}

/* --- Tablet Responsive --- */
@media (min-width: 641px) and (max-width: 1024px) {
    :root {
        --hex-width: clamp(150px, 20vw, 250px);
    }
}

/* --- Selection color --- */
::selection {
    background: var(--hot-magenta);
    color: var(--chrome-white);
}

/* --- Scrollbar styling (chrome/webkit) --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--deep-void);
}

::-webkit-scrollbar-thumb {
    background: var(--burgundy-velvet);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--oxblood);
}
