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

:root {
    --bg: #1a1a2e;
    --bg-rgb: 26, 26, 46;
    --text: #ffffff;
    --text-light: rgba(255, 255, 255, 0.7);
    --line-color: rgba(255, 255, 255, 0.12);
    --line-color-strong: rgba(255, 255, 255, 0.25);
}

:root.purple { --bg: #1a1a2e; --bg-rgb: 26, 26, 46; }
:root.navy { --bg: #0d1b2a; --bg-rgb: 13, 27, 42; }
:root.green { --bg: #0a1f1a; --bg-rgb: 10, 31, 26; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Garamond', 'EB Garamond', 'Times New Roman', Georgia, serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Tesseract Canvas */
#tesseract {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

/* Floating Nav */
.nav {
    position: fixed;
    top: 2rem;
    right: 3rem;
    z-index: 100;
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
    position: relative;
}

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

.nav-link:hover,
.nav-link.active {
    color: var(--text);
}

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

/* Sections */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.section-content {
    max-width: 600px;
    padding: 4rem;
}

/* Home */
.section-home {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.name {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1;
    position: relative;
    width: 100%;
    text-align: center;
}

.name-first,
.name-last {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.name-first {
    right: calc(50% + 10vw);
}

.name-last {
    left: calc(50% + 10vw);
}

/* About */
.section-about {
    padding-left: 15vw;
}

.section-about p {
    font-size: 1.15rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.skills span {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.skills span:not(:last-child)::after {
    content: ' /';
    margin-left: 1rem;
    color: var(--line-color-strong);
}

/* Projects */
.section-projects {
    padding-left: 20vw;
}

.project {
    margin-bottom: 2.5rem;
}

.project a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.3rem;
    transition: transform 0.3s ease;
}

.project p {
    font-size: 1rem;
    color: var(--text-light);
    font-style: italic;
}

.project a:hover h3 {
    transform: translateX(1rem);
}

/* Contact */
.section-contact {
    padding-left: 10vw;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.contact-form input,
.contact-form textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line-color-strong);
    padding: 0.75rem 0;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    transition: border-color 0.2s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-light);
    font-style: italic;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--text);
}

.contact-form textarea {
    resize: none;
    min-height: 100px;
}

.contact-form button {
    align-self: flex-start;
    background: transparent;
    border: 1px solid var(--text);
    padding: 0.75rem 2rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.contact-form button:hover {
    background: var(--text);
    color: var(--bg);
}

.contact-form input,
.contact-form textarea {
    background: transparent;
}

.contact-intro {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-intro a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s ease;
}

.contact-intro a:hover {
    opacity: 0.7;
}

.form-status {
    margin-top: 1rem;
    font-style: italic;
}

.form-status.success {
    color: var(--text-light);
}

.form-status.error {
    color: #e57373;
}

/* Mobile */
@media (max-width: 768px) {
    .nav {
        top: 1rem;
        right: 50%;
        transform: translateX(50%);
        gap: 1.5rem;
        background: rgba(var(--bg-rgb), 0.9);
        padding: 0.75rem 1.5rem;
        backdrop-filter: blur(10px);
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .section-home {
        padding-top: 80px;
    }

    .section-home,
    .section-about,
    .section-projects,
    .section-contact {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .section-content {
        padding: 2rem;
    }

    .name {
        font-size: 1.8rem;
    }

    .name-first {
        right: calc(50% + 8vw);
    }

    .name-last {
        left: calc(50% + 8vw);
    }

    h2 {
        font-size: 2rem;
    }
}
