/* ==========================================================================
   Acephal — acephal.fr home page
   Combines the ecosystem board (dark hero, domain cards) and the platform
   board (light sections). Mobile-first: base rules target phones.
   Builds on the shared design system (variables / base / components).
   ========================================================================== */

:root {
    /* Light surfaces (platform board) */
    --surface-light: #F3F7FC;
    --surface-white: var(--acephal-white);
    --line-light: #DCE5F0;
    --text-strong: var(--acephal-night);
    --text-body: var(--acephal-text-muted);
    --accent-on-light: #1565E0;    /* blue headline accent, AA on white */

    /* Financing modes reuse the ecosystem accents */
    --fund-acephal: var(--eco-eu-accent);
    --fund-owner: var(--eco-app-accent);
    --fund-crowd: var(--eco-website-accent);

    --header-height: 4.5rem;
    --radius-panel: 16px;
}

html {
    scroll-padding-top: 1rem;
}

/* ---- Shared section patterns ------------------------------------------- */
.section {
    padding-block: var(--space-8);
}

.section--light {
    background: var(--surface-light);
    color: var(--text-strong);
}

.section--white {
    background: var(--surface-white);
    color: var(--text-strong);
}

.section-eyebrow {
    margin-bottom: var(--space-3);
    color: var(--acephal-cyan);
}

.section--light .section-eyebrow,
.section--white .section-eyebrow {
    color: var(--text-body);
}

.section-title {
    font-size: clamp(1.75rem, 7vw, 3rem);
    font-weight: var(--weight-bold);
    line-height: 1.12;
    letter-spacing: -0.01em;
}

.section-title span {
    color: var(--acephal-cyan);
}

.section--light .section-title span,
.section--white .section-title span {
    color: var(--accent-on-light);
}

.section-text {
    margin-top: var(--space-4);
    max-width: 38rem;
    line-height: 1.6;
}

.section--light .section-text,
.section--white .section-text {
    color: var(--text-body);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

/* Labels stay on one line: a long button takes its own row instead. */
.actions .button {
    flex: 1 1 14rem;
    white-space: nowrap;
}

.button--ghost {
    border: 1px solid color-mix(in srgb, var(--acephal-white) 60%, transparent);
    background: transparent;
}

.button--ghost:hover {
    box-shadow: none;
    background: color-mix(in srgb, var(--acephal-white) 10%, transparent);
}

/* ---- Top: header + hero over the landscape ----------------------------- */
.top {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--acephal-night);
}

.top__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 80% bottom;
}

/* Network constellation (assets/images/constellation.svg): same size and framing as the
   photo (it also has the .top__bg / .cta-band__bg class), drawn above the darkening
   overlay (::before) and below the content. */
.top__stars,
.cta-band__stars {
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;   /* discreet: the network supports the landscape, it must not flash */
}

/* The constellation is drawn in blue: shift it towards each site's colour. */
:root[data-domain="fr"] :is(.top__stars, .cta-band__stars) { filter: hue-rotate(-18deg); }
:root[data-domain="app"] :is(.top__stars, .cta-band__stars) { filter: hue-rotate(55deg); }
:root[data-domain="website"] :is(.top__stars, .cta-band__stars) { filter: hue-rotate(-50deg); }
:root[data-domain="pro"] :is(.top__stars, .cta-band__stars) { filter: hue-rotate(-170deg) saturate(1.3); }

/* Readable text on phones: darker top, landscape visible at the bottom. */
.top::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to bottom,
            color-mix(in srgb, var(--acephal-night-deep) 80%, transparent) 0%,
            color-mix(in srgb, var(--acephal-night-deep) 55%, transparent) 55%,
            color-mix(in srgb, var(--acephal-night-deep) 20%, transparent) 80%,
            var(--acephal-night-deep) 100%);
}

/* Compact header (inner pages): the landscape is enlarged and anchored left so the
   "A" on the rock (right ~20% of the image) stays out of frame, and the overlay is
   even so the menu reads well everywhere. */
.top--compact .top__bg {
    right: auto;
    width: 155%;
    max-width: none;
    object-position: left bottom;
}

.top--compact::before {
    background: linear-gradient(to bottom,
        color-mix(in srgb, var(--acephal-night-deep) 82%, transparent) 0%,
        color-mix(in srgb, var(--acephal-night-deep) 60%, transparent) 70%,
        color-mix(in srgb, var(--acephal-night-deep) 85%, transparent) 100%);
}

/* Header */
.site-header {
    position: relative;
    z-index: 10;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: var(--header-height);
    padding-block: var(--space-3);
}

.brand--nav {
    --brand-mark-size: 2.6rem;
    --brand-name-size: 1.45rem;
    --brand-tagline-size: 0.5rem;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--acephal-line);
    border-radius: 10px;
    background: transparent;
    color: var(--acephal-white);
    cursor: pointer;
}

.nav-toggle__close {
    display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__open {
    display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__close {
    display: block;
}

/* Without JavaScript the navigation simply wraps under the logo. */
.site-header__inner {
    flex-wrap: wrap;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-5);
}

.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-5);
}

.site-nav__list a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.95rem;
    font-weight: var(--weight-medium);
    text-decoration: none;
}

.site-nav__list a:hover {
    color: var(--acephal-cyan);
}

/* With JavaScript (phones): collapsible panel under the header. */
.js .nav-toggle {
    display: grid;
}

.js .site-header__inner {
    flex-wrap: nowrap;
}

.js .site-nav {
    position: absolute;
    top: 100%;
    left: var(--gutter);
    right: var(--gutter);
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4) var(--space-5) var(--space-5);
    border: 1px solid var(--acephal-line);
    border-radius: var(--radius-panel);
    background: var(--acephal-night);
    box-shadow: var(--shadow-card);
}

.js .site-nav.is-open {
    display: flex;
}

.js .site-nav__list {
    flex-direction: column;
}

.js .site-nav__list a {
    width: 100%;
    min-height: 48px;
    border-bottom: 1px solid var(--acephal-line);
    font-size: 1.05rem;
}

.js .site-nav__cta {
    margin-top: var(--space-3);
}

/* Hero */
.hero-home {
    padding-block: var(--space-6) 4.5rem;
}

.hero-home__eyebrow {
    font-size: 0.72rem;
    line-height: 1.7;
    color: var(--acephal-gray);
}

.hero-home__main .accent-rule {
    margin-block: var(--space-4) var(--space-5);
}

/* Large but not massive: semibold, at most 3rem (user feedback 2026-10-03). */
.hero-home__title {
    font-size: clamp(1.65rem, 6vw, 3rem);
    font-weight: var(--weight-semibold);
    line-height: 1.08;
    letter-spacing: -0.01em;
}

.hero-home__title span {
    color: var(--acephal-cyan);
}

.hero-home__lead {
    margin-top: var(--space-5);
    max-width: 30rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--acephal-gray);
}

.hero-home__lead strong {
    font-weight: var(--weight-semibold);
    color: var(--acephal-cyan);
}

/* Editorial lists are hidden on phones: they would cover the summit mark. */
.hero-home__aside {
    display: none;
}

/* ---- Platform ---------------------------------------------------------- */
.platform {
    display: grid;
    gap: var(--space-6);
}

.platform__lead {
    margin-top: var(--space-4);
    font-size: 1.1rem;
    font-weight: var(--weight-semibold);
}

/* Pill-styled link to the project submission page. */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    align-self: flex-start;
    gap: var(--space-2);
    min-height: 44px;
    margin-top: var(--space-5);
    padding: 0.45rem 1rem;
    border: 1px solid var(--accent-on-light);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    color: var(--accent-on-light);
    transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.status-pill::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}

.status-pill:hover,
.status-pill:focus-visible {
    background: var(--accent-on-light);
    color: var(--acephal-white);
}

/* Project journey: Idée > Planifier > ... > Une réalité */
.journey {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    padding: 0;
    list-style: none;
    font-size: 0.72rem;
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--text-strong);
}

.journey li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.journey li + li::before {
    content: "\203A";
    color: var(--accent-on-light);
    letter-spacing: 0;
}

.journey li:last-child {
    color: var(--accent-on-light);
}

.subsection-title {
    margin-block: var(--space-7) var(--space-5);
    font-size: 1.25rem;
    font-weight: var(--weight-semibold);
}

.fund-grid {
    display: grid;
    gap: var(--space-4);
}

.fund-card {
    --fund: var(--fund-acephal);
    position: relative;
    overflow: hidden;
    padding: var(--space-6) var(--space-5);
    border: 1px solid var(--line-light);
    border-radius: var(--radius-panel);
    background: var(--surface-white);
    box-shadow: 0 14px 34px -26px color-mix(in srgb, var(--acephal-night) 60%, transparent);
}

/* Soft corner glow in the mode's accent, echoing the board's prisms. */
.fund-card::after {
    content: "";
    position: absolute;
    right: -2.5rem;
    bottom: -2.5rem;
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--fund) 22%, transparent), transparent 70%);
}

.fund-card--owner { --fund: var(--fund-owner); }
.fund-card--crowd { --fund: var(--fund-crowd); }

.fund-card__num {
    position: absolute;
    top: var(--space-5);
    right: var(--space-5);
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--fund) 12%, transparent);
    font-size: 0.8rem;
    font-weight: var(--weight-bold);
    color: var(--fund);
}

.fund-card__icon {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 14px;
    background: color-mix(in srgb, var(--fund) 12%, transparent);
    color: var(--fund);
}

.fund-card__icon .icon {
    width: 1.6rem;
    height: 1.6rem;
}

.fund-card__title {
    margin: var(--space-5) 0 0;
    font-size: 1.2rem;
    font-weight: var(--weight-bold);
}

.fund-card__text {
    margin-top: var(--space-2);
    line-height: 1.55;
    color: var(--text-body);
}

/* ---- How it works ------------------------------------------------------ */
.steps {
    display: grid;
    gap: var(--space-5);
    margin-top: var(--space-6);
    padding: 0;
    list-style: none;
}

.step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

/* Vertical timeline between icons on phones. */
.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 3.5rem;
    bottom: calc(-1 * var(--space-5) + 0.25rem);
    left: 1.6rem;
    width: 1px;
    background: var(--line-light);
}

.step__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border: 1px solid var(--line-light);
    border-radius: 50%;
    background: var(--surface-light);
    color: var(--accent-on-light);
}

.step__title {
    font-size: 1.05rem;
    font-weight: var(--weight-bold);
}

.step__num {
    margin-right: var(--space-1);
    font-size: 0.8rem;
    color: var(--accent-on-light);
}

.step__text {
    margin-top: var(--space-1);
    line-height: 1.5;
    color: var(--text-body);
}

/* ---- Values ------------------------------------------------------------ */
.values {
    display: grid;
    gap: var(--space-7);
}

.values__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6) var(--space-4);
}

.values__list li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-body);
}

.values__list strong {
    margin-top: var(--space-3);
    font-size: 0.8rem;
    font-weight: var(--weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-strong);
}

.value__icon {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    border: 1px solid var(--line-light);
    border-radius: 50%;
    background: var(--surface-white);
    color: var(--acephal-blue);
}

.value__icon .icon {
    width: 2rem;
    height: 2rem;
    stroke-width: 1.4;
}

/* ---- CTA band ---------------------------------------------------------- */
.cta-band {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: var(--space-8);
    background: var(--acephal-night);
}

.cta-band__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 80% bottom;
}

.cta-band::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--acephal-night-deep) 72%, transparent);
}

.cta-band .section-text {
    color: var(--acephal-gray);
}

/* ---- Footer bottom bar ------------------------------------------------- */
.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--acephal-line);
    font-size: 0.8rem;
    color: color-mix(in srgb, var(--acephal-gray) 75%, transparent);
}

.footer-bottom__nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-5);
}

.footer-bottom__nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
}

.footer-bottom__nav a:hover {
    color: var(--acephal-cyan);
}

/* ==========================================================================
   Larger screens
   ========================================================================== */
@media (min-width: 600px) {
    .actions .button {
        flex: 0 0 auto;
    }

    .fund-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .values__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

@media (min-width: 1024px) {
    .brand--nav {
        --brand-mark-size: 3.2rem;
        --brand-name-size: 1.9rem;
        --brand-tagline-size: 0.58rem;
    }

    .top::before {
        background:
            linear-gradient(to bottom, transparent 75%, var(--acephal-night-deep) 100%),
            linear-gradient(90deg,
                color-mix(in srgb, var(--acephal-night-deep) 75%, transparent) 0%,
                color-mix(in srgb, var(--acephal-night-deep) 35%, transparent) 45%,
                transparent 65%);
    }

    .top__bg {
        object-position: right bottom;
    }

    .hero-home {
        padding-block: var(--space-7) 7rem;
    }

    .hero-home__inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--space-7);
    }

    .hero-home__aside {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: var(--space-8);
    }

    .platform {
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
        align-items: center;
    }

    .journey {
        flex-direction: column;
        align-items: flex-start;
        justify-self: end;
        padding-left: var(--space-5);
        border-left: 1px solid var(--line-light);
        line-height: 1.6;
    }

    .journey li {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Vertical list: the chevron points down. */
    .journey li + li::before {
        content: "\203A";
        display: inline-block;
        transform: rotate(90deg);
    }

    .steps {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: var(--space-5);
    }

    .step {
        flex-direction: column;
    }

    .step:not(:last-child)::after {
        top: 1.6rem;
        bottom: auto;
        left: 4.25rem;
        right: var(--space-2);
        width: auto;
        height: 1px;
    }

    .values {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        align-items: center;
    }

    .values__list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .cta-band__inner {
        max-width: var(--container-max);
    }
}

/* Desktop navigation: inline, no toggle. Starts at 1240px so a 1280px screen
   (about 1263px once the scrollbar is drawn) gets the full menu; tablets keep
   the menu panel. Sign-in block: css/auth.css. */
@media (min-width: 1240px) {
    .js .nav-toggle {
        display: none;
    }

    .js .site-nav,
    .site-nav {
        position: static;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--space-5);
        padding: 0;
        border: 0;
        background: none;
        box-shadow: none;
    }

    .js .site-nav__list {
        flex-direction: row;
    }

    /* The shadow keeps the links legible over the bright "A" of the landscape
       (visible when the CTA is absent: project page, or signed in). */
    .js .site-nav__list a {
        width: auto;
        min-height: 44px;
        border: 0;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.6);
        font-size: 0.95rem;
    }

    .js .site-nav__cta {
        margin-top: 0;
    }
}

/* Small desktop (1240-1439px): tighter header so menu, button and sign-in
   stay on one line next to the logo. */
@media (min-width: 1240px) and (max-width: 1439px) {
    .brand--nav {
        --brand-mark-size: 2.5rem;
        --brand-name-size: 1.4rem;
        --brand-tagline-size: 0.48rem;
        gap: 0.6rem;
    }

    .site-header__inner {
        gap: var(--space-3);
    }

    .js .site-nav,
    .site-nav {
        gap: var(--space-3);
    }

    .site-nav__list {
        gap: var(--space-1) var(--space-3);
    }

    .js .site-nav__list a {
        font-size: 0.86rem;   /* "Mon compte" follows: see css/auth.css */
    }

    .site-nav .button {
        gap: var(--space-2);
        padding-inline: 0.95rem;
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-padding-top: 0;
    }
}

/* Phones and tablets (menu toggle): the header bar (logo "A", site name, menu) stays
   fixed at the top while scrolling. js/main.js keeps its height in --site-header-h
   (space reserved above the hero, anchor offsets) and adds .is-scrolled once the page
   moves, for a solid background over the content. */
@media (max-width: 1239.98px) {
    .js .top {
        z-index: 20;   /* above the page content, which the fixed bar overlaps */
        padding-top: var(--site-header-h, var(--header-height));
    }

    .js .site-header {
        position: fixed;
        inset: 0 0 auto;
        z-index: 50;
        transition: background-color 0.2s ease, box-shadow 0.2s ease;
    }

    .js .site-header.is-scrolled {
        background: color-mix(in srgb, var(--acephal-night-deep) 94%, transparent);
        box-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(8px);
    }

    /* Long menu on a short screen: scroll inside the panel. */
    .js .site-nav {
        max-height: calc(100vh - var(--site-header-h, var(--header-height)) - var(--space-4));
        overflow-y: auto;
    }

    html {
        scroll-padding-top: calc(var(--site-header-h, var(--header-height)) + 1rem);
    }
}
