/* The landing of www. (templates/public/home.html.twig). Colors from tokens.css only. */

.landing-eyebrow,
.landing-mono {
    margin: 0;
    color: var(--ink-muted);
    font: 400 13px/20px var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* The eyebrow names the section in the color of the action */
.landing-eyebrow {
    color: var(--brand);
    font: 600 14px/20px var(--font-sans);
}

/* display-lg (32/40) on a phone, up to 56/60 on a wide screen */
.landing-title {
    max-width: 16ch;
    margin: var(--space-3) 0 var(--space-5);
    font-size: 32px;
    line-height: 40px;
    letter-spacing: -0.01em;
    text-wrap: balance;

    @media (min-width: 768px) {
        font-size: 44px;
        line-height: 48px;
    }

    @media (min-width: 1200px) {
        font-size: 56px;
        line-height: 60px;
        letter-spacing: -0.02em;
    }
}

.landing-h2 {
    max-width: 44rem;
    margin: 0;
    font-size: 28px;
    line-height: 36px;
    text-wrap: balance;

    @media (min-width: 768px) {
        font-size: 36px;
        line-height: 44px;
        letter-spacing: -0.01em;
    }
}

.landing-h3 {
    display: block;
    margin: 0;
    font: 600 20px/28px var(--font-display);
    text-wrap: balance;
}

/* A file name reads in mono */
.landing-h3--file {
    font: 500 17px/26px var(--font-mono);
    overflow-wrap: anywhere;
}

.landing-lead {
    max-width: 40rem;
    margin: 0;
    color: var(--ink-muted);
    font-size: 17px;
    line-height: 28px;
    text-wrap: pretty;

    @media (min-width: 768px) {
        font-size: 18px;
        line-height: 30px;
    }
}

/* Hero: the text and its actions, the validated poster beside them from 992px, under them below */
.landing-hero {
    padding-block: var(--space-7) var(--space-8);
    overflow: clip;

    @media (min-width: 992px) {
        padding-block: var(--space-8) calc(var(--space-8) + var(--space-5));
    }
}

.landing-hero__grid {
    display: grid;
    align-items: center;
    gap: var(--space-8) var(--space-8);

    @media (min-width: 992px) {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    }
}

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

.landing-note {
    margin: var(--space-5) 0 0;
    color: var(--ink-muted);
    font-size: 14px;
    line-height: 20px;
}

/* The poster on a soft brand ground set off its corner, a pin, the client's comment and her validation in chips */
.landing-hero__poster {
    position: relative;
    justify-self: center;
    width: min(calc(100% - 2 * var(--space-6)), 340px);

    &::before {
        content: "";
        position: absolute;
        inset: var(--space-6) calc(var(--space-6) * -1) calc(var(--space-6) * -1) var(--space-6);
        border-radius: calc(var(--radius-lg) * 2);
        background: var(--brand-soft);
    }
}

.landing-hero__image {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.landing-hero__marks {
    position: absolute;
    inset: 0;
}

.landing-chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    max-width: 15rem;
    margin: 0;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-md);
    font-size: 13px;
    line-height: 18px;
}

.landing-chip--comment {
    top: 12%;
    right: calc(var(--space-5) * -1);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;

    @media (min-width: 576px) {
        right: calc(var(--space-8) * -1);
    }
}

.landing-chip--validated {
    bottom: 8%;
    left: calc(var(--space-5) * -1);
    white-space: nowrap;

    @media (min-width: 576px) {
        left: calc(var(--space-8) * -1.25);
    }
}

/* The page opens in beats: the text, then the poster */
@media (prefers-reduced-motion: no-preference) {
    .landing-hero__text > *,
    .landing-hero__poster {
        animation: landing-rise 250ms ease-out both;
    }

    .landing-hero__text > :nth-child(2) {
        animation-delay: 60ms;
    }

    .landing-hero__text > :nth-child(n + 3) {
        animation-delay: 120ms;
    }

    .landing-hero__poster {
        animation-delay: 180ms;
    }
}

@keyframes landing-rise {
    from {
        opacity: 0;
        transform: translateY(var(--space-3));
    }
}

/* Sections and bands */
.landing-section {
    padding-block: var(--space-8);

    @media (min-width: 992px) {
        padding-block: calc(var(--space-8) + var(--space-5));
    }
}

.landing-band {
    background: var(--surface-sunken);
}

/* The memory band carries data-bs-theme="dark": the dark tokens apply inside it, in both page themes */
.landing-band--dark {
    background: var(--surface-sunken);
    color: var(--ink);
}

.landing-head {
    display: grid;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

/* Cards of three: the pains, the memories, the AI, the data */
.landing-cards {
    display: grid;
    gap: var(--space-4);

    @media (min-width: 768px) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-5);
    }
}

.landing-card {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: var(--space-2);
    padding: var(--space-5);

    & p {
        margin: 0;
        text-wrap: pretty;
    }
}

.landing-card__label {
    font: 600 13px/18px var(--font-sans);
}

.landing-card__label--pain {
    color: var(--danger);
}

/* The cycle: its head, the bar of steps stuck at the top, then one chapter per step */
.landing-cycle {
    padding-top: var(--space-8);

    @media (min-width: 992px) {
        padding-top: calc(var(--space-8) + var(--space-5));
    }

    & > .container-xl > .landing-head {
        margin-bottom: var(--space-5);
    }
}

.landing-steps {
    position: sticky;
    top: var(--cb-env-banner-height, 0px);
    z-index: 2;
    padding-block: var(--space-3);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(6px);
}

/* The current step fills its half bar as it takes the turn */
.landing-steps .cb-steps__step--current .cb-steps__bar::before {
    transition: width 250ms ease-out;

    @starting-style {
        width: 0;
    }
}

/*
 * A chapter: the text, then the screen. From 992px, two columns, the screen wider; one chapter in two puts the screen on
 * the left. Below, one column, the text first.
 */
.landing-chapter {
    display: grid;
    align-items: center;
    gap: var(--space-6);
    padding-block: var(--space-7) var(--space-8);

    @media (min-width: 992px) {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        gap: var(--space-8);
        padding-block: calc(var(--space-8) + var(--space-3));
    }
}

.landing-chapter--reverse {
    @media (min-width: 992px) {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);

        & > .landing-chapter__text {
            order: 2;
        }
    }
}

.landing-chapter__text {
    display: grid;
    gap: var(--space-3);

    & > p {
        max-width: 34rem;
        margin: 0;
        color: var(--ink-muted);
        font-size: 17px;
        line-height: 27px;
        text-wrap: pretty;
    }
}

.landing-chapter__title {
    margin: 0;
    font: 600 28px/34px var(--font-display);
    text-wrap: balance;

    @media (min-width: 768px) {
        font-size: 32px;
        line-height: 38px;
    }
}

.landing-tag {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.landing-tag__number {
    color: var(--brand);
    font: 600 15px/20px var(--font-mono);
}

.landing-tag__turn {
    padding: 2px var(--space-3);
    border-radius: var(--radius-pill);
    font: 500 12px/20px var(--font-sans);
}

.landing-tag__turn--client {
    background: var(--info-soft);
    color: var(--info);
}

.landing-tag__turn--team {
    background: var(--brand-soft);
    color: var(--brand);
}

/* The ground behind a screen says who acts: the client, the team, the AI */
.landing-shot {
    position: relative;
    min-width: 0;
    margin: var(--space-4);
    container-type: inline-size;

    &::before {
        content: "";
        position: absolute;
        inset: calc(var(--space-4) * -1);
        border-radius: calc(var(--radius-lg) * 2);
        background: var(--brand-soft);

        @media (min-width: 768px) {
            inset: calc(var(--space-6) * -1);
        }
    }

    @media (min-width: 768px) {
        margin: var(--space-6);
    }

    .landing-chapter--client > &::before {
        background: var(--info-soft);
    }

    .landing-chapter--ai > &::before {
        background: linear-gradient(135deg, var(--ai-soft-start), var(--ai-soft-end));
    }

    & > .landing-window {
        position: relative;
        box-shadow: var(--shadow-md);
    }
}

/* A screen climbs into place as it enters the viewport, where the browser ties animations to scrolling */
@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        .landing-shot > .landing-window {
            animation: landing-climb linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 60%;
        }
    }
}

@keyframes landing-climb {
    from {
        opacity: 0.4;
        transform: translateY(var(--space-6));
    }
}

/* A product screen: an inert card, built with the classes of the app */
.landing-window {
    overflow: hidden;

    & .card-title {
        margin: 0;
    }
}

.landing-window__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
}

.landing-window__body {
    display: grid;
    gap: var(--space-3);

    & p {
        margin: 0;
    }
}

.landing-window__foot {
    display: flex;
    justify-content: flex-end;
}

/* Two cards in one screen, one under the other: the brief and its files */
.landing-pair {
    display: grid;
    gap: var(--space-3);
    overflow: visible;
}

/* The visual and its panel side by side once the screen is wide enough, the visual on top below */
.landing-split {
    display: grid;
    gap: var(--space-3);
    overflow: visible;

    @container (min-width: 560px) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
        align-items: start;
    }

    & > .landing-visual {
        border: 1px solid var(--line);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
    }
}

/* The brief as the app renders its Markdown: a heading, then the text */
.landing-brief {
    display: grid;
    gap: var(--space-1);
    font-size: 14px;
    line-height: 22px;

    & p {
        margin: 0;
    }
}

.landing-brief__heading {
    font: 600 15px/22px var(--font-display);
}

/* The client's request, as its field shows it once typed */
.landing-field {
    padding: var(--space-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    font-size: 15px;
    line-height: 23px;
}

/* Files in lines: the tile of the extension, the name, the size */
.landing-files {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;

    & li {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        min-width: 0;
        font-size: 14px;
        line-height: 20px;
    }

    & li > :nth-child(2) {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* The page of a file: the files of the project on the sunken ground, the open file beside them on a wide screen */
.landing-bench {
    display: grid;

    @container (min-width: 520px) {
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    }
}

.landing-bench__nav {
    display: grid;
    align-content: start;
    gap: 2px;
    background: var(--surface-sunken);
}

.landing-bench__work {
    display: grid;
    align-content: start;
    gap: var(--space-3);
    padding: var(--space-4);
}

/* A version as the viewer shows it: the poster on the sunken ground, its pins on the sheet */
.landing-visual {
    display: grid;
    place-items: center;
    padding: var(--space-5);
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
}

.landing-visual__sheet {
    position: relative;
    width: min(100%, 280px);

    & img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-md);
    }
}

.landing-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    margin: var(--space-6) 0 0;
    padding: 0;
    list-style: none;

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

/* The two libraries side by side from 992px: the client's, the agency's; then the memories under both */
.landing-libraries {
    display: grid;
    gap: var(--space-7) var(--space-6);

    @media (min-width: 992px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.landing-library {
    display: grid;
    align-content: start;
    gap: var(--space-3);

    & > p {
        max-width: 62ch;
        margin: 0;
        text-wrap: pretty;
    }

    & > .landing-window {
        margin-top: var(--space-2);
    }
}

.landing-memories {
    display: grid;
    gap: var(--space-5);
    margin-top: var(--space-8);
}

/* A memory of the library: its author, the sentence, where it comes from */
.landing-memory {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);

    & > div {
        display: grid;
        min-width: 0;
        font-size: 13px;
        line-height: 20px;
    }

    & strong {
        font-size: 14px;
        font-weight: 600;
    }

    & span {
        color: var(--ink-muted);
    }

    & > .cb-author {
        flex: none;
    }
}

/* The questions: one card each, the answer under its question */
.landing-faq {
    display: grid;
    gap: var(--space-3);
    max-width: 760px;

    & details {
        display: block;
        justify-items: normal;
        padding: var(--space-4) var(--space-5);
    }

    & summary {
        display: flex;
        justify-content: space-between;
        gap: var(--space-4);
        font: 600 17px/24px var(--font-display);
        list-style: none;
        cursor: pointer;

        &::-webkit-details-marker {
            display: none;
        }

        &::after {
            content: "+";
            color: var(--ink-muted);
            font-family: var(--font-mono);
        }
    }

    & details[open] summary::after {
        content: "\2212";
    }

    & p {
        margin: var(--space-3) 0 0;
    }
}

/* The closing band, in the color of the action; its link takes the inverse colors, without being the page's brand button */
.landing-final {
    padding-block: calc(var(--space-8) + var(--space-5));
    background: var(--brand);
    color: var(--on-brand);
    text-align: center;

    & .container-xl {
        display: grid;
        justify-items: center;
        gap: var(--space-4);
    }

    & .landing-h2 {
        color: inherit;
    }

    & p {
        max-width: 40rem;
        margin: 0;
        font-size: 18px;
        line-height: 28px;
        opacity: 0.85;
    }
}

.landing-final__action {
    --tblr-btn-bg: var(--on-brand);
    --tblr-btn-color: var(--brand);
    --tblr-btn-border-color: var(--on-brand);
    --tblr-btn-hover-bg: var(--surface-raised);
    --tblr-btn-hover-color: var(--brand-hover);
    --tblr-btn-hover-border-color: var(--surface-raised);
    --tblr-btn-active-bg: var(--surface-raised);
    --tblr-btn-active-color: var(--brand-hover);

    margin-top: var(--space-3);

    &,
    &:hover,
    &:focus,
    &:active {
        text-decoration: none;
    }
}
