/* best-apps.io - one dark theme, each app tints its own card and page through --accent */
@font-face {
    font-family: 'Geist';
    src: url('/fonts/geist.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --bg: #07070c;
    --panel: rgba(255, 255, 255, 0.045);
    --line: rgba(255, 255, 255, 0.1);
    --text: #f4f5fa;
    --soft: #a9adbd;
    --dim: #747890;
    --accent: #6f8cff;
    --display: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
        sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --wrap: 1160px;
    --edge: max(24px, calc((100vw - var(--wrap)) / 2));
    --spring: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
}

/* the background sits on body only, a background on html would cover the sky layer */
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.55 var(--body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 700;
    margin: 0;
    text-wrap: balance;
}

code {
    font: 500 0.88em var(--mono);
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    white-space: nowrap;
}

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

/* slow color clouds behind everything */
.sky {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.sky i {
    position: absolute;
    width: 70vmax;
    height: 70vmax;
    border-radius: 50%;
    opacity: 0.5;
    animation: drift 28s ease-in-out infinite alternate;
}

.sky i:nth-child(1) {
    left: -22vmax;
    top: -34vmax;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 55%, #1b2cff),
        transparent);
}

.sky i:nth-child(2) {
    right: -30vmax;
    top: -8vmax;
    background: radial-gradient(closest-side, #5a2bd6, transparent);
    animation-duration: 36s;
    animation-direction: alternate-reverse;
    opacity: 0.38;
}

.sky i:nth-child(3) {
    left: 14vmax;
    bottom: -52vmax;
    background: radial-gradient(closest-side, #0c8f6a, transparent);
    animation-duration: 44s;
    opacity: 0.28;
}

@keyframes drift {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(6vmax, 4vmax, 0) scale(1.12);
    }
}

.top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px var(--edge);
    background: rgba(7, 7, 12, 0.62);
    -webkit-backdrop-filter: saturate(170%) blur(18px);
    backdrop-filter: saturate(170%) blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: 700 19px var(--display);
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.mark {
    width: 26px;
    height: 26px;
}

.foot-row p a:first-child {
    margin-left: 0;
}

.top nav a, .foot-row p a {
    margin-left: 26px;
    color: var(--soft);
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s;
}

.top nav a:hover, .foot-row p a:hover {
    color: var(--text);
}

.hero, .lost {
    padding: clamp(52px, 8.5vw, 112px) 24px 0;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 7px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--soft);
    font-size: 14px;
}

.eyebrow i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d27b;
    box-shadow: 0 0 0 4px rgba(52, 210, 123, 0.18), 0 0 14px #34d27b;
}

.hero h1, .lost h1 {
    max-width: 1010px;
    margin: 24px auto 0;
    font-size: clamp(44px, 8.4vw, 98px);
    line-height: 0.98;
    letter-spacing: -0.025em;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(100deg, #34d27b, #5b9dff 30%, #9b7bff 55%, #ff5a8a 80%, #f5b545);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shine 9s ease-in-out infinite alternate;
}

@keyframes shine {
    to {
        background-position: 100% 0;
    }
}

.lead {
    max-width: 610px;
    margin: 26px auto 0;
    color: var(--soft);
    font-size: clamp(17px, 2vw, 20px);
}

/* the app icons laid out like a phone home screen, one row on a wide screen */
.dock {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 8px;
    width: min(100%, 420px);
    margin: 48px auto 0;
    padding: 22px 14px 16px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    box-shadow: 0 34px 80px -34px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--soft);
    font-size: 12.5px;
    line-height: 1.2;
    text-decoration: none;
    transform-origin: 50% 100%;
    transform: translateY(calc((var(--s, 1) - 1) * -14px)) scale(var(--s, 1));
    transition: transform 0.16s var(--spring), color 0.2s;
}

.tile:hover {
    color: var(--text);
}

.icon {
    display: block;
    border-radius: 22.5%;
    background: #15151d;
}

.tile .icon {
    width: 64px;
    height: 64px;
    box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.85);
    transition: box-shadow 0.25s;
}

.tile:hover .icon {
    box-shadow: 0 14px 34px -8px color-mix(in srgb, var(--accent) 75%, transparent);
}

.apps, .how, .about, .more {
    max-width: calc(var(--wrap) + 48px);
    margin: 0 auto;
    padding: clamp(64px, 9vw, 124px) 24px 0;
}

.title {
    margin-bottom: 30px;
}

.title h2, .about h2, .more h2 {
    font-size: clamp(30px, 4.6vw, 48px);
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.title p {
    max-width: 560px;
    margin: 12px 0 0;
    color: var(--soft);
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.card {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 39%;
    min-height: 276px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        radial-gradient(120% 130% at 0% 0%, color-mix(in srgb, var(--accent) 24%, transparent),
            transparent 58%),
        var(--panel);
    transition: transform 0.3s var(--spring), border-color 0.3s, box-shadow 0.3s;
}

/* a soft light that follows the pointer */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(440px circle at var(--mx, 50%) var(--my, 0%),
        color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%);
    opacity: 0;
    transition: opacity 0.35s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
    box-shadow: 0 34px 70px -38px color-mix(in srgb, var(--accent) 80%, transparent);
}

.card:hover::before {
    opacity: 1;
}

.card-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px 0 22px 24px;
}

.card-head .icon {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--accent) 70%, #000);
}

.card h3 {
    font-size: 21px;
    line-height: 1.12;
    letter-spacing: -0.01em;
}

/* the title link covers the whole card */
.card h3 a {
    text-decoration: none;
}

.card h3 a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.kind {
    margin: 4px 0 0;
    color: var(--dim);
    font-size: 13px;
}

.card .tagline {
    margin: 12px 0 0;
    color: var(--soft);
    font-size: 15.5px;
    line-height: 1.4;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 0 0;
}

.chips span {
    padding: 2px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--soft);
    font-size: 12px;
}

.go {
    display: flex;
    align-items: center;
    margin: auto 0 0;
    padding-top: 18px;
}

.copy {
    position: relative;
    z-index: 2;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--soft);
    font: 500 12.5px var(--mono);
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.copy b {
    color: var(--text);
    font-weight: 600;
}

.copy:hover {
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    color: var(--text);
}

/* round arrow in the corner of the card, the visible tap target */
.get {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    color: #0b0b12;
    font-size: 0;
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s var(--spring);
}

.get svg {
    width: 19px;
    height: 19px;
}

.card:hover .get {
    transform: scale(1.12) rotate(-45deg);
}

.card-shots {
    position: relative;
}

.shot {
    display: block;
    height: auto;
    border-radius: 16px;
    outline: 1px solid rgba(255, 255, 255, 0.12);
    outline-offset: -1px;
    background: #15151d;
}

.card-shots .shot {
    position: absolute;
    left: 6%;
    top: 30px;
    width: 88%;
    box-shadow: 0 24px 44px -16px rgba(0, 0, 0, 0.85);
    transform: rotate(6deg);
    transition: transform 0.45s var(--spring);
}

.card-shots .shot + .shot {
    display: none;
}

.card:hover .card-shots .shot {
    transform: rotate(3deg) translateY(-10px);
}

/* a landscape screenshot shows its left part */
.card.wide .card-shots .shot {
    left: 4%;
    top: 74px;
    width: 250%;
    max-width: none;
    transform: rotate(-4deg);
}

.card.wide:hover .card-shots .shot {
    transform: rotate(-2deg) translate(-10px, -8px);
}

.steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.steps li {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--panel);
}

.steps b {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #5b9dff, #9b7bff);
    font: 700 18px var(--display);
}

.steps li:nth-child(2) b {
    background: linear-gradient(135deg, #34d27b, #1aa3a3);
}

.steps li:nth-child(3) b {
    background: linear-gradient(135deg, #ff5a8a, #f5b545);
}

.steps h3 {
    margin-top: 18px;
    font-size: 21px;
    letter-spacing: -0.01em;
}

.steps p {
    margin: 8px 0 0;
    color: var(--soft);
    font-size: 15.5px;
}

.about {
    max-width: 800px;
    text-align: center;
}

.about p {
    margin: 18px 0 0;
    color: var(--soft);
    font-size: 18px;
}

.about a, .prose a {
    color: var(--text);
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.foot {
    max-width: calc(var(--wrap) + 48px);
    margin: clamp(70px, 10vw, 130px) auto 0;
    padding: 32px 24px 44px;
    border-top: 1px solid var(--line);
}

.foot-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
}

.foot-row p {
    margin: 0;
}

.fine {
    margin: 20px 0 0;
    color: var(--dim);
    font-size: 13px;
}

/* app page */
.app {
    max-width: calc(var(--wrap) + 48px);
    margin: 0 auto;
    padding: 24px 24px 0;
}

.back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--soft);
    font-size: 15px;
    text-decoration: none;
}

.back svg {
    width: 18px;
    height: 18px;
    transform: rotate(180deg);
}

.back:hover {
    color: var(--text);
}

.app-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 34px;
    margin-top: 22px;
}

.app-info .icon {
    width: 104px;
    height: 104px;
    box-shadow: 0 26px 60px -20px color-mix(in srgb, var(--accent) 85%, #000);
}

.app-info .kind {
    margin-top: 22px;
    font-size: 14px;
}

.app h1 {
    margin-top: 8px;
    font-size: clamp(34px, 5.2vw, 58px);
    line-height: 1.02;
    letter-spacing: -0.02em;
}

.app-info .tagline {
    margin: 14px 0 0;
    color: var(--soft);
    font-size: clamp(19px, 2.4vw, 24px);
    line-height: 1.3;
}

.stores {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.badge {
    display: block;
    flex: none;
    height: 56px;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.25s var(--spring);
}

.badge img {
    display: block;
    max-width: none;
    height: 56px;
    width: auto;
}

/* the Google file carries 41px of clear space on a 646 x 250 sheet, the badge itself is
   564 x 168, shown at 56px high (scale 1/3) and cropped to its own edges */
.badge.android {
    width: 188px;
    overflow: hidden;
    border-radius: 9px;
}

.badge.android img {
    height: 83px;
    margin: -13.67px;
}

.badge:hover {
    transform: translateY(-2px);
}

/* the badge of the visitor's own store carries the accent glow, the badge itself stays untouched */
.badge.first {
    filter: drop-shadow(0 16px 24px color-mix(in srgb, var(--accent) 55%, transparent));
}

.note {
    width: fit-content;
    margin: 16px 0 0;
    padding: 11px 15px;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    font-size: 15px;
}

.text {
    max-width: 54ch;
    margin: 30px 0 0;
    color: var(--soft);
    font-size: 18px;
}

.points {
    display: grid;
    gap: 11px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.points li {
    position: relative;
    padding-left: 32px;
}

.points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 26%, transparent);
}

.points li::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 7px;
    width: 6px;
    height: 10px;
    border: solid var(--accent);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* the code to scan is for computers, a phone already holds the link */
.scan {
    display: none;
    align-items: center;
    gap: 16px;
    width: fit-content;
    margin-top: 34px;
    padding: 14px 20px 14px 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel);
}

.scan img {
    flex: none;
    border-radius: 12px;
    background: #fff;
}

.scan p {
    max-width: 230px;
    margin: 0;
    color: var(--soft);
    font-size: 14.5px;
}

.scan b {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 16px;
}

.legal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 26px 0 0;
}

.legal a {
    color: var(--soft);
    white-space: nowrap;
    font-size: 14.5px;
    text-underline-offset: 4px;
}

.legal a:hover {
    color: var(--text);
}

.app-shots {
    display: flex;
    /* without this a flex row stretches every screenshot to the tallest item */
    align-items: flex-start;
    gap: 16px;
    margin: 0 -24px;
    padding: 6px 24px 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 24px;
    scrollbar-width: none;
}

.app-shots::-webkit-scrollbar {
    display: none;
}

.app-shots .shot {
    flex: none;
    width: min(62vw, 250px);
    border-radius: 24px;
    scroll-snap-align: start;
    box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.9);
}

.app.wide .app-shots .shot {
    width: min(84vw, 560px);
    border-radius: 16px;
}

.app .more {
    padding-left: 0;
    padding-right: 0;
    text-align: center;
}

.more .dock {
    margin-top: 28px;
}

.prose {
    max-width: 768px;
    margin: 0 auto;
    padding: clamp(44px, 7vw, 84px) 24px 0;
}

.prose h1 {
    font-size: clamp(40px, 6vw, 64px);
    letter-spacing: -0.02em;
}

.prose h2 {
    margin-top: 40px;
    font-size: 24px;
    letter-spacing: -0.01em;
}

.prose p {
    margin: 12px 0 0;
    color: var(--soft);
}

/* cards and steps rise in as they scroll into view, only when the script is running */
.js .rise {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--spring), transform 0.7s var(--spring);
}

.js .rise.in {
    opacity: 1;
    transform: none;
}

@media (max-width: 560px) {
    .top nav {
        display: none;
    }

    .card {
        grid-template-columns: minmax(0, 1fr) 36%;
    }

    .copy {
        font-size: 12px;
    }
}

@media (min-width: 600px) {
    .dock {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        width: min(100%, 560px);
        padding: 24px 18px 18px;
    }

    .tile .icon {
        width: 72px;
        height: 72px;
    }
}

@media (min-width: 680px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: dense;
    }

    .steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* a featured card spans two columns and fans out three screenshots */
    .card.featured {
        grid-column: span 2;
        grid-template-columns: minmax(0, 1fr) 54%;
    }

    .card.featured .card-text {
        padding: 30px 0 26px 30px;
    }

    .card.featured h3 {
        font-size: 30px;
    }

    .card.featured .tagline {
        font-size: 19px;
    }

    .card.featured .card-shots .shot {
        display: block;
        left: 3%;
        top: 44px;
        width: 34%;
        transform: rotate(-7deg);
    }

    .card.featured .card-shots .shot:nth-child(2) {
        z-index: 1;
        left: 32%;
        top: 24px;
        transform: none;
    }

    .card.featured .card-shots .shot:nth-child(3) {
        left: 61%;
        transform: rotate(7deg);
    }

    .card.featured:hover .card-shots .shot {
        transform: rotate(-10deg) translate(-8px, -6px);
    }

    .card.featured:hover .card-shots .shot:nth-child(2) {
        transform: translateY(-12px);
    }

    .card.featured:hover .card-shots .shot:nth-child(3) {
        transform: rotate(10deg) translate(8px, -6px);
    }
}

@media (min-width: 900px) {
    .app-top {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
        gap: 60px;
        margin-top: 34px;
    }

    .app-shots {
        margin: 0;
        padding: 6px 6px 26px;
        scroll-padding: 0 6px;
        -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent);
        mask-image: linear-gradient(90deg, #000 86%, transparent);
    }

    .app-shots .shot {
        width: 288px;
    }

    .app.wide .app-shots .shot {
        width: 560px;
    }
}

@media (min-width: 900px) and (hover: hover) {
    .scan {
        display: flex;
    }
}

@media (min-width: 1000px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

/* one row like a desktop dock, the script magnifies the icons under the pointer */
@media (min-width: 1060px) {
    .dock {
        display: flex;
        justify-content: center;
        align-items: flex-end;
        gap: 16px;
        width: fit-content;
        padding: 18px 22px 14px;
    }

    .tile {
        width: 76px;
    }

    .tile .icon {
        width: 76px;
        height: 76px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}