:root {
    --bg-color: #050505;
    --bg-secondary: #0a0a0a;
    --text-primary: #ededed;
    --text-secondary: #888888;
    --accent-color: #d4d4d4;
    --border-color: #222;

    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;

    /* Engineered Easing */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out-quad: cubic-bezier(0.455, 0.03, 0.515, 0.955);

    --transition-fast: all 0.3s var(--ease-out-quint);
    --transition-medium: all 0.6s var(--ease-out-expo);
    --transition-slow: all 0.9s var(--ease-out-expo);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Custom cursor everywhere */
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
    /* For spotlight */
}

/* --- Engineered Motion System --- */

/* Spotlight Overlay */
.spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    background: radial-gradient(800px circle at var(--x, 50%) var(--y, 50%),
            rgba(255, 255, 255, 0.03),
            transparent 40%);
    z-index: 9999;
}

/* Custom Cursor */
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    will-change: transform;
}

/* Masked Text Reveal - Hierarchy System */
.reveal-text-wrapper {
    overflow: hidden;
    display: block;
    /* Ensure the wrapper has dimensions */
}

.reveal-text {
    transform: translateY(110%);
    opacity: 0;
    will-change: transform, opacity;
    display: block;
}

/* Base Reveal Duration (Body text) */
.reveal-text-wrapper.visible .reveal-text {
    transform: translateY(0);
    opacity: 1;
    transition: transform 1s var(--ease-out-expo), opacity 1s ease-out;
}

/* Heading Hierarchy: Faster, stronger */
h1.reveal-text-wrapper.visible .reveal-text,
h2.reveal-text-wrapper.visible .reveal-text,
h3.reveal-text-wrapper.visible .reveal-text,
h1 .reveal-text-wrapper.visible .reveal-text,
h2 .reveal-text-wrapper.visible .reveal-text,
h3 .reveal-text-wrapper.visible .reveal-text {
    /* Handle both case where wrapper is the H tag or inside it */
    transition: transform 0.8s var(--ease-out-quint), opacity 0.8s var(--ease-out-quint);
}

/* Stagger List Items */
.stagger-wrapper .stagger-item {
    opacity: 0;
    transform: translateY(30px);
    will-change: transform, opacity;
    /* Transition is set here but delay provided by JS */
    transition: opacity 0.8s ease-out, transform 0.8s var(--ease-out-expo);
}

.stagger-wrapper.visible .stagger-item {
    opacity: 1;
    transform: translateY(0);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-family: var(--font-sans);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
    position: relative;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

.section {
    padding: 160px 0;
    /* More expansive vertical rhythm */
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 16px 32px;
    font-family: var(--font-mono);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 2px;
    font-size: 0.85rem;
    cursor: none;
    /* Use custom cursor */
    background: transparent;
    transition: all 0.4s var(--ease-out-quint);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.02);
}

/* Navbar - Scroll Aware */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 50px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    transition: transform 0.4s var(--ease-out-quint), background 0.4s ease, border 0.4s ease;
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 20px 50px;
    /* Compress slightly */
}

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

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

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

/* Link Underline Micro-interaction */
.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: lowercase;
    position: relative;
}

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

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

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

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

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.greeting {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    display: block;
}

h1.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.05;
    margin-bottom: 24px;
    margin-left: -3px;
}

.tagline {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 50px;
    opacity: 0.9;
}

.bio-short {
    max-width: 500px;
    color: var(--text-secondary);
    margin-bottom: 60px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.cta-group {
    display: flex;
    gap: 30px;
    align-items: center;
}

/* Section Headlines */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 80px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* About Grid */
.content-grid-2 {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 80px;
    align-items: center;
    /* Center image vertically */
}

.text-content p {
    margin-bottom: 32px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

.text-content strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* Profile Image */
.about-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 4px;
    overflow: hidden;
    /* Optional: Subtle border or glint */
    border: 1px solid var(--border-color);
}

.about-image {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%) contrast(1.1);
    /* Engineering aesthetic */
    transition: filter 0.5s ease;
    opacity: 0.9;
}

.about-image:hover {
    filter: grayscale(0%) contrast(1);
    opacity: 1;
}

/* Work / Projects - Hover: Depth not Scale */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.project-card {
    display: grid;
    grid-template-columns: 2fr 4fr;
    gap: 60px;
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.4s ease;
}

.project-card:first-child {
    border-top: 1px solid var(--border-color);
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.project-card:hover h3 {
    color: var(--text-primary);
}

.project-info h3 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.project-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 600px;
    line-height: 1.6;
}

.notes-heading {
    font-size: 0.85rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    font-family: var(--font-mono);
    opacity: 0.9;
}

.notes-list {
    margin-bottom: 30px;
    list-style: disc;
    padding-left: 20px;
}

.notes-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-family: var(--font-mono);
    opacity: 0.8;
}

.tech-list {
    margin-top: 0;
    gap: 24px;
}

.tech-list li {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    opacity: 0.7;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 60px;
}

.skill-category h3 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 32px;
    font-weight: 400;
}

.skill-category ul li {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    transition: color 0.3s ease, transform 0.3s var(--ease-out-quint);
}

.skill-category ul li:hover {
    color: var(--text-primary);
    transform: translateX(5px);
}

/* Philosophy */
.mindset-quote {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 400;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 60px;
    letter-spacing: -0.03em;
}

/* Contact */
.contact-heading {
    font-size: clamp(3rem, 5vw, 4.5rem);
    margin-bottom: 30px;
    letter-spacing: -0.04em;
    line-height: 1;
}

.contact-text {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 60px;
}

/* Status Badge for Learner Portfolio */
.status-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 4px 8px;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    border-radius: 2px;
    margin-bottom: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Advent of Code Section */
.aoc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Split text and stats */
    gap: 60px;
    align-items: center;
}

.aoc-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stat-box {
    border: 1px solid var(--border-color);
    padding: 24px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.stat-box:hover {
    border-color: var(--text-secondary);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Typewriter Cursor */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    /* Slim line */
    height: 1em;
    /* Matches font size roughly */
    background-color: var(--accent-color);
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    * {
        cursor: auto;
    }

    /* Restore cursor on touch */
    .cursor-dot,
    .spotlight {
        display: none;
    }

    .content-grid-2 {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .aoc-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

    .project-card {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 60px 0;
    }

    .container {
        padding: 0 24px;
    }

    .navbar {
        padding: 20px;
    }
}
