/* Homepage — Clean Product design (scoped to .page-home) */

.page-home {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --home-bg: #f4f6fb;
    --home-surface: #ffffff;
    --home-text: #0f172a;
    --home-muted: #64748b;
    --home-border: #e2e8f0;
    --home-primary: #4f46e5;
    --home-primary-soft: #eef2ff;
    --home-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
    --home-shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.04), 0 24px 48px rgba(15, 23, 42, 0.08);
    --home-radius: 16px;
    --home-radius-lg: 24px;
    background: var(--home-bg);
    color: var(--home-text);
}

.page-home .header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--home-border);
    box-shadow: none;
}

.page-home .header .container {
    padding: 0.85rem 20px;
    gap: 1rem;
    flex-wrap: nowrap;
}

.page-home .header .nav-menu {
    flex: 1;
    justify-content: center;
}

.page-home .logo {
    color: var(--home-text);
    font-size: 1.15rem;
    gap: 0.5rem;
}

.page-home .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.page-home .logo-icon i {
    margin-right: 0;
    font-size: inherit;
}

.page-home .logo > span:last-child {
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-home .logo .logo-domain {
    color: var(--home-primary);
}

.page-home .nav-menu {
    gap: 0.25rem;
}

.page-home .nav-link {
    color: var(--home-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    transform: none;
}

.page-home .nav-link:hover {
    color: var(--home-text);
    background: var(--home-primary-soft);
    transform: none;
    box-shadow: none;
}

.page-home .nav-link.active {
    color: var(--home-primary);
    background: var(--home-primary-soft);
    font-weight: 600;
    box-shadow: none;
}

.page-home .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-home .btn-browse {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--home-primary);
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}

.page-home .btn-browse:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.page-home .mobile-menu-toggle {
    color: var(--home-text);
}

/* Calculator first — primary hero */
.page-home .calc-first {
    padding: 1.5rem 0 2rem;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(79, 70, 229, 0.1), transparent),
        var(--home-bg);
}

.page-home .calc-first-title {
    text-align: center;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--home-text);
    margin-bottom: 0.35rem;
}

.page-home .calc-first-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--home-muted);
    margin-bottom: 1.25rem;
}

.page-home .calc-first-eyebrow i {
    color: var(--home-primary);
}

.page-home .calc-first .calculator-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.25rem;
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius-lg);
    box-shadow: var(--home-shadow-lg);
}

.page-home .calc-first-footer {
    max-width: 640px;
    margin: 1.5rem auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.page-home .calc-first-footer .hero-search-wrap {
    width: 100%;
    margin: 0;
}

.page-home .calc-quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.page-home .calc-quick-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: 999px;
    color: var(--home-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s;
}

.page-home .calc-quick-links a:hover {
    color: var(--home-primary);
    border-color: var(--home-primary);
    background: var(--home-primary-soft);
}

.page-home .calc-quick-links a i {
    color: var(--home-primary);
    font-size: 0.75rem;
}

.page-home .hero-search-wrap {
    max-width: 520px;
    position: relative;
    width: 100%;
}

/* Override legacy .site-search rules from styles.css */
.page-home .site-search {
    max-width: none;
}

.page-home .site-search .hero-search i {
    position: static;
    transform: none;
    left: auto;
    top: auto;
    pointer-events: none;
}

.page-home .site-search input {
    width: auto;
    padding: 0.85rem 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.page-home .site-search input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}

.page-home .hero-search {
    display: flex;
    align-items: center;
    background: var(--home-surface);
    border: 2px solid var(--home-border);
    border-radius: 14px;
    padding: 0.25rem 0.35rem 0.25rem 1rem;
    box-shadow: var(--home-shadow-lg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.page-home .hero-search:focus-within {
    border-color: var(--home-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12), var(--home-shadow-lg);
}

.page-home .hero-search i {
    color: var(--home-muted);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.page-home .hero-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.85rem 0;
    background: transparent;
    color: var(--home-text);
    min-width: 0;
}

.page-home .hero-search input::placeholder {
    color: #94a3b8;
}

.page-home .hero-search-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--home-primary);
    color: white;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.page-home .hero-search-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.page-home .search-results {
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    border: 1px solid var(--home-border);
    border-radius: 12px;
    z-index: 200;
}

.page-home .search-results[hidden] {
    display: none !important;
}

.page-home .search-result {
    align-items: flex-start;
}

.page-home .search-result.is-active,
.page-home .search-result:focus-visible {
    background: var(--home-primary-soft);
    color: var(--home-primary);
}

.page-home .search-result-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.page-home .search-result-cat {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--home-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.page-home .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Category tiles */
.page-home .category-tiles {
    padding: 0 0 2rem;
}

.page-home .category-tiles-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
}

.page-home .category-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 0.75rem;
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);
    text-decoration: none;
    color: var(--home-text);
    transition: all 0.2s ease;
    box-shadow: var(--home-shadow);
}

.page-home .category-tile:hover {
    border-color: var(--home-primary);
    transform: translateY(-3px);
    box-shadow: var(--home-shadow-lg);
}

.page-home .category-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    margin-bottom: 0.65rem;
}

.page-home .category-tile-icon.financial { background: linear-gradient(135deg, #059669, #10b981); }
.page-home .category-tile-icon.health { background: linear-gradient(135deg, #e11d48, #f43f5e); }
.page-home .category-tile-icon.math { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.page-home .category-tile-icon.time { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.page-home .category-tile-icon.construction { background: linear-gradient(135deg, #d97706, #f59e0b); }
.page-home .category-tile-icon.utilities { background: linear-gradient(135deg, #0891b2, #06b6d4); }

.page-home .category-tile strong {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}

.page-home .category-tile small {
    font-size: 0.7rem;
    color: var(--home-muted);
    margin-top: 0.2rem;
}

/* Popular strip */
.page-home .popular-strip {
    padding: 0 0 2.5rem;
}

.page-home .section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--home-muted);
    margin-bottom: 0.75rem;
}

.page-home .popular-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
}

.page-home .popular-scroll::-webkit-scrollbar {
    display: none;
}

.page-home .popular-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: 999px;
    color: var(--home-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}

.page-home .popular-pill:hover {
    border-color: var(--home-primary);
    color: var(--home-primary);
    background: var(--home-primary-soft);
}

.page-home .popular-pill i {
    color: var(--home-primary);
    font-size: 0.8rem;
}

/* Calculator styles (calc-first section) */
.page-home .calc-first .calculator {
    background: #fafbfc;
    border: 1px solid var(--home-border);
    box-shadow: var(--home-shadow);
    animation: none;
}

.page-home .history-panel {
    background: #fafbfc;
    border: 1px solid var(--home-border);
    box-shadow: var(--home-shadow);
    animation: none;
}

.page-home .calculator-display {
    background: linear-gradient(145deg, #1e293b, #334155);
}

.page-home .btn-operator {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.page-home .btn-equals {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Categories browse */
.page-home .categories {
    background: transparent;
    margin: 0;
    padding: 3rem 0;
    border: none;
    backdrop-filter: none;
}

.page-home .categories > .container > h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
    color: var(--home-text);
}

.page-home .categories-subtitle {
    text-align: center;
    color: var(--home-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.page-home .categories-grid {
    gap: 1.25rem;
}

.page-home .category-card {
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);
    padding: 1.5rem;
    box-shadow: var(--home-shadow);
    animation: none;
    opacity: 1;
    transform: none;
}

.page-home .category-card:hover {
    border-color: var(--home-primary);
    box-shadow: var(--home-shadow-lg);
    transform: translateY(-4px);
}

.page-home .category-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    margin-bottom: 1rem;
}

.page-home .category-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.page-home .category-card > p {
    font-size: 0.875rem;
    color: var(--home-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.page-home .category-list a {
    color: var(--home-text);
    font-size: 0.875rem;
}

.page-home .category-list a:hover {
    color: var(--home-primary);
}

.page-home .view-all-link {
    color: var(--home-primary);
    border-color: var(--home-primary);
    background: var(--home-primary-soft);
}

/* Comments — bottom */
.page-home .comments-section {
    margin-top: 0;
    padding: 2rem 0 3rem;
}

.page-home .comments-section::before {
    color: var(--home-muted);
    font-size: 1rem;
}

.page-home .comments-load-btn {
    background: var(--home-primary);
}

.page-home .fb-comments {
    background: var(--home-surface);
    border: 1px solid var(--home-border);
}

/* Footer */
.page-home .footer {
    background: var(--home-text);
    margin-top: 0;
    padding: 3rem 0 1.5rem;
    border-top: none;
}

.page-home .footer-brand {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-home .footer-brand-info {
    max-width: 320px;
}

.page-home .footer-brand .logo {
    color: white;
    margin-bottom: 0.75rem;
}

.page-home .footer-brand .logo-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.page-home .footer-tagline {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
}

.page-home .footer-brand-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-home .footer-brand-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transition: all 0.2s;
}

.page-home .footer-brand-links a:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.page-home .footer-section h4 {
    color: #e2e8f0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.page-home .footer-section a {
    color: #94a3b8;
    font-size: 0.875rem;
}

.page-home .footer-section a:hover {
    color: white;
}

.page-home .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
    color: #64748b;
    font-size: 0.85rem;
}

.page-home .footer-bottom p {
    margin-bottom: 0.25rem;
}

.page-home .footer-bottom strong {
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 1024px) {
    .page-home .category-tiles-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .page-home .nav-menu {
        display: none;
    }

    .page-home .mobile-menu-toggle {
        display: block;
    }

    .page-home .btn-browse span {
        display: none;
    }

    .page-home .btn-browse {
        padding: 0.5rem 0.65rem;
    }
}

@media (max-width: 768px) {
    .page-home .calc-first {
        padding: 1rem 0 1.5rem;
    }

    .page-home .calc-first-title {
        font-size: 1.25rem;
    }

    .page-home .category-tiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-home .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-home .footer-brand {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .page-home .category-tiles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .page-home .category-tile {
        padding: 1rem 0.5rem;
    }

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

    .page-home .footer-section ul {
        display: block;
    }

    .page-home .footer-section li {
        margin-bottom: 0.4rem;
    }
}
