﻿/* ============================================================================
   home-page.css
   Theme-aware design system for the public home page (HomePage.razor).
   Adopts the LandingPage aesthetic (gradient titles, soft glass cards, a dark
   gradient hero, gentle motion) while respecting the app's light/dark theme via
   --mud-palette-* tokens. All selectors are namespaced under .hp-* to avoid
   leaking into the rest of the app shell.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   Layout primitives
   ---------------------------------------------------------------------------- */
.hp-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(2.5rem, 5vw, 4rem) 1.5rem;
}

.hp-section--narrow {
    max-width: 880px;
}

/* Section headers ----------------------------------------------------------- */
.hp-eyebrow {
    display: block;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mud-palette-secondary);
    margin-bottom: 0.5rem;
}

.hp-title {
    text-align: center;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 auto 1rem;
    max-width: 760px;
    /* Gradient fill with a solid fallback for browsers without background-clip */
    color: var(--mud-palette-primary);
    background: linear-gradient(90deg, var(--mud-palette-primary), var(--mud-palette-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hp-subtitle {
    text-align: center;
    color: var(--mud-palette-text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 640px;
    margin: 0 auto 2.5rem;
}

.hp-subtitle a {
    color: var(--mud-palette-secondary);
    font-weight: 600;
    text-decoration: none;
}

.hp-subtitle a:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------------------------------
   Soft, theme-aware card
   ---------------------------------------------------------------------------- */
.hp-card {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px -18px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    height: 100%;
}

.hp-card:hover {
    transform: translateY(-6px);
    border-color: var(--mud-palette-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 18px 42px -20px rgba(0, 0, 0, 0.45);
}

/* ----------------------------------------------------------------------------
   Hero (intentionally dark in both themes, contained band)
   ---------------------------------------------------------------------------- */
.hp-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    min-height: clamp(440px, 64vh, 640px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(2.5rem, 6vw, 5rem) 1.5rem;
    color: #f4f6fb;
    background:
        radial-gradient(circle at 22% 18%, rgba(21, 217, 205, 0.30), transparent 55%),
        radial-gradient(circle at 82% 80%, rgba(21, 101, 192, 0.30), transparent 55%),
        linear-gradient(135deg, #1b2036 0%, #0d0f1a 100%);
}

/* Floating "sparks" */
.hp-hero__sparks {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.hp-hero__sparks span {
    position: absolute;
    bottom: -120px;
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    animation: hp-float 16s linear infinite;
}

.hp-hero__sparks span:nth-child(1) { left: 10%; width: 14px; height: 14px; animation-delay: 0s; }
.hp-hero__sparks span:nth-child(2) { left: 24%; width: 22px; height: 22px; animation-delay: 3s; background: rgba(21, 217, 205, 0.26); }
.hp-hero__sparks span:nth-child(3) { left: 39%; width: 10px; height: 10px; animation-delay: 5s; }
.hp-hero__sparks span:nth-child(4) { left: 54%; width: 26px; height: 26px; animation-delay: 2s; background: rgba(96, 165, 250, 0.22); }
.hp-hero__sparks span:nth-child(5) { left: 69%; width: 14px; height: 14px; animation-delay: 6s; }
.hp-hero__sparks span:nth-child(6) { left: 84%; width: 20px; height: 20px; animation-delay: 8s; background: rgba(21, 217, 205, 0.20); }
.hp-hero__sparks span:nth-child(7) { left: 48%; width: 12px; height: 12px; animation-delay: 4s; }
.hp-hero__sparks span:nth-child(8) { left: 16%; width: 16px; height: 16px; animation-delay: 7s; }

.hp-hero__content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.hp-hero__logo {
    display: block;
    max-height: 220px;
    width: auto;
    margin: 0 auto 1.5rem;
    filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45));
    animation: hp-fade-down 0.9s ease-out both;
}

.hp-hero__title {
    margin: 0 0 1rem;
    font-size: clamp(1.9rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: #ffffff;
    animation: hp-fade-up 0.9s ease-out 0.15s both;
}

.hp-hero__subtitle {
    margin: 0 auto 2rem;
    max-width: 560px;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
    animation: hp-fade-up 0.9s ease-out 0.3s both;
}

.hp-hero__actions {
    animation: hp-fade-up 0.9s ease-out 0.45s both;
}

.hp-hero__cta {
    font-size: 1.05rem !important;
    padding: 0.8rem 2.5rem !important;
    border-radius: 10px !important;
}

.hp-scroll-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    animation: hp-bounce 2.2s infinite;
}

/* ----------------------------------------------------------------------------
   Feature cards (the 6 platform features)
   ---------------------------------------------------------------------------- */
.hp-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.5rem;
}

.hp-feature {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    /* Cards may render as <a>; strip the default link styling. */
    text-decoration: none;
    color: inherit;
}

.hp-feature:focus-visible {
    outline: 2px solid var(--mud-palette-secondary);
    outline-offset: 2px;
}

.hp-feature.is-disabled {
    cursor: default;
}

.hp-feature.is-coming-soon {
    opacity: 0.72;
}

.hp-feature.is-coming-soon:hover {
    transform: none;
    border-color: var(--mud-palette-lines-default);
}

/* Members-only features shown to visitors: full-strength card, but not clickable and no lift on hover
   so it never reads as a link that goes nowhere. */
.hp-feature.is-members-only {
    cursor: default;
}

.hp-feature.is-members-only:hover {
    transform: none;
    border-color: var(--mud-palette-lines-default);
}

.hp-feature.is-members-only:hover .hp-feature__media img {
    transform: none;
}

.hp-feature__media {
    position: relative;
    overflow: hidden;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    /* Reserve space so the grid does not reflow as banner images load. */
    aspect-ratio: 16 / 10;
    background: var(--mud-palette-action-disabled-background);
}

.hp-feature__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hp-feature:hover .hp-feature__media img {
    transform: scale(1.04);
}

.hp-feature__media::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 55%, var(--mud-palette-surface));
}

.hp-feature__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 0 1.5rem 1.5rem;
}

.hp-feature__title {
    margin-top: -1.75rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.hp-feature__desc {
    color: var(--mud-palette-text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ----------------------------------------------------------------------------
   "Why Elevate Pyro Is Different" editorial rows
   ---------------------------------------------------------------------------- */
.hp-why {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 5vw, 3.5rem);
    margin-top: 0.5rem;
}

.hp-why__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
}

.hp-why__row.is-reverse .hp-why__media {
    order: 2;
}

.hp-why__row.is-reverse .hp-why__text {
    order: 1;
}

.hp-why__media img {
    display: block;
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 14px 36px -20px rgba(0, 0, 0, 0.5);
    transition: transform 0.35s ease;
}

.hp-why__media img:hover {
    transform: scale(1.02);
}

.hp-why__kicker {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mud-palette-secondary);
    margin-bottom: 0.4rem;
}

.hp-why__heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.75rem;
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.hp-why__text p {
    margin: 0;
    color: var(--mud-palette-text-secondary);
    font-size: 1.02rem;
    line-height: 1.7;
}

/* ----------------------------------------------------------------------------
   FAQ accordion
   ---------------------------------------------------------------------------- */
.hp-faq {
    max-width: 820px;
    margin: 0 auto;
}

.hp-faq .mud-expand-panel {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px !important;
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: var(--mud-palette-surface);
    transition: border-color 0.2s ease;
}

.hp-faq .mud-expand-panel:hover {
    border-color: var(--mud-palette-secondary);
}

.hp-faq .mud-expand-panel-header {
    font-weight: 600;
}

/* ----------------------------------------------------------------------------
   Call to action (anonymous visitors)
   Like the hero, intentionally dark in both themes: the band colors are pinned
   (not palette-tracked) because the copy on it is fixed white.
   ---------------------------------------------------------------------------- */
.hp-cta {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: clamp(2.5rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3rem);
    text-align: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--elevate-band-navy), var(--elevate-band-blue));
    box-shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.6);
}

.hp-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 60%);
}

.hp-cta > * {
    position: relative;
    z-index: 1;
}

.hp-cta__title {
    margin: 0.5rem 0 0.75rem;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    font-weight: 700;
    color: #ffffff;
}

.hp-cta__intro {
    max-width: 620px;
    margin: 0 auto 2rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
}

.hp-cta__tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    max-width: 760px;
    margin: 0 auto 2rem;
}

.hp-cta__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
}

.hp-cta__tile-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}

.hp-cta__button {
    font-size: 1.1rem !important;
    padding: 1rem 3rem !important;
    font-weight: 600 !important;
    background: #ffffff !important;
    color: var(--elevate-band-navy) !important;
}

.hp-cta__finepoint {
    max-width: 560px;
    margin: 1rem auto 0;
    color: rgba(255, 255, 255, 0.8);
}

/* ----------------------------------------------------------------------------
   Footer
   ---------------------------------------------------------------------------- */
.hp-footer {
    background-color: var(--mud-palette-background-grey);
    border-top: 1px solid var(--mud-palette-divider);
    margin-top: 3rem;
}

/* ----------------------------------------------------------------------------
   Keyframes
   ---------------------------------------------------------------------------- */
@keyframes hp-float {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-115vh) scale(0);
        opacity: 0;
    }
}

@keyframes hp-fade-down {
    0% {
        opacity: 0;
        transform: translateY(-28px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hp-fade-up {
    0% {
        opacity: 0;
        transform: translateY(24px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hp-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ----------------------------------------------------------------------------
   Dark-mode accent fixes
   Pair the dark purple primary (--mud-palette-primary) with the teal tertiary
   accent so the small accent text and the title gradient end-stop pop against
   the dark surface while tracking the live theme. (Light theme keeps the
   navy -> blue gradient.)
   ---------------------------------------------------------------------------- */
html.elevate-theme-dark .hp-eyebrow,
html.elevate-theme-dark .hp-why__kicker {
    color: var(--mud-palette-tertiary);
}

html.elevate-theme-dark .hp-title {
    background: linear-gradient(90deg, var(--mud-palette-primary), var(--mud-palette-tertiary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ----------------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .hp-why__row {
        grid-template-columns: 1fr;
    }

    .hp-why__row.is-reverse .hp-why__media,
    .hp-why__row.is-reverse .hp-why__text {
        order: 0;
    }

    .hp-hero__logo {
        max-height: 150px;
    }
}

/* ----------------------------------------------------------------------------
   Reduced motion
   ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .hp-hero__logo,
    .hp-hero__title,
    .hp-hero__subtitle,
    .hp-hero__actions {
        animation: none !important;
    }

    .hp-hero__sparks span {
        display: none;
    }

    .hp-scroll-hint {
        animation: none !important;
    }

    .hp-card,
    .hp-feature__media img,
    .hp-why__media img {
        transition: none !important;
    }
}
