/**
 * JigsawStation Homepage Styles
 * Page-specific styles for the homepage
 */

/* ==========================================================================
   Content Pages (About, Privacy, Terms, Cookies)
   ========================================================================== */

.content-page {
    min-height: calc(100vh - 200px);
}

.content-container {
    max-width: 900px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 3);
}

.content-container h1 {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.02em;
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.content-container .last-updated {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.content-section {
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.content-section h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: calc(var(--spacing-unit) * 2);
    margin-top: calc(var(--spacing-unit) * 3);
}

.content-section h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    margin-top: calc(var(--spacing-unit) * 2);
}

.content-section p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.content-section ul,
.content-section ol {
    margin-left: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.content-section li {
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.content-section a {
    color: var(--cyan-600);
    text-decoration: underline;
}

.content-section a:hover {
    color: var(--cyan-500);
}

/* ==========================================================================
   Header
   ========================================================================== */

header {
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: none;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 2.5) calc(var(--spacing-unit) * 3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--slate-900);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   Main Container
   ========================================================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 3);
}

/* ==========================================================================
   Category Filter
   ========================================================================== */

.category-filter-section {
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.category-filter {
    display: flex;
    gap: calc(var(--spacing-unit) * 1.5);
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.section-header {
    margin-bottom: calc(var(--spacing-unit) * 2.5);
}

.section-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    color: var(--slate-900);
    letter-spacing: -0.02em;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.section-subtitle {
    font-size: 14px;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

.section-header h1,
.section-header h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.section-header p {
    font-size: 13px;
    color: var(--gray-600);
}

/* ==========================================================================
   Featured Section
   ========================================================================== */

/* ==========================================================================
   Latest / Featured Puzzles
   ========================================================================== */

.featured-section {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
}


/* ==========================================================================
   Puzzle Grid - Dense catalog layout
   ========================================================================== */

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    margin-top: calc(var(--spacing-unit) * 8);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 3);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.footer-section h3 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: calc(var(--spacing-unit) * 2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.footer-links a {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--cyan-600);
}

.footer-bottom {
    padding-top: calc(var(--spacing-unit) * 3);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 2);
}

.footer-copyright {
    color: var(--gray-600);
    font-size: 13px;
}

.footer-social {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-link:hover {
    background: var(--cyan-600);
    color: white;
    transform: translateY(-2px);
}

.social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .header-content {
        gap: calc(var(--spacing-unit) * 2);
        padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2);
    }

    .category-filter {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: calc(var(--spacing-unit) * 1);
        justify-content: flex-start;
    }

    .category-filter::-webkit-scrollbar {
        display: none;
    }

    .puzzle-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: calc(var(--spacing-unit) * 1.5);
    }

    .container {
        padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: calc(var(--spacing-unit) * 3);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: calc(var(--spacing-unit) * 1.5);
    }

    .section-header h1,
    .section-header h2 {
        font-size: 16px;
    }

    .section-header p {
        font-size: 12px;
    }

    .category-filter-section {
        margin-bottom: calc(var(--spacing-unit) * 3);
    }
}

@media (min-width: 768px) and (max-width: 1200px) {
    .puzzle-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 1200px) {
    .puzzle-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* ==========================================================================
   HOMEPAGE — Clean Modern
   Scoped entirely to body.homepage — zero impact on other pages
   ========================================================================== */

/* ── Color tokens ── */
body.homepage {
    --nh-bg:      #ffffff;
    --nh-surface: #f7f8fa;
    --nh-surface2:#eef0f4;
    --nh-border:  #e2e6ed;
    --nh-text:    #1a202c;
    --nh-sub:     #4a5568;
    --nh-muted:   #a0aec0;
    --nh-accent:  #7AAACE;
    --nh-hi:      #5b8fb5;
    background-color: var(--nh-bg);
    background-image: none;
    color: var(--nh-text);
    font-family: 'DM Sans', sans-serif;
}

body.homepage.dark-mode {
    --nh-bg:      #111827;
    --nh-surface: #1a2234;
    --nh-surface2:#1e2840;
    --nh-border:  #2d3a50;
    --nh-text:    #e2e8f0;
    --nh-sub:     #94a3b8;
    --nh-muted:   #4a5568;
    --nh-accent:  #7AAACE;
    --nh-hi:      #9bbede;
    background-color: var(--nh-bg);
    background-image: none;
    color: var(--nh-text);
}

@media (prefers-color-scheme: dark) {
    body.homepage:not(.light-mode) {
        --nh-bg:      #111827;
        --nh-surface: #1a2234;
        --nh-surface2:#1e2840;
        --nh-border:  #2d3a50;
        --nh-text:    #e2e8f0;
        --nh-sub:     #94a3b8;
        --nh-muted:   #4a5568;
        --nh-accent:  #7AAACE;
        --nh-hi:      #9bbede;
        background-color: var(--nh-bg);
        background-image: none;
        color: var(--nh-text);
    }
}

/* ── Scrollbar ── */
body.homepage ::-webkit-scrollbar { width: 5px; height: 5px; }
body.homepage ::-webkit-scrollbar-track { background: transparent; }
body.homepage ::-webkit-scrollbar-thumb { background: var(--nh-border); border-radius: 3px; }
body.homepage ::-webkit-scrollbar-thumb:hover { background: var(--nh-muted); }

/* ── Load animation ── */
@keyframes hp-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Nav ── */
header {
    background: var(--nh-bg);
    border-bottom: 1px solid var(--nh-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: none;
}

.header-content {
    max-width: 1280px;
    padding: 16px 36px;
}

.logo {
    font-family: 'Raleway', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    font-style: normal;
    color: var(--nh-text);
    letter-spacing: -0.01em;
    gap: 10px;
}

.logo-icon { width: 26px; height: 26px; }
.logo-icon img { width: 100%; height: 100%; object-fit: contain; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ── Browse dropdown ── */
.nav-browse-wrap {
    position: relative;
}

.nav-browse {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--nh-sub);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    transition: color 0.2s;
}
.nav-browse:hover,
.nav-browse-wrap:hover .nav-browse { color: var(--nh-text); }

.nav-browse-caret {
    width: 10px;
    height: 6px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.nav-browse-wrap:hover .nav-browse-caret { transform: rotate(180deg); }

.nav-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 200;
}

/* Invisible bridge fills the gap so hover isn't lost mid-travel */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -10px;
    right: -10px;
    height: 12px;
}

.nav-browse-wrap:hover .nav-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nh-muted);
    padding: 4px 10px 2px;
    margin: 0;
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--nh-border);
    margin: 5px 4px;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 0.82rem;
    color: var(--nh-sub);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.nav-dropdown-item:hover {
    background: var(--nh-surface2);
    color: var(--nh-text);
}
.nav-dropdown-item span {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.nav-dropdown-all {
    font-weight: 600;
    color: var(--nh-accent);
}
.nav-dropdown-all:hover { color: var(--nh-accent); }

.theme-toggle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--nh-border);
    background: transparent;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--nh-accent); background: var(--nh-surface2); transform: none; }
.theme-toggle svg { display: none; }

.streak-badge {
    display: none;
    align-items: center;
    gap: 4px;
    font-size: 0.73rem;
    font-weight: 500;
    color: var(--nh-accent);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.btn-signup {
    background: transparent;
    color: var(--nh-text);
    border: 1px solid var(--nh-border);
    padding: 7px 20px;
    border-radius: 2px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
}
.btn-signup:hover {
    background: var(--nh-text);
    color: var(--nh-bg);
    border-color: var(--nh-text);
}

/* ── Main ── */
body.homepage .hp-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 44px 36px 88px;
}

/* ── Section Headers ── */
body.homepage .hp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--nh-border);
}

body.homepage .hp-section-title {
    font-family: 'Raleway', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--nh-text);
    letter-spacing: -0.01em;
    line-height: 1;
}

body.homepage .hp-section-link {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--nh-muted);
    text-decoration: none;
    transition: color 0.2s;
    margin-bottom: 2px;
}
body.homepage .hp-section-link:hover { color: var(--nh-accent); }

body.homepage .hp-daily-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.homepage .hp-daily-date {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--nh-muted);
    letter-spacing: 0.04em;
}

body.homepage .hp-daily-tagline {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--nh-accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

body.homepage .hp-daily-tagline::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nh-accent);
    animation: hp-pulse 2s ease-in-out infinite;
}

@keyframes hp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.75); }
}


/* ── Page Intro (H1) ── */
body.homepage .hp-page-intro {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--nh-border);
}

body.homepage .hp-page-title {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--nh-text);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 6px;
}

body.homepage .hp-page-sub {
    font-size: 0.85rem;
    color: var(--nh-sub);
    line-height: 1.5;
    margin: 0;
}

/* ── Continue Playing ── */
body.homepage .hp-continue {
    margin-bottom: 48px;
    animation: hp-rise 0.6s ease both;
}
body.homepage .hp-continue.hidden { display: none; }

body.homepage .hp-continue-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 18px 0 4px;
    scrollbar-width: none;
}
body.homepage .hp-continue-scroll::-webkit-scrollbar { display: none; }

body.homepage .hp-continue-card {
    flex-shrink: 0;
    width: 190px;
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 2px;
    overflow: hidden;
    text-decoration: none;
    color: var(--nh-text);
    transition: border-color 0.25s;
    display: block;
}
body.homepage .hp-continue-card:hover { border-color: var(--nh-accent); }

body.homepage .hp-continue-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}
body.homepage .hp-continue-card:hover img { transform: scale(1.04); }

body.homepage .hp-continue-body { padding: 10px 12px 12px; }

body.homepage .hp-continue-title {
    font-size: 0.76rem;
    font-weight: 400;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.homepage .hp-progress-wrap {
    background: var(--nh-border);
    height: 2px;
    margin-bottom: 8px;
    overflow: hidden;
}
body.homepage .hp-progress-fill { height: 100%; background: var(--nh-accent); }

body.homepage .hp-continue-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.67rem;
    color: var(--nh-muted);
}

/* ── Daily Puzzles ── */
body.homepage .hp-daily {
    margin-bottom: 44px;
    animation: hp-rise 0.5s 0.05s ease both;
}

body.homepage .hp-daily-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

body.homepage .hp-daily-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: block;
    border-radius: 6px;
}

body.homepage .hp-daily-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}
body.homepage .hp-daily-card:hover img { transform: scale(1.05); }

body.homepage .hp-daily-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 2;
}
body.homepage .hp-daily-card:hover .hp-daily-overlay { background: rgba(0,0,0,0.22); }

/* ── All Puzzles ── */
body.homepage .hp-puzzles {
    margin-bottom: 48px;
    animation: hp-rise 0.5s 0.1s ease both;
}

body.homepage .hp-puzzle-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

body.homepage .hp-puzzle-card {
    overflow: hidden;
    cursor: pointer;
    display: block;
    text-decoration: none;
    position: relative;
    border-radius: 6px;
}

body.homepage .hp-puzzle-thumb {
    position: relative;
    overflow: hidden;
}
body.homepage .hp-puzzle-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}
body.homepage .hp-puzzle-card:hover .hp-puzzle-thumb img { transform: scale(1.06); }

body.homepage .hp-puzzle-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 2;
}
body.homepage .hp-puzzle-card:hover .hp-puzzle-overlay { background: rgba(0,0,0,0.22); }

/* ── Play Pill (shared) ── */
body.homepage .hp-play-pill {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 6px 18px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
body.homepage .hp-daily-card:hover .hp-play-pill,
body.homepage .hp-puzzle-card:hover .hp-play-pill {
    opacity: 1;
    transform: translateY(0);
}

/* ── Footer ── */
.hp-footer {
    border-top: 1px solid var(--nh-border);
    background: var(--nh-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 36px;
    color: var(--nh-muted);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

.hp-footer-links { display: flex; gap: 28px; }
.hp-footer-links a {
    color: var(--nh-muted);
    text-decoration: none;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.hp-footer-links a:hover { color: var(--nh-accent); }

/* ── Dark mode header/footer background sync ── */
body.dark-mode header,
body.dark-mode .hp-footer {
    background: var(--nh-bg);
    border-color: var(--nh-border);
}
body.dark-mode .logo { color: var(--nh-text); }

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) header,
    body:not(.light-mode) .hp-footer {
        background: var(--nh-bg);
        border-color: var(--nh-border);
    }
}

/* ── Responsive ── */
@media (max-width: 1023px) {
    body.homepage .hp-daily-grid { grid-template-columns: repeat(3, 1fr); }
    body.homepage .hp-daily-card:nth-child(4),
    body.homepage .hp-daily-card:nth-child(5) { display: none; }
    body.homepage .hp-puzzle-grid { grid-template-columns: repeat(3, 1fr); }
    body.homepage .hp-main { padding: 28px 24px 64px; }
    .header-content { padding: 14px 24px; }
    body.homepage .hp-daily-tagline { font-size: 0.65rem; }
}

@media (max-width: 767px) {
    .header-content { padding: 12px 16px; }
    .streak-badge { display: none !important; }
    .btn-signup { display: none; }

    body.homepage .hp-main { padding: 20px 16px 48px; }

    /* Section headers stack vertically on mobile */
    body.homepage .hp-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding-bottom: 10px;
        margin-bottom: 12px;
    }

    /* Hide tagline on mobile — too much for one row */
    body.homepage .hp-daily-tagline { display: none; }

    body.homepage .hp-section-title { font-size: 1rem; }

    /* Daily: 2×2 grid on mobile — 4 big cards */
    body.homepage .hp-daily-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    body.homepage .hp-daily-card:nth-child(n) { display: block; }
    body.homepage .hp-daily-card:nth-child(5) { display: none; }

    /* All Puzzles: 2 columns on mobile */
    body.homepage .hp-puzzle-grid { grid-template-columns: repeat(2, 1fr); gap: 5px; }

    body.homepage .hp-daily { margin-bottom: 32px; }
    body.homepage .hp-puzzles { margin-bottom: 32px; }

    body.homepage .hp-page-intro {
        margin-bottom: 16px;
        padding-bottom: 14px;
    }
    body.homepage .hp-page-title { font-size: 1.1rem; }
    body.homepage .hp-page-sub { display: none; }

    .hp-footer { padding: 18px 16px; flex-direction: column; gap: 10px; text-align: center; }
    .hp-footer-links { flex-wrap: wrap; justify-content: center; gap: 16px; }
}

@media (min-width: 1600px) {
    body.homepage .hp-main { max-width: 1600px; }
    .header-content { max-width: 1600px; }
    .hp-footer { max-width: 1600px; }
}
