/* ============================================
   multipledger.com - Generative Hexagonal Data Ocean
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Color Palette */
    --color-ice-white: #D0E8F0;
    --color-ocean-grey: #80A8C0;
    --color-neon-teal: #00DCB4;
    --color-deep-ocean: #081828;
    --color-ocean-mid: #102838;
    --color-crystalline-blue: #4090B0;
    --color-neon-glow: rgba(0, 220, 180, 0.3);
    --color-neon-glow-bright: rgba(0, 220, 180, 0.6);
    --color-neon-glow-intense: rgba(0, 220, 180, 0.7);

    /* Typography */
    --font-display: 'Albert Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'Fira Code', monospace;
}

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

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

body {
    background-color: var(--color-deep-ocean);
    color: var(--color-ocean-grey);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--color-ice-white);
    font-weight: 700;
}

h2.section-title {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 0.5em;
    text-align: center;
}

.section-desc {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--color-ocean-grey);
    text-align: center;
    max-width: 640px;
    margin: 0 auto 3rem;
}

code, .hex-hash {
    font-family: var(--font-code);
    font-weight: 400;
    color: var(--color-neon-teal);
}

/* --- Crystalline SVG Background --- */
#crystalline-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.crystal-svg {
    position: absolute;
    opacity: 0.12;
}

#crystal-1 {
    width: 220px;
    height: 220px;
    top: 5%;
    right: 8%;
    animation: crystalDrift1 25s ease-in-out infinite;
}

#crystal-2 {
    width: 160px;
    height: 160px;
    top: 40%;
    left: 4%;
    animation: crystalDrift2 30s ease-in-out infinite;
}

#crystal-3 {
    width: 180px;
    height: 180px;
    bottom: 15%;
    right: 12%;
    animation: crystalDrift3 22s ease-in-out infinite;
}

#crystal-4 {
    width: 100px;
    height: 100px;
    top: 25%;
    left: 30%;
    animation: crystalDrift1 35s ease-in-out infinite reverse;
}

#crystal-5 {
    width: 140px;
    height: 140px;
    bottom: 35%;
    left: 55%;
    animation: crystalDrift2 28s ease-in-out infinite reverse;
}

@keyframes crystalDrift1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -20px) rotate(5deg); }
    50% { transform: translate(-10px, 10px) rotate(-3deg); }
    75% { transform: translate(8px, 15px) rotate(2deg); }
}

@keyframes crystalDrift2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-20px, 12px) rotate(-4deg); }
    66% { transform: translate(12px, -15px) rotate(6deg); }
}

@keyframes crystalDrift3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(10px, 18px) rotate(3deg); }
    40% { transform: translate(-15px, -8px) rotate(-5deg); }
    60% { transform: translate(18px, -12px) rotate(4deg); }
    80% { transform: translate(-8px, 14px) rotate(-2deg); }
}

/* --- Hero Section --- */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
}

#hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

#hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    color: var(--color-ice-white);
    letter-spacing: 0.15em;
    text-shadow: 0 0 40px var(--color-neon-glow), 0 0 80px rgba(0, 220, 180, 0.15);
    opacity: 0;
    animation: heroTitleIn 1.5s ease-out 0.3s forwards;
}

#hero-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    color: var(--color-ocean-grey);
    margin-top: 1rem;
    opacity: 0;
    animation: heroSubIn 1.2s ease-out 1s forwards;
}

@keyframes heroTitleIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes heroSubIn {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 0.85; transform: translateY(0); }
}

#hero-hex-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* --- Hex Grid Section --- */
#data-ocean {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
}

#section-header {
    margin-bottom: 2rem;
}

#hex-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Hex cell shape */
.hex-cell {
    position: relative;
    aspect-ratio: 1 / 1.1547;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--color-ocean-mid);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), z-index 0s;
    opacity: 0;
    animation: hexFadeIn 0.6s ease-out forwards;
}

/* Staggered fade-in delays for hex cells */
.hex-cell[data-cell="0"] { animation-delay: 0.1s; }
.hex-cell[data-cell="1"] { animation-delay: 0.15s; }
.hex-cell[data-cell="2"] { animation-delay: 0.2s; }
.hex-cell[data-cell="3"] { animation-delay: 0.25s; }
.hex-cell[data-cell="4"] { animation-delay: 0.3s; }
.hex-cell[data-cell="5"] { animation-delay: 0.35s; }
.hex-cell[data-cell="6"] { animation-delay: 0.4s; }
.hex-cell[data-cell="7"] { animation-delay: 0.45s; }
.hex-cell[data-cell="8"] { animation-delay: 0.5s; }
.hex-cell[data-cell="9"] { animation-delay: 0.55s; }
.hex-cell[data-cell="10"] { animation-delay: 0.6s; }
.hex-cell[data-cell="11"] { animation-delay: 0.65s; }
.hex-cell[data-cell="12"] { animation-delay: 0.7s; }
.hex-cell[data-cell="13"] { animation-delay: 0.75s; }
.hex-cell[data-cell="14"] { animation-delay: 0.8s; }
.hex-cell[data-cell="15"] { animation-delay: 0.85s; }
.hex-cell[data-cell="16"] { animation-delay: 0.9s; }
.hex-cell[data-cell="17"] { animation-delay: 0.95s; }

@keyframes hexFadeIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* Offset odd rows for honeycomb effect */
.hex-cell:nth-child(6n+4),
.hex-cell:nth-child(6n+5),
.hex-cell:nth-child(6n+6) {
    /* Handled by JS for proper offset */
}

/* Neon glow edge effect */
.hex-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: transparent;
    box-shadow: inset 0 0 8px var(--color-neon-glow);
    pointer-events: none;
    z-index: 1;
    transition: box-shadow 0.4s ease;
}

.hex-cell.neon-pulse::before {
    box-shadow: inset 0 0 15px var(--color-neon-glow-bright), inset 0 0 30px rgba(0, 220, 180, 0.2);
}

/* Hover zoom-focus */
.hex-cell:hover {
    transform: scale(1.15);
    z-index: 10;
}

.hex-cell:hover::before {
    box-shadow: inset 0 0 20px var(--color-neon-glow-intense), inset 0 0 40px rgba(0, 220, 180, 0.3);
}

/* Neighbors dim when a cell is hovered */
.hex-grid-container.has-hover .hex-cell:not(:hover) {
    opacity: 0.55;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

.hex-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15%;
    text-align: center;
    gap: 0.3em;
    z-index: 2;
}

.hex-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(0.7rem, 1.2vw, 0.95rem);
    color: var(--color-ice-white);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hex-data {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
    color: var(--color-ocean-grey);
}

.hex-hash {
    font-size: clamp(0.55rem, 0.8vw, 0.72rem);
}

/* --- Ledger Visualization Section --- */
#ledger-viz {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    text-align: center;
}

#ledger-canvas-wrap {
    max-width: 1000px;
    margin: 0 auto 3rem;
    aspect-ratio: 2 / 1;
    position: relative;
}

#ledger-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 4px;
}

#ledger-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-family: var(--font-code);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 400;
    color: var(--color-neon-teal);
    text-shadow: 0 0 15px var(--color-neon-glow);
}

.stat-label {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--color-ocean-grey);
    margin-top: 0.3em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --- Concept Section --- */
#concept {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
}

#concept-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    max-width: 900px;
    margin: 0 auto;
}

.concept-hex {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--color-ocean-mid);
    aspect-ratio: 1 / 1.1547;
    position: relative;
    transition: transform 0.4s ease;
}

.concept-hex:hover {
    transform: scale(1.1);
    z-index: 5;
}

.concept-hex::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow: inset 0 0 8px rgba(0, 220, 180, 0.25);
    pointer-events: none;
    z-index: 1;
    transition: box-shadow 0.4s ease;
}

.concept-hex:hover::before {
    box-shadow: inset 0 0 18px var(--color-neon-glow-bright), inset 0 0 35px rgba(0, 220, 180, 0.2);
}

.concept-hex-large {
    grid-column: 1 / -1;
}

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

.concept-hex-inner h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    color: var(--color-neon-teal);
    margin-bottom: 0.5em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.concept-hex-inner p {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.7rem, 0.95vw, 0.85rem);
    color: var(--color-ocean-grey);
    line-height: 1.6;
}

/* --- Footer --- */
#footer {
    position: relative;
    z-index: 1;
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(0, 220, 180, 0.1);
}

#footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-ice-white);
    letter-spacing: 0.15em;
    text-shadow: 0 0 15px rgba(0, 220, 180, 0.25);
}

.footer-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--color-crystalline-blue);
}

.footer-copy {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--color-ocean-grey);
    opacity: 0.5;
    margin-top: 0.5rem;
}

/* --- Neon Pulse Animation --- */
@keyframes neonPulse {
    0%, 100% { box-shadow: inset 0 0 8px var(--color-neon-glow); }
    50% { box-shadow: inset 0 0 18px var(--color-neon-glow-intense), inset 0 0 35px rgba(0, 220, 180, 0.2); }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    #hex-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    #concept-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .concept-hex-large {
        grid-column: 1 / -1;
    }

    #ledger-stats {
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    #hex-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    #concept-grid {
        grid-template-columns: 1fr;
    }

    #ledger-stats {
        gap: 1rem;
    }

    .stat-block {
        flex: 0 0 45%;
    }

    #hero-title {
        letter-spacing: 0.08em;
    }
}
