:root {
    --bg-color: #050505;
    --text-main: #ffffff;
    --text-muted: #8892b0;
    --accent-glow: rgba(0, 240, 255, 0.4);
    --accent-solid: #00f0ff;
    --accent-purple: #b537f2;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

a {
    color: inherit;
}

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(18px);
    background: linear-gradient(180deg, rgba(5,5,5,0.9), rgba(5,5,5,0.55));
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.site-nav .brand {
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-nav nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-nav nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.site-nav nav a:hover,
.site-nav .brand:hover {
    color: var(--text-main);
}

/* Background Noise Texture */
.overlay-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

.main-container {
    position: relative;
    width: 100%;
    padding-top: 72px;
}

/* Hero Section */
.hero-section {
    display: flex;
    width: 100vw;
    height: calc(100vh - 72px);
    position: relative;
    overflow: hidden;
    align-items: stretch;
    background:
        radial-gradient(circle at left center, rgba(0, 240, 255, 0.08) 0%, transparent 26%),
        radial-gradient(circle at right center, rgba(181, 55, 242, 0.08) 0%, transparent 26%),
        linear-gradient(180deg, rgba(5,5,5,0.96) 0%, rgba(7,7,7,1) 100%);
}

.split-side {
    width: 50%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow: hidden;
    gap: 2rem;
}

.left-side {
    border-right: 1px solid rgba(255,255,255,0.05);
    background: radial-gradient(circle at left center, rgba(0,240,255,0.05) 0%, transparent 58%);
}

.right-side {
    background: radial-gradient(circle at right center, rgba(181,55,242,0.05) 0%, transparent 58%);
}

.side-header {
    position: absolute;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    margin-bottom: 0;
    z-index: 10;
    width: min(100%, 560px);
}

.side-header h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.left-side .side-header h2 {
    background: linear-gradient(90deg, var(--accent-solid), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.right-side .side-header h2 {
    background: linear-gradient(90deg, var(--accent-purple), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Orbit Styles */
.project-orbit-system,
.blog-orbit-system {
    width: 100%;
    max-width: 560px;
    height: min(62vh, 520px);
    padding-top: 0;
    padding-bottom: 0;
    margin: 0 auto;
    position: relative;
    overflow: visible;
    outline: none;
}

.orbit-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.orbit-slide {
    position: absolute;
    left: 0;
    top: 0;
    background-position: center;
    background-size: cover;
    width: clamp(340px, 32vw, 450px);
    aspect-ratio: 4 / 3;
    height: auto;
    opacity: 0.55;
    transform-origin: center center;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease, filter 0.45s ease, left 0.45s cubic-bezier(0.22, 1, 0.36, 1), top 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity, left, top;
}

.orbit-slide-active {
    opacity: 1;
}

/* 3D Card Styling */
.card-3d {
    background: transparent;
    perspective: 1000px;
}

.card-inner {
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
    transform: scale(0.85);
    transition: transform 0.35s ease, border-color 0.3s ease, box-shadow 0.35s ease;
}

.card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent 40%, rgba(0,240,255,0.08) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.85;
}

.card-link {
    text-decoration: none;
}

.card-inner:hover {
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-4px);
}

.orbit-slide-active .card-inner {
    transform: scale(1.25);
    box-shadow: 0 18px 45px rgba(0,0,0,0.6);
}

.orbit-slide-active .card-inner:hover {
    transform: scale(1.27) translateY(-4px);
}

.orbit-slide:not(.orbit-slide-active) .card-inner {
    filter: saturate(0.92);
}

.project-pagination,
.blog-pagination {
    position: absolute;
    bottom: 0.25rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    pointer-events: none;
}

.card-img {
    height: 50%;
    width: 100%;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--card-border);
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tags span {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.2rem 0.6rem;
    background: rgba(255,255,255,0.05);
    border-radius: 100px;
    color: var(--accent-solid);
    border: 1px solid rgba(0,240,255,0.2);
}

.right-side .tags span {
    color: var(--accent-purple);
    border-color: rgba(181,55,242,0.2);
}

.card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
}

.date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 1rem;
    opacity: 0.7;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    opacity: 0.7;
}

.scroll-indicator span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 6px;
    background: var(--accent-solid);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { top: 6px; opacity: 1; }
    100% { top: 20px; opacity: 0; }
}

/* Profile Section */
.profile-section {
    position: absolute;
    inset: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 2rem;
    pointer-events: none;
    background: transparent;
}

.profile-container {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
    pointer-events: auto;
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 3rem;
    box-shadow: 0 40px 100px rgba(0,0,0,0.8), inset 0 2px 20px rgba(255,255,255,0.05);
}

.profile-image-container {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.glow-ring {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent-solid), var(--accent-purple), var(--accent-solid));
    z-index: 1;
    animation: rotateGlow 4s linear infinite;
    filter: blur(10px);
    opacity: 0.7;
}

@keyframes rotateGlow {
    100% { transform: rotate(360deg); }
}

.profile-info h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.profile-info h3 {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-solid);
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.profile-info .bio {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.contact-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.btn.primary {
    background: var(--text-main);
    color: var(--bg-color);
}

.btn.primary:hover {
    background: var(--accent-solid);
    box-shadow: 0 0 20px rgba(0,240,255,0.4);
}

.btn.secondary {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.btn.secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

.content-page {
    min-height: 100vh;
    padding: 7rem 1.5rem 3rem;
    position: relative;
    background:
    radial-gradient(circle at left top, rgba(0, 240, 255, 0.08), transparent 22%),
    radial-gradient(circle at right top, rgba(181, 55, 242, 0.08), transparent 22%),
        linear-gradient(180deg, #050505 0%, #090909 100%);
}

.page-shell {
    max-width: 1200px;
    margin: 0 auto;
}

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 2rem;
    margin-bottom: 2rem;
}

.page-hero h1 {
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
    margin-bottom: 0.75rem;
}

.page-hero p {
    max-width: 700px;
    color: var(--text-muted);
    line-height: 1.6;
}

.page-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.page-meta span {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.content-grid .card-3d {
    height: 100%;
}

.content-grid .card-inner {
    min-height: 100%;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 1.5rem;
    align-items: start;
}

.detail-panel,
.detail-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}

.detail-cover {
    min-height: 320px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.detail-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 10%, rgba(5,5,5,0.8) 100%);
}

.detail-body {
    padding: 1.5rem;
}

.detail-body h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1;
    margin: 0.5rem 0 1rem;
}

.detail-body .description {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.detail-section {
    margin-top: 1.5rem;
}

.detail-section h2,
.detail-sidebar h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}

.detail-sidebar {
    padding: 1.5rem;
}

.detail-list {
    display: grid;
    gap: 0.8rem;
}

.detail-list div {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
}

.detail-label {
    display: block;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.back-link:hover {
    color: var(--text-main);
}

/* Glitch Effect */
.glitch {
    position: relative;
}
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}
.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}
.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 86px, 0); }
    20% { clip: rect(61px, 9999px, 13px, 0); }
    40% { clip: rect(31px, 9999px, 66px, 0); }
    60% { clip: rect(98px, 9999px, 14px, 0); }
    80% { clip: rect(54px, 9999px, 73px, 0); }
    100% { clip: rect(12px, 9999px, 44px, 0); }
}

@media (max-width: 1024px) {
    .swiper-slide {
        width: 280px;
        height: 350px;
    }
}

@media (max-width: 768px) {
    .site-nav {
        padding: 0.9rem 1rem;
        align-items: flex-start;
        gap: 0.75rem;
        flex-direction: column;
    }

    .main-container {
        padding-top: 98px;
    }

    .hero-section {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    .split-side {
        width: 100%;
        height: auto;
        min-height: 50vh;
        padding: 4.5rem 1rem 2rem;
    }
    .left-side {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .profile-info h1 {
        font-size: 3rem;
    }

    .page-hero,
    .detail-layout {
        grid-template-columns: 1fr;
        display: grid;
    }

    .page-hero {
        align-items: start;
    }

    .page-meta {
        justify-content: flex-start;
    }

    .project-orbit-system,
    .blog-orbit-system {
        height: min(52vh, 420px);
    }

    .orbit-slide {
        width: min(90vw, 380px);
        opacity: 0.75;
    }

    .orbit-slide-active .card-inner {
        transform: scale(1.12);
    }
}

/* Modal Popup Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.modal-overlay.active .modal-window {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.modal-close:hover {
    background: var(--accent-solid);
    transform: scale(1.1);
}

.modal-cover {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--card-border);
}

.modal-body {
    padding: 2.5rem;
}

.modal-title {
    font-size: 2rem;
    margin: 1rem 0;
    color: var(--text-heading);
}

.modal-date {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.modal-desc {
    color: var(--text-body);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Modal Markdown Styling */
.modal-markdown {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-main);
    line-height: 1.7;
    font-size: 1rem;
}
.modal-markdown h2, .modal-markdown h3 {
    color: #fff;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.modal-markdown p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}
.modal-markdown ul, .modal-markdown ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}
.modal-markdown a {
    color: var(--accent-solid);
    text-decoration: none;
}
.modal-markdown a:hover {
    text-decoration: underline;
}
.modal-markdown code {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: var(--accent-purple);
}
