/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   THEME VARIABLES
   ======================================== */
:root {
    --bg-body: #ffffff;
    --bg-card: #fafafa;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --link-color: #2563eb;
    --link-hover: #1d4ed8;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] {
    --bg-body: #1a1a1a;
    --bg-card: #2d2d2d;
    --text-primary: #f5f5f5;
    --text-secondary: #9ca3af;
    --border-color: #404040;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-body: #1a1a1a;
        --bg-card: #2d2d2d;
        --text-primary: #f5f5f5;
        --text-secondary: #9ca3af;
        --border-color: #404040;
        --link-color: #60a5fa;
        --link-hover: #93c5fd;
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

/* ========================================
   HOMEPAGE LAYOUT
   ======================================== */
.homepage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.homepage-content {
    text-align: center;
    max-width: 600px;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.main-nav {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
}

/* ========================================
   ABOUT PAGE LAYOUT
   ======================================== */
.page-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.home-link {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.home-link:hover {
    color: var(--link-hover);
    text-decoration: none;
}

.about-page {
    flex: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* ========================================
   BIOGRAPHY SECTION
   ======================================== */
.bio {
    margin-bottom: 2rem;
}

.bio p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.site-footer p {
    margin: 0;
}

/* ========================================
   THEME TOGGLE BUTTON
   ======================================== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition), transform 0.2s ease;
}

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

.theme-toggle:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    transition: var(--transition);
}

.theme-toggle .moon-icon {
    fill: var(--text-primary);
}

.theme-toggle .sun-icon {
    fill: var(--text-primary);
    stroke: var(--text-primary);
    stroke-width: 2;
    stroke-linecap: round;
}

/* Hide icons based on theme */
[data-theme="light"] .theme-toggle .moon-icon,
:root:not([data-theme]) .theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon,
:root:not([data-theme]) .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .theme-toggle .moon-icon {
        display: none;
    }

    :root:not([data-theme]) .theme-toggle .sun-icon {
        display: block;
    }
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .site-title {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .main-nav {
        gap: 1.5rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .about-page {
        padding: 2rem 1.5rem;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
    }

    .theme-toggle svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.75rem;
    }

    .tagline {
        font-size: 0.9375rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .about-page {
        padding: 1.5rem 1rem;
    }

    .main-nav {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}
