:root {
    --nav-color: #00d4ff;
    --nav-color-rgb: 0, 212, 255;
    --mobile-padding: 2rem;
    --neon-glow: 0 0 10px rgba(var(--nav-color-rgb), 0.6), 0 0 40px rgba(var(--nav-color-rgb), 0.3), 0 0 80px rgba(var(--nav-color-rgb), 0.15);
    --neon-glow-strong: 0 0 10px rgba(var(--nav-color-rgb), 0.9), 0 0 40px rgba(var(--nav-color-rgb), 0.5), 0 0 80px rgba(var(--nav-color-rgb), 0.25), 0 0 120px rgba(var(--nav-color-rgb), 0.1);
    --border-glow: 0 0 8px rgba(var(--nav-color-rgb), 0.6), inset 0 0 8px rgba(var(--nav-color-rgb), 0.15);
}

@media (max-width: 768px) {
    html {
        font-size: 55%;
    }
    section {
        padding: 8rem var(--mobile-padding) 5rem;
    }
    header {
        padding: 1.2rem var(--mobile-padding);
    }
    header.scrolled {
        padding: 1rem var(--mobile-padding);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
}

html {
    font-size: 62.5%;
}

body {
    width: 100%;
    height: 100vh;
    overflow-x: hidden;
    background-color: #0e0e12;
    color: #e0e0e0;
}

body.home-page {
    overflow-y: auto;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0a0a0d;
}
::-webkit-scrollbar-thumb {
    background: rgba(var(--nav-color-rgb), 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--nav-color-rgb), 0.5);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.2rem 9%;
    background-color: rgba(5, 5, 8, 0.92);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.5);
}

header.scrolled {
    padding: 1rem 9%;
}

.logo {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    margin-right: auto;
    gap: 0.8rem;
}

.logo-terminal {
    font-size: 2rem;
    font-weight: 600;
    color: var(--nav-color);
    letter-spacing: -0.01em;
    text-shadow: 0 0 10px rgba(var(--nav-color-rgb), 0.5), 0 0 30px rgba(var(--nav-color-rgb), 0.2);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
}

.logo:hover .logo-terminal {
    text-shadow: 0 0 10px rgba(var(--nav-color-rgb), 0.8), 0 0 40px rgba(var(--nav-color-rgb), 0.4), 0 0 80px rgba(var(--nav-color-rgb), 0.2);
}

.logo-terminal i {
    font-size: 1.6rem;
    background: var(--nav-color);
    color: #0e0e12;
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(var(--nav-color-rgb), 0.3);
}

.logo-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--nav-color);
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(var(--nav-color-rgb), 0.3);
}

.logo:hover .logo-img {
    transform: scale(1.1);
    box-shadow: var(--neon-glow);
}

section {
    padding-top: 10rem;
    min-height: 100vh;
    padding: 10rem 9% 4rem;
    box-sizing: border-box;
}

nav a {
    font-size: 1.8rem;
    font-weight: 400;
    color: #ddd;
    margin-left: 3rem;
    transition: 0.3s ease;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.02em;
}

nav a.download-cv {
    color: #aaa;
}

nav a.download-cv:hover {
    color: var(--nav-color);
    border-bottom: 2px solid var(--nav-color);
}

nav a:hover,
nav a.active {
    color: var(--nav-color);
    border-bottom: 2px solid var(--nav-color);
    text-shadow: 0 0 10px rgba(var(--nav-color-rgb), 0.4);
}

/* Home */
.home {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    background-color: #0e0e12;
    margin-top: 0;
    padding-top: 3rem;
}

.home .home-content h1 {
    font-size: 4.2rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

span {
    color: var(--nav-color);
}

.home-content h3 {
    font-size: 2.6rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

.home-content p {
    font-size: 1.7rem;
    line-height: 1.9;
    color: #ccc;
}

.home-content p a {
    color: var(--nav-color);
    transition: color 0.3s ease;
}

.home-img {
    border-radius: 50%;
}

.home-img img {
    position: relative;
    width: 24vw;
    max-width: 340px;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(var(--nav-color-rgb), 0.3), 0 0 60px rgba(var(--nav-color-rgb), 0.1);
    cursor: pointer;
    transition: 0.3s ease;
    border: 2px solid rgba(var(--nav-color-rgb), 0.4);
}

.home-img img:hover {
    box-shadow: var(--neon-glow-strong);
    transform: scale(1.02);
}

.social-icons a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 5rem;
    height: 5rem;
    background-color: transparent;
    border: 1.5px solid rgba(var(--nav-color-rgb), 0.5);
    font-size: 2.2rem;
    border-radius: 50%;
    margin: 3rem 1.2rem 3rem 0;
    transition: 0.3s ease;
    color: var(--nav-color);
}

.social-icons a:hover {
    color: #0e0e12;
    transform: scale(1.3) translateY(-3px);
    background-color: var(--nav-color);
    box-shadow: var(--neon-glow-strong);
    border-color: var(--nav-color);
}

.btn {
    display: inline-block;
    padding: 1.2rem 3.5rem;
    background-color: transparent;
    border-radius: 4rem;
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--nav-color);
    letter-spacing: 0.05rem;
    border: 1.5px solid var(--nav-color);
    transition: 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    transform: scale(1.05);
    background-color: var(--nav-color);
    color: #0e0e12;
    box-shadow: var(--neon-glow-strong);
}

.typing-text {
    font-size: 2.6rem;
    font-weight: 400;
    min-width: 280px;
}

.typing-text span::after {
    content: "▋";
    display: inline-block;
    animation: blink 1s infinite;
    color: var(--nav-color);
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   WRITEUPS PAGE
   ============================================ */

.writeups-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #0e0e12;
    text-align: center;
}

.page-title {
    font-size: 3.8rem;
    font-weight: 600;
    color: var(--nav-color);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    text-shadow: 0 0 30px rgba(var(--nav-color-rgb), 0.4);
}

.page-sub {
    font-size: 1.8rem;
    color: #aaa;
    margin-bottom: 3rem;
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.filter-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 500;
    padding: 0.6rem 1.8rem;
    background: transparent;
    border: 1px solid #333;
    border-radius: 4rem;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.filter-btn:hover {
    border-color: var(--nav-color);
    color: var(--nav-color);
    box-shadow: 0 0 15px rgba(var(--nav-color-rgb), 0.2);
}

.filter-btn.active {
    background: rgba(var(--nav-color-rgb), 0.15);
    border-color: var(--nav-color);
    color: var(--nav-color);
    box-shadow: 0 0 20px rgba(var(--nav-color-rgb), 0.3);
}

/* Writeup cards grid */
.writeups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 4rem;
}

.writeup-card {
    background: #0a0a0d;
    border: 1px solid #1a1a1a;
    border-radius: 10px;
    padding: 1.8rem;
    text-align: left;
    transition: all 0.3s ease;
    cursor: default;
    display: flex;
    flex-direction: column;
    min-height: 260px;
}

.writeup-card:hover {
    border-color: rgba(var(--nav-color-rgb), 0.4);
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(var(--nav-color-rgb), 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.card-cat {
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
}

.card-pts {
    font-size: 1.2rem;
    color: #666;
    background: #111;
    padding: 0.2rem 0.6rem;
    border-radius: 4rem;
    border: 1px solid #1a1a1a;
}

.card-title {
    font-size: 2.2rem;
    color: #e0e0e0;
    margin-bottom: 0.6rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-desc {
    font-size: 1.5rem;
    color: #bbb;
    line-height: 1.6;
    margin-bottom: 1.2rem;
    min-height: 3.5rem;
    flex: 1;
}

.card-bottom {
    margin-top: auto;
}

.card-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.file-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.15rem;
    color: #777;
    background: #0f0f12;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid #1a1a1a;
}

.file-tag i {
    font-size: 0.9rem;
    opacity: 0.5;
}

.card-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid;
    border-radius: 4rem;
    padding: 0.5rem 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.02em;
}

.card-btn:hover {
    background: var(--nav-color);
    border-color: var(--nav-color) !important;
    color: #0e0e12 !important;
    box-shadow: var(--neon-glow);
}

/* ============================================
   INDIVIDUAL WRITEUP VIEW
   ============================================ */

.writeup-view {
    width: 100%;
    max-width: 900px;
    text-align: left;
}

.back-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid #333;
    border-radius: 4rem;
    color: #999;
    padding: 0.6rem 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.back-btn:hover {
    border-color: var(--nav-color);
    color: var(--nav-color);
    box-shadow: 0 0 15px rgba(var(--nav-color-rgb), 0.2);
}

.wup-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #1a1a1a;
}

.wup-cat {
    font-size: 1.4rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.wup-title {
    font-size: 3.2rem;
    color: #e0e0e0;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Files section */
.wup-files {
    margin-top: 1rem;
    padding: 1rem 1.2rem;
    background: #0a0a0d;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
}

.wup-files h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 500;
    color: #888;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wup-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.wup-file-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    color: #aaa;
    background: #0f0f12;
    border: 1px solid #1a1a1a;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.wup-file-tag:hover {
    border-color: #333;
    color: #ddd;
}

.wup-file-tag i {
    font-size: 1rem;
    opacity: 0.4;
}

.file-original {
    font-size: 1rem;
    color: #777;
    opacity: 0.6;
}

/* Writeup body */
.wup-body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    color: #ccc !important;
    line-height: 1.9;
}

.wup-body p {
    color: #ccc !important;
}

.wup-body h3 {
    font-size: 2.4rem;
    font-weight: 600;
    margin: 3rem 0 1rem;
    letter-spacing: -0.01em;
    padding-top: 1rem;
    padding-bottom: 0.6rem;
    border-top: 1px solid #1a1a1a;
    border-bottom: 2px solid currentColor;
}

.wup-body h4 {
    font-size: 1.9rem;
    font-weight: 500;
    color: #ddd;
    margin: 2rem 0 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid currentColor;
}

/* Terminal blocks */
.terminal-block {
    background: #0a0a0d;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    margin: 1.2rem 0;
    overflow: hidden;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: #0f0f12;
    border-bottom: 1px solid #1a1a1a;
}

.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.7;
}

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    color: #666;
    margin-left: 0.4rem;
}

.terminal-block pre {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1.2rem 1.5rem;
    overflow-x: auto;
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.7;
    color: #ccc;
}

.wup-body code {
    font-family: 'JetBrains Mono', monospace;
}

.wup-body code.inline {
    background: #0f0f12;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 1.5rem;
    border: 1px solid #1a1a1a;
}

.wup-body blockquote {
    border-left: 2px solid;
    padding: 1rem 1.4rem;
    margin: 1.2rem 0;
    background: rgba(255,255,255,0.03);
    border-radius: 0 6px 6px 0;
    color: #bbb;
    font-style: italic;
    font-size: 1.5rem;
}

.wup-body strong {
    color: #ddd;
    font-weight: 600;
}

.wup-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
    font-size: 1.45rem;
}

.wup-body th {
    background: #0f0f12;
    padding: 0.7rem 1.2rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid;
}

.wup-body td {
    padding: 0.5rem 1.2rem;
    border-bottom: 1px solid #1a1a1a;
    color: #ccc;
}

.wup-body tr:hover td {
    background: rgba(255,255,255,0.02);
}

.wup-body ul {
    padding-left: 2rem;
    margin: 0.8rem 0;
}

.wup-body li {
    margin-bottom: 0.5rem;
    font-size: 1.55rem;
    color: #ccc;
}

.wup-body hr {
    border: none;
    border-top: 1px solid #1a1a1a;
    margin: 2rem 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 995px) {
    .home {
        flex-direction: column;
        margin: 5rem 4rem;
    }
    .home .home-content h3 {
        font-size: 2.2rem;
    }
    .home-content h1 {
        font-size: 3rem;
    }
    .home-img img {
        width: 55vw;
        max-width: 300px;
        margin-top: 4rem;
    }
}

/* Mobile navigation */
@media (max-width: 995px) {
    .menu-toggle {
        display: flex;
        position: fixed;
        top: 2rem;
        right: 2rem;
        width: 4rem;
        height: 4rem;
        background: rgba(var(--nav-color-rgb), 0.15);
        border-radius: 50%;
        z-index: 1001;
        cursor: pointer;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: all 0.3s ease;
        border: 1px solid rgba(var(--nav-color-rgb), 0.4);
        box-shadow: 0 0 10px rgba(var(--nav-color-rgb), 0.1);
    }

    .menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--nav-color);
        margin: 3px 0;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    .menu-toggle.active {
        background: rgba(5, 5, 8, 0.9);
        border-color: var(--nav-color);
    }

    .menu-toggle.active span {
        background: var(--nav-color);
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(5px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-5px) rotate(-45deg);
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: rgba(5, 5, 8, 0.98);
        backdrop-filter: blur(20px);
        z-index: 1000;
        transition: all 0.5s cubic-bezier(0.77, 0.2, 0.05, 1);
        padding: 8rem 2rem 2rem;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
        border-left: 1px solid rgba(var(--nav-color-rgb), 0.3);
    }

    nav.active {
        right: 0;
    }

    nav a {
        display: block;
        font-size: 1.7rem;
        color: #bbb;
        padding: 1.2rem;
        margin: 0.3rem 0;
        border-radius: 0.5rem;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    nav a:hover,
    nav a.active {
        color: var(--nav-color);
        background: rgba(var(--nav-color-rgb), 0.08);
        transform: translateX(3px);
        text-shadow: 0 0 10px rgba(var(--nav-color-rgb), 0.3);
    }
}

@media (max-width: 768px) {
    .writeups-page {
        padding: 10rem var(--mobile-padding) 5rem;
    }
    .page-title {
        font-size: 2.8rem;
    }
    .writeups-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .filter-bar {
        gap: 0.5rem;
    }
    .filter-btn {
        font-size: 1.3rem;
        padding: 0.4rem 1.2rem;
    }
    .wup-title {
        font-size: 2.4rem;
    }
    .wup-body {
        font-size: 1.4rem;
    }
    .terminal-block pre {
        font-size: 1.25rem;
    }
}
