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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: padding-top 0.3s ease;
}

body.has-banner {
    padding-top: 80px;
}

#tg-banner {
    position: fixed;
    top: 8px;
    left: 12px;
    right: 12px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 10px 16px;
    min-height: 48px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#tg-banner.tg-hidden {
    display: none;
}

#tg-banner.tg-closing {
    opacity: 0;
    transform: translateY(-100%);
}

.tg-banner-text {
    color: #f0f0f0;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
}

#tg-banner-close {
    background: none;
    border: none;
    color: #555;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

#tg-banner-close:hover {
    color: #e0e0e0;
}

header {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #e8a045, #f472b6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    margin: 1rem auto 0;
    max-width: 720px;
    color: #ddd;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.5;
}

.hero-subtitle {
    margin: 0.6rem auto 0;
    max-width: 600px;
    color: #888;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* "Try it" featured book section (top: new book, bottom: starter recommendation) */
.try-it {
    padding: 0.5rem 2rem 0;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.try-it-bottom {
    padding: 1rem 2rem 2rem;
}

.try-it-card {
    display: block;
    background:
        linear-gradient(135deg, rgba(232, 160, 69, 0.06), rgba(244, 114, 182, 0.04), rgba(168, 85, 247, 0.06)),
        #15151f;
    border: 1px solid rgba(244, 114, 182, 0.2);
    border-radius: 14px;
    padding: 1.1rem 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, border-color 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.try-it-card:hover {
    transform: translateY(-2px);
    border-color: rgba(244, 114, 182, 0.45);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 18px rgba(244, 114, 182, 0.1);
}

.try-it-card > * {
    margin: 0;
}

.try-it-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #888;
    flex-shrink: 0;
    border-right: 1px solid #2a2a35;
    padding-right: 1rem;
    line-height: 1.2;
}

.try-it-title {
    font-size: 1.05rem;
    font-weight: 600;
    background: linear-gradient(135deg, #e8a045, #f472b6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

.try-it-text {
    font-size: 0.85rem;
    color: #999;
    line-height: 1.45;
    flex: 1;
    min-width: 200px;
}

.try-it-btn {
    background: linear-gradient(135deg, #e8a045, #f472b6, #a855f7);
    color: #fff;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 2rem 3rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.card {
    background: #15151f;
    border: 1px solid #222;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, border-color 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent, #444);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px color-mix(in srgb, var(--accent) 20%, transparent);
}

.card-icon {
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
    color: #f0f0f0;
    margin-bottom: 0.5rem;
}

.card .author {
    font-size: 0.85rem;
    color: #777;
}

/* Dual-theme card (dark + warm cream wave corner) */
.card-dual-theme {
    background: #15151f;
    border-color: rgba(201, 168, 78, 0.3);
    position: relative;
    overflow: hidden;
}

.card-dual-theme::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #FBF8F3;
    clip-path: url(#wave-clip);
    z-index: 0;
}

.card-dual-theme:hover {
    border-color: #C9A84E;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(201, 168, 78, 0.15);
}

.card-dual-theme .card-icon,
.card-dual-theme h2,
.card-dual-theme .author {
    position: relative;
    z-index: 1;
}

.theme-icon-light {
    position: absolute;
    bottom: 14px;
    right: 16px;
    font-size: 1.15rem;
    opacity: 0.7;
    z-index: 1;
    transition: opacity 0.3s;
}

.card-dual-theme:hover .theme-icon-light {
    opacity: 1;
}

footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem 1.5rem 1.75rem;
    border-top: 1px solid #1a1a26;
}

.footer-content {
    color: #555;
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-name {
    color: #888;
}

.footer-sep {
    margin: 0 0.6rem;
    color: #2a2a35;
}

.footer-link {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #e8a045;
}


@media (max-width: 640px) {
    header {
        padding: 2rem 1rem 1.5rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .hero-tagline {
        font-size: 1.05rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .try-it {
        padding: 0.5rem 1rem 0;
    }

    .try-it-bottom {
        padding: 0.75rem 1rem 1.5rem;
    }

    .try-it-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.5rem;
        padding: 1.1rem 1.25rem;
    }

    .try-it-label {
        border-right: none;
        padding-right: 0;
        padding-bottom: 0.3rem;
        border-bottom: 1px solid #2a2a35;
    }

    .try-it-title {
        font-size: 1.15rem;
    }

    .try-it-text {
        min-width: 0;
    }

    .try-it-btn {
        align-self: center;
    }

    .grid {
        grid-template-columns: 1fr;
        padding: 0.5rem 1rem 2rem;
        gap: 1rem;
    }

    .card {
        padding: 1.5rem 1.2rem;
    }

    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
    }

    .footer-sep {
        display: none;
    }
}
