/*
 * BeneFile landing page.
 *
 * The colours are the colours of the BeneFile application: the plum of its
 * top bar, the dark teal of its menu, its teal and mint buttons, and its
 * purple accent. The page uses the fonts of the visitor's system: it makes
 * no requests to other sites.
 */

:root {
    --plum: #4c2a47;
    --plum-dark: #3a1f36;
    --purple: #b269a7;
    --teal-dark: #18454b;
    --teal-deep: #10343a;
    --teal: #00a59a;
    --teal-text: #00766e; /* The teal of the app, darker: 5.4:1 on white, for text. */
    --mint: #6ae0b4;
    --mist: #e6f4f4;
    --ink: #1f2a2e;
    --muted: #4f5d62;
    --line: #cfe3e3;
    --white: #fff;
    --radius: 0.75rem;
    --width: 72rem;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    --focus: 0.1875rem solid var(--purple);

    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 5rem;

    @media (prefers-reduced-motion: no-preference) {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    background-color: var(--white);
    color: var(--ink);
    font: 400 1.0625rem/1.6 var(--font);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3 {
    line-height: 1.15;
    text-wrap: balance;
    margin: 0 0 1rem;
}

h1 {
    font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.625rem);
    font-weight: 800;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

p {
    margin: 0 0 1rem;
    text-wrap: pretty;
}

a {
    color: var(--teal-text);
    text-underline-offset: 0.15em;
}

:focus-visible {
    outline: var(--focus);
    outline-offset: 0.1875rem;
}

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -4rem;
    z-index: 10;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    background-color: var(--plum);
    color: var(--white);
    font-weight: 700;

    &:focus {
        top: 0.5rem;
    }
}

.wrap {
    max-width: var(--width);
    margin-inline: auto;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

/* Header ------------------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: rgb(255 255 255 / 95%);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);

    .wrap {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem 1.5rem;
        padding-block: 0.625rem;
    }

    nav ul {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.25rem 1.25rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    nav a {
        color: var(--teal-dark);
        font-weight: 600;
        text-decoration: none;

        &:hover {
            color: var(--plum);
            text-decoration: underline;
        }
    }

    .lang a {
        padding: 0.25rem 0.625rem;
        border: 2px solid var(--teal-dark);
        border-radius: 2rem;
        font-size: 0.875rem;
    }

    /* On phones, only the language link stays in the bar. */
    @media (width < 48rem) {
        nav li:not(.lang) {
            display: none;
        }
    }
}

.logo img {
    width: 9.5rem;
}

/* Buttons ----------------------------------------------------------------- */

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8125rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 2rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        background-color 0.15s ease-in-out,
        color 0.15s ease-in-out;

    svg {
        width: 1.25rem;
        height: 1.25rem;
        flex-shrink: 0;
    }
}

.btn-primary {
    background-color: var(--mint);
    color: var(--teal-deep);

    &:hover {
        background-color: var(--white);
    }
}

.btn-outline {
    border-color: currentcolor;
    color: var(--white);

    &:hover {
        background-color: rgb(255 255 255 / 12%);
    }
}

.btn-plum {
    background-color: var(--plum);
    color: var(--white);

    &:hover {
        background-color: var(--plum-dark);
    }
}

/* Hero -------------------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(3rem, 7vw, 5.5rem) 0;
    background:
        radial-gradient(60rem 30rem at 85% 10%, rgb(178 105 167 / 35%), transparent 60%),
        linear-gradient(160deg, var(--teal-dark), var(--teal-deep));
    color: var(--white);

    .eyebrow {
        color: var(--mint);
    }

    .lead {
        max-width: 38rem;
        color: #d7eceb;
    }
}

.hero-text {
    max-width: 46rem;
}

.hero h1 em {
    font-style: normal;
    color: var(--mint);
}

.lead {
    font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
}

.eyebrow {
    margin-bottom: 0.75rem;
    color: var(--plum);
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* A screenshot in a browser window. */
.browser {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    background-color: var(--white);
    box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 35%);

    &::before {
        content: "";
        display: block;
        height: 1.75rem;
        background:
            radial-gradient(circle at 1rem 50%, #e0605c 0.3rem, transparent 0.32rem),
            radial-gradient(circle at 1.75rem 50%, #e9b949 0.3rem, transparent 0.32rem),
            radial-gradient(circle at 2.5rem 50%, #5fc26b 0.3rem, transparent 0.32rem),
            #eef2f2;
    }
}

.hero .browser {
    margin-top: clamp(2.5rem, 5vw, 4rem);
}

/* The animated hero (hero/, built to assets/hero/). Its stage is
   transparent: the hero's gradient is its ground, and the window runs off
   the bottom of the section. Until the script runs, a still of the same
   scene holds its place. */
.hero-demo {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    margin-top: clamp(1rem, 3vw, 2rem);
}

.hero-demo-stage {
    align-self: stretch;

    .hero-demo-poster {
        width: 100%;
        max-width: 70rem;
        margin-inline: auto;
    }

    @media (max-width: 55.75rem) {
        .hero-demo-poster {
            max-width: 26.25rem;
        }
    }
}

.hero-demo-toggle {
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    border: 0.0625rem solid rgb(255 255 255 / 45%);
    border-radius: 999px;
    background-color: transparent;
    color: var(--white);
    font: inherit;
    font-size: 0.9375rem;
    cursor: pointer;

    &:hover {
        background-color: rgb(255 255 255 / 12%);
    }

    &:focus-visible {
        outline: var(--focus);
        outline-offset: 0.1875rem;
    }
}

/* Facts ------------------------------------------------------------------- */

.facts {
    background-color: var(--plum);
    color: var(--white);

    dl {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
        gap: 1.25rem;
        margin: 0;
        padding-block: 1.75rem;
    }

    div {
        border-left: 0.25rem solid var(--purple);
        padding-left: 0.875rem;
    }

    dt {
        font-size: 1.5rem;
        font-weight: 800;
        line-height: 1.2;
    }

    dd {
        margin: 0;
        color: #ead8e7;
        font-size: 0.9375rem;
    }
}

/* Sections ---------------------------------------------------------------- */

.section {
    padding-block: clamp(3.5rem, 8vw, 6rem);

    > .wrap > header {
        max-width: 44rem;
        margin-bottom: 2.5rem;
    }
}

.section-mist {
    background-color: var(--mist);
}

.section-dark {
    background-color: var(--teal-dark);
    color: var(--white);

    .eyebrow {
        color: var(--mint);
    }

    a:not(.btn) {
        color: var(--mint);
    }
}

/* The four folders. */
.folders {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.folder {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-top: 0.375rem solid var(--teal);
    border-radius: var(--radius);
    background-color: var(--white);
    box-shadow: 0 0.25rem 1.25rem rgb(24 69 75 / 10%);

    &:nth-child(2) {
        border-top-color: var(--purple);
    }

    &:nth-child(3) {
        border-top-color: var(--plum);
    }

    &:nth-child(4) {
        border-top-color: var(--mint);
    }

    svg {
        width: 2.5rem;
        height: 2.5rem;
        margin-bottom: 1rem;
        color: var(--teal-dark);
    }

    ul {
        margin: 0;
        padding-left: 1.125rem;
        color: var(--muted);
        font-size: 0.9375rem;
    }

    li + li {
        margin-top: 0.25rem;
    }
}

/* A row: text on one side, a screenshot on the other. */
.feature {
    display: grid;
    gap: 2rem;
    align-items: center;

    & + & {
        margin-top: clamp(3rem, 7vw, 5rem);
    }

    @media (width >= 56rem) {
        grid-template-columns: 5fr 7fr;

        &.reverse {
            grid-template-columns: 7fr 5fr;
        }

        &.reverse > :first-child {
            order: 2;
        }
    }

    .browser {
        border-radius: var(--radius);
        box-shadow: 0 1rem 2.5rem rgb(24 69 75 / 18%);
    }

    ul {
        padding-left: 1.125rem;
    }

    li + li {
        margin-top: 0.375rem;
    }
}

/* Why BeneFile. */
.reasons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;

    li {
        padding: 1.5rem;
        border-top: 0.25rem solid var(--purple);
        border-radius: var(--radius);
        background-color: var(--mist);
    }

    h3 {
        margin-top: 0;
    }

    p:last-child {
        margin-bottom: 0;
    }
}

/* The roles. */
.roles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;

    li {
        padding: 1.25rem;
        border: 1px solid rgb(255 255 255 / 20%);
        border-radius: var(--radius);
        background-color: rgb(255 255 255 / 6%);
    }

    strong {
        display: block;
        margin-bottom: 0.25rem;
        color: var(--mint);
        font-size: 1.0625rem;
    }

    span {
        color: #d7eceb;
        font-size: 0.9375rem;
    }
}

/* The gallery of screens. */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    gap: 1.75rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;

    figure {
        margin: 0;
    }

    a {
        display: block;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: 0 0.25rem 1rem rgb(24 69 75 / 10%);

        &:hover img {
            transform: scale(1.02);
        }
    }

    img {
        aspect-ratio: 16 / 10;
        object-fit: cover;
        object-position: top left;
        transition: transform 0.2s ease-in-out;

        @media (prefers-reduced-motion: reduce) {
            transition: none;
        }
    }

    figcaption {
        margin-top: 0.625rem;
        color: var(--muted);
        font-size: 0.9375rem;

        strong {
            display: block;
            color: var(--ink);
        }
    }
}

.note {
    margin-top: 2rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

/* Get started. */
.steps {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;

    @media (width >= 56rem) {
        grid-template-columns: repeat(3, 1fr);
    }

    > li {
        counter-increment: step;
        padding: 1.5rem;
        border-radius: var(--radius);
        background-color: var(--white);
        box-shadow: 0 0.25rem 1.25rem rgb(24 69 75 / 10%);

        &::before {
            content: counter(step);
            display: grid;
            place-items: center;
            width: 2.25rem;
            height: 2.25rem;
            margin-bottom: 0.875rem;
            border-radius: 50%;
            background-color: var(--plum);
            color: var(--white);
            font-weight: 800;
        }
    }
}

pre {
    margin: 0.75rem 0 0;
    padding: 0.875rem 1rem;
    overflow-x: auto;
    border-radius: 0.5rem;
    background-color: var(--teal-deep);
    color: #e3f5f2;
    font-size: 0.875rem;
    line-height: 1.5;
}

code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

.callout {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    border-left: 0.375rem solid var(--purple);
    border-radius: 0 var(--radius) var(--radius) 0;
    background-color: var(--white);

    p:last-child {
        margin-bottom: 0;
    }
}

/* Cookie consent (_consent/): the banner and the dialog in the colours of BeneFile.
 * This file loads after consent.css, so these values win, also in dark mode. */

:root {
    --scc-bg: var(--white);
    --scc-surface-2: var(--mist);
    --scc-border: var(--line);
    --scc-text: var(--ink);
    --scc-dim: var(--muted);
    --scc-accent: var(--plum);
    --scc-on-accent: var(--white);
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
    padding-block: 2.5rem;
    background-color: var(--teal-deep);
    color: #c9dfdd;
    font-size: 0.9375rem;

    .wrap {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 1rem 2rem;
    }

    p {
        margin: 0;
    }

    a,
    .footer-link {
        color: var(--white);
    }

    .footer-link {
        padding: 0;
        border: 0;
        background: none;
        font: inherit;
        text-decoration: underline;
        text-underline-offset: 0.15em;
        cursor: pointer;
    }
}
