/* ========================================
   Variables & Reset
   ======================================== */
:root {
    --bg: #0f0f13;
    --bg-card: #16161d;
    --bg-card-hover: #1c1c26;
    --bg-nav: rgba(15, 15, 19, 0.85);
    --text: #cdd6f4;
    --text-muted: #6c7086;
    --text-dim: #45475a;
    --accent: #89b4fa;
    --accent-hover: #b4d0fb;
    --border: #1e1e2e;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --max-width: 1000px;
    --nav-height: 60px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

ul {
    list-style: none;
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 640px;
}

.section {
    padding: 100px 0;
}

/* ========================================
   Navigation
   ======================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: transform 0.3s;
}

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

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text);
}

.nav-logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 1px;
    transition: all 0.3s;
}

/* ========================================
   Hero
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
}

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.hero-name {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.hero-title {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 24px;
}

.hero-summary {
    max-width: 560px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 0.875rem;
    font-family: var(--font-mono);
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border: 1px solid var(--accent);
}

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

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-ghost:hover {
    background: rgba(137, 180, 250, 0.08);
    color: var(--accent-hover);
}

/* ========================================
   Section Headings
   ======================================== */
.section-heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-heading .accent {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 400;
}

.section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    max-width: 300px;
}

.accent {
    color: var(--accent);
}

/* ========================================
   Hero Avatar
   ======================================== */
.hero-intro {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
}

.hero-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2px solid var(--border);
    transition: border-color 0.3s;
    flex-shrink: 0;
}

.hero-avatar:hover {
    border-color: var(--accent);
}

.hero-intro .hero-greeting {
    margin-bottom: 4px;
}

.hero-intro .hero-name {
    margin-bottom: 0;
}

/* ========================================
   About
   ======================================== */
.about-content p {
    color: var(--text-muted);
    margin-bottom: 16px;
    max-width: 600px;
    line-height: 1.7;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* ========================================
   Experience Timeline
   ======================================== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.timeline-item {
    padding-left: 24px;
    border-left: 2px solid var(--border);
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

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

.timeline-role {
    font-size: 1.1rem;
    font-weight: 600;
}

.timeline-company {
    color: var(--accent);
    font-size: 0.95rem;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
}

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

.timeline-details li {
    position: relative;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 8px;
}

.timeline-details li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* ========================================
   Projects
   ======================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    border-color: var(--accent);
}

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

.project-icon {
    width: 36px;
    height: 36px;
    color: var(--accent);
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.project-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
    margin-bottom: 20px;
}

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

.project-tags li {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ========================================
   Skills
   ======================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 32px;
}

.skill-group-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.skill-list li {
    position: relative;
    padding-left: 18px;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.skill-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}

/* ========================================
   Writing
   ======================================== */
.writing-placeholder {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 500px;
    padding: 32px;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

/* ========================================
   Education
   ======================================== */
.edu-grid {
    display: grid;
    gap: 24px;
}

.edu-item {
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.edu-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.edu-org {
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.edu-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.edu-detail {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ========================================
   Contact
   ======================================== */
#contact {
    text-align: center;
}

.contact-text {
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.7;
}

.contact-form {
    text-align: left;
    max-width: 520px;
    margin: 0 auto 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 36px;
    transition: border-color 0.3s;
}

.contact-form:focus-within {
    border-color: rgba(137, 180, 250, 0.3);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group input,
.form-group textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(137, 180, 250, 0.1);
}

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

.contact-form .btn {
    width: 100%;
    text-align: center;
    border: 1px solid var(--accent);
    font-family: var(--font-mono);
    padding: 14px 28px;
    font-size: 0.9rem;
    margin-top: 4px;
    transition: all 0.2s;
}

.contact-form .btn:hover {
    box-shadow: 0 0 20px rgba(137, 180, 250, 0.15);
}

.contact-form .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.form-status {
    margin-top: 16px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    text-align: center;
    min-height: 1.2em;
}

.form-status.success { color: #a6e3a1; }
.form-status.error { color: #f38ba8; }

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form {
        padding: 24px 20px;
    }
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
}

.contact-links a {
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.contact-links svg {
    width: 22px;
    height: 22px;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px 24px;
        gap: 16px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .section {
        padding: 64px 0;
    }

    .hero {
        min-height: auto;
        padding-top: calc(var(--nav-height) + 60px);
        padding-bottom: 60px;
    }

    .timeline-header {
        flex-direction: column;
    }

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

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Animations
   ======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
