/*
 * Uplift: six full-screen scenes, moved through by clicking a swarm of ink specks.
 *
 * Everything is sized in --u, one unit of a 1200 x 750 artboard, so the layout
 * keeps its proportions on any screen. Without JavaScript (no .js on <html>)
 * the scenes simply stack into a normal scrolling page.
 */

:root {
    --bg: #0D0D0B;
    --fg: #F1ECDF;
    --dim: rgba(241, 236, 223, 0.62);
    --line: rgba(241, 236, 223, 0.18);
    --accent: #FF5A3C;
    --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mono: "JetBrains Mono", Menlo, Monaco, "Courier New", monospace;
    --u: clamp(0.7px, min(100vw / 1200, 100vh / 750), 1.5px);
    /* Headline scale; phones shrink it. */
    --h: 1;
}

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

html {
    background: var(--bg);
    color: var(--fg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd {
    margin: 0;
    padding: 0;
}

ul, ol {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Type ------------------------------------------------------------------- */

h1, h2, h3 {
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1.04;
}

h2 {
    font-size: calc(var(--u) * 42 * var(--h));
}

.display {
    font-size: calc(var(--u) * 88 * var(--h));
    line-height: 0.96;
    white-space: nowrap;
}

.display.yalla {
    font-size: calc(var(--u) * 108 * var(--h));
    line-height: 1;
}

.statement {
    font-size: calc(var(--u) * 35 * var(--h));
    line-height: 1.12;
}

.statement em {
    font-style: normal;
    color: var(--accent);
}

.clients-title {
    font-size: calc(var(--u) * 37 * var(--h));
}

.best-title {
    font-size: calc(var(--u) * 50 * var(--h));
}

.tag {
    font-family: var(--mono);
    font-size: max(10.5px, calc(var(--u) * 11));
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: calc(var(--u) * 15);
}

.lead {
    font-size: max(16px, calc(var(--u) * 20));
    line-height: 1.35;
    margin-top: calc(var(--u) * 24);
}

.sub {
    font-size: max(15px, calc(var(--u) * 18));
    color: var(--dim);
    margin-top: calc(var(--u) * 9);
}

.body {
    font-size: max(14px, calc(var(--u) * 15));
    color: var(--dim);
    margin-top: calc(var(--u) * 16);
}

.hint {
    margin: calc(var(--u) * 31) 0 0;
}

.hint-tap {
    display: none;
}

@media (hover: none) {
    .hint-click {
        display: none;
    }

    .hint-tap {
        display: inline;
    }
}

/* Scene content ---------------------------------------------------------- */

.steps {
    margin-top: calc(var(--u) * 22);
}

.steps li {
    display: grid;
    grid-template-columns: calc(var(--u) * 40) minmax(0, 1fr);
    padding: calc(var(--u) * 12) 0;
    border-top: 1px solid var(--line);
}

.steps .tag {
    margin: 0;
    padding-top: calc(var(--u) * 7);
}

.steps h3 {
    font-size: max(18px, calc(var(--u) * 23));
}

.steps p {
    font-size: max(13.5px, calc(var(--u) * 14));
    line-height: 1.42;
    color: var(--dim);
    margin-top: calc(var(--u) * 4);
}

.stats {
    display: flex;
    gap: calc(var(--u) * 40);
    margin: calc(var(--u) * 22) 0 0;
}

/* The label comes first in the markup and is shown under its number. */
.stats > div {
    display: flex;
    flex-direction: column-reverse;
}

.stats dd {
    font-size: calc(var(--u) * 59 * var(--h));
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1;
}

.stats .tag {
    color: var(--fg);
    margin: calc(var(--u) * 6) 0 0;
}

.clients {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: calc(var(--u) * 26);
    margin-top: calc(var(--u) * 20);
}

.clients li {
    font-size: max(15px, calc(var(--u) * 20));
    letter-spacing: -0.02em;
    padding: calc(var(--u) * 8) 0;
    border-top: 1px solid var(--line);
}

.soon {
    font-family: var(--mono);
    font-size: max(9.5px, calc(var(--u) * 10));
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    vertical-align: middle;
    margin-left: 6px;
}

.price {
    font-size: max(16px, calc(var(--u) * 20));
    margin-top: calc(var(--u) * 10);
}

.best {
    margin-top: calc(var(--u) * 18);
}

.best li {
    font-size: max(15px, calc(var(--u) * 16));
    padding: calc(var(--u) * 10) 0;
    border-top: 1px solid var(--line);
}

.contact-list {
    margin-top: calc(var(--u) * 22);
}

.contact-list li {
    display: grid;
    grid-template-columns: calc(var(--u) * 72) minmax(0, 1fr);
    align-items: baseline;
    padding: calc(var(--u) * 12) 0;
    border-top: 1px solid var(--line);
}

.contact-list .tag {
    margin: 0;
}

.contact-list a {
    font-size: max(20px, calc(var(--u) * 29));
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.contact-list a:hover {
    color: var(--accent);
}

/* Bars ------------------------------------------------------------------- */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: max(20px, calc(var(--u) * 24));
    font-weight: 700;
    letter-spacing: -0.045em;
}

.logo img {
    width: auto;
    height: max(26px, calc(var(--u) * 30));
}

.pill {
    display: flex;
    align-items: center;
    height: max(36px, calc(var(--u) * 40));
    padding: 0 max(18px, calc(var(--u) * 22));
    border-radius: 980px;
    background: var(--accent);
    color: var(--bg);
    font-size: max(14px, calc(var(--u) * 15));
    font-weight: 700;
}

/* Scrolling page: what you get without JavaScript ------------------------- */

.swarm,
.zone,
.bottom-bar,
.hint {
    display: none;
}

.js .hint {
    display: block;
}

.stage {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

.scene {
    padding: 64px 0;
}

.scene + .scene {
    border-top: 1px solid var(--line);
}

/* Click-through scenes ---------------------------------------------------- */

.js,
.js body {
    height: 100%;
    overflow: hidden;
    /* Stops a downward swipe on the first scene from pulling the page to refresh. */
    overscroll-behavior: none;
}

.js .swarm {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.js .top-bar {
    position: fixed;
    z-index: 2;
    top: max(14px, calc(var(--u) * 24));
    left: max(20px, calc(var(--u) * 44));
    right: max(20px, calc(var(--u) * 44));
    padding: 0;
}

.js .stage {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: calc(var(--u) * 430) minmax(0, 1fr);
    column-gap: calc(var(--u) * 46);
    max-width: calc(var(--u) * 1560);
    margin: 0 auto;
    padding: max(64px, calc(var(--u) * 78)) calc(var(--u) * 64) max(52px, calc(var(--u) * 58));
}

/* All six scenes share one grid cell; only the active one is shown. */
.js .copy {
    display: grid;
    min-height: 0;
}

.js .scene {
    grid-area: 1 / 1;
    align-self: center;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
    padding: 0;
    border: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(var(--u) * 14));
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
}

/* The new scene waits for the specks to burst before it fades in. */
.js .scene.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.5s ease 0.45s, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.45s, visibility 0s 0.45s;
}

/* The swarm shows these, so the text copies are only for screen readers here. */
.js .swarm-alt {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.js .zone {
    display: block;
    position: relative;
    min-height: 0;
    /* Set by script.js: screen pixels per unit of the swarm's own coordinates. */
    --s: 1;
}

.zone-hit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
}

/* Labels sit at swarm coordinates, measured from the centre of the zone. */
.zone-labels {
    position: absolute;
    left: 50%;
    top: 50%;
    pointer-events: none;
}

.zone-group {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.zone-group.is-active {
    opacity: 1;
    transition: opacity 0.5s ease 0.6s;
}

.zone-number,
.zone-caption {
    position: absolute;
    left: calc(var(--s) * var(--x) * 1px);
    top: calc(var(--s) * var(--y) * 1px);
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.zone-number {
    font-size: calc(var(--s) * 34px);
    font-weight: 500;
    letter-spacing: -0.03em;
}

.zone-caption {
    font-family: var(--mono);
    font-size: max(9px, calc(var(--s) * 12px));
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dim);
}

.js .bottom-bar {
    display: flex;
    align-items: center;
    position: fixed;
    z-index: 2;
    left: max(20px, calc(var(--u) * 44));
    right: max(20px, calc(var(--u) * 44));
    bottom: max(10px, calc(var(--u) * 14));
    font-family: var(--mono);
    font-size: max(10.5px, calc(var(--u) * 12));
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.counter {
    flex: 1;
    white-space: nowrap;
}

.counter-name {
    margin-left: 14px;
    opacity: 0.6;
}

.dots {
    display: flex;
    align-items: center;
}

/* Each dot is a 24px-tall target with the visible dot drawn inside it. */
.dots a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 4px;
}

.dots a::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--fg);
    opacity: 0.35;
    transition: width 0.3s ease, opacity 0.3s ease;
}

.dots a:hover::before {
    opacity: 0.7;
}

.dots a[aria-current="true"]::before {
    width: 26px;
    opacity: 1;
}

.next {
    flex: 1;
    padding: 6px 0;
    border: 0;
    background: none;
    text-align: right;
    letter-spacing: inherit;
    text-transform: inherit;
    white-space: nowrap;
}

.next:hover {
    color: var(--accent);
}

/* Phones and upright tablets: swarm on top, copy underneath ---------------- */

@media (max-width: 820px), (orientation: portrait) {
    :root {
        --u: clamp(0.66px, min(100vw / 430, 100vh / 800), 1.2px);
        --h: 0.8;
    }

    .js .stage {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 36% minmax(0, 1fr);
        row-gap: 12px;
        padding: 64px 22px 54px;
    }

    .js .zone {
        grid-row: 1;
    }

    .js .copy {
        grid-row: 2;
    }

    .js .scene {
        align-self: start;
    }

    /* Not enough room for the full labels beside the dots. */
    .counter-name,
    #next-prefix {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .js .scene,
    .js .scene.is-active,
    .zone-group,
    .zone-group.is-active {
        transform: none;
        transition: opacity 0.2s ease, visibility 0s;
    }
}
