:root {
    --bg-color: #ffffff;
    --text-main: #111111;
    --text-muted: #777777;
    --border-color: #eaeaea;
    --hover-bg: #f9f9f9;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --modal-overlay-bg: rgba(255, 255, 255, 0.8);
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

[data-theme="dark"] {
    --bg-color: #111111;
    --text-main: #ffffff;
    --text-muted: #999999;
    --border-color: #222222;
    --hover-bg: #1a1a1a;
    --nav-bg: rgba(17, 17, 17, 0.9);
    --modal-overlay-bg: rgba(0, 0, 0, 0.8);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Nav */
.site-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 2.5rem 5%;
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: -0.5px;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.3s;
}

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

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
    padding: 0;
    margin-left: 1rem;
}

.theme-toggle:hover {
    color: var(--text-main);
}

/* Typography & Layout */
main {
    padding-top: 10vh;
}

.section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 8rem 5%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-header .count {
    color: var(--text-muted);
    font-family: var(--font-heading);
}

/* Hero */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4rem;
    width: 100%;
}

.hero-inner {
    flex: 1;
}

.hero-image-container {
    flex: 0 0 400px;
    display: flex;
    justify-content: flex-end;
}

.profile-img {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: cover;
    border-radius: 20px;
}

.hero-inner {
    max-width: 800px;
}

.subtitle {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.title {
    font-family: var(--font-heading);
    font-size: clamp(4rem, 8vw, 8rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
}

.description {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.4;
    max-width: 600px;
}

.hero-actions {
    margin-top: 2.5rem;
}

.primary-btn {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
    background: var(--text-main);
    color: var(--bg-color);
    text-decoration: none;
    border: 1px solid var(--text-main);
    border-radius: 100px;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: transparent;
    color: var(--text-main);
}

/* Lists (Projects, Experience) */
.list-container {
    display: flex;
    flex-direction: column;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-main);
    transition: padding-left 0.4s ease, background 0.4s ease;
}

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

.list-item:not(.non-interactive):hover {
    padding-left: 2rem;
    background: var(--hover-bg);
}

.item-main h3 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.item-meta {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 300;
}

.item-year {
    font-family: var(--font-heading);
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Skills */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skills-grid span {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 300;
    padding: 1rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: 100px; /* pill shape */
    transition: all 0.3s ease;
}

.skills-grid span:hover {
    background: var(--text-main);
    color: var(--bg-color);
    border-color: var(--text-main);
}

/* Footer */
.site-footer {
    background: var(--hover-bg);
    padding: 8rem 5% 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.huge-text {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 4rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.footer-bottom p {
    color: var(--text-muted);
}

.email-link {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    position: relative;
}

.email-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--text-main);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.email-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Contact Form */
.contact-form-container {
    max-width: 600px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.form-group label {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-main);
}

.form-group input,
.form-group textarea {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 1rem 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.3s ease;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-bottom-color: var(--text-main);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.submit-btn {
    align-self: flex-start;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
    background: var(--text-main);
    color: var(--bg-color);
    border: 1px solid var(--text-main);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: transparent;
    color: var(--text-main);
}

.file-input {
    border: none !important;
    padding: 0.5rem 0 !important;
    font-size: 0.95rem;
    color: var(--text-muted) !important;
}

#form-status {
    margin-top: 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay-bg);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 600px;
    padding: 3rem;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.modal-overlay.open .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    font-size: 2.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-header {
    margin-bottom: 2rem;
    padding-right: 2rem;
}

.modal-meta {
    font-family: var(--font-heading);
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.2;
}

.modal-body {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    /* Navigation */
    .site-nav { padding: 1rem 5%; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.85rem; }
    
    /* Sections & Typography */
    .section { padding: 4rem 5%; }
    main { padding-top: 12vh; }
    
    .hero-layout { flex-direction: column-reverse; gap: 2rem; text-align: center; }
    .hero-image-container { flex: none; width: 250px; margin: 0 auto; justify-content: center; }
    
    .title { font-size: 3rem; }
    .description { font-size: 1.1rem; }
    .huge-text { font-size: 3rem; margin-bottom: 2rem; }
    
    /* Lists */
    .list-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 1.5rem 0; }
    .list-item:not(.non-interactive):hover { padding-left: 0; background: transparent; }
    .item-main h3 { font-size: 1.5rem; }
    .item-year { font-size: 0.9rem; align-self: flex-start; }
    
    /* Skills */
    .skills-grid span { font-size: 1rem; padding: 0.6rem 1.2rem; }
    
    /* Footer */
    .footer-bottom { flex-direction: column-reverse; align-items: flex-start; gap: 1rem; }
    
    /* Modal */
    .modal-content { padding: 2.5rem 1.5rem; }
    .modal-title { font-size: 1.5rem; }
    .modal-body { font-size: 1rem; }
    .modal-close { top: 0.5rem; right: 1rem; font-size: 2rem; }
}

@media (max-width: 480px) {
    .site-nav { flex-direction: column; gap: 1rem; padding: 1rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .logo { margin-bottom: 0.5rem; }
}
