/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-deep: #0a0a14;
    --surface-raised: #12122a;
    --surface-inset: #0d0d1a;
    --neon-cyan: #00e5ff;
    --neon-magenta: #ff00ff;
    --neon-lime: #b8ff00;
    --text-body: #c8c8e0;
    --text-muted: #6a6a80;
    --shadow-dark: #060610;
    --shadow-light: #1a1a3e;
    --surface-hover: #0a0a16;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-deep);
    color: var(--text-body);
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.8;
    letter-spacing: 0.015em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== PARTICLES CANVAS ===== */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== COLUMN ===== */
.column {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ===== CRATER ===== */
.crater {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 0;
}

.crater-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--surface-inset);
    box-shadow:
        inset 6px 6px 16px var(--shadow-dark),
        inset -6px -6px 16px var(--shadow-light),
        0 0 60px rgba(0, 229, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: craterReveal 400ms 500ms ease-out forwards;
}

@keyframes craterReveal {
    from {
        opacity: 0;
        box-shadow:
            inset 0 0 0 var(--shadow-dark),
            inset 0 0 0 var(--shadow-light),
            0 0 0 rgba(0, 229, 255, 0);
    }
    to {
        opacity: 1;
        box-shadow:
            inset 6px 6px 16px var(--shadow-dark),
            inset -6px -6px 16px var(--shadow-light),
            0 0 60px rgba(0, 229, 255, 0.08);
    }
}

.site-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--neon-cyan);
    text-shadow: 0 0 40px rgba(0, 229, 255, 0.35);
    position: relative;
    cursor: default;
    opacity: 0;
    animation: titleReveal 600ms 900ms ease-out forwards;
}

@keyframes titleReveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.site-title:hover {
    animation: glitchText 200ms steps(2) 1;
}

@keyframes glitchText {
    0% {
        text-shadow:
            0 0 40px rgba(0, 229, 255, 0.35);
    }
    25% {
        text-shadow:
            -3px 0 rgba(0, 229, 255, 0.8),
            3px 0 rgba(255, 0, 255, 0.8),
            0 0 40px rgba(0, 229, 255, 0.35);
        transform: translateX(2px);
    }
    50% {
        text-shadow:
            3px 0 rgba(0, 229, 255, 0.8),
            -3px 0 rgba(255, 0, 255, 0.8),
            0 0 40px rgba(0, 229, 255, 0.35);
        transform: translateX(-2px);
    }
    75% {
        text-shadow:
            -2px 0 rgba(0, 229, 255, 0.8),
            2px 0 rgba(255, 0, 255, 0.8),
            0 0 40px rgba(0, 229, 255, 0.35);
        transform: translateX(1px);
    }
    100% {
        text-shadow:
            0 0 40px rgba(0, 229, 255, 0.35);
        transform: translateX(0);
    }
}

.tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
    opacity: 0;
    animation: titleReveal 500ms 1400ms ease-out forwards;
}

/* ===== TILE GAP + NEON LINES ===== */
.tile-gap {
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 48px;
}

.gap-line {
    display: block;
    width: 0;
    height: 1px;
    background: rgba(0, 229, 255, 0.3);
    transition: width 0.6s ease-out;
}

.gap-line.visible {
    width: 100%;
}

/* ===== TILES ===== */
.tile {
    background: var(--surface-raised);
    border-radius: 24px;
    padding: 40px 48px;
    box-shadow:
        8px 8px 24px var(--shadow-dark),
        -8px -8px 24px var(--shadow-light);
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out,
                box-shadow 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tile.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tile:hover {
    box-shadow:
        12px 12px 28px var(--shadow-dark),
        -12px -12px 28px var(--shadow-light);
    transform: translateY(-2px) scale(1);
}

.tile-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* ===== SECTION HEADINGS ===== */
.section-heading {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--neon-cyan);
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.25);
    margin-bottom: 20px;
}

.section-heading:hover {
    animation: glitchText 200ms steps(2) 1;
}

.project-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    margin-bottom: 10px;
}

.project-desc {
    margin-bottom: 20px;
}

/* ===== CODE INSET ===== */
.code-inset {
    background: var(--surface-inset);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow:
        inset 4px 4px 12px var(--shadow-dark),
        inset -4px -4px 12px var(--shadow-light),
        inset 0 0 20px rgba(255, 0, 255, 0.08);
    border-left: 3px solid var(--neon-magenta);
    overflow-x: auto;
    transition: background 0.3s ease, border-color 0.6s ease;
}

.code-inset:hover {
    background: var(--surface-hover);
    border-left-color: var(--neon-magenta);
    animation: codePulse 600ms ease 1;
}

@keyframes codePulse {
    0% { border-left-color: rgba(255, 0, 255, 0.6); }
    50% { border-left-color: rgba(255, 0, 255, 1); }
    100% { border-left-color: rgba(255, 0, 255, 0.6); }
}

.code-inset pre {
    margin: 0;
}

.code-inset code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 400;
    color: #e0e0ff;
    line-height: 1.7;
}

.code-inset .kw { color: var(--neon-cyan); font-weight: 600; }
.code-inset .fn { color: var(--neon-magenta); }
.code-inset .str { color: var(--neon-lime); }
.code-inset .num { color: #e0e0ff; }
.code-inset .prop { color: var(--text-body); }

/* ===== AVATAR ===== */
.avatar-container {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.avatar-svg {
    animation: avatarFloat 4s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ===== POST LIST ===== */
.post-list {
    list-style: none;
}

.post-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid rgba(106, 106, 128, 0.15);
    gap: 16px;
}

.post-item:last-child {
    border-bottom: none;
}

.post-link {
    color: var(--neon-cyan);
    text-decoration: none;
    position: relative;
    background-image: linear-gradient(var(--neon-cyan), var(--neon-cyan));
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s ease, text-shadow 0.3s ease;
}

.post-link:hover {
    background-size: 100% 1px;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.post-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===== CONTACT ===== */
.contact-email {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: var(--neon-cyan);
    margin: 16px 0 24px;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-raised);
    box-shadow:
        4px 4px 10px var(--shadow-dark),
        -4px -4px 10px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.social-circle:hover {
    box-shadow:
        6px 6px 14px var(--shadow-dark),
        -6px -6px 14px var(--shadow-light),
        0 0 16px rgba(0, 229, 255, 0.2);
    transform: translateY(-2px);
}

.social-circle svg {
    transition: fill 0.25s ease;
}

.social-circle:hover svg {
    fill: var(--neon-cyan);
}

/* ===== FOOTER ===== */
.footer-text {
    text-align: center;
    padding: 40px 0 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== MOON NAVIGATOR ===== */
.moon-nav {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 100;
}

.moon-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface-raised);
    box-shadow:
        3px 3px 8px var(--shadow-dark),
        -3px -3px 8px var(--shadow-light),
        0 0 12px rgba(0, 229, 255, 0.2);
    cursor: pointer;
    transition: width 0.3s ease, height 0.3s ease, box-shadow 0.3s ease;
    animation: moonPulse 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes moonPulse {
    0%, 100% { box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light), 0 0 12px rgba(0, 229, 255, 0.2); }
    50% { box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light), 0 0 20px rgba(0, 229, 255, 0.4); }
}

.moon-nav:hover .moon-icon {
    width: 32px;
    height: 32px;
    box-shadow:
        4px 4px 10px var(--shadow-dark),
        -4px -4px 10px var(--shadow-light),
        0 0 24px rgba(0, 229, 255, 0.4);
}

.radial-menu {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.radial-item {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    opacity: 0;
    transform: translate(0, 0);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.moon-nav:hover .radial-item {
    opacity: 1;
    pointer-events: auto;
}

.moon-nav:hover .radial-item:nth-child(1) { transform: translate(-60px, 10px); transition-delay: 0ms; }
.moon-nav:hover .radial-item:nth-child(2) { transform: translate(-55px, -35px); transition-delay: 40ms; }
.moon-nav:hover .radial-item:nth-child(3) { transform: translate(-35px, -75px); transition-delay: 80ms; }
.moon-nav:hover .radial-item:nth-child(4) { transform: translate(-5px, -100px); transition-delay: 120ms; }
.moon-nav:hover .radial-item:nth-child(5) { transform: translate(20px, -110px); transition-delay: 160ms; }

.radial-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
    flex-shrink: 0;
}

.radial-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease 0.15s;
}

.moon-nav:hover .radial-item:hover .radial-label {
    opacity: 1;
    color: var(--neon-cyan);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .crater-circle {
        width: 60vw;
        height: 60vw;
    }

    .tile {
        padding: 28px 24px;
        border-radius: 18px;
    }

    .post-item {
        flex-direction: column;
        gap: 4px;
    }

    .moon-nav {
        bottom: 20px;
        right: 20px;
    }
}

/* ===== SCANLINE OVERLAY (for code insets) ===== */
.code-inset::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(0, 229, 255, 0.03) 1px,
        rgba(0, 229, 255, 0.03) 2px
    );
    pointer-events: none;
    border-radius: 16px;
}

.code-inset {
    position: relative;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    #particles {
        display: none;
    }
}
