/* ==========================================================================
   Manch — the homepage.

   The layout of the homepage reference, drawn with this site's own tokens:
   the reference ships its own palette, but this page sits inside the shell's
   top bar and footer, so it uses the shell's colours rather than importing a
   second set.

   Everything is scoped under `.hp` and every class carries the `hp` prefix,
   because app.css and shell.css own the short generic names and reach this
   page too — `.grid`, `.card` and `.lede` there would all collide silently.
   ========================================================================== */

.hp {
    --hp-gutter: clamp(1rem, 3vw, 1.5rem);
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--hp-gutter);
    padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

.hp .nums { font-variant-numeric: tabular-nums; }

.hp h1,
.hp h2,
.hp h3 {
    font-family: 'Bricolage Grotesque', var(--display, system-ui), sans-serif;
    letter-spacing: -0.022em;
    line-height: 1.05;
}

/* --- the shared furniture ---------------------------------------------------- */

.hp__blk { padding-top: clamp(2.75rem, 6vw, 4rem); }

.hp__sechead {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.25rem;
    margin-bottom: 1.375rem;
}
.hp__sechead h2 {
    margin: 0;
    font-weight: 800;
    font-size: clamp(1.625rem, 3.4vw, 2.375rem);
}
.hp__sechead p {
    margin: 0.375rem 0 0;
    max-width: 58ch;
    font-size: 0.9375rem;
    color: var(--text-2);
    text-wrap: pretty;
}

.hp__more {
    flex: none;
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 1px solid var(--accent-soft);
    padding-bottom: 1px;
}
.hp__more:hover { border-bottom-color: var(--accent); }

.hp__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    font-size: 0.9375rem;
    font-weight: 700;
    color: #140702;
    text-decoration: none;
    transition: filter 0.15s var(--ease);
}
.hp__btn:hover { filter: brightness(1.08); }

.hp__btn--ghost {
    background: transparent;
    border-color: var(--line-hard);
    color: var(--text);
}
.hp__btn--ghost:hover { border-color: var(--text); filter: none; }

/* --- the stage ---------------------------------------------------------------
   Full-bleed inside a centred page: the negative margin pulls the art out to
   the gutter and the padding puts the words back where the grid is. */

.hp__hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    min-height: min(640px, 82vh);
    margin-inline: calc(var(--hp-gutter) * -1);
    padding-inline: var(--hp-gutter);
}

.hp__heroart {
    position: absolute;
    inset: 0;
    /* An explicit z-index so the layers inside stack against each other and
       not against the darkening gradient, which has to stay on top. */
    z-index: 0;
}
.hp__heroart img,
.hp__heroart video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The loop sits over the still, so the still is what shows until it plays. */
.hp__herovid { z-index: 1; }

/* Asked for less motion: the still is the stage. */
@media (prefers-reduced-motion: reduce) {
    .hp__herovid { display: none; }
}

/* Dark from the left so the headline has something to sit on, and from the
   floor so the page below joins onto it rather than starting.

   The wash clears completely by 72% rather than fading to a haze at the edge,
   so the right of the frame plays at the film's own brightness. The left two
   stops are unchanged — that is the part the headline sits on. */
.hp__hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg,
            rgba(7, 8, 10, 0.95) 0%,
            rgba(7, 8, 10, 0.74) 34%,
            rgba(7, 8, 10, 0.28) 56%,
            rgba(7, 8, 10, 0) 72%),
        linear-gradient(0deg, rgba(7, 8, 10, 0.92) 0%, transparent 32%);
}

.hp__herogrid {
    position: relative;
    z-index: 2;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    gap: 2.5rem;
    align-items: end;
    padding-block: clamp(3.5rem, 8vw, 5rem) clamp(2.25rem, 5vw, 3.5rem);
}

.hp__kicker {
    margin: 0 0 1.125rem;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: clamp(1.0625rem, 1.8vw, 1.3125rem);
    letter-spacing: -0.01em;
    color: var(--accent);
}

.hp__h1 {
    margin: 0;
    max-width: 12ch;
    font-weight: 800;
    font-size: clamp(2.5rem, 6.4vw, 5.25rem);
    line-height: 0.96;
    letter-spacing: -0.035em;
}

.hp__lede {
    margin: 1.375rem 0 1.75rem;
    max-width: 52ch;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.6;
    color: var(--text);
    text-wrap: pretty;
}

.hp__ctas { display: flex; flex-wrap: wrap; gap: 0.625rem; }

/* the plate */

.hp__now {
    position: relative;
    display: block;
    padding: 1.125rem;
    border: 1px solid var(--line-hard);
    border-radius: 10px;
    background: rgba(18, 21, 23, 0.86);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-decoration: none;
    transition: border-color 0.15s var(--ease);
}
.hp__now:hover { border-color: var(--accent); }

/* The Story's own still, standing proud of the top-right corner. Absolute so
   it can overlap the plate's edge; the kicker and the title reserve room for
   it so a long title never runs underneath. */
.hp__nowshot {
    position: absolute;
    /* Lifted clear of the plate's top-right corner, so it reads as a card
       pinned over the stage rather than part of the plate. */
    top: -3.125rem;
    right: 3.125rem;
    width: 40%;
    max-width: 200px;
    aspect-ratio: 16 / 9;
    border: 2px solid #ef4e13;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}
.hp__nowshot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hp__nowk,
.hp__nowt { padding-right: calc(40% + 0.75rem); }

.hp__nowk {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent);
}
.hp__nowk::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.hp__nowt { margin: 0.625rem 0 0.5rem; font-size: 1.625rem; }

.hp__nowm { margin: 0; font-size: 0.875rem; line-height: 1.6; color: var(--text-2); }

.hp__nowplay {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: 0.875rem;
    font-size: 0.90625rem;
    font-weight: 700;
    color: var(--text);
}
.hp__nowplay i {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #140702;
    font-style: normal;
    font-size: 0.8125rem;
}

/* --- what it promises --------------------------------------------------------- */

.hp__trust {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    border-block: 1px solid var(--line);
}
.hp__trust li {
    padding: 1.25rem 1.5rem 1.25rem 0;
    font-size: 0.90625rem;
    line-height: 1.6;
    color: var(--text-2);
}
.hp__trust li + li { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.hp__trust strong {
    display: block;
    margin-bottom: 0.125rem;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* --- the grid of new Stories -------------------------------------------------- */

.hp__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.375rem;
}

/* --- genres -------------------------------------------------------------------- */

.hp__genres {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.875rem;
}

.hp__gtile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 168px;
    padding: 1.125rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: hidden;
    text-decoration: none;
    /* The tile carries its genre's accent from the topics table rather than a
       picture, so a new genre needs no new artwork. */
    background:
        radial-gradient(120% 100% at 18% 0%, var(--gaccent) 0%, transparent 62%),
        var(--ink-700);
}
.hp__gtile:hover { border-color: var(--accent); }
.hp__gtile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(7, 8, 10, 0.9), rgba(7, 8, 10, 0.15) 70%);
}

.hp__gname,
.hp__gline { position: relative; z-index: 1; }

.hp__gname {
    display: flex;
    align-items: baseline;
    gap: 0.625rem;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text);
}
.hp__gcount { font-size: 0.75rem; font-weight: 500; letter-spacing: 0; color: var(--accent); }
.hp__gline { margin-top: 0.25rem; font-size: 0.875rem; color: var(--text-2); }

/* --- for creators -------------------------------------------------------------- */

.hp__create {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 3.5rem;
    align-items: start;
    padding: clamp(1.5rem, 4vw, 3rem);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--ink-700);
}
.hp__create h2 {
    margin: 0 0 0.875rem;
    font-weight: 800;
    font-size: clamp(1.625rem, 3.4vw, 2.375rem);
}
.hp__createp {
    margin: 0 0 1.5rem;
    max-width: 46ch;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-2);
}

.hp__steps { counter-reset: hpstep; margin: 0; padding: 0; list-style: none; }
.hp__steps li {
    counter-increment: hpstep;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 0.25rem 1rem;
    padding: 1.125rem 0;
    border-bottom: 1px solid var(--line);
}
.hp__steps li:first-child { padding-top: 0; }
.hp__steps li:last-child { border-bottom: 0; }
.hp__steps li::before {
    content: counter(hpstep);
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
}
.hp__steps h3 {
    margin: 0;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--text);
}
.hp__steps p { margin: 0; font-size: 0.90625rem; line-height: 1.65; color: var(--text-2); }

/* --- the questions -------------------------------------------------------------- */

.hp__faq {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    gap: 3rem;
}
.hp__faq h2 { margin: 0; font-weight: 800; font-size: clamp(1.625rem, 3.4vw, 2.375rem); }

.hp__q { border-bottom: 1px solid var(--line); }
.hp__q:first-child { border-top: 1px solid var(--line); }

.hp__q summary {
    position: relative;
    padding: 1.125rem 2.25rem 1.125rem 0;
    list-style: none;
    cursor: pointer;
}
.hp__q summary::-webkit-details-marker { display: none; }
.hp__q summary::after {
    content: '+';
    position: absolute;
    right: 0.25rem;
    top: 0.875rem;
    font-size: 1.5rem;
    color: var(--accent);
    transition: transform 0.2s var(--ease);
}
.hp__q[open] summary::after { transform: rotate(45deg); }

.hp__q summary h3 {
    display: inline;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.4;
    color: var(--text);
}

.hp__q p {
    margin: 0;
    padding: 0 2.25rem 1.25rem 0;
    max-width: 68ch;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-2);
}

/* --- narrower --------------------------------------------------------------------- */

@media (max-width: 1000px) {
    .hp__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hp__herogrid { grid-template-columns: minmax(0, 1fr); }
    .hp__now { max-width: 420px; }
    .hp__create,
    .hp__faq { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}

@media (max-width: 760px) {
    .hp__trust { grid-template-columns: minmax(0, 1fr); }
    .hp__trust li,
    .hp__trust li + li { padding: 0.875rem 0; border-left: 0; }
    .hp__trust li + li { border-top: 1px solid var(--line); }
    .hp__genres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hp__gtile { min-height: 130px; padding: 0.875rem; }
    .hp__gname { flex-direction: column; gap: 0; font-size: 1.1875rem; }
    .hp__gline { display: none; }
    .hp__sechead { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
    .hp__grid { grid-template-columns: minmax(0, 1fr); }
}
