/* ppuzzl.net - Electric Crystalline Network */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #08080c;
    color: #e0f0ff;
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Bento Grid Base */
.bento-grid {
    display: grid;
    gap: 4px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.bento-main {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    min-height: 100vh;
    align-content: center;
}

/* Bento Cells */
.bento-cell {
    background: #0c0c14;
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, border-color 0.3s ease;
}

.bento-cell.visible {
    opacity: 1;
}

.bento-cell:hover {
    border-color: rgba(0, 240, 255, 0.6);
}

/* Cell sizes */
.cell-large {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0f1020;
    border-image: linear-gradient(135deg, #00f0ff, #ff00aa) 1;
}

.cell-medium-h {
    grid-column: 2 / 4;
    grid-row: 1;
}

.cell-medium-v {
    grid-column: 2;
    grid-row: 2 / 4;
}

.cell-small {
    min-height: 120px;
}

/* Cell Content */
.cell-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: #00f0ff;
    display: block;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.cell-text {
    font-family: 'Lora', serif;
    font-size: 15px;
    line-height: 1.7;
    color: #e0f0ff;
    max-width: 55ch;
    opacity: 0.85;
}

.cell-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #e0f0ff;
    margin-bottom: 10px;
}

/* Wordmark */
.net-wordmark {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.02em;
    color: #e0f0ff;
    text-shadow: 0 0 8px #00f0ff, 0 0 20px rgba(0, 240, 255, 0.3);
}

.net-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.2rem;
    color: #00f0ff;
    letter-spacing: 0.1em;
}

/* Cell Glow */
.cell-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Color Pulse */
.color-pulse {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pulse-cyan {
    background: #00f0ff;
    box-shadow: 0 0 8px #00f0ff, 0 0 20px rgba(0, 240, 255, 0.3);
    animation: pulse-glow 3s ease-in-out infinite;
}

.pulse-magenta {
    background: #ff00aa;
    box-shadow: 0 0 8px #ff00aa, 0 0 20px rgba(255, 0, 170, 0.3);
    animation: pulse-glow 3s ease-in-out infinite 1s;
}

@keyframes pulse-glow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* Crystal SVGs */
.crystal-svg,
.prism-svg,
.hex-lattice {
    width: 100%;
    height: 100%;
    max-width: 80px;
    max-height: 80px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Network Section */
.network-section {
    position: relative;
    min-height: 200vh;
    padding: 80px 20px;
}

#network-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.network-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40vh;
    padding: 20vh 0;
}

.network-node-text {
    background: rgba(12, 12, 20, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 40px 36px;
    max-width: 500px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.network-node-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.node-1 { align-self: flex-start; }
.node-2 { align-self: flex-end; }

.net-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: #e0f0ff;
    margin-bottom: 16px;
}

.node-body {
    font-family: 'Lora', serif;
    font-size: 16px;
    line-height: 1.7;
    color: #e0f0ff;
    opacity: 0.85;
}

/* Deep Grid */
.deep-grid-section {
    padding: 60px 20px;
}

.bento-deep {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
}

.cell-deep {
    min-height: 150px;
}

/* #8b00ff violet for accent borders */
.cell-d1 {
    border-image: linear-gradient(180deg, #00f0ff, #8b00ff) 1;
}

.cell-d4 {
    border: 2px double rgba(0, 240, 255, 0.4);
}

/* Crack SVG */
.crack-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.crack-path {
    transition: opacity 0.3s ease;
}

.crackable.cracked .crack-path {
    opacity: 0.8;
    filter: drop-shadow(0 0 4px #00f0ff);
}

/* Resonance Footer */
.resonance-footer {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.convergence-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.convergence-svg {
    width: 100%;
    height: 100%;
}

.footer-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.footer-domain {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5rem);
    letter-spacing: 0.02em;
    color: #e0f0ff;
    text-shadow: 0 0 8px #00f0ff, 0 0 20px rgba(0, 240, 255, 0.3);
    opacity: 0;
    transition: opacity 1s ease, text-shadow 1s ease;
}

.footer-domain.visible {
    opacity: 1;
    text-shadow: 0 0 8px #00f0ff, 0 0 20px rgba(0, 240, 255, 0.3), 0 0 40px rgba(0, 240, 255, 0.15);
}

/* Resonance Pulse */
.resonance-pulse {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
}

.resonance-pulse.active {
    animation: resonance-burst 1s ease-out forwards;
}

@keyframes resonance-burst {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 200vw; height: 200vw; opacity: 0; }
}

/* Responsive */
@media (max-width: 700px) {
    .bento-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .cell-large {
        grid-column: 1;
        grid-row: auto;
        min-height: 300px;
    }

    .cell-medium-h,
    .cell-medium-v {
        grid-column: 1;
        grid-row: auto;
    }

    .bento-deep {
        grid-template-columns: 1fr;
    }

    .network-node-text {
        max-width: 100%;
    }

    .node-1,
    .node-2 {
        align-self: center;
    }
}
