@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8f9fb;
    color: #1a1a2e;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.gallery-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.gallery-header .inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gallery-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.gallery-brand img {
    width: 40px;
    height: 40px;
}

.gallery-brand span {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.gallery-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.gallery-back:hover { color: #1a1a2e; }

/* Intro */
.gallery-intro {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 32px 0;
    text-align: center;
}

.gallery-intro h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.gallery-intro p {
    font-size: 16px;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Grid */
.gallery-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 32px 80px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

/* Card */
.template-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* Preview Frame */
.preview-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f1f3f5;
    border-bottom: 1px solid #e5e7eb;
}

.preview-wrapper iframe {
    width: 400%;
    height: 400%;
    transform: scale(0.25);
    transform-origin: top left;
    pointer-events: none;
    border: none;
}

.preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
}

.preview-wrapper.loaded .preview-placeholder {
    display: none;
}

/* Card Info */
.card-info {
    padding: 24px;
}

.card-info .card-number {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 8px;
    background: #f3f4f6;
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 12px;
}

.card-info h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}

.card-info .card-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Palette */
.card-palette {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}

.card-palette .swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

/* Buttons */
.card-actions {
    display: flex;
    gap: 10px;
}

.btn-preview, .btn-select {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-preview {
    background: #1a1a2e;
    color: #fff;
}

.btn-preview:hover {
    background: #2d2d44;
}

.btn-select {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-select:hover {
    background: #e5e7eb;
}

/* Footer */
.gallery-footer {
    text-align: center;
    padding: 32px;
    color: #9ca3af;
    font-size: 13px;
    border-top: 1px solid #e5e7eb;
}

/* Responsive */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px 20px 60px;
    }

    .gallery-intro {
        padding: 32px 20px 0;
    }

    .gallery-intro h1 {
        font-size: 28px;
    }

    .gallery-header .inner {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .card-actions {
        flex-direction: column;
    }
}
