/*
 * Client galleries (petrmareska.online): intro band, section navigation, justified tiles (sizes come from
 * gallery.js as --w / --h), favourites, lightbox chrome, password gate, landing and the selection pages.
 * Tokens from site.css.
 */

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

.g-hero .hero__stage {
    padding-bottom: clamp(28px, 4vw, 56px);
}

.g-hero__down {
    position: absolute;
    right: var(--gutter);
    bottom: clamp(28px, 4vw, 56px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 4px;
    color: var(--on-photo);
    font-size: var(--step-small);
    font-weight: 700;
    text-decoration: none;
}

.g-hero__down .icon {
    width: 22px;
    height: 22px;
}

@media (max-width: 640px) {
    .g-hero__down span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .g-hero__down {
        width: 44px;
        justify-content: center;
        border: 1px solid rgb(255 255 255 / 0.4);
        border-radius: 999px;
    }

    .g-hero .hero__content {
        padding-right: 52px;
    }
}

/* ---------- Intro: the message beside the downloads ---------- */

.g-intro {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 32px clamp(32px, 6vw, 120px);
    padding: clamp(40px, 6vw, 96px) var(--gutter) 0;
}

.g-intro__text {
    max-width: var(--measure);
    font-size: var(--step-lead);
    line-height: 1.45;
}

.g-intro__lead {
    color: var(--muted);
}

.g-intro__actions {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 20px;
}

.g-zip {
    flex-wrap: wrap;
    text-align: left;
}

.g-zip .icon {
    width: 22px;
    height: 22px;
}

.g-share {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.g-share .share__status {
    flex-basis: 100%;
    min-height: 1.4em;
    color: var(--muted);
    font-size: var(--step-small);
}

.g-share .share__status:empty {
    display: none;
}

.g-intro__hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 38ch;
    color: var(--muted);
    font-size: var(--step-small);
    line-height: 1.45;
}

.g-intro__hint .icon {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--accent);
}

@media (max-width: 900px) {
    .g-intro {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .g-intro__actions,
    .g-zip {
        width: 100%;
    }
}

/* ---------- Section navigation (sticky; moves down while the header shows) ---------- */

.g-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-top: clamp(40px, 5vw, 72px);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-solid) 86%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
}

.js .site-header:not(.is-hidden) ~ .site-main .g-nav {
    top: var(--header-h);
}

.g-nav__list {
    display: flex;
    gap: 6px;
    padding: 10px var(--gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.g-nav__list::-webkit-scrollbar {
    display: none;
}

.g-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: var(--step-small);
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

.g-nav__link:hover {
    border-color: var(--ink);
}

.g-nav__link[aria-current="true"] {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--bg-solid);
}

/* ---------- Sections and the justified grid ---------- */

.g-body {
    padding: clamp(40px, 5vw, 72px) var(--gutter) 0;
}

.g-body:focus {
    outline: none;
}

.g-noscript {
    margin-bottom: 24px;
    color: var(--muted);
}

.g-section + .g-section {
    margin-top: clamp(56px, 7vw, 112px);
}

/* html already pads by the header (site.css scroll-padding-top); this adds the sticky section bar. */
.g-section {
    scroll-margin-top: 64px;
}

.g-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 24px;
    margin-bottom: clamp(20px, 2.5vw, 36px);
}

.g-section__title {
    margin-right: auto;
    font-size: var(--step-sub);
    overflow-wrap: anywhere;
}

.g-section__count {
    color: var(--muted);
    font-size: var(--step-small);
    font-variant-numeric: tabular-nums;
}

.g-section__zip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-size: var(--step-small);
    font-weight: 700;
    text-decoration-color: currentColor;
}

.g-section__zip .icon {
    width: 18px;
    height: 18px;
}

.g-section.is-filtered-out {
    display: none;
}

.g-grid {
    --gal-gap: clamp(4px, 0.6vw, 10px);
    display: flex;
    flex-wrap: wrap;
    gap: var(--gal-gap);
}

.g-tile {
    position: relative;
    flex: none;
    width: var(--w, 240px);
    height: var(--h, 180px);
    overflow: hidden;
    background: var(--surface);
    -webkit-tap-highlight-color: transparent;
}

.g-tile__link {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    cursor: zoom-in;
}

.g-tile__link:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: -3px;
}

.g-tile__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
}

.g-tile__img.is-loaded {
    opacity: 1;
}

.g-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 0);
    pointer-events: none;
}

@media (hover: hover) {
    .g-tile:hover::after {
        background: rgb(0 0 0 / 0.12);
    }
}

/* Heart: always visible on touch screens (quiet), on hover / focus with a mouse, always when chosen. */
.g-tile__fav {
    position: absolute;
    right: 2px;
    bottom: 2px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    cursor: pointer;
    filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.55));
}

.g-tile__fav .icon {
    width: 24px;
    height: 24px;
}

.g-tile__fav .icon-heart__shape,
.pswp__button--fav .icon-heart__shape,
.g-fav-icon .icon-heart__shape {
    fill: transparent;
}

.g-tile__fav[aria-pressed="true"] .icon-heart__shape,
.pswp__button--fav[aria-pressed="true"] .icon-heart__shape {
    fill: var(--accent);
    stroke: var(--accent);
}

.g-tile__fav[aria-pressed="true"] {
    filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.45));
}

@media (hover: hover) and (pointer: fine) {
    .g-tile__fav {
        opacity: 0;
    }

    .g-tile:hover .g-tile__fav,
    .g-tile__fav:focus-visible,
    .g-tile__fav[aria-pressed="true"] {
        opacity: 1;
    }
}

@media (hover: none) {
    .g-tile__fav:not([aria-pressed="true"]) {
        opacity: 0.86;
    }
}

.g-tile__fav:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -6px;
}

.g-tile__badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 3px;
    background: rgb(0 0 0 / 0.62);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.g-tile__play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgb(0 0 0 / 0.5);
    color: #fff;
    transform: translate(-50%, -50%);
    pointer-events: none;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.g-tile__play .icon {
    width: 26px;
    height: 26px;
    margin-left: 3px;
}

/* Files without a preview: the type, the name and a download. */
.g-tile--file .g-tile__link {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 6px;
    padding: 16px 14px 18px;
    text-align: center;
    cursor: pointer;
}

.g-tile--file .g-tile__link[aria-disabled="true"] {
    cursor: default;
}

.g-tile__ext {
    font-family: var(--font-heading);
    font-weight: var(--heading-weight, 700);
    letter-spacing: var(--heading-tracking, -0.02em);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1;
    text-transform: uppercase;
}

.g-tile__name {
    max-width: 100%;
    overflow: hidden;
    font-size: var(--step-small);
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g-tile__size {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.g-tile__size .icon {
    width: 16px;
    height: 16px;
}

.g-more {
    display: flex;
    justify-content: center;
    padding: 32px 0 0;
}

.g-sentinel {
    width: 100%;
    height: 1px;
}

.g-fav-empty {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: clamp(48px, 8vw, 120px) 0;
    color: var(--muted);
    text-align: center;
}

.g-fav-empty .icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
}

.g-fav-empty p {
    max-width: 34ch;
    font-size: var(--step-lead);
    line-height: 1.4;
}

/* ---------- Selection call to action ---------- */

.g-select {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px 48px;
    margin: var(--gap) var(--gutter) 0;
    padding: clamp(28px, 4vw, 56px);
    border: 1px solid var(--line);
    background: var(--surface);
}

.g-select__text {
    display: grid;
    gap: 12px;
    max-width: 48ch;
}

.g-select__title {
    font-size: var(--step-sub);
}

.g-select__lead {
    color: var(--muted);
    line-height: 1.5;
}

.g-select .button .icon {
    width: 20px;
    height: 20px;
}

.g-select .button__note:empty {
    display: none;
}

/* ---------- Favourites bar (sticky at the bottom while something is chosen) ---------- */

.g-favbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    justify-content: center;
    padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
}

.g-favbar.is-away .g-favbar__inner {
    opacity: 0;
    transform: translateY(140%);
    pointer-events: none;
    visibility: hidden;
}

.g-favbar__inner {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-solid) 88%, transparent);
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.35);
    pointer-events: auto;
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
}

.g-favbar__count,
.g-favbar__zip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--ink);
    font: inherit;
    font-size: var(--step-small);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.g-favbar__count .icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.g-favbar__count .icon-heart__shape {
    fill: var(--accent);
    stroke: var(--accent);
}

.g-favbar__zip .icon {
    width: 20px;
    height: 20px;
}

.g-favbar__count:hover,
.g-favbar__zip:hover,
.g-favbar__count[aria-pressed="true"] {
    background: var(--surface);
}

.g-favbar__count[aria-pressed="true"] {
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

.g-favbar__send {
    min-height: 44px;
    padding: 0.5em 1.2em;
    border-radius: 999px;
    font-size: var(--step-small);
    white-space: nowrap;
}

.g-favbar__send .icon {
    width: 18px;
    height: 18px;
}

body:has(.g-favbar:not([hidden])) .site-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 520px) {
    .g-favbar__label {
        display: none;
    }

    .g-favbar__count,
    .g-favbar__zip {
        padding: 0 12px;
    }

    .g-favbar__inner {
        width: 100%;
        justify-content: space-between;
    }
}

/* ---------- Toast ---------- */

.g-toast {
    position: fixed;
    left: 50%;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    z-index: 100001;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg-solid);
    font-size: var(--step-small);
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.3);
}

/* ---------- Lightbox (PhotoSwipe): quiet chrome over a black ground ---------- */

.pswp {
    --pswp-bg: #000;
    --pswp-placeholder-bg: #111318;
    --pswp-icon-color: #ffffff;
    --pswp-icon-color-secondary: rgb(0 0 0 / 0.4);
    --pswp-icon-stroke-color: rgb(0 0 0 / 0.4);
}

.pswp__counter {
    font-family: var(--font-body);
    font-variant-numeric: tabular-nums;
}

.pswp__button--g {
    display: grid;
    place-items: center;
    width: 50px;
    height: 60px;
    color: #fff;
    text-decoration: none;
}

.pswp__button--g .icon {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.5));
}

.pswp__button--g[hidden] {
    display: none !important;
}

.pswp__button--raw {
    width: auto;
    padding: 0 10px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.pswp__button--raw span {
    padding: 4px 7px;
    border: 1.5px solid currentColor;
    border-radius: 4px;
}

.pswp__g-caption {
    position: absolute;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 32px);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgb(0 0 0 / 0.45);
    color: rgb(255 255 255 / 0.86);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateX(-50%);
    pointer-events: none;
}

.pswp__g-caption:empty {
    display: none;
}

.g-video {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 60px 0 56px;
}

.g-video video {
    max-width: 100%;
    max-height: 100%;
    background: #000;
}

.g-lb-note {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: 30ch;
    color: #fff;
    text-align: center;
    transform: translate(-50%, -50%);
}

/* ---------- Password gate ---------- */

.g-gate .hero__stage {
    padding-top: calc(var(--header-h) + clamp(40px, 7vw, 120px));
    padding-bottom: clamp(24px, 4vw, 56px);
}

.g-gate__body {
    display: grid;
    justify-items: center;
    padding: clamp(28px, 5vw, 80px) var(--gutter) 0;
}

.g-gate__card {
    display: grid;
    gap: 20px;
    width: min(100%, 480px);
}

@media (max-width: 640px) {
    .g-gate__card {
        gap: 16px;
    }

    .g-gate__icon {
        width: 44px;
        height: 44px;
    }

    .g-gate__icon .icon {
        width: 22px;
        height: 22px;
    }
}

.g-gate__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
}

.g-gate__icon .icon {
    width: 26px;
    height: 26px;
}

.g-gate__title {
    font-size: var(--step-sub);
}

.g-gate__lead,
.g-gate__help {
    color: var(--muted);
    line-height: 1.5;
}

.g-gate__help {
    font-size: var(--step-small);
}

.g-gate__form .button {
    width: 100%;
    justify-self: stretch;
}

.g-gate__form .button .icon,
.g-sel__form .button .icon {
    width: 20px;
    height: 20px;
}

/* ---------- Landing and the code field ---------- */

.landing {
    display: grid;
    gap: clamp(36px, 5vw, 72px);
    padding: calc(var(--header-h) + clamp(56px, 10vw, 160px)) var(--gutter) 0;
}

.landing__head {
    display: grid;
    gap: 24px;
}

.landing__kicker {
    color: var(--muted);
    font-size: var(--step-small);
    font-weight: 700;
}

.landing__title {
    font-size: clamp(3.5rem, 15vw, 15rem);
    line-height: 0.9;
    overflow-wrap: anywhere;
}

.landing__lead {
    max-width: 44ch;
    font-size: var(--step-lead);
    line-height: 1.4;
}

.landing__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.code-form {
    display: grid;
    gap: 10px;
    width: min(100%, 720px);
}

.code-form__label {
    color: var(--muted);
    font-size: var(--step-small);
    font-weight: 700;
}

.code-form__row {
    display: flex;
    gap: 12px;
}

.code-form__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 54px;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid var(--line-strong);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: var(--step-lead);
    line-height: 1.3;
}

.code-form__input:focus {
    outline: none;
    border-bottom-color: var(--accent);
    box-shadow: inset 0 -2px 0 0 var(--accent);
}

.code-form__input[aria-invalid="true"] {
    border-bottom-color: var(--danger);
    box-shadow: inset 0 -2px 0 0 var(--danger);
}

.code-form__input::placeholder {
    color: var(--muted);
    opacity: 0.75;
}

.code-form__hint {
    color: var(--muted);
    font-size: var(--step-small);
}

.code-form .button .icon {
    width: 20px;
    height: 20px;
}

@media (max-width: 560px) {
    .code-form__row {
        flex-direction: column;
    }

    .code-form .button {
        width: 100%;
    }
}

/* ---------- Selection form and confirmation ---------- */

.g-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: inherit;
}

.g-back .icon {
    width: 18px;
    height: 18px;
}

.g-sel {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 48px clamp(32px, 6vw, 120px);
    padding: clamp(40px, 6vw, 96px) var(--gutter) 0;
}

.g-sel__empty {
    display: grid;
    justify-items: start;
    gap: 24px;
}

.g-sel__picked {
    display: grid;
    align-content: start;
    gap: 20px;
}

.g-sel__lead {
    max-width: 48ch;
    color: var(--muted);
    line-height: 1.5;
}

.g-sel__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.g-sel__thumb {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.g-sel__thumb img,
.g-sel__file {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--surface);
}

.g-sel__file {
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: var(--step-small);
}

.g-sel__name {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g-sel__edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: start;
    min-height: 44px;
    font-size: var(--step-small);
    font-weight: 700;
    text-decoration-color: currentColor;
}

.g-sel__edit .icon {
    width: 18px;
    height: 18px;
}

.g-sel__form {
    align-content: start;
}

@media (max-width: 900px) {
    .g-sel {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }

    /* A strip that scrolls sideways, so the form stays close however many photos were chosen. */
    .g-sel__thumbs {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 88px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        margin: 0 calc(var(--gutter) * -1);
        padding: 0 var(--gutter) 6px;
        scrollbar-width: thin;
    }
}

@media (max-width: 560px) {
    .g-sel__thumbs {
        grid-auto-columns: 76px;
        gap: 6px;
    }

    .g-sel__form .button {
        width: 100%;
        justify-self: stretch;
    }
}

.g-sent__icon {
    display: grid;
    place-items: center;
    width: clamp(88px, 14vw, 140px);
    height: clamp(88px, 14vw, 140px);
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
}

.g-sent__icon .icon {
    width: 55%;
    height: 55%;
    stroke-width: 2.25;
}

/* ---------- Photos still being processed ---------- */

.g-pending {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: clamp(20px, 3vw, 36px);
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: var(--step-small);
    line-height: 1.35;
}

.g-pending__spin {
    flex: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
}

.g-empty {
    margin-bottom: 24px;
}

/* ---------- In-app browser hint (Instagram, Messenger, TikTok, Snapchat) ---------- */

.g-inapp {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 34rem;
    padding: 14px 14px 14px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    font-size: var(--step-small);
    line-height: 1.45;
}

.g-inapp__text {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.g-inapp__text .icon {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--accent);
}

.g-inapp__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.g-inapp__close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: -4px -6px -4px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    cursor: pointer;
}

.g-inapp__close:hover {
    color: var(--ink);
}

.g-inapp__close .icon {
    width: 20px;
    height: 20px;
}

.g-inapp__url {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--bg-solid);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
}

/* The hint carries its own copy button; the one in the share row would say the same twice. */
.g-intro__actions:has(.g-inapp:not([hidden])) .g-share [data-copy-url] {
    display: none;
}

.g-inapp__status:empty {
    display: none;
}

.g-inapp__status {
    color: var(--muted);
}

/* ---------- Password gate on phones: field and button high enough to stay above the keyboard ---------- */

@media (max-width: 640px) {
    .g-gate .hero__stage {
        padding-top: calc(var(--header-h) + 12px);
        padding-bottom: 14px;
    }

    .g-gate .hero__subtitle {
        display: none;
    }

    .g-gate .hero__title {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    .g-gate__body {
        padding-top: 16px;
    }

    .g-gate__card {
        gap: 12px;
    }

    /* The form first, the explanation under it (the lock is said by the hidden heading and the label). */
    .g-gate__icon {
        display: none;
    }

    .g-gate__title {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .g-gate__card > .form-notice {
        order: -2;
        padding: 12px 14px;
        font-size: var(--step-small);
    }

    .g-gate__form {
        order: -1;
        gap: 12px;
    }

    .g-gate__lead {
        font-size: var(--step-small);
    }

    .g-gate__form input {
        min-height: 46px;
        padding: 8px 0;
        font-size: 1.125rem;
    }

    .g-gate__form .button {
        min-height: 50px;
        margin-top: 0;
    }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
    .g-tile__img {
        transition: opacity 420ms ease, transform 1100ms var(--ease-expo);
    }

    .g-tile::after {
        transition: background-color 400ms ease;
    }

    @media (hover: hover) {
        .g-tile:hover .g-tile__img {
            transform: scale(1.035);
        }
    }

    .g-tile__fav {
        transition: opacity 200ms ease, transform 160ms var(--ease-out);
    }

    .g-pending__spin {
        animation: g-spin 900ms linear infinite;
    }

    @keyframes g-spin {
        to { transform: rotate(360deg); }
    }

    .g-tile__fav:active {
        transform: scale(0.88);
    }

    .g-tile__fav.is-pop .icon,
    .pswp__button--fav.is-pop .icon {
        animation: g-pop 420ms var(--ease-expo);
    }

    .js .site-header:not(.is-hidden) ~ .site-main .g-nav,
    .g-nav {
        transition: top 520ms var(--ease-expo);
    }

    .g-favbar__inner {
        transition: opacity 320ms ease, transform 520ms var(--ease-expo), visibility 0s;
    }

    .g-favbar.is-away .g-favbar__inner {
        transition: opacity 240ms ease, transform 420ms var(--ease-expo), visibility 0s 420ms;
    }

    .g-toast:not([hidden]) {
        animation: g-toast-in 360ms var(--ease-expo) both;
    }

    .js .landing__head > *,
    .js .landing__form,
    .js .landing__links {
        animation: rise 900ms var(--ease-out) both;
    }

    .js .landing__title { animation-delay: 80ms; }
    .js .landing__lead { animation-delay: 180ms; }
    .js .landing__form { animation-delay: 260ms; }
    .js .landing__links { animation-delay: 340ms; }

    .js .g-sent__icon {
        animation: g-pop 700ms var(--ease-expo) 80ms both;
    }

    @keyframes g-pop {
        0% { transform: scale(0.6); }
        60% { transform: scale(1.18); }
        100% { transform: scale(1); }
    }

    @keyframes g-toast-in {
        from { opacity: 0; transform: translate(-50%, 12px); }
        to { opacity: 1; transform: translate(-50%, 0); }
    }
}
