/* === ronri.net — Vaporwave Logic === */

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

:root {
    --hot-pink: #FF6B9D;
    --electric-cyan: #00E5FF;
    --dream-lavender: #C4B5E0;
    --vapor-purple: #7C3AED;
    --surface-dark: #1A1028;
    --mint-fresh: #A7F3D0;
    --grid-white: rgba(255, 255, 255, 0.15);
    --grid-white-strong: rgba(255, 255, 255, 0.25);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.75;
    color: var(--surface-dark);
    background: var(--surface-dark);
    overflow-x: hidden;
}

/* === Grid Overlay === */
#grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.07) 0.5px, transparent 0.5px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.07) 0.5px, transparent 0.5px);
    background-size: 80px 80px;
}

/* === Digital Lobby === */
#digital-lobby {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hot-pink) 0%, var(--electric-cyan) 40%, var(--dream-lavender) 80%, var(--hot-pink) 100%);
    background-size: 400% 400%;
    animation: gradientShift 30s ease infinite;
    overflow: hidden;
    z-index: 2;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

.lobby-content {
    position: relative;
    text-align: center;
    padding-top: 30vh;
    padding-bottom: 30vh;
    z-index: 3;
}

.wordmark {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(42px, 8vw, 96px);
    letter-spacing: 0.02em;
    color: #fff;
    text-shadow: 0 0 60px rgba(255, 255, 255, 0.3), 0 0 120px rgba(124, 58, 237, 0.2);
    opacity: 0;
    transform: scale(0.95);
    animation: wordmarkIn 0.8s ease-out 0.3s forwards;
}

.wordmark-sub {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(20px, 3vw, 36px);
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.3em;
    margin-top: 0.5em;
    opacity: 0;
    animation: wordmarkIn 0.8s ease-out 0.6s forwards;
}

@keyframes wordmarkIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Ripple Container in Lobby */
.ripple-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.ripple-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: rippleExpand 1.2s ease-out forwards;
}

@keyframes rippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0);
    }
    100% {
        width: 600px;
        height: 600px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(3);
    }
}

/* === Logic Fragments === */
#logic-fragments {
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, var(--dream-lavender) 0%, var(--electric-cyan) 30%, var(--hot-pink) 60%, var(--dream-lavender) 100%);
    background-size: 100% 300%;
    animation: gradientShift 30s ease infinite;
    padding: clamp(80px, 15vh, 200px) 20px;
}

.logic-block {
    position: relative;
    max-width: 500px;
    margin-inline: auto;
    margin-block: clamp(120px, 20vh, 250px);
    padding: 40px;
    background: rgba(26, 16, 40, 0.08);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.logic-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.logic-block:first-child {
    margin-top: 0;
}

.logic-label {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--vapor-purple);
    display: block;
    margin-bottom: 12px;
}

.logic-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(28px, 5vw, 48px);
    letter-spacing: 0.02em;
    color: var(--surface-dark);
    margin-bottom: 20px;
    line-height: 1.1;
}

.logic-formula {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: rgba(26, 16, 40, 0.06);
    border-left: 3px solid var(--vapor-purple);
    border-radius: 0 2px 2px 0;
}

.logic-formula code {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 15px;
    color: var(--surface-dark);
    line-height: 1.6;
}

.logic-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.75;
    color: rgba(26, 16, 40, 0.85);
}

/* Block ripple effect container */
.block-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    pointer-events: none;
    z-index: -1;
}

.block-ripple-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: blockRipple 0.8s ease-out forwards;
}

@keyframes blockRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0);
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(3);
    }
}

/* === The Grid Plane === */
#grid-plane {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    background: var(--surface-dark);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(80px, 15vh, 200px) 20px;
}

.grid-plane-perspective {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    perspective: 400px;
    overflow: hidden;
}

.grid-plane-surface {
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    transform: rotateX(60deg);
    transform-origin: bottom center;
    background-image:
        linear-gradient(to right, var(--grid-white-strong) 1px, transparent 1px),
        linear-gradient(to top, var(--grid-white-strong) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridScroll 8s linear infinite;
}

@keyframes gridScroll {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 60px;
    }
}

/* Horizon glow */
.grid-plane-perspective::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, var(--hot-pink), transparent);
    opacity: 0.3;
    z-index: 1;
}

.grid-plane-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: clamp(60px, 10vh, 120px);
}

.grid-block {
    background: rgba(26, 16, 40, 0.5);
    backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.08);
}

.grid-block .logic-label {
    color: var(--mint-fresh);
}

.grid-block .logic-heading {
    color: #fff;
}

.grid-block .logic-text {
    color: rgba(255, 255, 255, 0.75);
}

.grid-block .logic-formula {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--mint-fresh);
}

.grid-block .logic-formula code {
    color: var(--electric-cyan);
}

/* === Sunset Footer === */
#sunset-footer {
    position: relative;
    z-index: 2;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--surface-dark) 0%, var(--vapor-purple) 100%);
    overflow: hidden;
}

.footer-grid-vanish {
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    perspective: 300px;
}

.footer-grid-vanish::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    transform: rotateX(65deg);
    transform-origin: bottom center;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(to top, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

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

.footer-mark {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 4vw, 48px);
    color: #fff;
    letter-spacing: 0.02em;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
}

.footer-kanji {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(16px, 2vw, 24px);
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.3em;
    margin-top: 8px;
}

.footer-tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.1em;
    margin-top: 24px;
    text-transform: lowercase;
}

/* === Responsive === */
@media (max-width: 600px) {
    .logic-block {
        padding: 28px 24px;
        margin-block: clamp(80px, 15vh, 180px);
    }

    .logic-formula {
        padding: 12px 16px;
    }

    .logic-formula code {
        font-size: 13px;
    }

    .grid-plane-content {
        gap: clamp(40px, 8vh, 80px);
    }
}
