/* ===================================================
   gabs.games - Gold-Black Luxury Hexagonal Arcade
   Neubrutalism + Leather + Honeycomb
   =================================================== */

/* --- Spring Easing Approximation --- */
:root {
    --spring-ease: linear(
        0, 0.006, 0.025, 0.056, 0.099, 0.153, 0.216, 0.287,
        0.364, 0.445, 0.528, 0.612, 0.694, 0.772, 0.845,
        0.911, 0.968, 1.015, 1.052, 1.078, 1.093, 1.098,
        1.093, 1.080, 1.061, 1.037, 1.011, 0.985, 0.961,
        0.941, 0.926, 0.917, 0.914, 0.916, 0.923, 0.933,
        0.946, 0.960, 0.974, 0.987, 0.998, 1.006, 1.011,
        1.013, 1.012, 1.009, 1.005, 1.000
    );
    --spring-fast: linear(
        0, 0.011, 0.044, 0.098, 0.173, 0.265, 0.371, 0.486,
        0.607, 0.727, 0.842, 0.946, 1.034, 1.104, 1.154,
        1.184, 1.194, 1.187, 1.166, 1.133, 1.093, 1.049,
        1.005, 0.964, 0.929, 0.903, 0.886, 0.879, 0.882,
        0.893, 0.910, 0.932, 0.955, 0.978, 0.997, 1.012,
        1.021, 1.024, 1.021, 1.014, 1.005, 0.997, 0.991,
        0.988, 0.988, 0.991, 0.996, 1.000
    );

    /* Palette */
    --vault-black: #0A0A0A;
    --obsidian: #1A1A1A;
    --burnished-gold: #D4A017;
    --pale-gold: #F5D060;
    --warm-parchment: #F5E6C8;
    --aged-ivory: #E8DCC8;
    --deep-umber: #3D2B1F;
    --brass-oxide: #8B6914;
    --pure-black: #000000;

    /* Hex Sizing */
    --hex-large: 320px;
    --hex-medium: 240px;
    --hex-small: 160px;
    --hex-mini: 56px;
    --hex-crown: 380px;
    --hex-nav: 140px;
    --hex-border: 4px;
    --hex-shadow: 6px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--vault-black);
    color: var(--aged-ivory);
    font-family: 'Alegreya', serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* --- Leather Surface Background --- */
.leather-surface {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            rgba(61, 43, 31, 0.03) 0deg,
            transparent 2deg,
            transparent 10deg
        ),
        radial-gradient(ellipse at center, var(--obsidian) 0%, var(--vault-black) 100%);
    filter: url(#leather-noise);
}

/* --- Hexagonal Clip Path --- */
.hex-cell {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: relative;
    transition: transform 0.5s var(--spring-fast), box-shadow 0.4s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.hex-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20%;
}

/* --- Hex Cell Sizes --- */
.hex-large {
    width: var(--hex-large);
    height: calc(var(--hex-large) * 1.1547);
}

.hex-medium {
    width: var(--hex-medium);
    height: calc(var(--hex-medium) * 1.1547);
}

.hex-small {
    width: var(--hex-small);
    height: calc(var(--hex-small) * 1.1547);
}

.hex-mini {
    width: var(--hex-mini);
    height: calc(var(--hex-mini) * 1.1547);
}

/* --- Hex Cell Base Styling (Neubrutalist) --- */
.hex-content,
.hex-nav,
.hex-vault,
.hex-crown-center,
.hex-mini {
    background: var(--obsidian);
    border: none;
    position: relative;
}

.hex-content::before,
.hex-nav::before,
.hex-vault::before,
.hex-crown-center::before,
.hex-mini::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--vault-black);
    z-index: -2;
    transform: translate(var(--hex-shadow), var(--hex-shadow));
}

.hex-content::after,
.hex-nav::after,
.hex-vault::after,
.hex-crown-center::after {
    content: '';
    position: absolute;
    inset: -1px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, var(--deep-umber) 0%, #000000 100%);
    z-index: -1;
}

/* Inner face sits on top of border layer */
.hex-content .hex-inner,
.hex-nav .hex-inner,
.hex-vault .hex-inner,
.hex-crown-center .hex-inner {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--obsidian);
    z-index: 1;
    margin: var(--hex-border);
}

/* Resting golden glow */
.hex-content,
.hex-nav {
    filter: drop-shadow(0 0 15px rgba(212, 160, 23, 0.1));
}

/* --- Hover States --- */
.hex-content:hover,
.hex-nav:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 30px rgba(212, 160, 23, 0.25))
            drop-shadow(0 0 60px rgba(212, 160, 23, 0.1));
}

.hex-content:hover .hex-inner,
.hex-nav:hover .hex-inner {
    box-shadow: inset 0 0 20px rgba(212, 160, 23, 0.2);
}

/* --- Active / Click Depression --- */
.hex-content:active,
.hex-nav:active {
    transform: translate(3px, 3px) scale(1.02);
}

/* --- Crown Zone --- */
.crown-zone {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.crown-container {
    position: relative;
    width: 600px;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-crown-center {
    width: var(--hex-crown);
    height: calc(var(--hex-crown) * 1.1547);
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(212, 160, 23, 0.15));
}

.hex-crown-center .hex-inner {
    background: radial-gradient(ellipse at center, #1f1a0f 0%, var(--obsidian) 100%);
}

/* Concentric hexagonal rings */
.concentric-rings {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ring {
    position: absolute;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 2px solid transparent;
    background: transparent;
}

.ring::after {
    content: '';
    position: absolute;
    inset: 2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: transparent;
}

.ring-outer {
    width: 90%;
    height: 90%;
    background: rgba(139, 105, 20, 0.15);
}

.ring-outer::after {
    background: rgba(26, 26, 26, 0.85);
}

.ring-mid {
    width: 70%;
    height: 70%;
    background: rgba(212, 160, 23, 0.2);
}

.ring-mid::after {
    background: rgba(26, 26, 26, 0.85);
}

.ring-inner {
    width: 50%;
    height: 50%;
    background: rgba(245, 208, 96, 0.25);
}

.ring-inner::after {
    background: rgba(26, 26, 26, 0.85);
}

.site-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 900;
    font-size: 52px;
    color: var(--burnished-gold);
    letter-spacing: -0.01em;
    z-index: 2;
    position: relative;
    text-shadow: 0 0 30px rgba(212, 160, 23, 0.3);
}

.site-tagline {
    font-family: 'Zilla Slab', serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--warm-parchment);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 8px;
    z-index: 2;
    position: relative;
    opacity: 0.7;
}

/* --- Navigation Rosette --- */
.rosette {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.hex-nav {
    width: var(--hex-nav);
    height: calc(var(--hex-nav) * 1.1547);
    position: absolute;
    z-index: 3;
}

.hex-nav .hex-inner {
    background: var(--obsidian);
    gap: 4px;
}

.nav-icon {
    font-size: 28px;
    color: var(--burnished-gold);
    line-height: 1;
}

.nav-label {
    font-family: 'Zilla Slab', serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--warm-parchment);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hex-nav:hover .nav-icon {
    color: var(--pale-gold);
}

.hex-nav:hover .nav-label {
    color: var(--pale-gold);
}

/* --- Hive Zone --- */
.hive-zone {
    position: relative;
    z-index: 1;
    padding: 80px 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
    max-width: 900px;
    padding: 0 20px;
}

/* Honeycomb stagger - offset odd items slightly */
.cluster .hex-cell:nth-child(even) {
    margin-top: 40px;
}

/* --- Typography --- */
.cluster-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 900;
    font-size: 42px;
    color: var(--burnished-gold);
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.cluster-text {
    font-family: 'Alegreya', serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: var(--aged-ivory);
}

.cell-heading {
    font-family: 'Zilla Slab', serif;
    font-weight: 600;
    font-size: 22px;
    color: var(--warm-parchment);
    margin-bottom: 8px;
}

.cell-text {
    font-family: 'Alegreya', serif;
    font-weight: 400;
    font-size: 15px;
    color: var(--aged-ivory);
    line-height: 1.6;
}

.cell-stat {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 36px;
    color: var(--burnished-gold);
    text-shadow: 0 0 8px rgba(212, 160, 23, 0.3);
    line-height: 1;
}

.cell-stat-label {
    font-family: 'Zilla Slab', serif;
    font-weight: 500;
    font-size: 13px;
    color: var(--brass-oxide);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 6px;
}

/* --- Score Board in Hex --- */
.hex-scoreboard .hex-inner {
    padding: 15%;
    gap: 6px;
}

.score-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.score-rank {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: var(--brass-oxide);
}

.score-name {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--burnished-gold);
    letter-spacing: 0.05em;
}

.score-value {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: var(--pale-gold);
    text-shadow: 0 0 8px rgba(212, 160, 23, 0.3);
}

/* --- Vault Zone (Footer) --- */
.vault-zone {
    position: relative;
    z-index: 1;
    padding: 120px 0 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vault-band {
    width: 100%;
    display: flex;
    justify-content: center;
}

.hex-vault {
    width: 400px;
    height: calc(400px * 1.1547);
}

.hex-vault .hex-inner {
    background: linear-gradient(135deg, #0f0d08 0%, var(--vault-black) 100%);
}

.vault-text {
    font-family: 'Roboto Slab', serif;
    font-weight: 900;
    font-size: 32px;
    color: var(--burnished-gold);
    letter-spacing: -0.01em;
}

.vault-sub {
    font-family: 'Alegreya', serif;
    font-weight: 400;
    font-size: 15px;
    color: var(--warm-parchment);
    margin-top: 8px;
    opacity: 0.7;
}

.vault-copy {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--brass-oxide);
    margin-top: 16px;
    letter-spacing: 0.2em;
}

/* --- Return to Crown Button --- */
.return-crown {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease, transform 0.5s var(--spring-ease);
    cursor: pointer;
}

.return-crown.visible {
    opacity: 1;
    transform: scale(1);
}

.return-crown .hex-mini {
    filter: drop-shadow(0 0 12px rgba(212, 160, 23, 0.3));
}

.return-crown .hex-mini .hex-inner {
    background: var(--obsidian);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.return-icon {
    color: var(--burnished-gold);
    font-size: 20px;
}

.return-crown:hover .hex-mini {
    filter: drop-shadow(0 0 20px rgba(212, 160, 23, 0.5));
}

/* --- Starburst Decorations --- */
.starburst-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.starburst {
    position: absolute;
    width: 40px;
    height: 40px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(212, 160, 23, 0.15) 15deg,
        transparent 30deg,
        rgba(212, 160, 23, 0.15) 45deg,
        transparent 60deg,
        rgba(212, 160, 23, 0.15) 75deg,
        transparent 90deg,
        rgba(212, 160, 23, 0.15) 105deg,
        transparent 120deg,
        rgba(212, 160, 23, 0.15) 135deg,
        transparent 150deg,
        rgba(212, 160, 23, 0.15) 165deg,
        transparent 180deg,
        rgba(212, 160, 23, 0.15) 195deg,
        transparent 210deg,
        rgba(212, 160, 23, 0.15) 225deg,
        transparent 240deg,
        rgba(212, 160, 23, 0.15) 255deg,
        transparent 270deg,
        rgba(212, 160, 23, 0.15) 285deg,
        transparent 300deg,
        rgba(212, 160, 23, 0.15) 315deg,
        transparent 330deg,
        rgba(212, 160, 23, 0.15) 345deg,
        transparent 360deg
    );
    border-radius: 50%;
    opacity: 0.6;
}

/* --- Zigzag Border Accent for select cells --- */
.cluster-lore .hex-large .hex-inner::before,
.cluster-craft .hex-large .hex-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            45deg,
            transparent 0px,
            transparent 6px,
            rgba(212, 160, 23, 0.08) 6px,
            rgba(212, 160, 23, 0.08) 12px
        );
    pointer-events: none;
    z-index: 0;
}

/* --- Scroll Entrance Animation --- */
.hex-content,
.hex-vault {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.6s ease, transform 0.8s var(--spring-ease);
}

.hex-content.visible,
.hex-vault.visible {
    opacity: 1;
    transform: scale(1);
}

/* Crown elements always visible */
.hex-crown-center,
.hex-nav {
    opacity: 1;
}

/* --- Crown Glow Pulse Animation --- */
@keyframes crown-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(212, 160, 23, 0.1));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(212, 160, 23, 0.2));
    }
}

.hex-crown-center {
    animation: crown-pulse 4s ease-in-out infinite;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    :root {
        --hex-large: 260px;
        --hex-medium: 200px;
        --hex-small: 130px;
        --hex-crown: 280px;
        --hex-nav: 100px;
    }

    .crown-container {
        width: 400px;
        height: 400px;
    }

    .site-title {
        font-size: 36px;
    }

    .site-tagline {
        font-size: 14px;
    }

    .cluster-title {
        font-size: 30px;
    }

    .nav-label {
        font-size: 10px;
    }

    .nav-icon {
        font-size: 20px;
    }

    .cluster .hex-cell:nth-child(even) {
        margin-top: 20px;
    }

    .hex-vault {
        width: 300px;
        height: calc(300px * 1.1547);
    }

    .vault-text {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    :root {
        --hex-large: 220px;
        --hex-medium: 170px;
        --hex-small: 110px;
        --hex-crown: 230px;
        --hex-nav: 80px;
    }

    .crown-container {
        width: 320px;
        height: 320px;
    }

    .site-title {
        font-size: 28px;
    }

    .cluster-title {
        font-size: 24px;
    }

    .cell-heading {
        font-size: 18px;
    }

    .cluster-text,
    .cell-text {
        font-size: 13px;
    }

    .hive-zone {
        padding: 40px 0;
    }
}
