/* Reset and base styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #2b2a27;
    --color-surface: #3d3b37;
    --color-text: #ececec;
    --color-text-muted: #a8a8a8;
    --color-accent: #FFB84D;
    --font-serif: 'Times New Roman', Times, serif;
}

/* Light Mode */
body.light-mode {
    --color-bg: #f8f4e6;
    --color-surface: #ebe7d8;
    --color-text: #333333;
    --color-text-muted: #333333;
    --color-accent: #a85d28;
    /* Claude orange (used for URLs in light mode) - dark + vibrant */
    --color-claude-orange: #C24F0A;
}

/* In light mode: default links are highlighted; specific UI links stay dark and only highlight on hover */
/* Default: anchors in body use the highlight color */
body.light-mode a {
    color: var(--color-claude-orange);
}

/* Exceptions: project, experience, social and toggle controls should be dark by default */
/* Exceptions: project, experience, social and toggle controls - make always highlighted in the body for light mode */
body.light-mode .project-link,
body.light-mode .experience-link {
    color: var(--color-claude-orange);
}

/* keep an underline on hover for affordance */
body.light-mode .project-link:hover,
body.light-mode .experience-link:hover,
body.light-mode .social-links a:hover,
body.light-mode .toggle-btn:hover {
    text-decoration: underline;
}

/* Outside light mode, make these link-like items use the accent color by default */
body:not(.light-mode) .project-link,
body:not(.light-mode) .experience-link,
body:not(.light-mode) .social-links a,
body:not(.light-mode) .toggle-btn {
    color: var(--color-accent);
}

/* In light mode: make social, about/stack toggle and theme toggle dark by default
   and only turn claude-orange on hover/focus (overrides the default anchor color) */
body.light-mode .social-links a,
body.light-mode .toggle-btn,
body.light-mode .theme-toggle {
    color: var(--color-text);
}

body.light-mode .social-links a:hover,
body.light-mode .toggle-btn:hover,
body.light-mode .theme-toggle:hover,
body.light-mode .social-links a:focus,
body.light-mode .toggle-btn:focus,
body.light-mode .theme-toggle:focus {
    color: var(--color-claude-orange);
    text-decoration: underline;
}

/* In dark mode: social links, toggle, and theme toggle should only turn yellow on hover/focus */
body:not(.light-mode) .social-links a,
body:not(.light-mode) .toggle-btn,
body:not(.light-mode) .theme-toggle {
    color: var(--color-text-muted);
}

body:not(.light-mode) .social-links a:hover,
body:not(.light-mode) .toggle-btn:hover,
body:not(.light-mode) .theme-toggle:hover,
body:not(.light-mode) .social-links a:focus,
body:not(.light-mode) .toggle-btn:focus,
body:not(.light-mode) .theme-toggle:focus {
    color: var(--color-accent);
    text-decoration: underline;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.4;
    min-height: 100vh;
}

/* Container */
.container {
    width: 37%;
    margin: 0 auto;
    padding: 6rem 2rem 2rem 2rem;
}

/* Header */
.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

header {
    text-align: left;
}

header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-bottom: 0.1rem;
    font-family: 'Times New Roman', Times, serif;
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.15);
    margin-top: -1rem;
}

.tagline {
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

/* Divider */
.divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-surface);
    margin: 1rem 0;
    opacity: 0.95;
}

/* Light mode: make divider slightly darker for better visibility */
body.light-mode .divider {
    background-color: #d4c9ba;
}

/* Sections */
section {
    margin-bottom: 1.5rem;
}

section h2 {
    font-size: 1.125rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}

section ul {
    list-style: none;
    padding-left: 0;
    margin-left: 1.5rem;
}

section li {
    color: var(--color-text-muted);
    font-size: 1.125rem;
    font-weight: 300;
    font-family: 'Times New Roman', Times, serif;
    margin-bottom: 0.2rem;
    padding-left: 1.5rem;
    position: relative;
    letter-spacing: 0.01em;
    opacity: 0.85;
}

section li::before {
    content: '◆';
    position: absolute;
    left: 0;
    color: var(--color-text-muted);
}

/* Top List (without heading) */
.top-list {
    list-style: none;
    padding-left: 0;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.top-list li {
    color: var(--color-text-muted);
    font-size: 1.125rem;
    font-weight: 300;
    font-family: 'Times New Roman', Times, serif;
    margin-bottom: 0.2rem;
    padding-left: 1.5rem;
    position: relative;
    letter-spacing: 0.01em;
    opacity: 0.85;
}

.top-list li::before {
    content: '◆';
    position: absolute;
    left: 0;
    color: var(--color-text-muted);
}

.top-list .inline-logo {
    display: inline-block;
    height: 1em;
    width: auto;
    vertical-align: middle;
    margin-left: 0.25rem;
}

/* Project Links */
.project-link {
    color: var(--color-accent);
    text-decoration: underline;
}

/* In light mode, project links use Claude orange */
body.light-mode .project-link {
    color: var(--color-claude-orange);
}

.projects ul li {
    margin-bottom: 0.15rem;
    line-height: 1.5rem;
    min-height: 1.5rem;
}

.project-desc {
    font-style: italic;
    color: var(--color-text-muted);
    opacity: 0.75;
    vertical-align: middle;
}

/* Project Icons (hidden by default, inline replacement for desc) */
.project-icons {
    display: none;
    gap: 0.6rem;
    align-items: center;
    vertical-align: middle;
    margin-left: 0.5rem;
    height: 1.5rem;
}

.project-icons img {
    height: 1.8rem;
    width: auto;
    vertical-align: middle;
}

.project-icons .tech-bracket {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--color-text-muted);
    opacity: 0.75;
}

/* When toggled: hide desc, show icons inline */
.show-details .project-desc {
    display: none;
}

.show-details .project-icons {
    display: inline-flex;
}

/* Show Toggle */
.show-toggle {
    margin-top: 0.5rem;
    margin-left: 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.toggle-btn {
    color: var(--color-text-muted);
    text-decoration: none;
    cursor: pointer;
}

.toggle-btn:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Experience Links */
.experience-link {
    color: var(--color-accent);
    text-decoration: underline;
}

/* In light mode, experience links use Claude orange */
body.light-mode .experience-link {
    color: var(--color-claude-orange);
}

/* Social Links Row */
.social-links-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 1rem;
}

.social-links a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Ensure these UI controls always react to hover/focus in any theme
   (use Claude orange in light mode, otherwise fall back to accent) */
.social-links a:hover,
.toggle-btn:hover,
.theme-toggle:hover,
.social-links a:focus,
.toggle-btn:focus,
.theme-toggle:focus {
    color: var(--color-claude-orange, var(--color-accent));
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: right;
}

footer p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Theme Toggle */
.theme-toggle {
    text-align: right;
    font-size: 1rem;
    color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        width: 70%;
    }
}

@media (max-width: 640px) {
    .container {
        width: 90%;
        padding: 2rem 1.5rem;
    }

    header h1 {
        font-size: 1.625rem;
    }

    .tagline {
        font-size: 1.125rem;
    }

    section h2 {
        font-size: 1.125rem;
    }
}