:root {
    /* Minimalist Black and White Palette */
    --bg-color: #ffffff;
    --text-primary: #111111;
    --text-secondary: #777777;
    --border-color: #eeeeee;
    --card-bg: #fdfdfd;
    --accent: #000000;
    --line: rgba(0, 0, 0, 0.1);
}

body.dark-theme {
    --bg-color: #0c0c0c;
    --text-primary: #f2f2f2;
    --text-secondary: #888888;
    --border-color: #222222;
    --card-bg: #121212;
    --accent: #ffffff;
    --line: rgba(255, 255, 255, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background-color: var(--text-primary);
    color: var(--bg-color);
}

/* Typography */
h1 {
    font-size: clamp(3rem, 8vw, 4.5rem);
    font-weight: 500;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 650px;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.6;
}

/* Nav */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--bg-color);
    transition: background-color 0.4s ease, border-bottom 0.4s ease;
}

nav.scrolled {
    border-bottom: 1px solid var(--line);
    padding: 1.5rem 5%;
}

@supports (backdrop-filter: blur(10px)) {
    nav.scrolled {
        background-color: transparent;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 400;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    padding: 0.5rem;
    margin-left: -0.5rem; /* Optical alignment */
}

#theme-toggle:hover {
    opacity: 0.5;
}

/* Layout */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 5%;
}

.section {
    padding: 6rem 0;
}

#hero {
    min-height: 65vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 8rem;
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 300;
}

.minimal-line {
    width: 24px;
    height: 1px;
    background-color: var(--text-secondary);
    margin-bottom: 2rem;
    opacity: 0.5;
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 600px) {
    .project-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 6px;
    transition: transform 0.4s ease, border-color 0.4s ease;
}

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

.project-card h3 {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-card p {
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.project-link {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.arrow {
    transition: transform 0.3s ease;
}

.project-link:hover .arrow {
    transform: translateX(4px);
}

/* Contact */
.contact-email {
    display: inline-block;
    margin-top: 1rem;
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 400;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.25rem;
    transition: border-color 0.3s ease, opacity 0.3s ease;
}

.contact-email:hover {
    border-color: var(--text-primary);
    opacity: 1;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 600px) {
    nav {
        padding: 1.5rem 5%;
    }
    .section {
        padding: 4rem 0;
    }
}
