/* Import color system */
@import url('colors.css');

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

:root {
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-secondary: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Default to light theme */
html {
    color-scheme: light dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

/* Set data-theme attribute based on checkbox state and system preference */
html {
    /* Default to light theme */
}

/* When checkbox is checked, force dark theme */
html:has(.theme-switch:checked) {
    color-scheme: dark;
}

/* When checkbox is not checked, respect system preference */
@media (prefers-color-scheme: dark) {
    html:has(.theme-switch:not(:checked)) {
        color-scheme: dark;
    }
}

@media (prefers-color-scheme: light) {
    html:has(.theme-switch:not(:checked)) {
        color-scheme: light;
    }
}

/* All colors come from colors.css via data-theme attribute */
body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-700);
    background-color: var(--background-50);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto auto auto;
    grid-template-areas:
        "header"
        "hero"
        "features"
        "about"
        "footer";
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    grid-area: header;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--background-200);
    margin-bottom: 40px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo h1 {
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary-600);
    letter-spacing: -0.02em;
}

.nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.nav a {
    text-decoration: none;
    color: var(--text-600);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    letter-spacing: -0.01em;
}

.nav a:hover {
    color: var(--primary-600);
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
}

.theme-switch {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Auto-check based on system preference */
@media (prefers-color-scheme: dark) {
    .theme-switch {
        /* Set initial state based on system preference */
    }
}

.theme-label {
    background: var(--background-100);
    border: 1px solid var(--background-300);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
}

.theme-label:hover {
    background: var(--background-200);
    transform: scale(1.05);
}

.theme-icon {
    position: absolute;
    transition: all 0.3s ease;
}

.light-icon {
    opacity: 1;
    transform: translateY(0);
}

.dark-icon {
    opacity: 0;
    transform: translateY(20px);
}

/* When dark mode is active */
.theme-switch:checked+.theme-label .light-icon {
    opacity: 0;
    transform: translateY(-20px);
}

.theme-switch:checked+.theme-label .dark-icon {
    opacity: 1;
    transform: translateY(0);
}

/* Auto-detect system preference for icon state */
@media (prefers-color-scheme: dark) {
    .light-icon {
        opacity: 0;
        transform: translateY(-20px);
    }

    .dark-icon {
        opacity: 1;
        transform: translateY(0);
    }
}

/* When checkbox is checked, show opposite icon */
.theme-switch:checked+.theme-label .light-icon {
    opacity: 1;
    transform: translateY(0);
}

.theme-switch:checked+.theme-label .dark-icon {
    opacity: 0;
    transform: translateY(20px);
}

/* Override system dark preference when checkbox is checked */
@media (prefers-color-scheme: dark) {
    .theme-switch:checked+.theme-label .light-icon {
        opacity: 1;
        transform: translateY(0);
    }

    .theme-switch:checked+.theme-label .dark-icon {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Hero Section */
.hero {
    grid-area: hero;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 60px 0;
    margin-bottom: 80px;
}

.hero-content h2 {
    font-family: var(--font-secondary);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-900);
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-600);
    margin-bottom: 30px;
    line-height: 1.7;
}

.cta-buttons {
    display: grid;
    grid-template-columns: auto auto;
    gap: 15px;
    justify-content: start;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.btn-primary {
    background-color: var(--primary-600);
    color: var(--background-50);
}

.btn-primary:hover {
    background-color: var(--primary-700);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-600);
    border: 2px solid var(--primary-600);
}

.btn-secondary:hover {
    background-color: var(--primary-600);
    color: var(--background-50);
    transform: translateY(-1px);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-placeholder {
    width: 300px;
    height: 300px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

/* Features Section */
.features {
    grid-area: features;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 60px 0;
    margin-bottom: 80px;
}

.feature-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--background-50);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
    border: 1px solid var(--background-200);
}

.feature-card:hover {
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-family: var(--font-secondary);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-800);
    margin-bottom: 15px;
    letter-spacing: -0.02em;
}

.feature-card p {
    color: var(--text-600);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* About Section */
.about {
    grid-area: about;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 60px 0;
    margin-bottom: 80px;
}

.about-text h2 {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-900);
    margin-bottom: 25px;
    letter-spacing: -0.03em;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-600);
    margin-bottom: 20px;
    line-height: 1.7;
}

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image .image-placeholder {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-700) 100%);
}

/* Footer */
.footer {
    grid-area: footer;
    background-color: var(--text-800);
    color: var(--background-100);
    padding: 50px 40px;
    margin: 40px -20px 0 -20px;
    border-radius: 16px 16px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1160px;
    margin: 0 auto;
}

.footer-section h4 {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--background-50);
    letter-spacing: -0.01em;
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--background-300);
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }

    .header-right {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-content h2 {
        font-size: 2.2rem;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .about-text h2 {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    .footer {
        padding: 40px 20px;
        margin: 40px -15px 0 -15px;
    }

    .cta-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .image-placeholder {
        width: 200px !important;
        height: 200px !important;
        font-size: 3rem !important;
    }

    .image-placeholder img {
        border-radius: 16px !important;
    }
}