:root {
    --bg: #0f0e0d;
    --bg-elevated: #181614;
    --surface: #1f1d1a;
    --border: rgba(255, 255, 255, 0.06);
    --accent: #f59e0b;
    --accent-soft: rgba(245, 158, 11, 0.15);
    --text: #a8a29e;
    --text-bright: #e7e5e4;
    --text-muted: #78716c;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --section-scroll-margin: 80px;
    --radius: 12px;
    --radius-sm: 8px;
    --content-width: 1120px;
    --section-padding-y: 100px;
    --section-padding-x: 24px;
}

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

/* Hide system cursor when user has a mouse (fine pointer) so only custom cursor shows */
@media (pointer: fine) {
    body,
    body * {
        cursor: none !important;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    background: linear-gradient(180deg, var(--bg) 0%, #131210 50%, var(--bg-elevated) 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
}

.cursor {
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 999;
    transition: width 0.2s, height 0.2s, border-color 0.2s;
}

.cursor-follower {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 999;
    transition: transform 0.08s;
}

.cursor.project-hover {
    width: 36px;
    height: 36px;
    background: var(--accent-soft);
}

.cursor-follower.project-hover {
    width: 14px;
    height: 14px;
}

.initial-scroll {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: transparent;
    padding: 0;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.initial-scroll p {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    margin: 0;
    text-transform: uppercase;
    font-weight: 500;
    order: 1;
}

.initial-scroll .mouse {
    order: 2;
}

.initial-scroll.hidden {
    opacity: 0;
    pointer-events: none;
}

.initial-scroll.hidden p {
    display: none;
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 18px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: var(--transition);
}

nav.scrolled {
    background: rgba(15, 14, 13, 0.9);
    backdrop-filter: blur(12px);
    padding: 14px 48px;
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    color: var(--text-bright);
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
}

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

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

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--text-bright);
    background: var(--accent-soft);
}

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

.section {
    min-height: 20vh;
    padding: var(--section-padding-y) var(--section-padding-x);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-margin-top: var(--section-scroll-margin);
}

.section-inner {
    width: 100%;
    max-width: var(--content-width);
}

#work .section-inner,
#contact .section-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#work,
#contact {
    background: transparent;
}

section h2 {
    color: var(--text-bright);
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 600;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.03em;
}

#about .section-inner h2 {
    margin-bottom: 32px;
}

section h2::before {
    content: '// ';
    color: var(--accent);
    font-weight: 500;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.hamburger .bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    background-color: var(--text-bright);
    transition: var(--transition);
    border-radius: 1px;
}

.hero {
    text-align: center;
    position: relative;
    padding-top: 40px;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 100% 80% at 50% -20%, rgba(245, 158, 11, 0.12), transparent 55%);
    pointer-events: none;
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 700;
    color: var(--text-bright);
    position: relative;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.03em;
    line-height: 1.1;
    opacity: 0;
    animation: fadeInUp 0.7s ease forwards;
}

.hero-title .accent {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--text);
    margin-top: 20px;
    font-weight: 400;
    max-width: 420px;
    opacity: 0;
    transform: translateY(16px);
    animation: fadeInUp 0.6s ease 0.35s forwards;
}

/* Projects Section */
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    margin-top: 0;
    width: 100%;
}

.project {
    min-height: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 26px;
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: var(--transition), box-shadow 0.3s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
    cursor: none !important;
    display: flex;
    flex-direction: column;
}

.project::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 0;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    transition: height 0.3s ease;
}

.project:hover {
    border-color: rgba(245, 158, 11, 0.2);
    box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.5);
}

.project:hover::before {
    height: 100%;
}

.project-content {
    transform: translateZ(30px);
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project h3 {
    color: var(--text-bright);
    margin-bottom: 12px;
    font-size: 1.25rem;
    font-weight: 600;
}

.project p {
    color: var(--text);
    margin-bottom: 0;
    font-size: 0.9375rem;
    line-height: 1.65;
    flex: 1;
}

.project-links {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.project-link {
    color: var(--accent);
    font-size: 1.15rem;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--text-bright);
    transform: translateY(-2px);
}

/* Tilt card glare - match theme */
.project .js-tilt-glare-inner {
    background: linear-gradient(105deg, transparent 0%, var(--accent-soft) 100%) !important;
}

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

.about-content .reveal-text {
    margin-bottom: 1.25em;
    max-width: 60ch;
}

.about-content .reveal-text:last-of-type {
    margin-bottom: 0;
}

.reveal-text {
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.reveal-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.skills {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.skill {
    margin-bottom: 24px;
}

.skill:last-child {
    margin-bottom: 0;
}

.skill-name {
    color: var(--text-bright);
    margin-bottom: 8px;
    display: block;
    font-size: 1rem;
    font-weight: 500;
}

.skill-bar {
    height: 6px;
    background: var(--bg-elevated);
    position: relative;
    border-radius: 999px;
    overflow: hidden;
}

.skill-bar::before {
    content: '';
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
    background: var(--accent);
    width: var(--level, 0%);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 999px;
}

.contact-content {
    text-align: center;
    margin-top: 0;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.contact-content .reveal-text {
    margin-bottom: 40px;
}

.contact-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 0;
}

.contact-link {
    color: var(--text-bright);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    padding: 22px 26px;
    min-width: 120px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}

.contact-link:hover {
    color: var(--accent);
    border-color: rgba(245, 158, 11, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.3);
}

.contact-link i {
    font-size: 2rem;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 28px var(--section-padding-x);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.site-footer p {
    margin: 0;
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-soft);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--text-bright);
}

.back-to-top i {
    font-size: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 1s forwards;
}

@media (max-width: 768px) {
    nav {
        padding: 12px 20px;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-logo {
        width: auto;
        text-align: left;
        margin-bottom: 0;
        font-size: 1.2rem;
    }
    
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        position: relative;
        z-index: 101;
    }
    
    .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        align-items: center;
        gap: 4px;
        margin-top: 12px;
        padding: 16px 0;
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        box-shadow: 0 12px 32px rgba(0,0,0,0.3);
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, opacity 0.35s ease, margin 0.35s ease, padding 0.35s ease;
    }
    
    .nav-links.active {
        max-height: 280px;
        opacity: 1;
    }
    
    .nav-link {
        padding: 10px 16px;
        font-size: 1rem;
    }
    
    .section {
        padding: 72px var(--section-padding-x);
    }
    
    section h2 {
        font-size: 1.875rem;
        margin-bottom: 28px;
    }
    
    #about .section-inner h2 {
        margin-bottom: 24px;
    }
    
    .projects {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .about-content .reveal-text {
        margin-bottom: 1em;
    }
    
    .skills {
        margin-top: 36px;
        padding-top: 32px;
    }
    
    .contact-content .reveal-text {
        margin-bottom: 28px;
    }
    
    .contact-links {
        justify-content: center;
        gap: 16px;
    }
    
    .contact-link {
        min-width: 100px;
        padding: 18px 20px;
    }
}

/* Scroll hint mouse icon */
.initial-scroll .mouse {
    width: 22px;
    height: 34px;
    border: 2px solid var(--text-muted);
    border-radius: 11px;
    position: relative;
    margin: 0;
}

.initial-scroll .mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 6px;
    background: var(--accent);
    border-radius: 2px;
    animation: scroll-wheel 2s ease-in-out infinite;
}

@keyframes scroll-wheel {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.3; transform: translateX(-50%) translateY(6px); }
}

.initial-scroll.hidden .mouse {
    display: none;
}

@media (max-width: 768px) {
    .cursor, .cursor-follower {
        display: none !important;
    }
    body {
        cursor: auto !important;
    }
}

@media (max-width: 480px) {
    section h2 {
        font-size: 1.75rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .subtitle {
        font-size: 1.3rem;
    }
}
