/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

:root {
    --bg-color: #050505; /* Deep black */
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #222222;
    --hover-bg: #121212;
    --accent: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.3s ease;
}

nav:hover {
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    z-index: 1001; /* Stay above mobile menu */
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger .line {
    width: 25px;
    height: 2px;
    background-color: var(--text-main);
    transition: all 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-muted);
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--text-main);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Layout & Sections */
section {
    padding: 5rem 5% 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

#home {
    min-height: 100vh;
    padding-top: 8rem;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1.5px;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    margin-bottom: 2.5rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

h2::after {
    content: '';
    display: block;
    height: 1px;
    flex-grow: 1;
    background-color: var(--border-color);
    margin-left: 2rem;
    max-width: 300px;
}

h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    max-width: 600px;
}

/* Buttons & Links */
.btn-container {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    border: 1px solid var(--accent);
    color: var(--bg-color);
    background-color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    letter-spacing: 0.5px;
}

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

.btn-hero {
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    border-radius: 30px;
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.btn-hero:hover {
    color: var(--text-main);
    border-color: var(--text-main);
}

.btn-outline {
    background-color: transparent;
    color: var(--accent);
}

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

/* Work & Projects Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--hover-bg);
    transition: transform 0.4s ease, background-color 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.card:hover {
    transform: translateY(-8px);
    background-color: transparent;
}

.card p.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-family: monospace;
}

.tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-main);
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 500px;
    width: 100%;
}

.form-group {
    position: relative;
}

input, textarea {
    width: 100%;
    padding: 0.8rem 0;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--text-main);
}

label {
    position: absolute;
    top: 0.8rem;
    left: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: 0.3s ease all;
}

input:focus ~ label,
input:not(:placeholder-shown) ~ label,
textarea:focus ~ label,
textarea:not(:placeholder-shown) ~ label {
    top: -1.2rem;
    font-size: 0.75rem;
    color: var(--text-main);
}

textarea {
    resize: vertical;
    min-height: 120px;
    margin-top: 1rem;
}

/* Footer */
footer {
    padding: 3rem 5%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: monospace;
}

/* Typing Cursor Animation */
.cursor {
    font-weight: 300;
    color: var(--accent);
    animation: blink 1s step-end infinite;
    margin-left: 0.2rem;
}

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

/* Home Features Grid */
.home-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-top: 4.5rem;
    width: 100%;
}

.home-card {
    padding: 1.5rem 1.2rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .home-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background-color: rgba(5, 5, 5, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease;
        z-index: 1000;
        border-left: 1px solid var(--border-color);
        gap: 3rem;
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger.active .line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .line:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    section { padding: 6rem 5% 4rem; }
    h2::after { display: none; }
    .btn-container { flex-direction: column; }
    .btn { width: 100%; }
    .home-features-grid {
        grid-template-columns: 1fr;
        margin-top: 3rem;
    }
}

/* --- Extracted Classes --- */
.hero-greeting { font-family: monospace; color: var(--text-main); margin-bottom: 1rem; font-size: 0.95rem; }
.hero-description { margin-top: 1.5rem; max-width: 600px; font-size: 1rem; line-height: 1.7; }
.highlight-text { color: var(--text-main); font-weight: 800; }
.home-card-title { font-size: 0.95rem; margin-bottom: 0.5rem; line-height: 1.3; }
.home-card-desc { font-size: 0.85rem; margin-bottom: 0; line-height: 1.5; }

.work-container { display: flex; flex-direction: column; gap: 2rem; }
.work-card { width: 100%; padding: 3rem; }
.work-header-row { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; margin-bottom: 1.5rem; gap: 1rem; }
.work-title { font-size: 1.25rem; color: var(--text-main); }
.work-company { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0; font-family: monospace; }
.work-date { font-family: monospace; color: var(--accent); font-size: 0.85rem; }

.work-section-block { margin-bottom: 2rem; }
.work-subsection-title { font-size: 0.95rem; margin-bottom: 0.5rem; color: var(--text-main); }
.work-product-desc { font-size: 0.95rem; line-height: 1.8; color: var(--text-muted); margin-bottom: 0; max-width: 800px; }
.accent-text { color: var(--accent); }

.work-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 3rem; margin-bottom: 2rem; }
.work-column-title { font-size: 0.95rem; margin-bottom: 0.8rem; color: var(--text-main); border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; display: inline-block; }
.work-list { list-style-type: none; padding-left: 0; color: var(--text-muted); line-height: 1.7; font-size: 0.95rem; }
.work-list-item { margin-bottom: 0.8rem; display: flex; align-items: flex-start; }
.work-list-bullet { color: var(--accent); margin-right: 0.8rem; flex-shrink: 0; font-size: 0.8rem; line-height: 1.7; }
.work-list-item-large { margin-bottom: 1.2rem; display: flex; align-items: flex-start; }

.additional-work-section { margin-bottom: 1.5rem; border-top: 1px solid var(--border-color); padding-top: 1.5rem; }
.additional-work-title { font-size: 0.85rem; margin-bottom: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.additional-work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; opacity: 0.85; }
.additional-work-item-title { color: var(--text-muted); font-size: 0.9rem; display: block; margin-bottom: 0.3rem; }
.additional-work-item-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0; }

.work-tags { margin-top: auto; padding-top: 1rem; }
.work-header-row-small { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.work-title-small { font-size: 1.15rem; color: var(--text-main); }
.work-company-small { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0; font-family: monospace; }
.work-date-muted { font-family: monospace; color: var(--text-muted); font-size: 0.8rem; }
.work-summary { font-size: 0.95rem; line-height: 1.7; color: var(--text-muted); margin-bottom: 1.5rem; max-width: 800px; }
.work-section-block-small { margin-bottom: 1.5rem; }
.work-subsection-title-small { font-size: 0.9rem; margin-bottom: 0.8rem; color: var(--text-main); }
.work-list-compact { list-style-type: none; padding-left: 0; color: var(--text-muted); line-height: 1.6; font-size: 0.95rem; }
.work-tags-bordered { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.tag-small { font-size: 0.75rem; padding: 0.2rem 0.6rem; margin-bottom: 0; }

.about-container { display: grid; grid-template-columns: 1fr; gap: 2rem; max-width: 800px; }
.tech-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1rem; font-family: monospace; font-size: 0.9rem; color: var(--text-main); }
.contact-desc { margin-bottom: 2rem; font-size: 0.95rem; max-width: 500px; }
.btn-fit { width: fit-content; }

/* Mobile Adjustments for new classes */
@media (max-width: 768px) {
    .work-card { padding: 1.5rem; }
    .work-details-grid { gap: 1.5rem; }
    .diag-h-line { display: none; }
}

.btn:hover {
    cursor: pointer;
}
