/* Clean Dark Portfolio */

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

:root {
    --bg: #0a0a0a;
    --bg-card: #111;
    --text: #fff;
    --text-muted: #999;
    --text-dim: #666;
    --border: #222;
    --accent: #fff;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

::selection {
    background: var(--text);
    color: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 48px;
    z-index: 100;
    background: transparent;
    transition: background 0.3s, transform 0.3s;
}

.nav.scrolled {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
}

.nav.hidden {
    transform: translateY(-100%);
}

.nav-logo {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 1;
}

/* Hero - Full Screen */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 120px 24px;
}

.hero .container {
    text-align: center;
}

.hero-title {
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.hero-title .line {
    display: block;
    opacity: 0;
    transform: translateY(40px);
}

/* CSS Animation Fallbacks */
.hero-title .line.animated {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-title .line:nth-child(2).animated {
    transition-delay: 0.2s;
}

.hero-typing {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 24px;
    min-height: 36px;
}

.typing-text {
    color: var(--text);
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-desc {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 40px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-desc.animated {
    opacity: 1;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-cta.animated {
    opacity: 1;
}

.btn {
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: transparent;
    color: var(--text);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--text);
    color: var(--bg);
}

.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.scroll-hint.animated {
    opacity: 1;
}

.scroll-hint span {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.scroll-hint svg {
    color: var(--text-dim);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Sections */
.section {
    padding: 100px 0;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-title.animated {
    opacity: 1;
    transform: translateY(0);
}

/* About */
.about-lead {
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 48px;
    max-width: 700px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-lead.animated {
    opacity: 1;
    transform: translateY(0);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.about-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease, border-color 0.3s;
}

.about-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.about-card:nth-child(2).animated {
    transition-delay: 0.1s;
}

.card-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.card-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-sub {
    font-size: 14px;
    color: var(--text-muted);
}

.skills {
    opacity: 0;
    transform: translateY(30px);
}

.skills.animated {
    opacity: 1;
    transform: translateY(0);
}

.skills-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 20px;
}

/* Skills Marquee */
.skills-marquee {
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.skills-track {
    display: flex;
    gap: 16px;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.skills-track:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.skill-item:hover {
    border-color: var(--text-muted);
    background: #151515;
}

.skill-item i {
    font-size: 24px;
    line-height: 1;
}

.skill-item span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s;
}

.skill-item:hover span {
    color: var(--text);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 48px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.timeline-item.animated {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(2).animated {
    transition-delay: 0.15s;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 8px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--text-dim);
    transition: all 0.3s;
}

.timeline-item:hover .timeline-dot {
    border-color: var(--text);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.timeline-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.company {
    font-size: 15px;
    color: var(--text-muted);
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--border);
    margin-left: 8px;
}

.date {
    font-size: 14px;
    color: var(--text-dim);
    white-space: nowrap;
}

.timeline-list {
    list-style: none;
}

.timeline-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--text-muted);
}

.timeline-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 1px;
    background: var(--text-dim);
}

/* Timeline Related Projects */
.timeline-related {
    margin-top: 16px;
}

.related-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.related-project {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: color 0.3s, border-color 0.3s;
}

.related-project:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease, border-color 0.3s;
    display: flex;
    flex-direction: column;
}

.project-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.project-card:nth-child(2).animated {
    transition-delay: 0.1s;
}

.project-card:hover {
    border-color: var(--text-dim);
    transform: translateY(-4px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.project-year {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
}

.project-link {
    color: var(--text-dim);
    transition: color 0.3s;
}

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

.project-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.project-desc {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

.project-title a:hover {
    color: var(--text-muted);
}

.read-more {
    display: inline-block;
    align-self: flex-start;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted); /* Start with muted color */
    padding-bottom: 2px;
    position: relative;
    transition: color 0.3s;
}

.read-more::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--text);
    transform: scaleX(0); /* Hidden initially */
    transform-origin: right;
    transition: transform 0.3s;
}

.read-more:hover {
    color: var(--text); /* Brighten text on hover */
}

.read-more:hover::after {
    transform: scaleX(1); /* Slide in */
    transform-origin: left;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.project-tags span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg);
    border: 1px solid var(--border);
}

.project-tags i, .project-tags img {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Contact */
.contact-content {
    max-width: 500px;
}

.contact-text {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.contact-text.animated {
    opacity: 1;
    transform: translateY(0);
}

.contact-email {
    display: inline-block;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    margin-bottom: 32px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.contact-email.animated {
    opacity: 1;
    transform: translateY(0);
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s;
}

.contact-email:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.contact-links {
    display: flex;
    gap: 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.contact-links.animated {
    opacity: 1;
    transform: translateY(0);
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s;
}

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

/* Footer */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

.footer p {
    font-size: 13px;
    color: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {

    .nav {
        padding: 16px 24px;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 16px;
    }

    .nav-links {
        display: flex;
        gap: 24px;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        position: static;
        background: transparent;
        padding: 0;
        transform: none;
        box-shadow: none;
        flex-direction: row;
    }

    .nav-links.active {
        transform: none;
    }

    /* Remove Overlay */
    .nav::before {
        display: none;
    }

    .nav-links a {
        font-size: 13px;
        font-weight: 500;
    }

    .hero {
        padding: 120px 24px 40px; /* Adjusted padding, enough space for stacked nav */
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .scroll-hint {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: 60px;
        opacity: 1; /* Ensure visible */
    }

    .hero-title {
        font-size: clamp(36px, 10vw, 48px);
        margin-bottom: 16px;
    }
    
    .hero-typing {
        font-size: 16px;
        margin-bottom: 32px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 32px;
    }

    .about-lead {
        font-size: 18px;
        margin-bottom: 32px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* Compact Timeline for Mobile */
    .timeline {
        padding-left: 30px; /* Sufficient space for dot (13px) + gap */
        margin-left: 0;
    }

    .timeline::before {
        left: 6px; /* Center of the dot (13px / 2 = 6.5px) */
    }

    .timeline-dot {
        left: -30px; /* Pull back by padding amount to start at 0px */
        flex-shrink: 0;
    }

    .timeline-header {
        flex-direction: column;
        gap: 4px;
        margin-bottom: 12px;
    }
    
    .contact-email {
        font-size: clamp(20px, 6vw, 32px);
        word-break: break-word;
    }
    
    .contact-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Detail Pages */
.page-header {
    padding: 120px 0 60px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.03), transparent);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 32px;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--text);
    transform: translateX(-4px);
}

.page-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.page-subtitle {
    font-size: clamp(18px, 3vw, 24px);
    color: var(--text-muted);
    margin-bottom: 24px;
}

.article-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 64px;
    margin-bottom: 80px;
}

.article-content {
    font-size: 18px;
    line-height: 1.8;
    color: #ccc;
}

.article-content h3 {
    font-size: 24px;
    color: var(--text);
    margin: 40px 0 20px;
}

.article-content p {
    margin-bottom: 24px;
}

.article-content ul {
    margin-bottom: 24px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 12px;
}

.meta-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.meta-group {
    margin-bottom: 32px;
}

.meta-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.meta-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .meta-sidebar {
        position: static;
        margin-top: 40px;
        padding-top: 40px;
        border-top: 1px solid var(--border);
    }
}
