:root {
    /* System Fonts for that "Native" feel */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;

    /* GitHub Light Theme */
    --bg-body: #ffffff;
    --bg-subtle: #f6f8fa;
    --bg-card: #ffffff;
    --text-main: #24292f;
    --text-muted: #57606a;
    --border: #d0d7de;
    --primary: #0969da;
    --primary-hover: #1a7f37; /* GitHub Green for hover actions */
    
    --shadow-sm: 0 1px 0 rgba(27, 31, 36, 0.04);
    --shadow-md: 0 3px 6px rgba(140, 149, 159, 0.15);
    
    --radius: 6px;
    --transition: all 0.2s ease-in-out;
}

[data-theme="dark"] {
    /* GitHub Dark Theme */
    --bg-body: #0d1117;
    --bg-subtle: #161b22;
    --bg-card: #0d1117;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --border: #30363d;
    --primary: #58a6ff;
    --primary-hover: #238636; /* GitHub Green for hover actions */
    
    --shadow-sm: 0 1px 0 rgba(240, 246, 252, 0.1);
    --shadow-md: 0 3px 6px rgba(1, 4, 9, 0.4);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

ul {
    list-style: none;
}

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

/* Layout Utilities */
.container {
    max-width: 1024px; /* Slightly tighter for reading */
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 5rem 0;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
    line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: 2rem; }
h3 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

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

/* Navbar */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] header {
    background-color: rgba(13, 17, 23, 0.8);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.05em;
}

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

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

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

/* Theme Toggle */
#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

#theme-toggle:hover {
    background-color: var(--bg-subtle);
    color: var(--text-main);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-top: 70px;
}

.hero h1 {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.hero .bio {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2.5rem;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--text-main);
    color: var(--bg-body);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

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

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.skill-item {
    background-color: var(--bg-subtle);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.project-media {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: var(--bg-subtle);
    box-shadow: var(--shadow-md);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-info .description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-subtle);
    border-radius: 4px;
    color: var(--primary);
}

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

.link-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

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

/* Contact Section */
.contact-section {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

/* Footer */
footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; } /* Simplified for now, can add hamburger back if needed but keeping it simple */
    
    .project-card {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}
