/* --- VARIABLES & RESET --- */
:root {
    --bg-dark: #050505;
    --bg-card: rgba(20, 20, 25, 0.6);
    --bg-card-hover: rgba(30, 30, 40, 0.8);
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.5);
    --secondary: #3b82f6;
    --accent: #db2777;
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(139, 92, 246, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 20%);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
}

/* --- LAYOUT UTILS --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.section-active {
    display: block;
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- HEADER --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(5, 5, 5, 0.8);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.linkedin-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.linkedin-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary);
}

nav ul {
    display: flex;
    gap: 2rem;
}

nav a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

nav a:hover,
nav a.active {
    color: var(--text-main);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    box-shadow: 0 0 10px var(--primary);
}

/* --- HOME HERO --- */
.hero-section {
    padding-top: 140px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero-role {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.cta-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

.hero-visual {
    position: relative;
}

/* Abstract Code Window Visual */
.code-window {
    background: rgba(20, 20, 25, 0.8);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.code-window:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

.window-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #ef4444;
}

.yellow {
    background: #eab308;
}

.green {
    background: #22c55e;
}

.code-content {
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: #d1d5db;
}

.code-line {
    margin-bottom: 0.5rem;
    display: block;
}

.keyword {
    color: var(--primary);
}

.string {
    color: var(--accent);
}

.func {
    color: var(--secondary);
}

/* --- ABOUT SECTION --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 4rem 0;
}

.about-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    background: linear-gradient(90deg, #fff, #94a3b8);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.tag:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

/* --- ARTICLES CARD GRID --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.article-card:hover {
    transform: translateY(-10px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.article-card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-link {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- ARTICLE DETAIL VIEW --- */
.article-detail {
    display: none;
    /* hidden by default */
}

.article-detail.active {
    display: block;
    animation: fadeIn 0.3s;
}

.detail-header {
    margin-bottom: 2rem;
}

.back-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn:hover {
    color: var(--text-main);
}

.detail-content {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.detail-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.detail-content p,
.detail-content li {
    font-size: 1.1rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.detail-content ul {
    padding-left: 1.5rem;
    list-style: disc;
    margin-bottom: 1.5rem;
}

/* --- CONTACT --- */
.contact-box {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(59, 130, 246, 0.05));
    border: 1px solid var(--border);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-item {
    margin: 1.5rem 0;
    font-size: 1.25rem;
}

.contact-item strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

/* --- LEGAL MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.legal-text h2 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.legal-text h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 1.1rem;
}

.legal-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.legal-text a {
    color: var(--primary);
    text-decoration: underline;
}

/* --- SOURCE CODE MODAL --- */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    border-color: rgba(139, 92, 246, 0.2);
}

.code-view {
    display: none;
    background: #0d0d0d;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

.code-view.active {
    display: block;
}

.code-view pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: #e5e7eb;
}

/* Responsive */
@media (max-width: 768px) {

    .hero-layout,
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .code-window {
        display: none;
    }

    /* Hide complex visual on mobile */
    nav ul {
        gap: 1rem;
        font-size: 0.9rem;
    }
}