/* CSS Variables - Default to ink-light theme */
:root {
    --primary-color: #1a1a1a;
    --primary-dark: #000000;
    --primary-light: #3a3a3a;
    --text-color: #0f0f0f;
    --text-light: #2a2a2a;
    --background: #ffffff;
    --card-background: #fafafa;
    --border-color: #d0d0d0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 3px 8px rgba(0, 0, 0, 0.18);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Original Light Theme (preserved) */
[data-theme="original-light"] {
    --primary-color: #74ac00;
    --primary-dark: #5a8500;
    --primary-light: #8bc614;
    --text-color: #333;
    --text-light: #666;
    --background: #f0f8f0;
    --card-background: #fff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Original Dark Theme (preserved) */
[data-theme="original-dark"] {
    --primary-color: #74ac00;
    --primary-dark: #5a8500;
    --primary-light: #8bc614;
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    --background: #2a2a2a;
    --card-background: #2d2d2d;
    --border-color: #404040;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* New Ink on Paper Light Theme (default) */
[data-theme="ink-light"] {
    --primary-color: #1a1a1a;
    --primary-dark: #000000;
    --primary-light: #3a3a3a;
    --text-color: #0f0f0f;
    --text-light: #2a2a2a;
    --background: #ffffff;
    --card-background: #fafafa;
    --border-color: #d0d0d0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 3px 8px rgba(0, 0, 0, 0.18);
}

/* New Inverted Dark Theme */
[data-theme="ink-dark"] {
    --primary-color: #f0f0f0;
    --primary-dark: #ffffff;
    --primary-light: #d0d0d0;
    --text-color: #f5f5f5;
    --text-light: #e0e0e0;
    --background: #1a1a1a;
    --card-background: #252525;
    --border-color: #3a3a3a;
    --shadow: 0 1px 3px rgba(255, 255, 255, 0.05);
    --shadow-hover: 0 3px 8px rgba(255, 255, 255, 0.08);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.header h1 {
    font-family: 'Inter', sans-serif;
    font-size: 3rem;
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 16px;
}


.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 16px;
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.contact-email:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
    color: var(--primary-color);
}

.email-icon {
    width: 16px;
    height: 16px;
}

/* Hero Section */
.hero-section {
    margin-bottom: 30px;
}

.hero-projects {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.hero-card {
    background: var(--card-background);
    background: rgba(255, 255, 255, 0.82);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
}

.hero-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}


.hero-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-card .card-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(100%) brightness(0) invert(0);
    opacity: 0.8;
}

/* Make icons responsive to theme */
[data-theme="ink-light"] .hero-card .card-icon {
    filter: grayscale(100%) brightness(0) invert(0);
}

[data-theme="ink-dark"] .hero-card .card-icon {
    filter: grayscale(100%) brightness(0) invert(1);
}

[data-theme="original-dark"] .hero-card .card-icon {
    filter: grayscale(100%) brightness(0) invert(0.8);
}

.hero-card .emoji-icon {
    font-size: 24px;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    filter: grayscale(100%);
    opacity: 0.8;
}

/* Make emoji icons responsive to theme - match image icon darkness */
[data-theme="ink-light"] .hero-card .emoji-icon {
    filter: grayscale(100%) brightness(0) invert(0);
}

[data-theme="ink-dark"] .hero-card .emoji-icon {
    filter: grayscale(100%) brightness(0) invert(1);
}

[data-theme="original-dark"] .hero-card .emoji-icon {
    filter: grayscale(100%) brightness(1.5);
}

/* Also handle when no data-theme is set but system is in dark mode */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .hero-card .emoji-icon {
        filter: grayscale(100%) brightness(0) invert(1);
    }
}


.hero-card p {
    color: var(--text-light);
    line-height: 1.5;
}

/* Content Sections */
.content-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.section {
    background: var(--card-background);
    background: rgba(255, 255, 255, 0.82);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border: 2px solid transparent;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

.section p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.5;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 0;
}

.section-link:hover {
    color: var(--primary-dark);
    transform: translateX(3px);
}

.section-link::after {
    content: '→';
    transition: var(--transition);
}

.section-link:hover::after {
    transform: translateX(3px);
}

/* GitHub Projects Section */
.github-section {
    background: var(--card-background);
    background: rgba(255, 255, 255, 0.82);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.github-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.github-header:hover {
    background: #f8f9fa;
}

.github-header h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.expand-icon {
    transition: var(--transition);
    color: var(--primary-color);
    font-size: 1.2rem;
}

.github-section.expanded .expand-icon {
    transform: rotate(180deg);
}

.github-projects {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.github-section.expanded .github-projects {
    max-height: 500px;
}

.github-projects ul {
    list-style: none;
    padding: 0;
}

.github-projects li {
    border-bottom: 1px solid var(--border-color);
}

.github-projects li:last-child {
    border-bottom: none;
}

.github-projects a {
    display: block;
    padding: 15px 25px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.github-projects a:hover {
    background: #f8f9fa;
    color: var(--primary-color);
    padding-left: 35px;
}

/* Tablet/Medium Screen Styles */
@media (max-width: 1024px) and (min-width: 769px) {
    .hero-projects {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }
    
    .hero-card:first-child {
        grid-column: 1;
    }
    
    .hero-card:nth-child(2) {
        grid-column: 2;
    }
    
    .hero-card:nth-child(3) {
        grid-column: 1 / -1;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        margin-bottom: 20px;
        padding: 10px 0;
    }

    .header h1 {
        font-size: 2.2rem;
        margin-bottom: 12px;
    }

    .hero-section {
        margin-bottom: 25px;
    }

    .hero-projects {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .hero-card {
        padding: 20px;
    }

    .hero-card h3 {
        font-size: 1.3rem;
    }

    .hero-card .card-icon {
        width: 28px;
        height: 28px;
    }
    
    .hero-card .emoji-icon {
        font-size: 20px;
    }

    .content-sections {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section {
        padding: 20px;
    }

    .github-header {
        padding: 20px;
    }

    .github-projects a {
        padding: 12px 20px;
    }

    .github-projects a:hover {
        padding-left: 30px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header {
        margin-bottom: 12px;
        padding: 5px 0;
    }

    .header h1 {
        font-size: 1.8rem;
        letter-spacing: 0.5px;
        margin-bottom: 10px;
    }

    .hero-section {
        margin-bottom: 20px;
    }

    .hero-card {
        padding: 12px;
    }

    .hero-card h3 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .hero-card .card-icon {
        width: 24px;
        height: 24px;
    }
    
    .hero-card .emoji-icon {
        font-size: 18px;
    }

    .content-sections {
        gap: 15px;
        margin-bottom: 25px;
    }

    .section {
        padding: 12px;
    }

    .section h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .contact-email {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .email-icon {
        width: 14px;
        height: 14px;
    }
}

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

/* Focus styles for keyboard navigation */
.hero-card:focus,
.section-link:focus,
.github-header:focus,
.github-projects a:focus,
.contact-email:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode media query - applies ink-dark theme by default */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --primary-color: #f0f0f0;
        --primary-dark: #ffffff;
        --primary-light: #d0d0d0;
        --text-color: #f5f5f5;
        --text-light: #e0e0e0;
        --background: #1a1a1a;
        --card-background: #252525;
        --border-color: #3a3a3a;
        --shadow: 0 1px 3px rgba(255, 255, 255, 0.05);
        --shadow-hover: 0 3px 8px rgba(255, 255, 255, 0.08);
    }

    :root:not([data-theme]) .hero-card {
        background: rgba(37, 37, 37, 0.82);
    }

    :root:not([data-theme]) .section {
        background: rgba(37, 37, 37, 0.82);
    }

    :root:not([data-theme]) .github-section {
        background: rgba(37, 37, 37, 0.82);
    }

    :root:not([data-theme]) .github-header:hover,
    :root:not([data-theme]) .github-projects a:hover {
        background: #2f2f2f;
    }
}

/* Theme-specific card backgrounds */
[data-theme="ink-light"] .hero-card {
    background: rgba(250, 250, 250, 0.95);
}

[data-theme="ink-light"] .section {
    background: rgba(250, 250, 250, 0.95);
}

[data-theme="ink-light"] .github-section {
    background: rgba(250, 250, 250, 0.95);
}

[data-theme="ink-light"] .github-header:hover,
[data-theme="ink-light"] .github-projects a:hover {
    background: #f0f0f0;
}

[data-theme="ink-dark"] .hero-card {
    background: rgba(37, 37, 37, 0.95);
}

[data-theme="ink-dark"] .section {
    background: rgba(37, 37, 37, 0.95);
}

[data-theme="ink-dark"] .github-section {
    background: rgba(37, 37, 37, 0.95);
}

[data-theme="ink-dark"] .github-header:hover,
[data-theme="ink-dark"] .github-projects a:hover {
    background: #2f2f2f;
}

[data-theme="original-dark"] .hero-card {
    background: rgba(45, 45, 45, 0.82);
}

[data-theme="original-dark"] .section {
    background: rgba(45, 45, 45, 0.82);
}

[data-theme="original-dark"] .github-section {
    background: rgba(45, 45, 45, 0.82);
}

[data-theme="original-dark"] .github-header:hover,
[data-theme="original-dark"] .github-projects a:hover {
    background: #3a3a3a;
}