/*
 * The marketing site's base: tokens, type, buttons, the editor's selection frame
 * around the big headlines, reveals on scroll, browser frames, chips and the FAQ.
 * Everything sits under .mk (the wrapper in marketing/_layout.html.twig).
 */
@layer marketing {
    .mk {
        --bg: #ffffff;
        --bg-2: #f5f5f5;
        --text: #0e1117;
        --line: #e6e6e6;
        --muted: #5c5c5c;
        --faint: #8f8f8f;
        --green: #0f9f6e;
        --f-sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
        --f-mono: "Geist Mono", ui-monospace, Menlo, monospace;
        --out: cubic-bezier(0.16, 1, 0.3, 1);
        --gl: max(16px, env(safe-area-inset-left, 0px));
        --gr: max(16px, env(safe-area-inset-right, 0px));

        color-scheme: light;
        color: var(--text);
        font: 17px / 1.6 var(--f-sans);
        overflow-x: clip;
        -webkit-font-smoothing: antialiased;
        background: #fff;

        & *,
        & *::before,
        & *::after {
            box-sizing: border-box;
        }
        & a {
            color: inherit;
        }
        & button,
        & input,
        & select {
            font: inherit;
            color: inherit;
        }
        & img {
            display: block;
            max-width: 100%;
        }
        & h1,
        & h2,
        & h3,
        & h4 {
            margin: 0;
            font-weight: 600;
            letter-spacing: -0.045em;
            line-height: 1.05;
            text-wrap: balance;
        }
        & p {
            margin: 0;
        }

        & .soft {
            color: var(--faint);
        }
        & .wrap {
            max-width: 1200px;
            margin: 0 auto;
            padding-left: var(--gl);
            padding-right: var(--gr);
        }
        & .narrow {
            max-width: 760px;
        }
        & .sec {
            padding-block: clamp(88px, 11vw, 150px);
        }
        & .bg2 {
            background: var(--bg-2);
        }
        & .head {
            text-align: center;
            max-width: 760px;
            margin: 0 auto clamp(48px, 6vw, 72px);
            display: grid;
            gap: 18px;
            justify-items: center;
        }
        & .head.left {
            text-align: left;
            justify-items: start;
            margin-left: 0;
            max-width: none;
        }
        & .head.left .h2 {
            font-size: clamp(36px, 4.8vw, 60px);
            max-width: 16ch;
        }
        & .h2 {
            font-size: clamp(34px, 4.6vw, 56px);
        }
        & .lead {
            font-size: clamp(18px, 1.6vw, 20px);
            color: var(--muted);
            max-width: 58ch;
        }
        & .ctas {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
        }
        & .note {
            font-size: 14px;
            color: var(--faint);
        }

        /* buttons: pills */
        & .btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            height: 46px;
            padding: 0 20px;
            border: 0;
            border-radius: 999px;
            font-size: 15px;
            font-weight: 500;
            text-decoration: none;
            white-space: nowrap;
            cursor: pointer;
            transition:
                background 0.2s,
                box-shadow 0.2s,
                color 0.2s;
        }
        & .btn-dark {
            background: #0a0a0a;
            color: #fff;
        }
        & .btn-dark:hover {
            background: #2b2b2b;
        }
        & .btn-light {
            background: #fff;
            color: #0a0a0a;
        }
        & .btn-line {
            background: transparent;
            box-shadow: inset 0 0 0 1px #d4d4d4;
        }
        & .btn-line:hover {
            box-shadow: inset 0 0 0 1px var(--faint);
        }
        & .btn-outline {
            height: 48px;
            padding: 0 24px;
            background: transparent;
            font-size: 16px;
            box-shadow: inset 0 0 0 1.5px #0a0a0a;
            color: #0a0a0a;
        }
        & .btn-outline:hover {
            background: #0a0a0a;
            color: #fff;
        }
        & .more {
            display: inline-flex;
            gap: 6px;
            font-size: 15px;
            font-weight: 500;
            text-decoration: none;
            color: #0a0a0a;
        }
        & .more::after {
            content: "→";
            transition: transform 0.3s var(--out);
        }
        & .more:hover::after {
            transform: translateX(3px);
        }

        /* the small label above a heading, with the logo's block mark */
        & .kicker {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            font: 500 13px / 1 var(--f-mono);
            letter-spacing: 0.02em;
            color: #0a0a0a;
        }
        & .kicker::before,
        & .sc-label::before {
            content: "";
            width: 14px;
            height: 14px;
            flex: 0 0 auto;
            border-radius: 2px;
            background:
                linear-gradient(currentColor, currentColor) 0 0 / 6px 6px no-repeat,
                linear-gradient(rgb(128 128 128 / 0.55), rgb(128 128 128 / 0.55)) 8px 0 / 6px 6px no-repeat,
                linear-gradient(currentColor, currentColor) 0 8px / 14px 6px no-repeat;
        }

        /* dark sections */
        & .dk {
            background: #000;
            color: #fff;
        }
        & .dk h1,
        & .dk .h2,
        & .dk h3 {
            letter-spacing: -0.045em;
        }
        & .dk .soft {
            color: rgb(255 255 255 / 0.45);
        }
        & .dk .kicker {
            color: rgb(255 255 255 / 0.75);
        }
        & .dk .lead,
        & .dk p {
            color: rgb(255 255 255 / 0.68);
        }

        /* the editor's selection frame around the big headlines ("Kop · H1"); its width follows the text (core.js) */
        & .sel {
            position: relative;
            padding: 0.06em 0.18em;
            width: fit-content;
            margin-inline: auto;
        }
        & .sel::before {
            content: attr(data-sel);
            position: absolute;
            left: -10px;
            top: -36px;
            padding: 6px 8px;
            border-radius: 6px 6px 6px 0;
            background: #fff;
            color: #0a0a0a;
            font: 500 11px / 1 var(--f-mono);
            letter-spacing: 0;
            text-transform: none;
            opacity: 0;
            transform: translateY(6px);
            transition:
                opacity 0.5s,
                transform 0.6s var(--out);
            transition-delay: 0.9s;
        }
        & .sel::after {
            content: "";
            position: absolute;
            inset: -10px;
            border: 1.5px solid rgb(255 255 255 / 0.75);
            border-radius: 4px;
            pointer-events: none;
            background:
                linear-gradient(#fff, #fff) 0 0 / 9px 9px no-repeat,
                linear-gradient(#fff, #fff) 100% 0 / 9px 9px no-repeat,
                linear-gradient(#fff, #fff) 0 100% / 9px 9px no-repeat,
                linear-gradient(#fff, #fff) 100% 100% / 9px 9px no-repeat;
            clip-path: inset(0 100% 100% 0);
            transition: clip-path 1s var(--out);
            transition-delay: 0.4s;
        }
        &.is-ready .sel::after {
            clip-path: inset(-4px);
        }
        &.is-ready .sel::before {
            opacity: 1;
            transform: none;
        }

        /* page entrance and reveals on scroll (core.js adds .pre to what is below the fold) */
        & [data-in] {
            animation: mk-up 0.9s var(--out) both;
            animation-delay: calc(var(--d, 0) * 1ms + 80ms);
        }
        & .rv {
            transition:
                opacity 0.9s var(--out),
                transform 1s var(--out);
            transition-delay: calc(var(--d, 0) * 1ms);
        }
        & .rv.pre {
            opacity: 0;
            transform: translateY(22px) scale(0.985);
        }
        & .rvi {
            overflow: hidden;
            clip-path: inset(0 round 16px);
            transition:
                clip-path 1s var(--out),
                transform 1.1s var(--out);
            transition-delay: calc(var(--d, 0) * 1ms);
        }
        & .rvi.pre {
            clip-path: inset(10% round 20px);
            transform: translateY(18px) scale(0.97);
        }
        & .rvi > img {
            transition: transform 1.6s var(--out);
            transition-delay: calc(var(--d, 0) * 1ms);
        }
        & .rvi.pre > img {
            transform: scale(1.14);
        }
        & [data-par] > img {
            scale: 1.1;
            will-change: translate;
        }
        & .rise .w {
            display: inline-block;
            overflow: hidden;
            vertical-align: top;
            padding-bottom: 0.08em;
            margin-bottom: -0.08em;
        }
        & .rise .w > span {
            display: inline-block;
            transition: transform 1s var(--out);
            transition-delay: calc(var(--i) * 45ms + 60ms);
        }
        & .rv.pre .rise .w > span {
            transform: translateY(108%);
        }

        /* a browser frame around a screenshot */
        & .frame {
            border-radius: 14px;
            overflow: hidden;
            background: #fff;
            border: 1px solid rgb(14 17 23 / 0.1);
            box-shadow: 0 50px 120px -60px rgb(60 40 20 / 0.45);
        }
        & .frame-bar {
            display: flex;
            align-items: center;
            gap: 7px;
            height: 34px;
            padding: 0 12px;
            background: #f6f6f8;
            border-bottom: 1px solid var(--line);
        }
        & .frame-bar i {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: #dcdde2;
        }
        & .frame-bar span {
            margin: 0 auto;
            font-size: 11px;
            color: var(--faint);
            transform: translateX(-20px);
        }
        & .frame img {
            width: 100%;
            height: auto;
            display: block;
        }

        /* filter chips */
        & .chips {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            justify-content: center;
            margin-top: 32px;
        }
        & .chips button {
            height: 38px;
            padding: 0 16px;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: #fff;
            cursor: pointer;
            font-size: 14px;
            color: var(--muted);
            transition:
                background 0.2s,
                color 0.2s,
                border-color 0.2s;
        }
        & .chips button.on {
            background: var(--text);
            border-color: var(--text);
            color: #fff;
        }

        /* FAQ */
        & .faq {
            max-width: 760px;
            margin: 0 auto;
        }
        & .q {
            border-top: 1px solid var(--line);
        }
        & .q:last-child {
            border-bottom: 1px solid var(--line);
        }
        & .q button {
            width: 100%;
            text-align: left;
            background: none;
            border: 0;
            padding: 22px 0;
            cursor: pointer;
            font-size: 18px;
            font-weight: 500;
            letter-spacing: -0.015em;
            display: flex;
            justify-content: space-between;
            gap: 24px;
            align-items: center;
        }
        & .q .pm {
            flex: 0 0 auto;
            width: 14px;
            height: 14px;
            position: relative;
        }
        & .q .pm::before,
        & .q .pm::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            top: 6px;
            height: 1.5px;
            background: var(--text);
            transition: transform 0.4s var(--out);
        }
        & .q .pm::after {
            transform: rotate(90deg);
        }
        & .q.open .pm::after {
            transform: rotate(0);
        }
        & .q .a {
            display: grid;
            grid-template-rows: 0fr;
            transition: grid-template-rows 0.5s var(--out);
        }
        & .q.open .a {
            grid-template-rows: 1fr;
        }
        & .q .a > div {
            overflow: hidden;
        }
        & .q .a p {
            padding-bottom: 24px;
            color: var(--muted);
            max-width: 62ch;
        }
        & .dk .q {
            border-color: rgb(255 255 255 / 0.12);
        }
        & .dk .q button {
            color: #f3ede6;
            font-size: clamp(20px, 2.2vw, 28px);
            padding-block: 28px;
        }
        & .dk .q .pm::before,
        & .dk .q .pm::after {
            background: #f3ede6;
        }
        & .dk .q .a p {
            color: rgb(243 237 230 / 0.7);
        }
        & .dk .faq {
            max-width: none;
        }
    }

    @keyframes mk-up {
        0% {
            opacity: 0;
            transform: translateY(14px);
        }
    }

    @media (max-width: 700px) {
        .mk .sel::before {
            display: none;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .mk *,
        .mk ::before,
        .mk ::after {
            animation-duration: 0.001ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.001ms !important;
        }
        .mk .rv.pre {
            opacity: 1;
            transform: none;
        }
        .mk .sel::after {
            clip-path: none;
        }
    }
}
