/* ============================================
   CSS Variables — Theming
   ============================================ */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-2: #7c3aed;
    --accent-warm: #f59e0b;
    --border: #e5e7eb;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --card-shadow-hover: rgba(0, 0, 0, 0.15);
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --tag-bg: #e8f0fe;
    --tag-text: #1a56db;
    --timeline-line: #e5e7eb;
    --input-bg: #f8f9fa;
    --input-border: #e5e7eb;
    --font-mono: 'JetBrains Mono', monospace;
    --gradient-primary: linear-gradient(135deg, #2563eb, #7c3aed);
    --gradient-accent: linear-gradient(135deg, #f59e0b, #ef4444);
    --gradient-hero: linear-gradient(180deg, #f0f4ff 0%, #ffffff 100%);
    --btn-shadow: rgba(37, 99, 235, 0.3);
    --hero-glow-warm: rgba(245, 158, 11, 0.07);
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #f0f0f0;
    --text-secondary: #999999;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-2: #8b5cf6;
    --accent-warm: #fbbf24;
    --border: #2a2a2a;
    --card-bg: #1a1a1a;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --card-shadow-hover: rgba(0, 0, 0, 0.5);
    --navbar-bg: rgba(10, 10, 10, 0.85);
    --tag-bg: #1e3a5f;
    --tag-text: #93c5fd;
    --timeline-line: #2a2a2a;
    --input-bg: #1a1a1a;
    --input-border: #2a2a2a;
    --font-mono: 'JetBrains Mono', monospace;
    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-accent: linear-gradient(135deg, #fbbf24, #f87171);
    --gradient-hero: linear-gradient(180deg, #0a0a2e 0%, #0a0a0a 100%);
    --btn-shadow: rgba(59, 130, 246, 0.3);
    --hero-glow-warm: rgba(251, 191, 36, 0.1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    display: block;
}

code, .skill-tag, .project-card__tag, .timeline__date {
    font-family: var(--font-mono);
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.navbar__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar__logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
}

.navbar__logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
}

.navbar__links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.navbar__links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.navbar__links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.2s ease;
}

.navbar__links a:hover,
.navbar__links a.active {
    color: var(--accent);
}

.navbar__links a:hover::after {
    width: 100%;
}

.navbar__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    transition: border-color 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* ============================================
   Sections — General
   ============================================ */
section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    padding-left: 1rem;
    position: relative;
}

.section__title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.15em;
    bottom: 0.15em;
    width: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.section__title::after {
    content: '';
    display: block;
    width: 64px;
    height: 4px;
    background: var(--gradient-accent);
    border-radius: 2px;
    margin-top: 0.75rem;
}

.section__subtitle {
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

/* ============================================
   Hero
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 80px;
    background: var(--gradient-hero);
    transition: background 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '< />';
    position: absolute;
    font-family: var(--font-mono);
    font-size: 10rem;
    font-weight: 700;
    color: var(--accent-2);
    opacity: 0.04;
    pointer-events: none;
    line-height: 1;
    top: 12%;
    right: 6%;
    user-select: none;
    transform: rotate(-4deg);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 8%;
    left: 4%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, var(--hero-glow-warm) 0%, transparent 70%);
    pointer-events: none;
}

.hero__photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px var(--card-shadow);
    background-image: linear-gradient(var(--bg-primary), var(--bg-primary)), var(--gradient-primary);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
}

.hero__name {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    background-image: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.hero__title {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 400;
}

.hero__tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero__links {
    display: flex;
    gap: 1rem;
}

.hero__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.hero__link:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-shadow);
}

.hero__link svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   Stats
   ============================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.stat {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat:hover {
    border-color: var(--accent-2);
    box-shadow: 0 8px 24px var(--card-shadow-hover);
    transform: translateY(-2px);
}

.stat__number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat__label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   About
   ============================================ */
.about__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about__text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ============================================
   Experience — Timeline
   ============================================ */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.timeline__item {
    position: relative;
    padding-bottom: 3rem;
    padding-left: 2rem;
}

.timeline__item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: 3px solid var(--bg-primary);
    transform: translateX(-5px);
}

.timeline__date {
    font-size: 0.85rem;
    color: var(--accent-warm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.timeline__company {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.timeline__role {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.timeline__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline__list li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding-left: 1.2rem;
    position: relative;
}

.timeline__list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ============================================
   Skills
   ============================================ */
.skills__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.skill-category__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category__icon {
    font-size: 1.2rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    padding: 0.4rem 0.9rem;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.skill-tag:hover {
    background: var(--gradient-primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* ============================================
   Education
   ============================================ */
.education__list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.education__item {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    transition: all 0.2s ease;
}

.education__item:hover {
    box-shadow: 0 4px 16px var(--card-shadow);
}

.education__date {
    font-size: 0.85rem;
    color: var(--accent-warm);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.education__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.education__institution {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   Projects
   ============================================ */
.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.project-card {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--card-shadow-hover);
    border-color: var(--accent-2);
    background: linear-gradient(135deg, var(--card-bg) 60%, var(--bg-secondary));
}

.project-card__name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-card__desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.project-card__tag {
    padding: 0.25rem 0.6rem;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
}

.project-card__link:hover {
    text-decoration: underline;
}

/* ============================================
   Blog
   ============================================ */
.blog__placeholder {
    text-align: center;
    padding: 4rem 2rem;
    border: 2px dashed var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
}

.blog__placeholder p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.blog__placeholder span {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ============================================
   Contact
   ============================================ */
.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact__form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn {
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--btn-shadow);
}

.contact__links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact__link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.contact__link:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--card-shadow);
    color: var(--accent);
}

.contact__link-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 8px;
    font-size: 1.2rem;
}

.contact__link-text {
    display: flex;
    flex-direction: column;
}

.contact__link-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.contact__link-value {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer__links a {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer__links a:hover {
    color: var(--accent);
}

/* ============================================
   Scroll Reveal Animation
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive — Tablet (768px)
   ============================================ */
@media (max-width: 768px) {
    .navbar__links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 1.25rem;
    }

    .navbar__links.active {
        display: flex;
    }

    .navbar__links a {
        font-size: 1rem;
        padding: 0.25rem 0;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 2rem;
    }

    .hero__photo {
        width: 140px;
        height: 140px;
    }

    .hero__name {
        font-size: 2.2rem;
    }

    .hero__title {
        font-size: 1.1rem;
    }

    .hero__tagline {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    .hero__links {
        gap: 0.75rem;
    }

    .hero__link {
        width: 44px;
        height: 44px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 3rem 1.25rem;
    }

    .stat__number {
        font-size: 2.2rem;
    }

    .stat__label {
        font-size: 0.8rem;
    }

    section {
        padding: 4rem 1.5rem;
    }

    .section__title {
        font-size: 1.8rem;
    }

    .section__subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .about__content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about__text p {
        font-size: 0.95rem;
    }

    .skills__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .skill-tags {
        gap: 0.4rem;
    }

    .skill-tag {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline__item {
        padding-left: 1.5rem;
        padding-bottom: 2rem;
    }

    .timeline__company {
        font-size: 1.1rem;
    }

    .timeline__list li {
        font-size: 0.9rem;
    }

    .projects__grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .project-card {
        padding: 1.25rem;
    }

    .project-card__name {
        font-size: 1.05rem;
    }

    .project-card__desc {
        font-size: 0.85rem;
    }

    .education__item {
        padding: 1.25rem;
    }

    .education__title {
        font-size: 1rem;
    }

    .education__institution {
        font-size: 0.85rem;
    }

    .contact__grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .contact__form {
        gap: 1rem;
    }

    .contact__link {
        padding: 0.875rem 1rem;
    }

    .contact__link-value {
        font-size: 0.85rem;
    }
}

/* ============================================
   Responsive — Mobile (480px)
   ============================================ */
@media (max-width: 480px) {
    .navbar__container {
        padding: 0.75rem 1rem;
    }

    .navbar__logo {
        font-size: 1.1rem;
    }

    .navbar__links {
        padding: 1rem 1.25rem;
        gap: 1rem;
    }

    section {
        padding: 3rem 1rem;
    }

    .hero {
        padding-top: 80px;
    }

    .hero__photo {
        width: 120px;
        height: 120px;
        margin-bottom: 1.5rem;
    }

    .hero__name {
        font-size: 1.75rem;
    }

    .hero__title {
        font-size: 1rem;
    }

    .hero__tagline {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .stats {
        padding: 2.5rem 1rem;
        gap: 1rem;
    }

    .stat {
        padding: 1rem;
    }

    .stat__number {
        font-size: 1.8rem;
    }

    .stat__label {
        font-size: 0.75rem;
    }

    .section__title {
        font-size: 1.5rem;
    }

    .section__subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .about__text {
        font-size: 0.9rem;
    }

    .skill-category__title {
        font-size: 0.9rem;
    }

    .skill-tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .timeline__date {
        font-size: 0.75rem;
    }

    .timeline__company {
        font-size: 1rem;
    }

    .timeline__role {
        font-size: 0.9rem;
    }

    .timeline__list li {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .project-card {
        padding: 1rem;
    }

    .project-card__name {
        font-size: 1rem;
    }

    .project-card__desc {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .project-card__tag {
        font-size: 0.7rem;
    }

    .education__item {
        padding: 1rem;
    }

    .education__date {
        font-size: 0.75rem;
    }

    .education__title {
        font-size: 0.9rem;
    }

    .education__institution {
        font-size: 0.8rem;
    }

    .blog__placeholder {
        padding: 2.5rem 1rem;
    }

    .blog__placeholder p {
        font-size: 1rem;
    }

    .contact__form input,
    .contact__form textarea {
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
    }

    .contact__link-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .contact__link-label {
        font-size: 0.75rem;
    }

    .contact__link-value {
        font-size: 0.8rem;
    }

    .footer {
        padding: 1.5rem 1rem;
    }

    .footer__links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer__links a {
        font-size: 0.8rem;
    }

    .footer p {
        font-size: 0.75rem;
    }
}
