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

:root {
    --color-cream: #e8e4dc;
    --color-text: #1a1a1a;
    --color-accent: #d63447;
    --color-gray: #6b6b6b;
    --color-light-gray: #e5e5e5;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-cream);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.header {
    position: sticky;
    top: 0;
    background-color: var(--color-cream);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--color-text);
    z-index: 100;
}

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

.logo {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-accent);
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}

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

.nav-link {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

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

.cta-button {
    padding: 0.75rem 2rem;
    background-color: var(--color-text);
    color: var(--color-cream);
    text-decoration: none;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: background-color 0.3s ease;
    border: 1px solid var(--color-text);
}

.cta-button:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-section {
    padding: 8rem 0 4rem;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.main-title {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 400;
    color: var(--color-accent);
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
    line-height: 0.9;
}

.intro-text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--color-text);
    max-width: 800px;
    margin: 0 auto;
}

.featured-templates {
    padding: 6rem 0 4rem;
    border-top: 1px solid var(--color-text);
    margin-top: 4rem;
}

.featured-header {
    text-align: center;
    margin-bottom: 4rem;
}

.featured-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    font-weight: 400;
}

.featured-subtitle {
    font-size: 1.125rem;
    color: var(--color-gray);
    font-style: italic;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.featured-card {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-8px);
}

.featured-image {
    position: relative;
    aspect-ratio: 16/11;
    overflow: hidden;
    background-color: var(--color-light-gray);
    margin-bottom: 1.5rem;
    cursor: pointer;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s ease;
}

.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(214, 52, 71, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.featured-cta {
    color: white;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.featured-card:hover .featured-image img {
    transform: scale(1.05);
}

.featured-card:hover .featured-overlay {
    opacity: 1;
}

.featured-info {
    text-align: center;
}

.featured-template-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.featured-category {
    font-size: 0.875rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.category-nav {
    padding: 4rem 0 3rem;
    border-top: 1px solid var(--color-text);
    margin-top: 4rem;
}

.category-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 600px;
}

.category-link {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: 1.125rem;
    text-align: left;
    padding: 1rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid transparent;
}

.category-link i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.category-link:hover i,
.category-link.active i {
    transform: translateX(5px);
}

.category-link.active {
    font-weight: 600;
    border-bottom-color: var(--color-accent);
}

.templates-showcase {
    padding: 4rem 0;
}

.template-item {
    margin-bottom: 6rem;
    cursor: pointer;
    display: grid;
    gap: 3rem;
    align-items: start;
}

.template-item.layout-1 {
    grid-template-columns: 1.5fr 1fr;
}

.template-item.layout-2 {
    grid-template-columns: 1fr 1.5fr;
}

.template-item.layout-2 .template-image {
    order: 2;
}

.template-item.layout-2 .template-info {
    order: 1;
}

.template-item.layout-3 {
    grid-template-columns: 1fr;
    max-width: 1000px;
    margin-left: auto;
    margin-right: 0;
}

.template-image {
    position: relative;
    overflow: hidden;
    background-color: var(--color-light-gray);
    aspect-ratio: 4/5;
}

.template-item.layout-3 .template-image {
    aspect-ratio: 16/10;
}

.template-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(214, 52, 71, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.view-template {
    color: white;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.template-item:hover .template-image img {
    transform: scale(1.05);
}

.template-item:hover .template-overlay {
    opacity: 1;
}

.template-info {
    padding: 2rem 0;
}

.template-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.template-category {
    color: var(--color-accent);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.template-description {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--color-gray);
}

.cta-section {
    padding: 8rem 0;
    border-top: 1px solid var(--color-text);
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-title {
    font-family: var(--font-serif);
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.cta-description {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--color-gray);
    margin-bottom: 3rem;
}

.cta-button-large {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 3rem;
    background-color: var(--color-accent);
    color: white;
    text-decoration: none;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: background-color 0.3s ease;
}

.cta-button-large:hover {
    background-color: var(--color-text);
}

.footer {
    background-color: var(--color-text);
    color: white;
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}

.footer-brand h3 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.footer-column h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-column a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: var(--color-accent);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    font-size: 1.25rem;
    display: inline;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 2rem;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: transparent;
    max-width: 90vw;
    width: auto;
    max-height: 90vh;
    overflow: visible;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background-color: var(--color-accent);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: var(--color-text);
}

.modal-body {
    display: flex;
    flex-direction: column;
}

.modal-image {
    width: 100%;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    background-color: var(--color-light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
}

.modal-text {
    padding: 4rem;
}

.modal-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.modal-description {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--color-gray);
    margin-bottom: 3rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    text-decoration: none;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    border: 1px solid var(--color-text);
    display: inline-block;
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background-color: var(--color-text);
    border-color: var(--color-text);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
}

.btn-secondary:hover {
    background-color: var(--color-text);
    color: white;
}

@media (max-width: 1024px) {
    .hero-section {
        padding: 4rem 0 3rem;
    }

    .main-title {
        font-size: 6rem;
    }

    .featured-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .featured-title {
        font-size: 3rem;
    }

    .template-item.layout-1,
    .template-item.layout-2 {
        grid-template-columns: 1fr;
    }

    .template-item.layout-2 .template-image {
        order: 1;
    }

    .template-item.layout-2 .template-info {
        order: 2;
    }

    .template-title {
        font-size: 2.5rem;
    }

    .cta-title {
        font-size: 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        gap: 1rem;
    }

    .nav {
        display: none;
    }

    .main-title {
        font-size: 4rem;
    }

    .intro-text {
        font-size: 1.125rem;
    }

    .category-nav {
        padding: 2rem 0;
        margin-top: 2rem;
    }

    .template-item {
        margin-bottom: 4rem;
    }

    .template-title {
        font-size: 2rem;
    }

    .cta-section {
        padding: 4rem 0;
    }

    .cta-title {
        font-size: 2.5rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .modal {
        padding: 1rem;
    }

    .modal-text {
        padding: 2rem 1.5rem;
    }

    .modal-title {
        font-size: 2.5rem;
    }

    .modal-actions {
        flex-direction: column;
    }
}