/*
 * One-page site of a client on its domain (resources/views/viewer/client-page.blade.php):
 * the VR Creators tokens and kit, a light page around the tour. Written for VIRTUS.
 */
@import url('tokens.css');

.cp {
    background: var(--bg);
    color: var(--ink);
}

.cp .section {
    padding-block: clamp(32px, 5vw, 64px);
}

.cp__bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in oklab, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.cp__bar-in {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
}

.cp__logo {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.cp__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
}

.cp__full {
    margin-left: auto;
}

.cp__hero {
    padding-block: clamp(32px, 6vw, 72px) clamp(24px, 4vw, 48px);
}

.cp__hero h1 {
    max-width: 22ch;
}

.cp__intro {
    max-width: 62ch;
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--muted);
}

.cp__intro p {
    margin: 0 0 0.8em;
}

.cp__frame {
    margin-top: clamp(20px, 3vw, 36px);
    aspect-ratio: 16 / 9;
    max-height: 78vh;
    width: 100%;
    overflow: hidden;
    border-radius: var(--r-lg, 20px);
    background: #141414;
    box-shadow: 0 24px 60px rgb(20 20 20 / 22%);
}

.cp__frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.cp__hint {
    margin-top: 10px;
}

.cp__contacts {
    padding-block: clamp(24px, 4vw, 56px);
}

.cp__dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px 28px;
    margin: 0;
}

.cp__dl dt {
    font-size: 0.85rem;
    color: var(--muted);
}

.cp__dl dd {
    margin: 4px 0 0;
    font-size: 1.05rem;
}

.cp__dl dd a {
    display: inline-block;
    margin-left: 6px;
}

.cp__foot {
    padding-block: 28px;
    background: var(--p-inv-bg);
    color: var(--p-inv-ink);
}

.cp__foot a {
    color: inherit;
}

/* the tour is not public yet */
.cp__soon {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 6px;
    padding: 24px;
    text-align: center;
    color: #f2efe9;
    background: radial-gradient(ellipse at 50% 40%, #2b3a44, #141414 70%);
}

.cp__soon svg {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    opacity: 0.85;
}

.cp__soon p {
    margin: 0;
    max-width: 40ch;
}

.cp__soon-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    font-weight: 600;
}

/* skip links: fixed at the top left of the window on the first Tab (the kit places them in a header) */
.cp > .skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
}

.cp > .skip-link:focus {
    transform: none;
}

/* anchors land below the sticky bar */
.cp [id] {
    scroll-margin-top: 84px;
}

.cp main:focus,
.cp__frame:focus,
.cp h2:focus {
    outline: none;
}

.cp a:focus-visible,
.cp button:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* the project contact person */
.cp__person {
    padding-block: clamp(24px, 4vw, 56px);
}

.cp__quote {
    margin: 18px 0 0;
    max-width: 68ch;
    padding: clamp(20px, 3vw, 32px);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--r-md, 12px) var(--r-md, 12px) 0;
    background: var(--surface);
}

.cp__quote blockquote {
    margin: 0 0 16px;
    font-size: 1.15rem;
    line-height: 1.6;
}

.cp__quote blockquote p {
    margin: 0 0 0.6em;
}

.cp__quote figcaption {
    display: grid;
    gap: 2px;
}

.cp__person-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
}

.cp__person-role {
    color: var(--muted);
}

.cp__person-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

/* made with VIRTUS */
.cp__virtus {
    padding-block: clamp(32px, 5vw, 64px);
}

.cp__virtus-in {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px 40px;
}

.cp__virtus p {
    max-width: 62ch;
    margin: 0;
    color: var(--muted);
}

.cp__virtus-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cp__foot-in {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
}

.cp__foot p {
    margin: 0;
}

.cp__foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 760px) {
    .cp__virtus-in {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .cp__full {
        display: none;
    }

    .cp__frame {
        aspect-ratio: 3 / 4;
        border-radius: var(--r-md, 12px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cp__pano-strip {
        animation: none;
    }

    .cp__slide {
        transition: none;
    }
}

/* ---------------------------------------------------------------- 17/11: grounds, QR, steps, photo, 360° band */

/* every section on its own ground, as on the home page of vr-creators.it */
.cp .section {
    padding-block: clamp(48px, 7vw, 96px);
}

.cp__hero-in {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 24px 48px;
}

.cp__qr {
    margin: 0;
    display: grid;
    justify-items: center;
    gap: 12px;
    width: 220px;
    text-align: center;
}

.cp__qr-code {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: var(--r-sm, 8px);
    background: #fff;
}

.cp__qr-code svg {
    display: block;
    width: 100%;
    height: auto;
}

.cp__qr figcaption {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.3;
}

/* the steps of the project, a pictogram each, on a white ground with a small photo carousel */
.cp__steps {
    --bg: #ffffff;
    --surface: var(--p-bg);
    background: var(--bg);
}

.cp__steps-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
    align-items: center;
    gap: 28px 56px;
}

.cp__slider {
    display: grid;
    gap: 12px;
}

.cp__slides {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--r-lg, 20px);
    background: var(--p-accent);
    box-shadow: 0 18px 44px rgb(20 20 20 / 16%);
}

.cp__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.cp__slide.is-on {
    opacity: 1;
}

.cp__slider-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.cp__dot,
.cp__slider-pause {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.cp__dot::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--p-accent);
    transition:
        background 0.2s ease,
        width 0.2s ease;
}

.cp__dot[aria-current='true']::before {
    width: 24px;
    border-radius: 6px;
    background: var(--p-accent);
}

.cp__slider-pause svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cp__slider-pause .i-play,
.cp__slider-pause[aria-pressed='true'] .i-pause {
    display: none;
}

.cp__slider-pause[aria-pressed='true'] .i-play {
    display: inline;
}

.cp__step-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 32px 28px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.cp__step {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 16px;
    text-align: center;
}

.cp__step-icon {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--accent);
}

.cp__step-icon svg {
    width: 46px;
    height: 46px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cp__step-text {
    max-width: 28ch;
    font-weight: 600;
    line-height: 1.45;
}

/* the contact person: the photo beside the message */
.cp__person-in {
    display: grid;
    gap: 24px 48px;
    margin-top: 24px;
}

.cp__person-in--photo {
    grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
    align-items: center;
}

.cp__person-photo {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--r-lg, 20px);
    box-shadow: 0 18px 44px rgb(20 20 20 / 18%);
}

.cp__person-in .cp__quote {
    margin: 0;
}

.cp__person-more {
    margin-top: 14px;
}

/* the contacts on the dark ground */
.cp__contacts .cp__dl dd a {
    color: var(--ink);
}

/* the 360° view turning slowly between the contacts and the blog */
.cp__pano {
    contain: paint;
    position: relative;
    height: clamp(260px, 52vh, 520px);
    overflow: hidden;
    background: #141414;
}

.cp__pano-move {
    position: absolute;
    inset: -12% 0;
    will-change: transform;
}

.cp__pano-strip {
    display: flex;
    width: max-content;
    height: 100%;
    animation: cp-pan 140s linear infinite;
}

.cp__pano-strip img {
    display: block;
    flex: none;
    width: auto;
    height: 100%;
    max-width: none;
}

@keyframes cp-pan {
    to {
        transform: translateX(-50%);
    }
}

.cp__blog .blog-strip {
    padding-block: clamp(48px, 7vw, 96px);
}

.cp__blog .blog-sep {
    margin: 0;
}

@media (max-width: 900px) {
    .cp__hero-in,
    .cp__steps-head {
        grid-template-columns: 1fr;
    }

    /* on a phone the visitor is already there */
    .cp__qr {
        display: none;
    }

    .cp__person-in--photo {
        grid-template-columns: 1fr;
    }

    .cp__person-photo {
        max-width: 280px;
    }
}

/* the maps of the tour (Phase 12): a point opens the tour above on its scene */
.cp__map-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cp__map-tabs button {
    padding: 8px 16px;
    border: 1px solid var(--line, rgb(0 0 0 / 18%));
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.cp__map-tabs button[aria-selected='true'] {
    border-color: var(--p-accent);
    background: var(--p-accent);
    color: #fff;
}

.cp__map {
    display: grid;
    justify-items: center;
}

.cp__map[hidden] {
    display: none;
}

.cp__map-canvas {
    position: relative;
    max-width: 100%;
}

.cp__map-canvas img {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    border-radius: var(--r-lg, 20px);
    background: #fff;
    box-shadow: 0 18px 44px rgb(20 20 20 / 12%);
}

.cp__map-point {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--p-accent);
    box-shadow: 0 2px 8px rgb(0 0 0 / 35%);
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease;
}

.cp__map-point:hover,
.cp__map-point:focus-visible {
    transform: translate(-50%, -50%) scale(1.2);
}

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

.cp__map-label {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    display: none;
    padding: 4px 10px;
    border-radius: 8px;
    background: #141414;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
}

.cp__map-point:hover .cp__map-label,
.cp__map-point:focus-visible .cp__map-label,
.cp__map-canvas--labels .cp__map-label {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .cp__map-point {
        transition: none;
    }
}

/* a 3D model among the maps (resources/js/client-page-model.ts) */
.cp__map-model {
    position: relative;
    width: 100%;
    height: min(70vh, 560px);
    overflow: hidden;
    border-radius: var(--r-lg, 20px);
    background: #fff;
    box-shadow: 0 18px 44px rgb(20 20 20 / 12%);
}

.cp__map-model.is-failed::after {
    content: 'Il modello 3D non si può mostrare su questo dispositivo.';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
}

.model-map__canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}

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

.model-map__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.model-map__overlay > * {
    pointer-events: auto;
}

.model-map__overlay .is-behind {
    opacity: 0.35;
}

/* points crowded out by their neighbours: they appear when zooming in (shared/declutter.ts) */
.model-map__overlay .is-crowded {
    opacity: 0;
    pointer-events: none;
}

.model-map__overlay .is-crowded:focus-visible {
    opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
    .model-map__overlay .cp__map-point {
        transition:
            transform 0.15s ease,
            opacity 0.2s;
    }
}

.cp__map-list {
    columns: 2;
}
