/* SportsIQ.frontend/styles/pages/landing.css */
body {
    /* Ensured by base.css using var(--bg-primary), but good to be mindful */
    color: var(--panel-text);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Padding now handled in base.css */
}

/* Landing page should not inherit the global body top padding for fixed header */
body.landing-page {
    padding-top: 0 !important;
}

/* Header is already styled with var(--bg-primary) via layout.css */

/* Adjusted for fixed header in base.css */
.page-content-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Padding now handled in base.css */
}

main.landing-main {
    flex: 1;
    background-color: transparent;
    width: 100%;
    box-sizing: border-box;
    display: flex;           /* make main a flex column */
    flex-direction: column;
    /* Apply header offset at the page-main level */
    padding-top: 50px;
}

/* Ensure the footer sits at the bottom when content is short */
.landing-main > .site-footer {
    margin-top: auto;
}

/* Hero Section */
.hero-section {
    background: transparent;
    color: var(--panel-text);
    text-align: center;
    padding: 20px 20px 28px 20px; /* tighter to maximize block height */
    /* Fill the viewport below the fixed 50px header */
    --header-offset: 50px;
    /* keep this synced with vertical padding (top + bottom) */
    --hero-vpad: 48px; /* 20px top + 28px bottom */
    min-height: calc(100svh - var(--header-offset));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-title-simple {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    line-height: 1.1;
    color: #ffffff;
}

.hero-title-wrap { text-align: center; padding-bottom: var(--title-gap); }
.hero-subtitle {
    font-size: clamp(14px, 1.6vw, 18px);
    color: rgba(255,255,255,0.92);
    margin: 0 auto;
    max-width: 820px;
}

.hero-content .subtitle {
    font-size: 1.2rem; /* Slightly adjusted */
    margin-bottom: 40px;
    max-width: 650px; /* Adjusted max-width */
    margin-left: auto;
    margin-right: auto;
    opacity: 0.85; /* Slightly less transparent */
}

/* Product preview block styled similarly to modern hero previews */
.product-preview-block {
    width: min(1800px, 97vw); /* wider with modest gutters */
    aspect-ratio: 16 / 9;
    /* Make the block dominate the first view but never exceed the viewport */
    height: clamp(560px, 78svh, 1200px);
    max-height: calc(100svh - var(--header-offset) - var(--hero-vpad));
    --overlay-top: clamp(16px, 3svh, 32px);
    --title-gap: clamp(24px, 3svh, 48px);
    border-radius: 18px;
    /* Light blue gradient scheme layered entirely within the block (no page transparency) */
    background:
        radial-gradient(1200px 700px at 15% 0%, rgba(37,99,235,0.28) 0%, rgba(37,99,235,0.00) 60%),
        radial-gradient(1200px 700px at 85% 10%, rgba(59,130,246,0.24) 0%, rgba(59,130,246,0.00) 60%),
        linear-gradient(180deg, #1c2230 0%, #151a23 100%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
    border: 1px solid var(--panel-border);
    overflow: hidden;
    position: relative;
    backdrop-filter: none; /* keep solid inside the block */
    padding: clamp(10px, 1.2vw, 22px); /* visible frame around the image */
    box-sizing: border-box;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr); /* title area, then flexible image area */
}

.product-preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* fit within block, maintain aspect */
    object-position: center bottom;
    display: block;
    border-radius: 12px; /* soften corners inside the frame */
    position: relative;
    z-index: 0;
    max-height: 100%; /* never overflow its grid area */
}

/* Overlay for text and future controls */
.product-preview-overlay {
    position: relative; /* take up its own space */
    display: flex;
    align-items: start;
    justify-content: center;
    padding-top: var(--overlay-top);
    padding-left: clamp(8px, 1vw, 16px);
    padding-right: clamp(8px, 1vw, 16px);
    padding-bottom: var(--title-gap);
    pointer-events: none;
    background: none; /* remove gradient/tint */
    z-index: 1;
}

/* Hide the preview image if no src is provided */
.product-preview-image[src=""],
.product-preview-image:not([src]) {
    display: none;
}

.cta-buttons .btn-primary {
    background-color: var(--accent-primary);
    color: #fff;
    border: 2px solid var(--accent-primary);
}
.cta-buttons .btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-3px); /* Enhanced hover effect */
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

.cta-buttons .btn-secondary {
    background-color: transparent;
    color: var(--panel-text);
    border: 2px solid var(--panel-text);
}
.cta-buttons .btn-secondary:hover {
    background-color: var(--panel-text);
    color: var(--bg-primary);
    transform: translateY(-3px); /* Enhanced hover effect */
    box-shadow: 0 6px 12px rgba(200,200,200,0.15);
}


/* Features Section */
.features-section {
    padding: 0 20px 56px; /* add bottom breathing room below cards */
    text-align: center;
    background-color: transparent;
}

.features-section h2 {
    font-family: 'Montserrat', sans-serif; /* ensure same font */
    font-weight: 700;
    font-size: clamp(2rem, 2.4vw, 2.6rem); /* slightly larger */
    color: var(--panel-text);
    margin-bottom: 16px; /* tight gap above cards */
    text-transform: none; /* keep natural casing: Key Features */
    letter-spacing: 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* Adjusted minmax */
    gap: 35px; /* Increased gap */
    max-width: 1100px; /* Adjusted max-width */
    margin: 0 auto;
}

.feature-item {
    /* Light blue themed background to match hero */
    background:
      radial-gradient(600px 300px at 20% 0%, rgba(37,99,235,0.18), rgba(37,99,235,0) 60%),
      radial-gradient(600px 300px at 80% 20%, rgba(59,130,246,0.18), rgba(59,130,246,0) 60%),
      linear-gradient(180deg, #1c2230 0%, #151a23 100%);
    padding: 35px 25px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ensure feature cards that are links don't show default link styles */
.features-grid a.feature-item {
    text-decoration: none;
    color: inherit;
}
.features-grid a.feature-item:link,
.features-grid a.feature-item:visited,
.features-grid a.feature-item:hover,
.features-grid a.feature-item:focus {
    text-decoration: none;
    color: inherit;
}

.feature-item:hover {
    box-shadow: 0 12px 26px rgba(0,0,0,0.22);
}

.feature-icon {
    font-size: 2.2rem; /* Adjusted */
    color: var(--accent-primary);
    margin-bottom: 25px; /* Increased margin */
    line-height: 1; /* Ensure icon aligns well */
}

.feature-item h3 {
    font-size: 1.3rem; /* Adjusted */
    color: var(--panel-text);
    margin-bottom: 12px; /* Adjusted */
}

.feature-item p {
    font-size: 0.95rem; /* Adjusted */
    color: var(--text-muted);
    line-height: 1.7; /* Increased line-height */
    flex-grow: 1; /* Allow p to take space if cards vary in height */
}

/* Footer */
.landing-footer {
    background-color: transparent;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 16px;
}

.landing-footer p {
    margin: 0;
    font-size: 0.9rem;
}
.landing-footer p:last-child { margin-bottom: 0; }
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 12px; /* Adjusted margin */
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
.footer-links a:hover {
    color: var(--accent-primary);
}

/* Social links row under the footer links */
.social-links {
    margin-top: 0;
}
.social-links a,
.social-links a:visited {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 10px;
    display: inline-flex;
    align-items: center;
}
.social-links a:hover {
    color: var(--accent-primary);
}
.social-links i {
    font-size: 1.1rem;
    line-height: 1;
}

/* Responsive adjustments */
@media (max-width: 992px) { /* Adjusted breakpoint */
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Allow 2 columns on medium */
    }
}

/* Up-size the product image sooner on large viewports */
@media (min-width: 1200px) {
    .product-preview-block {
        height: clamp(700px, 86svh, 1300px);
        max-height: calc(100svh - var(--header-offset) - var(--hero-vpad));
        --overlay-top: clamp(16px, 3svh, 28px);
        --title-gap: clamp(20px, 2.5svh, 36px);
    }
}

/* On narrow viewports, allow the hero to shrink vertically */
@media (max-width: 1100px) {
    .hero-section { min-height: auto; }
    .product-preview-block {
        height: clamp(500px, 66svh, 1000px);
        --overlay-top: clamp(10px, 2svh, 20px);
        --title-gap: clamp(12px, 1.6svh, 20px);
    }
    /* Bring the image closer to the title on narrower screens */
    .product-preview-image { object-position: center top; }
}

@media (max-width: 900px) {
    .product-preview-block {
        height: clamp(460px, 60svh, 920px);
        --overlay-top: clamp(8px, 1.8svh, 16px);
        --title-gap: clamp(10px, 1.4svh, 16px);
    }
}

@media (max-width: 768px) {
    .hero-content h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); }
    .hero-content .subtitle {
        font-size: 1.1rem;
    }
    .product-preview-block {
        /* Stop forcing extra vertical space; size the block to its contents */
        height: auto;
        max-height: none;
        aspect-ratio: auto;
        grid-template-rows: auto auto;
        align-content: start;
        --overlay-top: clamp(8px, 1.6svh, 14px);
        --title-gap: clamp(6px, 1.2svh, 14px);
    }
    .product-preview-image {
        height: auto;
        max-height: none;
    }
    .cta-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .cta-buttons .btn {
        margin: 10px 0;
        width: 90%; /* Adjusted width */
        max-width: 320px; /* Adjusted max-width */
    }
    .features-grid {
        grid-template-columns: 1fr; /* Stack features */
    }
    .features-section h2 {
        font-size: 2rem; /* a bit larger on small screens */
        margin-bottom: 12px; /* tighter gap on small screens */
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: clamp(1.6rem, 7vw, 2rem);
    }
    .hero-content .subtitle {
        font-size: 1rem;
    }
    .hero-section { padding: 24px 12px 28px 12px; }
    .product-preview-block {
        height: auto;
        max-height: none;
        aspect-ratio: auto;
        grid-template-rows: auto auto;
        align-content: start;
        --overlay-top: clamp(6px, 1.4svh, 12px);
        --title-gap: clamp(4px, 1svh, 10px);
    }
    .features-section {
        padding: 50px 15px;
    }
    .feature-item {
        padding: 25px 20px;
    }
}

/* Ultra-small widths */
@media (max-width: 400px) {
    .hero-content h1 { font-size: clamp(1.45rem, 7.8vw, 1.9rem); }
    .hero-subtitle { font-size: clamp(12px, 3.6vw, 14px); }
    .product-preview-block {
        height: auto;
        max-height: none;
        aspect-ratio: auto;
        grid-template-rows: auto auto;
        align-content: start;
        --overlay-top: clamp(4px, 1.2svh, 10px);
        --title-gap: clamp(4px, 0.9svh, 8px);
    }
}

@media (max-width: 360px) {
    .hero-section { padding: 16px 10px 18px; }
    .hero-content h1 { font-size: clamp(1.5rem, 8.4vw, 2rem); }
    .hero-subtitle { font-size: clamp(12px, 3.8vw, 14px); }
    .product-preview-block {
        height: auto;
        max-height: none;
        aspect-ratio: auto;
        grid-template-rows: auto auto;
        align-content: start;
        --overlay-top: clamp(2px, 1svh, 8px);
        --title-gap: clamp(3px, 0.8svh, 7px);
    }
}

@media (max-width: 330px) {
    .hero-subtitle { display: none; }
    .product-preview-block { height: auto; max-height: none; aspect-ratio: auto; }
}

/* particles background removed */