/* ==========================================================================
   Joseph Ampfer — Portfolio
   Hand-crafted CSS. No frameworks.
   ========================================================================== */

:root {
    --bg: #0a0a0a;
    --bg-elevated: #111111;
    --bg-hover: #191919;
    --border: #1e1e1e;
    --border-hover: #2e2e2e;
    --text: #ededed;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1100px;
    --header-height: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 2rem);
}

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

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

ul {
    list-style: none;
}

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==========================================================================
   Skip Link (accessibility)
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 200;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0.5rem;
}

/* ==========================================================================
   Container
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */

#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

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

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    transition: color 0.15s;
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    align-items: center;
    justify-content: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.15s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

/* ==========================================================================
   Shared Components
   ========================================================================== */

.icon-link {
    color: var(--text-secondary);
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
    border-radius: var(--radius-xs);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    font-family: var(--font);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

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

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--header-height) 1.5rem 2rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    pointer-events: none;
}

.hero-container {
    position: relative;
    z-index: 1;
}

.hero-label {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

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

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

.hero-tagline {
    font-size: 1.125rem;
    color: var(--text-tertiary);
    max-width: 480px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-tertiary);
    animation: bounce 2s ease-in-out infinite;
    display: flex;
    padding: 0.5rem;
    border-radius: 50%;
    transition: color 0.15s;
}

.scroll-hint:hover {
    color: var(--text-secondary);
}

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

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
    padding: 5rem 0;
}

.section-heading {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
}

/* ==========================================================================
   About
   ========================================================================== */

.about-content {
    max-width: 680px;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

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

.stats {
    display: flex;
    gap: 3rem;
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* ==========================================================================
   Experience
   ========================================================================== */

.experience-grid {
    display: grid;
    gap: 1.5rem;
}

.exp-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: border-color 0.2s;
}

.exp-card:hover {
    border-color: var(--border-hover);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.exp-company {
    font-size: 1.125rem;
    font-weight: 600;
}

.exp-role {
    font-size: 0.9375rem;
    color: var(--accent);
    margin-top: 0.25rem;
}

.exp-date {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 0.125rem;
}

.exp-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.exp-list li {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    padding-left: 1.125rem;
    position: relative;
    line-height: 1.6;
}

.exp-list li::before {
    content: '\2013';
    position: absolute;
    left: 0;
    color: var(--text-tertiary);
}

/* ==========================================================================
   Projects
   ========================================================================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

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

.project-card.featured {
    grid-column: 1 / -1;
}

.project-accent {
    height: 4px;
    background: var(--card-gradient);
}

.project-preview {
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.project-preview img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.3s ease;
}

.project-card:hover .project-preview img {
    transform: scale(1.03);
}

.project-body {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.project-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border-radius: var(--radius-xs);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.project-tags:last-child {
    margin-bottom: 0;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.15s;
}

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

/* ==========================================================================
   Skills
   ========================================================================== */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
}

.skill-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skill-item {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    transition: color 0.15s;
}

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

/* ==========================================================================
   Education & Awards
   ========================================================================== */

.edu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.edu-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.edu-card:hover {
    border-color: var(--border-hover);
}

.edu-institution {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.edu-degree {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.edu-meta {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 0.75rem;
}

.award-badge {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1;
    text-align: center;
}

/* ==========================================================================
   Contact
   ========================================================================== */

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

#contact {
    padding-bottom: 6rem;
}

.contact-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--accent);
    transition: color 0.15s;
    margin-bottom: 2rem;
}

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

.contact-socials {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    text-align: center;
}

.site-footer p {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.site-footer p + p {
    margin-top: 0.375rem;
}

/* ==========================================================================
   Scroll Animations
   ========================================================================== */

.animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   Responsive — Tablet (1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

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

/* ==========================================================================
   Responsive — Mobile (768px)
   ========================================================================== */

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 0.5rem 1.5rem 1rem;
        border-bottom: 1px solid var(--border);
        gap: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    }

    .nav-links.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-links li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }

    .nav-link.active::after {
        display: none;
    }

    .section {
        padding: 3.5rem 0;
    }

    .section-heading {
        font-size: 1.5rem;
        margin-bottom: 1.75rem;
    }

    .stats {
        gap: 2rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .exp-header {
        flex-direction: column;
        gap: 0.25rem;
    }

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

    .project-card.featured {
        grid-column: auto;
    }

    .project-preview img {
        height: 180px;
    }

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

    #contact {
        padding-bottom: 4rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

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

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

    .hero-actions {
        flex-wrap: wrap;
    }

    .contact-email {
        font-size: 1rem;
    }
}
