/* CSS Custom Properties */
:root {
    /* Colors - Light Mode */
    --accent: #c55043;
    --font-color: #2A2B2A;
    --background: linear-gradient(135deg, #FAF0EF 0%, #F4F2F9 100%);
    --background-solid: #F4F2F9;
    --alternate: #6943A4;
    --white: #ffffff;
    --shadow-light: rgba(255, 255, 255, 0.8);
    --shadow-dark: rgba(106, 67, 164, 0.15);
    --shadow-inset-light: rgba(255, 255, 255, 0.6);
    --shadow-inset-dark: rgba(106, 67, 164, 0.1);
    
    /* Typography */
    --font-body: 'JetBrains Mono', monospace;
    --font-heading: 'Inter', sans-serif;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --accent: #e74c3c;
    --font-color: #e8e8e8;
    --background: linear-gradient(135deg, #1a1a1a 0%, #2d1b69 100%);
    --background-solid: #2d1b69;
    --alternate: #9b59b6;
    --white: #2c2c2c;
    --shadow-light: rgba(255, 255, 255, 0.05);
    --shadow-dark: rgba(0, 0, 0, 0.4);
    --shadow-inset-light: rgba(255, 255, 255, 0.1);
    --shadow-inset-dark: rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--font-color);
    background: var(--background);
    background-attachment: fixed;
    line-height: 1.6;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--font-color);
    line-height: 1.2;
}

/* Neumorphic Design System */
.neuro-card {
    background: var(--background-solid);
    border-radius: 20px;
    box-shadow: 
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
    padding: 2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.neuro-card:hover {
    box-shadow: 
        12px 12px 24px var(--shadow-dark),
        -12px -12px 24px var(--shadow-light);
    transform: translateY(-2px);
}

.neuro-button {
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: 0.8rem 2rem;
    font-family: var(--font-body);
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 
        4px 4px 8px rgba(197, 80, 67, 0.3),
        -2px -2px 8px rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.neuro-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.neuro-button:hover::before {
    left: 100%;
}

.neuro-button:hover {
    transform: translateY(-1px);
    box-shadow: 
        6px 6px 12px rgba(197, 80, 67, 0.4),
        -3px -3px 12px rgba(255, 255, 255, 0.9);
}

.neuro-button:active {
    transform: translateY(1px);
    box-shadow: 
        2px 2px 4px rgba(197, 80, 67, 0.3),
        -1px -1px 4px rgba(255, 255, 255, 0.8);
}

/* Header */
header {
    padding: 1rem 2rem;
    background: rgba(244, 242, 249, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] header {
    background: rgba(45, 27, 105, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.2rem;
    color: #2a2b2a;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--font-color);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--background-solid);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

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

.theme-toggle:active {
    transform: scale(0.95);
    box-shadow: 
        inset 2px 2px 4px var(--shadow-dark),
        inset -2px -2px 4px var(--shadow-light);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 2rem;
    box-shadow: 
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
    transition: all 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 
        12px 12px 24px var(--shadow-dark),
        -12px -12px 24px var(--shadow-light);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--font-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hero .subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    margin-bottom: 2rem;
    color: var(--alternate);
    font-weight: 600;
}

.hero .description {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 1rem;
    line-height: 1.7;
    color: var(--font-color);
}

/* Work Section */
.work-section {
    padding: 1rem 0 2rem 0;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.work-box {
    text-align: center;
    position: relative;
}

.work-box img {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
    transition: all 0.3s ease;
}

.work-box img:hover {
    transform: scale(1.05) rotate(2deg);
}

.work-box h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--font-color);
}

.work-box p {
    margin-bottom: 2rem;
    line-height: 1.7;
    color: var(--font-color);
}

/* Email Signup */
.email-signup {
    background: transparent;
    padding: 4rem 0;
    text-align: center;
}

.signup-card {
    max-width: 500px;
    margin: 0 auto;
}

.signup-card h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--font-color);
}

.signup-card p {
    margin-bottom: 2rem;
    color: var(--alternate);
    font-size: 1.1rem;
}

/* ConvertKit Custom Form Styling */
.convertkit-form-container {
    margin-top: 2rem;
}

.convertkit-form {
    background: transparent;
}

/* Ensure input styling takes priority */
#convertkit-custom-form .form-input,
.convertkit-form .form-input,
input.form-input {
    flex: 1;
    min-width: 200px;
    padding: 1rem !important;
    border: none !important;
    border-radius: 12px !important;
    font-family: var(--font-body) !important;
    font-size: 0.95rem !important;
    background: var(--background-solid) !important;
    color: var(--font-color) !important;
    box-shadow: 
        inset 4px 4px 8px var(--shadow-inset-dark),
        inset -4px -4px 8px var(--shadow-inset-light) !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    flex-wrap: wrap;
}

.form-input {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-family: var(--font-body) !important;
    font-size: 0.95rem;
    background: var(--background-solid) !important;
    color: var(--font-color) !important;
    box-shadow: 
        inset 4px 4px 8px var(--shadow-inset-dark),
        inset -4px -4px 8px var(--shadow-inset-light) !important;
    transition: all 0.2s ease;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.form-input:focus {
    box-shadow: 
        inset 6px 6px 12px var(--shadow-inset-dark),
        inset -6px -6px 12px var(--shadow-inset-light) !important;
    transform: translateY(-1px);
    border: none !important;
}

.form-input::placeholder {
    color: rgba(42, 43, 42, 0.6) !important;
    font-family: var(--font-body) !important;
}

[data-theme="dark"] .form-input::placeholder {
    color: rgba(232, 232, 232, 0.6) !important;
}

[data-theme="dark"] .form-input {
    background: var(--background-solid) !important;
    color: var(--font-color) !important;
}

.form-submit {
    min-width: 140px;
    white-space: nowrap;
}

.form-status {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.form-status.show {
    opacity: 1;
    transform: translateY(0);
}

.form-status.success {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.form-status.error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.form-status.loading {
    background: rgba(106, 67, 164, 0.1);
    color: var(--alternate);
    border: 1px solid rgba(106, 67, 164, 0.3);
}

/* Responsive form layout */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-input {
        min-width: auto;
    }
}

/* Footer */
footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid rgba(106, 67, 164, 0.1);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content p {
    margin-bottom: 1rem;
    color: var(--alternate);
}

.footer-content a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-content a:hover {
    text-decoration: underline;
    color: var(--font-color);
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 6px;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Loading optimization */
img {
    loading: lazy;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero, .work-box, .signup-card {
    animation: fadeInUp 0.6s ease forwards;
}

.work-box:nth-child(2) {
    animation-delay: 0.2s;
}

/* Performance optimizations */
* {
    will-change: auto;
}

.neuro-card, .neuro-button, .profile-image {
    will-change: transform, box-shadow;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .nav-right {
        gap: 1rem;
    }
    
    .work-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    header {
        padding: 1rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .work-section {
        padding: 3rem 0;
    }
    
    .email-signup {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    
    .neuro-card {
        padding: 1.5rem;
    }
    
    .profile-image {
        width: 120px;
        height: 120px;
    }
    
    .work-box img {
        width: 240px;
        height: 160px;
    }
    
    .hero h1 {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }
    
    .hero .subtitle {
        font-size: clamp(1rem, 3vw, 1.3rem);
    }
}