/* --- CSS Variables (Theme) --- */
:root {
    --bg-color: #0c0704;
    --text-color: #c4b096;
    --highlight-color: #e6cba8;
    --accent-color: #783d11;
    --brown-light: #7a6a5d;
    --brown-medium: #5c4839;
    --brown-dark: #453429;
    --brown-darker: #2b2018;
    --brown-darkest: #160f0a;
    
    --font-header: "Press Start 2P", cursive;
    --font-body: "VT323", monospace;
}

[data-theme="light"] {
    --bg-color: #f0e6d2;
    --text-color: #4a3b32;
    --highlight-color: #2c241b;
    --accent-color: #a65d24;
    --brown-light: #8c7666;
    --brown-medium: #a89282;
    --brown-dark: #c4b096;
    --brown-darker: #d6c2aa;
    --brown-darkest: #e6d5c0;
}

/* --- Reset & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

::selection {
    background: var(--accent-color);
    color: white;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; font-family: inherit; cursor: pointer; }

/* --- Utilities --- */
.pixel-art {
    image-rendering: pixelated;
    shape-rendering: crispEdges; /* Firefox */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Theme Toggle --- */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, color 0.2s;
}

.theme-toggle:hover {
    transform: scale(1.1);
    color: var(--highlight-color);
}

.sun-icon, .moon-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Hide sun by default (dark mode is default) */
.sun-icon { display: none; }
.moon-icon { display: block; }

/* Show sun in light mode */
[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

/* --- Layout Components --- */

/* Main Container */
main {
    width: 100%;
    max-width: 900px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    flex: 1;
    opacity: 0; /* Initial state for animation */
    animation: fadeIn 1s ease-out forwards;
    justify-content: center;
}

/* Responsive Layout (Desktop) */
@media (min-width: 768px) {
    main {
        flex-direction: row;
        align-items: center;
        gap: 5rem;
    }
}

/* Avatar Section */
.avatar-container {
    flex-shrink: 0;
}

.avatar-box {
    width: 14rem;
    aspect-ratio: 1 / 1;
    background-color: var(--brown-darkest);
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .avatar-box {
        width: 16rem;
    }
}

.avatar-svg {
    width: 8rem;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill width; crop bottom if needed */
    object-position: top center; /* Keep top aligned */
    display: block;
}

[data-theme="light"] .avatar-img { }

/* Text Content */
.content-area {
    flex: 1;
    text-align: left;
}

h1 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--highlight-color);
    line-height: 1.6;
}

@media (min-width: 768px) {
    h1 { font-size: 1.875rem; }
}

h2 {
    color: var(--accent-color);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    h2 { font-size: 1.5rem; }
}

.bio {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 28rem;
}

@media (min-width: 768px) {
    .bio { font-size: 1.5rem; }
}

/* Experience List */
ul {
    list-style: none;
    margin-bottom: 2.5rem;
    font-size: 1.125rem;
    color: var(--brown-light);
}

@media (min-width: 768px) {
    ul { font-size: 1.25rem; }
}

li {
    display: flex;
    align-items: first baseline;
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.bullet {
    margin-right: 0.75rem;
    color: var(--brown-dark);
    padding-top: 0.25rem; /* Optical alignment */
}

/* Contact & Buttons */
.contact-text {
    color: var(--brown-medium);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.email-link {
    color: var(--highlight-color);
    transition: color 0.2s;
    font-size: 1.3rem;
}
.email-link:hover { color: white; }

.resume-btn {
    padding: 0.5rem 1.25rem;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    transition: all 0.2s;
}

.resume-btn:hover {
    background-color: var(--accent-color);
    color: var(--highlight-color);
}

/* Footer */
footer {
    width: 100%;
    padding: 2rem;
    text-align: center;
    margin-top: auto; /* Stick to bottom */
}

.social-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.social-row:hover { opacity: 1; }

.icon-svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--brown-light);
    transition: color 0.2s;
}
.icon-svg:hover { color: var(--highlight-color); }

.copyright {
    font-size: 1.125rem;
    color: var(--brown-darker);
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pixel-heart {
    width: 1.25rem;
    height: 1.25rem;
    color: #d32f2f; /* Red color for heart */
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
