/* ==========================================================================
   PhoneGrade site - site layer
   Header, hero, page header, pricing, download picker, language menu, modal.
   ========================================================================== */

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

.pg-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--pg-bg) 86%, transparent);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.pg-header[data-scrolled='true'] {
    border-bottom-color: var(--pg-border);
}

.pg-header__inner {
    display: flex;
    align-items: center;
    gap: var(--pg-5);
    height: var(--pg-header-h);
}

.pg-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--pg-3);
    color: var(--pg-text);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.06rem;
    flex: none;
}

.pg-brand:hover {
    text-decoration: none;
}

.pg-brand img {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    box-shadow: var(--pg-sh-sm);
}

.pg-nav {
    display: flex;
    align-items: center;
    gap: var(--pg-1);
    margin-inline-start: var(--pg-2);
}

.pg-nav a {
    padding: var(--pg-2) var(--pg-3);
    border-radius: var(--pg-r-md);
    color: var(--pg-text-2);
    font-size: 0.93rem;
    font-weight: 600;
    white-space: nowrap;
}

.pg-nav a:hover {
    color: var(--pg-text);
    background: var(--pg-surface-2);
    text-decoration: none;
}

.pg-nav a[aria-current='page'] {
    color: var(--pg-text);
    background: var(--pg-surface-2);
}

.pg-header__actions {
    display: flex;
    align-items: center;
    gap: var(--pg-2);
    margin-inline-start: auto;
}

/* Language picker */

.pg-lang {
    position: relative;
}

.pg-lang__button {
    display: inline-flex;
    align-items: center;
    gap: var(--pg-2);
    height: 38px;
    padding-inline: var(--pg-3);
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-r-md);
    background: var(--pg-surface);
    color: var(--pg-text-2);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.pg-lang__button:hover {
    color: var(--pg-text);
    border-color: var(--pg-border-strong);
}

.pg-lang__button svg {
    width: 15px;
    height: 15px;
    color: var(--pg-text-3);
}

.pg-lang__code {
    font-variant-numeric: tabular-nums;
}

.pg-lang__menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    min-width: 208px;
    padding: var(--pg-2);
    background: var(--pg-surface);
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-r-lg);
    box-shadow: var(--pg-sh-lg);
    display: none;
}

.pg-lang__menu[data-open='true'] {
    display: block;
}

.pg-lang__item {
    display: flex;
    align-items: center;
    gap: var(--pg-3);
    width: 100%;
    padding: var(--pg-2) var(--pg-3);
    border: 0;
    border-radius: var(--pg-r-md);
    background: none;
    color: var(--pg-text-2);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
}

.pg-lang__item:hover {
    background: var(--pg-surface-2);
    color: var(--pg-text);
}

.pg-lang__item[aria-selected='true'] {
    color: var(--pg-accent);
    background: var(--pg-blue-50);
}

.pg-lang__check {
    margin-inline-start: auto;
    width: 15px;
    height: 15px;
    opacity: 0;
}

.pg-lang__item[aria-selected='true'] .pg-lang__check {
    opacity: 1;
}

.pg-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-r-md);
    background: var(--pg-surface);
    color: var(--pg-text-2);
    cursor: pointer;
}

.pg-nav-toggle svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 940px) {
    .pg-nav-toggle {
        display: inline-flex;
    }

    .pg-nav {
        position: absolute;
        inset-inline: 0;
        top: var(--pg-header-h);
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin: 0;
        padding: var(--pg-3);
        background: var(--pg-surface);
        border-bottom: 1px solid var(--pg-border);
        box-shadow: var(--pg-sh-md);
        display: none;
    }

    .pg-nav[data-open='true'] {
        display: flex;
    }

    .pg-nav a {
        padding: var(--pg-3);
    }
}

@media (max-width: 560px) {
    .pg-header__inner {
        gap: var(--pg-2);
    }

    .pg-brand span {
        display: none;
    }

    .pg-header__actions .pg-btn span {
        display: none;
    }

    .pg-header__actions .pg-btn {
        padding-inline: var(--pg-3);
    }
}

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

.pg-hero {
    position: relative;
    background: var(--pg-inv-bg);
    color: var(--pg-inv-text);
    overflow: hidden;
    isolation: isolate;
}

.pg-hero::before {
    content: '';
    position: absolute;
    inset: -40% -20% auto -20%;
    height: 130%;
    background: radial-gradient(
        ellipse 60% 50% at 22% 34%,
        rgba(37, 99, 235, 0.34) 0%,
        transparent 62%
    );
    z-index: -2;
}

.pg-hero::after {
    content: '';
    position: absolute;
    inset: auto -10% -55% 40%;
    height: 100%;
    background: radial-gradient(
        ellipse 50% 50% at 70% 60%,
        rgba(56, 189, 248, 0.16) 0%,
        transparent 64%
    );
    z-index: -2;
}

.pg-hero__inner {
    display: grid;
    /* The copy column is wider than the screenshot column on purpose. The
     * headline is the largest type on the site and at an even split it wraps to
     * one or two words per line, which reads as a broken layout rather than as
     * a large headline. */
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--pg-10);
    align-items: center;
    padding-block: var(--pg-20) var(--pg-24);
}

/* Below this the hero stops being two columns and the screenshot has nowhere to
 * sit beside the copy. 1040 rather than 1000 because the copy column needs room
 * for a comfortable measure at its widest before it starts wrapping to three
 * lines per sentence. */
@media (max-width: 1040px) {
    .pg-hero__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--pg-10);
        padding-block: var(--pg-16) var(--pg-16);
    }
}

.pg-hero__title {
    color: #fff;
}

.pg-hero__lede {
    margin-top: var(--pg-5);
    font-size: clamp(1.05rem, 1rem + 0.35vw, 1.22rem);
    color: var(--pg-inv-text-2);
    max-width: 54ch;
}

.pg-hero .pg-btn-row {
    margin-top: var(--pg-8);
}

.pg-hero__note {
    margin-top: var(--pg-5);
    display: flex;
    flex-wrap: wrap;
    gap: var(--pg-2) var(--pg-5);
    font-size: 0.86rem;
    color: var(--pg-inv-text-2);
}

.pg-hero__note span {
    display: inline-flex;
    align-items: center;
    gap: var(--pg-2);
}

.pg-hero__note svg {
    width: 15px;
    height: 15px;
    color: var(--pg-green-500);
}

.pg-hero__visual {
    position: relative;
}

.pg-hero__visual .pg-shot {
    border-color: var(--pg-inv-border);
    box-shadow: var(--pg-sh-xl);
    transform: perspective(1400px) rotateY(-4deg) rotateX(1.5deg);
}

@media (max-width: 1040px) {
    .pg-hero__visual .pg-shot {
        transform: none;
    }
}

.pg-hero__pill {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: var(--pg-2);
    padding: var(--pg-2) var(--pg-3);
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--pg-r-full);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--pg-sh-lg);
    font-size: 0.78rem;
    font-weight: 650;
    color: #f1f5f9;
    white-space: nowrap;
}

.pg-hero__pill svg {
    width: 14px;
    height: 14px;
}

.pg-hero__pill--tl {
    top: -14px;
    inset-inline-start: -12px;
}

.pg-hero__pill--br {
    bottom: -14px;
    inset-inline-end: -12px;
}

/* The hero caption sits on the hero's own dark background rather than on a card,
 * so it takes the inverted secondary. The base .pg-shot__caption colour is the
 * light-scheme tertiary, which is unreadable here. */
.pg-hero__visual .pg-shot__caption {
    color: var(--pg-inv-text-2);
}

.pg-hero__pill--ok svg {
    color: var(--pg-green-500);
}

.pg-hero__pill--warn svg {
    color: var(--pg-amber-500);
}

@media (max-width: 560px) {
    .pg-hero__pill--tl {
        inset-inline-start: -6px;
    }

    .pg-hero__pill--br {
        inset-inline-end: -6px;
    }
}

/* The floating pills only work while the screenshot has a copy column beside it.
 * Once the hero stacks, the screenshot is full width and the app's own header bar
 * is exactly where a pill wants to sit, so below the stacking breakpoint they
 * drop out of the overlap and line up under the screenshot instead.
 *
 * This has to come after the .pg-hero__pill rules above, because at equal
 * specificity the later declaration wins and the pills would stay absolute.
 */
@media (max-width: 1040px) {
    .pg-hero__pill {
        position: static;
        margin-top: var(--pg-3);
    }

    .pg-hero__pill--tl {
        inset-inline-start: auto;
        margin-inline-end: var(--pg-3);
    }

    .pg-hero__pill--br {
        inset-inline-end: auto;
    }

    .pg-hero__visual {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
}

/* A thin strip of logos or facts under the hero. */
.pg-truststrip {
    background: var(--pg-inv-bg);
    border-top: 1px solid var(--pg-inv-border);
    padding-block: var(--pg-6);
}

.pg-truststrip__inner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--pg-4) var(--pg-8);
    align-items: center;
    justify-content: center;
    color: var(--pg-inv-text-2);
    font-size: 0.88rem;
}

.pg-truststrip__inner span {
    display: inline-flex;
    align-items: center;
    gap: var(--pg-2);
}

.pg-truststrip__inner svg {
    width: 16px;
    height: 16px;
    color: var(--pg-green-500);
}

/* --------------------------------------------------------------------------
   Page header, used by every page except home
   -------------------------------------------------------------------------- */

.pg-pagehead {
    position: relative;
    background: var(--pg-inv-bg);
    color: var(--pg-inv-text);
    overflow: hidden;
    isolation: isolate;
}

.pg-pagehead::before {
    content: '';
    position: absolute;
    inset: -50% -20% auto -20%;
    height: 150%;
    background: radial-gradient(
        ellipse 55% 60% at 20% 40%,
        rgba(37, 99, 235, 0.3) 0%,
        transparent 62%
    );
    z-index: -1;
}

.pg-pagehead__inner {
    padding-block: var(--pg-16) var(--pg-16);
    max-width: 70ch;
}

.pg-pagehead__inner .pg-h1 {
    color: #fff;
}

.pg-pagehead__inner .pg-lede {
    margin-top: var(--pg-4);
    color: var(--pg-inv-text-2);
}

.pg-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--pg-2);
    margin-bottom: var(--pg-5);
    font-size: 0.84rem;
    color: var(--pg-inv-text-2);
}

.pg-breadcrumbs a {
    color: var(--pg-inv-text-2);
}

.pg-breadcrumbs a:hover {
    color: var(--pg-inv-accent);
}

.pg-breadcrumbs svg {
    width: 13px;
    height: 13px;
    opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Feature cards
   -------------------------------------------------------------------------- */

.pg-feature {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pg-feature p {
    margin-top: var(--pg-3);
    font-size: 0.94rem;
    color: var(--pg-text-2);
}

.pg-section--dark .pg-feature p {
    color: var(--pg-inv-text-2);
}

.pg-feature__link {
    margin-top: var(--pg-4);
    font-size: 0.88rem;
    font-weight: 650;
}

/* Numbered steps */

.pg-steps {
    counter-reset: pg-step;
    display: grid;
    gap: var(--pg-6);
}

.pg-step {
    position: relative;
    padding-inline-start: 58px;
    counter-increment: pg-step;
}

.pg-step::before {
    content: counter(pg-step);
    position: absolute;
    inset-inline-start: 0;
    top: -2px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--pg-r-full);
    background: var(--pg-blue-50);
    color: var(--pg-accent);
    font-size: 0.95rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.pg-section--dark .pg-step::before {
    background: rgba(96, 165, 250, 0.16);
    color: var(--pg-inv-accent);
}

.pg-step p {
    margin-top: var(--pg-2);
    color: var(--pg-text-2);
}

.pg-section--dark .pg-step p {
    color: var(--pg-inv-text-2);
}

/* Split media, text beside a screenshot */

.pg-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--pg-12);
    align-items: center;
}

.pg-split--reverse .pg-split__media {
    order: -1;
}

@media (max-width: 900px) {
    .pg-split {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--pg-8);
    }

    .pg-split--reverse .pg-split__media {
        order: 0;
    }
}

.pg-split__copy > * + * {
    margin-top: var(--pg-4);
}

/* Screenshot gallery */

.pg-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--pg-6);
}

@media (max-width: 760px) {
    .pg-gallery {
        grid-template-columns: minmax(0, 1fr);
    }
}

.pg-gallery__item {
    margin: 0;
}

.pg-gallery__item figcaption {
    margin-top: var(--pg-3);
    font-size: 0.87rem;
    color: var(--pg-text-3);
    text-align: center;
}

/* Side by side light and dark variants of the same screen. */

.pg-gallery__pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--pg-3);
}

@media (max-width: 520px) {
    .pg-gallery__pair {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */

.pg-plans {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--pg-5);
    align-items: start;
}

@media (max-width: 940px) {
    .pg-plans {
        grid-template-columns: minmax(0, 1fr);
        max-width: 460px;
        margin-inline: auto;
    }
}

.pg-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--pg-6);
    background: var(--pg-surface);
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-r-xl);
}

.pg-plan--featured {
    border-color: var(--pg-accent);
    box-shadow: 0 0 0 1px var(--pg-accent), var(--pg-sh-lg);
}

.pg-plan__flag {
    position: absolute;
    top: -11px;
    inset-inline-start: var(--pg-6);
}

.pg-plan__name {
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.pg-plan__tagline {
    margin-top: var(--pg-2);
    font-size: 0.9rem;
    color: var(--pg-text-2);
    min-height: 2.7em;
}

.pg-plan__price {
    display: flex;
    align-items: baseline;
    gap: var(--pg-2);
    margin-top: var(--pg-5);
}

.pg-plan__amount {
    font-size: 2.35rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.pg-plan__period {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--pg-text-2);
}

.pg-plan__meta {
    margin-top: var(--pg-2);
    font-size: 0.84rem;
    /* One step darker than --pg-text-3. The tertiary slate sits at about 2.5 to 1
     * on white, which is decorative-only territory, and this line carries the
     * billing terms rather than decoration. */
    color: var(--pg-text-2);
}

.pg-plan .pg-btn {
    margin-top: var(--pg-6);
}

.pg-plan__features {
    list-style: none;
    display: grid;
    gap: var(--pg-3);
    margin-top: var(--pg-6);
    padding-top: var(--pg-6);
    border-top: 1px solid var(--pg-border);
}

.pg-plan__features li {
    display: flex;
    gap: var(--pg-3);
    align-items: flex-start;
    font-size: 0.92rem;
}

.pg-plan__features svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: var(--pg-green-600);
}

.pg-plan__features li[data-tone='muted'] svg {
    color: var(--pg-text-3);
}

.pg-plan__foot {
    margin-top: auto;
    padding-top: var(--pg-6);
    font-size: 0.82rem;
    color: var(--pg-text-2);
}

/* Simple two column comparison for what a licence includes. */

.pg-compare {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--pg-5);
}

@media (max-width: 940px) {
    .pg-compare {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Download page
   -------------------------------------------------------------------------- */

.pg-osdetect {
    display: flex;
    align-items: center;
    gap: var(--pg-3);
    padding: var(--pg-4) var(--pg-5);
    background: var(--pg-blue-50);
    border: 1px solid var(--pg-blue-100);
    border-radius: var(--pg-r-lg);
    font-size: 0.93rem;
    margin-bottom: var(--pg-6);
}

.pg-osdetect svg {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--pg-accent);
}

.pg-osdetect strong {
    font-weight: 700;
}

.pg-oslist {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--pg-4);
}

@media (max-width: 940px) {
    .pg-oslist {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .pg-oslist {
        grid-template-columns: minmax(0, 1fr);
    }
}

.pg-os {
    display: flex;
    flex-direction: column;
    gap: var(--pg-3);
    padding: var(--pg-5);
    background: var(--pg-surface);
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-r-lg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pg-os[data-detected='true'] {
    border-color: var(--pg-accent);
    box-shadow: 0 0 0 1px var(--pg-accent);
}

.pg-os__head {
    display: flex;
    align-items: center;
    gap: var(--pg-3);
}

.pg-os__icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--pg-r-md);
    background: var(--pg-surface-2);
    color: var(--pg-text-2);
}

.pg-os__icon svg {
    width: 19px;
    height: 19px;
}

.pg-os[data-detected='true'] .pg-os__icon {
    background: var(--pg-blue-50);
    color: var(--pg-accent);
}

.pg-os__name {
    font-weight: 700;
    font-size: 0.97rem;
    letter-spacing: -0.01em;
}

.pg-os__arch {
    font-size: 0.79rem;
    color: var(--pg-text-3);
}

.pg-os__meta {
    font-size: 0.83rem;
    color: var(--pg-text-3);
    font-variant-numeric: tabular-nums;
}

.pg-os__release {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--pg-3);
    padding-top: var(--pg-3);
    border-top: 1px solid var(--pg-border);
    font-size: 0.8rem;
    color: var(--pg-text-3);
}

.pg-os .pg-btn {
    width: 100%;
}

.pg-releases-fallback {
    margin-top: var(--pg-6);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Modal, used by the trial explainer
   -------------------------------------------------------------------------- */

.pg-modal[hidden] {
    display: none;
}

.pg-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: var(--pg-5);
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.pg-modal__dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: min(88vh, 760px);
    overflow-y: auto;
    padding: var(--pg-8);
    background: var(--pg-surface);
    border-radius: var(--pg-r-xl);
    box-shadow: var(--pg-sh-xl);
}

.pg-modal__close {
    position: absolute;
    top: var(--pg-4);
    inset-inline-end: var(--pg-4);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-r-md);
    background: var(--pg-surface);
    color: var(--pg-text-2);
    cursor: pointer;
}

.pg-modal__close svg {
    width: 16px;
    height: 16px;
}

.pg-modal__close:hover {
    background: var(--pg-surface-2);
    color: var(--pg-text);
}

.pg-modal__body > * + * {
    margin-top: var(--pg-4);
}

.pg-modal__list {
    list-style: none;
    display: grid;
    gap: var(--pg-3);
}

.pg-modal__list li {
    display: flex;
    gap: var(--pg-3);
    align-items: flex-start;
    font-size: 0.94rem;
    color: var(--pg-text-2);
}

.pg-modal__list svg {
    flex: none;
    width: 19px;
    height: 19px;
    margin-top: 2px;
    color: var(--pg-accent);
}

/* --------------------------------------------------------------------------
   Closing call to action band
   -------------------------------------------------------------------------- */

.pg-cta {
    text-align: center;
    max-width: 60ch;
    margin-inline: auto;
}

.pg-cta .pg-btn-row {
    justify-content: center;
}

.pg-cta__contact {
    margin-top: var(--pg-5);
    font-size: 0.92rem;
    color: var(--pg-inv-text-2);
}

.pg-cta__contact a {
    color: var(--pg-inv-accent);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Small utilities
   -------------------------------------------------------------------------- */

.pg-mt-4 { margin-top: var(--pg-4); }
.pg-mt-6 { margin-top: var(--pg-6); }
.pg-mt-8 { margin-top: var(--pg-8); }
.pg-mt-10 { margin-top: var(--pg-10); }
.pg-mt-12 { margin-top: var(--pg-12); }
.pg-mb-6 { margin-bottom: var(--pg-6); }
.pg-mb-8 { margin-bottom: var(--pg-8); }
.pg-text-center { text-align: center; }

.pg-divider {
    height: 1px;
    background: var(--pg-border);
    border: 0;
    margin-block: var(--pg-8);
}

.pg-section--dark .pg-divider {
    background: var(--pg-inv-border);
}
