/* Reset and design tokens */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #f97316;
    --primary-light: #fb923c;
    --secondary: #ec4899;
    --accent: #a855f7;
    --bg-deep: #0c0a09;
    --bg: #14100f;
    --bg-elevated: #1c1512;
    --surface: #241c18;
    --border: rgba(249, 115, 22, 0.22);
    --border-strong: rgba(249, 115, 22, 0.4);
    --text: #fafaf9;
    --text-secondary: #d6d3d1;
    --text-muted: #a8a29e;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 55%, var(--accent) 100%);
    --gradient-soft: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(236, 72, 153, 0.1));
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 8px 40px rgba(249, 115, 22, 0.18);
    --font-sans: "DM Sans", system-ui, sans-serif;
    --font-display: "Outfit", system-ui, sans-serif;
    --nav-h: 72px;
    --radius: 12px;
    --radius-lg: 20px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --container: 1120px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text-secondary);
    background: var(--bg-deep);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(249, 115, 22, 0.12), transparent 50%),
        radial-gradient(ellipse 60% 40% at 90% 20%, rgba(236, 72, 153, 0.08), transparent 45%),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(168, 85, 247, 0.06), transparent 40%);
    pointer-events: none;
    z-index: -1;
}

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

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
}

.section-label {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.section-title .gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-h);
    background: rgba(12, 10, 9, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.navbar.scrolled {
    background: rgba(12, 10, 9, 0.92);
    box-shadow: var(--shadow);
}

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

.nav-logo {
    text-decoration: none;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(249, 115, 22, 0.1);
}

.nav-link--cta {
    margin-left: 0.5rem;
    background: var(--gradient);
    color: var(--bg-deep) !important;
    font-weight: 600;
}

.nav-link--cta:hover {
    filter: brightness(1.08);
    background: var(--gradient);
}

.nav-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

.bar {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.3s;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s, filter 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient);
    color: var(--bg-deep);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    filter: brightness(1.05);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(249, 115, 22, 0.08);
    transform: translateY(-2px);
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-h) + 2rem) 0 4rem;
    position: relative;
}

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

.hero-content {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: var(--gradient-soft);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--primary-light);
    margin-bottom: 1.25rem;
}

.hero-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
    font-size: clamp(2.75rem, 6vw, 4rem);
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.15rem, 2.5vw, 1.4rem);
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1.25rem;
}

.hero-description {
    font-size: 1.1rem;
    max-width: 32rem;
    margin-bottom: 2rem;
    line-height: 1.75;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-headshot {
    position: relative;
    width: min(420px, 85vw);
    aspect-ratio: 1;
    margin: 0;
    padding: 5px;
    border-radius: 50%;
    background: var(--gradient);
    box-shadow: var(--shadow-glow);
}

.hero-headshot-placeholder {
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 5.5rem;
}

.hero-headshot-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient);
    z-index: 9999;
    pointer-events: none;
}

/* Sections — alternating backgrounds (hero → about → projects) */
section {
    padding: 6rem 0;
}

body > section:nth-of-type(odd) {
    background: var(--bg-deep);
}

body > section:nth-of-type(even) {
    background: var(--bg);
}

.about-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(220px, 30%, 320px);
    gap: 2.5rem 3rem;
    align-items: stretch;
}

.about-text.about-panel,
.about-sidebar {
    height: 100%;
    min-height: 100%;
}

.about-text p {
    margin-bottom: 1.25rem;
    font-size: 1.0625rem;
    line-height: 1.75;
}

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

.about-sidebar {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 1.25rem;
    align-content: stretch;
}

.about-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.15rem;
}

.about-panel.about-skills {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.about-panel.about-skills .about-skill-list {
    flex: 1;
    align-content: flex-start;
}

.about-panel-title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.about-skill-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.about-skill-list li {
    padding: 0.3rem 0.65rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.about-cert-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.about-cert-list li {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.about-cert-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.about-cert-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.project-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-glow);
    transform: translateY(-6px);
}

.project-image {
    height: 160px;
    background: var(--gradient-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary);
}

.project-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.project-description {
    flex: 1;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    line-height: 1.65;
}

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

.tech-tag {
    padding: 0.25rem 0.65rem;
    background: var(--bg-elevated);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-light);
    border: 1px solid var(--border);
}

.project-links {
    display: flex;
    gap: 1.25rem;
    margin-top: auto;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s;
}

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

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    background: var(--bg-deep);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9375rem;
    text-align: center;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.7s var(--ease) forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 900px) {
    .hero-content,
    .about-content {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        order: -1;
    }

    .hero-headshot {
        width: min(280px, 70vw);
    }

    .hero-headshot-placeholder {
        font-size: 3.75rem;
    }

    .about-text.about-panel,
    .about-sidebar {
        height: auto;
        min-height: 0;
    }

    .about-sidebar {
        display: flex;
        flex-direction: column;
    }

    .about-panel.about-skills {
        display: block;
    }

    .about-panel.about-skills .about-skill-list {
        flex: none;
    }
}

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

    .nav-menu {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        padding: 1.5rem;
        background: rgba(12, 10, 9, 0.98);
        border-bottom: 1px solid var(--border);
        transform: translateY(-120%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.35s var(--ease), opacity 0.35s, visibility 0.35s;
    }

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

    .nav-link--cta {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    .hero {
        text-align: center;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

}
