/* Interactive product composition */
.trail {
    --scene-ink: #e9f5a4;
    --trail-motion: running;
    position: relative;
    isolation: isolate;
    overflow: clip;
    color: #f8fbf2;
    background: #151b23;
}
.trail[data-terrain="1"] { --scene-ink: #ffc795; }
.trail[data-terrain="2"] { --scene-ink: #b1f0d5; }
.trail[data-paused], .trail[data-offscreen] { --trail-motion: paused; }

.trail-atmosphere, .trail-atmosphere i {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
.trail-atmosphere { overflow: clip; }
.trail-atmosphere i {
    opacity: 0;
    transition: opacity .9s var(--ease-out);
}
.trail-atmosphere i:nth-child(1) {
    background:
        radial-gradient(ellipse at 38% 36%, #b0c39e60, transparent 39%),
        radial-gradient(ellipse at 7% 90%, #538e892d, transparent 49%),
        linear-gradient(128deg, #18383a 3%, #263435 35%, #161923 68%, #242237);
}
.trail-atmosphere i:nth-child(2) {
    background:
        radial-gradient(ellipse at 42% 29%, #f0975a70, transparent 38%),
        radial-gradient(ellipse at 10% 80%, #95627454, transparent 46%),
        linear-gradient(130deg, #382a40, #4c302d 41%, #211d27 70%, #2b203b);
}
.trail-atmosphere i:nth-child(3) {
    background:
        radial-gradient(ellipse at 30% 51%, #a5d7be63, transparent 39%),
        radial-gradient(ellipse at 2% 12%, #aa91d75d, transparent 48%),
        linear-gradient(129deg, #3b405a, #28494a 42%, #171f2c 74%, #213d3c);
}
.trail[data-terrain="0"] .trail-atmosphere i:nth-child(1),
.trail[data-terrain="1"] .trail-atmosphere i:nth-child(2),
.trail[data-terrain="2"] .trail-atmosphere i:nth-child(3) { opacity: 1; }
.trail::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-linear-gradient(111deg, #fff3 0 1px, transparent 1px 78px);
    opacity: .08;
    mask-image: linear-gradient(90deg, #000, transparent 64%);
    pointer-events: none;
}
.trail-frame {
    display: grid;
    grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr);
    grid-template-areas: "stage copy";
    width: min(100%, 1590px);
    margin-inline: auto;
    direction: ltr;
    min-height: clamp(545px, 48vw, 730px);
    padding-inline: clamp(7px, 2vw, 38px) clamp(22px, 4.2vw, 76px);
}

.trail-board {
    grid-area: copy;
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-self: center;
    direction: rtl;
    min-width: 0;
    padding: 22px 1px 25px 12px;
    z-index: 2;
}
.trail-index {
    display: inline-flex;
    width: max-content;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: #e3ebdd;
}
.trail-index span {
    width: 6px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--scene-ink);
    box-shadow: 0 0 10px var(--scene-ink);
}
.trail-index .icon { width: 14px; height: 14px; opacity: .72; }
.trail-scene-stack {
    display: grid;
    align-items: center;
    min-width: 0;
    padding-block: clamp(19px, 2.3vw, 34px) clamp(25px, 3.7vw, 59px);
}
.trail-scene {
    grid-area: 1 / 1;
    visibility: hidden;
    min-width: 0;
}
.trail-scene.is-current { visibility: visible; }
.trail-scene h1, .trail-scene h2 {
    display: grid;
    gap: .065em;
    font-size: clamp(38px, 4.35vw, 72px);
    line-height: 1.12;
    letter-spacing: -.048em;
    font-weight: 880;
}
.trail-scene strong {
    color: var(--scene-ink);
    background: linear-gradient(120deg, #fdfff0 6%, var(--scene-ink) 68%, #fff3dc 116%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: inherit;
}
.trail-scene p {
    margin-block: 16px 23px;
    color: #dddeda;
    font-size: clamp(13px, 1.17vw, 17px);
    line-height: 1.8;
}
.trail-button {
    min-height: 48px;
    border-radius: 4px 16px 4px 16px;
    padding-inline: 16px;
    color: #182022;
    background: linear-gradient(120deg, #fdfff0, var(--scene-ink) 85%);
    font-weight: 830;
}
.trail-button .icon, .trail-collection-arrow .icon { transition: transform .18s var(--ease-out); }
.trail-chooser {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 5px;
    border: 1px solid #e8f4e041;
    border-radius: 7px 18px 7px 18px;
    background: #12192161;
}
.trail-chooser[hidden], .trail-rail-footer[hidden], .trail-motion[hidden] { display: none; }
.trail-chooser button {
    display: grid;
    gap: 3px;
    min-width: 0;
    min-height: 53px;
    padding: 6px 10px;
    text-align: start;
    border: 1px solid transparent;
    border-radius: 4px 12px 4px 12px;
    color: #e2e8dd;
    background: transparent;
    font-size: clamp(11px, 1.05vw, 15px);
    font-weight: 680;
    transition: border-color .24s ease, color .24s ease, background-color .24s ease;
}
.trail-chooser button[aria-pressed="true"] {
    color: var(--scene-ink);
    border-color: color-mix(in srgb, var(--scene-ink), transparent 40%);
    background: color-mix(in srgb, var(--scene-ink), transparent 89%);
}
.trail-chooser small { font-size: 11px; line-height: 1; }
.trail-chooser button:focus-visible, .trail-button:focus-visible, .trail-motion:focus-visible { outline-color: var(--scene-ink); }

.trail-lab {
    grid-area: stage;
    position: relative;
    align-self: stretch;
    min-width: 0;
    isolation: isolate;
}
.trail-word {
    position: absolute;
    z-index: -1;
    top: 44%;
    left: 51%;
    transform: translate(-50%, -50%) rotate(-9deg);
    color: transparent;
    -webkit-text-stroke: 1px #ecfce463;
    font: 900 clamp(110px, 18vw, 320px)/.72 Arial, sans-serif;
    letter-spacing: -.13em;
    white-space: nowrap;
    text-indent: -.13em;
    opacity: .73;
    pointer-events: none;
}
.trail-map {
    position: absolute;
    z-index: -1;
    width: 104%;
    height: 100%;
    left: -2%;
    top: 0;
    stroke: url(#trail-orbit-gradient);
    stroke-width: 1.25;
    pointer-events: none;
    transform-origin: 50% 52%;
    transition: transform 1.05s var(--ease-out);
}
.trail[data-terrain="1"] .trail-map { transform: rotate(9deg) scale(1.06); }
.trail[data-terrain="2"] .trail-map { transform: rotate(-10deg) scale(.97); }
.trail-glint {
    position: absolute;
    z-index: -1;
    inset: 14% 9% 16%;
    border-radius: 50%;
    background: conic-gradient(from 235deg, transparent 0 55%, #aef0be21 59%, transparent 64%);
    animation: trail-glint 13s linear infinite;
    animation-play-state: var(--trail-motion);
    pointer-events: none;
}
.trail-orbit {
    position: absolute;
    inset: 0;
    container-type: size;
}
.trail-object {
    position: absolute;
    z-index: var(--layer);
    left: 50%;
    top: 50%;
    width: var(--width);
    height: var(--height);
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 15%;
    background: none;
    opacity: 1;
    transform: translate3d(calc(-50% + var(--x) * 1cqw), calc(-50% + var(--y) * 1cqh), 0)
        rotate(var(--angle)) scale(var(--size, 1));
    transition: transform var(--travel, .9s) var(--ease-out), opacity .35s ease;
}
.trail-object:disabled { opacity: 1; cursor: default; }
.trail-object:focus-visible { outline-color: var(--scene-ink); }
.trail-object--jacket { --x: -22; --y: -15; --angle: -15deg; --width: 43%; --height: 58%; --layer: 3; --travel: 920ms; --drift: -26px; --float: 5.6s; --phase: -1.4s; }
.trail-object--pants { --x: 26; --y: -14; --angle: 18deg; --width: 33%; --height: 62%; --layer: 1; --travel: 1020ms; --drift: -19px; --float: 6.7s; --phase: -2.2s; }
.trail-object--boot { --x: -19; --y: 25; --angle: -9deg; --width: 42%; --height: 39%; --layer: 4; --travel: 810ms; --drift: -20px; --float: 5.3s; --phase: -.6s; }
.trail-object--sneaker { --x: 13; --y: 15; --angle: -14deg; --width: 51%; --height: 43%; --layer: 5; --travel: 740ms; --drift: -34px; --float: 4.9s; --phase: -1.1s; }
.trail[data-focus="jacket"] .trail-object--jacket { --x: 4; --y: -10; --angle: -8deg; --size: 1.32; --layer: 5; }
.trail[data-focus="jacket"] .trail-object--pants { --x: 28; --y: 12; --angle: 26deg; --size: .74; }
.trail[data-focus="jacket"] .trail-object--boot { --x: -23; --y: 21; --angle: 9deg; --size: .87; }
.trail[data-focus="jacket"] .trail-object--sneaker { --x: -26; --y: -21; --angle: -19deg; --size: .65; --layer: 2; }
.trail[data-focus="pants"] .trail-object--pants { --x: 8; --y: -9; --angle: 11deg; --size: 1.23; --layer: 5; }
.trail[data-focus="pants"] .trail-object--jacket { --x: -22; --y: -17; --angle: -23deg; --size: .77; }
.trail[data-focus="pants"] .trail-object--boot { --x: 28; --y: 25; --angle: -8deg; --size: .72; --layer: 4; }
.trail[data-focus="pants"] .trail-object--sneaker { --x: -19; --y: 21; --angle: -3deg; --size: .79; --layer: 4; }
.trail[data-focus="boot"] .trail-object--boot { --x: 6; --y: 11; --angle: -12deg; --size: 1.32; --layer: 5; }
.trail[data-focus="boot"] .trail-object--sneaker { --x: 24; --y: -11; --angle: -17deg; --size: .72; --layer: 3; }
.trail[data-focus="boot"] .trail-object--pants { --x: -27; --y: 10; --angle: 13deg; --size: .72; }

.trail-gear-depth, .trail-gear-drift {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}
.trail-gear-depth {
    transition: transform .45s var(--ease-out);
}
.trail-gear-drift {
    animation: trail-float var(--float) var(--phase) ease-in-out infinite alternate;
    animation-play-state: var(--trail-motion);
}
.trail-object picture { width: 100%; height: 100%; display: block; }
.trail-object img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 15px 12px #080d15a0);
    transition: transform .33s var(--ease-out);
}
.trail:not([data-entered]) .trail-object {
    animation: trail-arrive var(--arrive, 1050ms) var(--wait, 0ms) var(--ease-out) backwards;
}
.trail:not([data-entered]) .trail-object--jacket { --wait: 65ms; --enter-x: -110px; --enter-y: -26px; }
.trail:not([data-entered]) .trail-object--pants { --wait: 130ms; --arrive: 1150ms; --enter-x: 95px; --enter-y: -54px; }
.trail:not([data-entered]) .trail-object--boot { --wait: 96ms; --arrive: 900ms; --enter-x: -90px; --enter-y: 72px; }
.trail:not([data-entered]) .trail-object--sneaker { --arrive: 960ms; --enter-x: 75px; --enter-y: 62px; }
.trail-motion {
    position: absolute;
    z-index: 7;
    left: clamp(9px, 1.25vw, 23px);
    bottom: clamp(10px, 1.8vw, 28px);
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #f9ffed;
    border: 1px solid #cdddc573;
    border-radius: 50%;
    background: #18242a80;
    font: 600 19px/1 Arial, sans-serif;
}
.trail-motion .motion-play, .trail-motion[aria-pressed="true"] .motion-pause { display: none; }
.trail-motion[aria-pressed="true"] .motion-play { display: inline; }

@keyframes trail-arrive {
    from {
        opacity: .08;
        transform: translate3d(calc(-50% + var(--x) * 1cqw + var(--enter-x)), calc(-50% + var(--y) * 1cqh + var(--enter-y)), 0)
            rotate(calc(var(--angle) - 16deg)) scale(.78);
    }
}
@keyframes trail-float { to { transform: translateY(var(--drift)) rotate(3.5deg); } }
@keyframes trail-glint { to { transform: rotate(360deg); } }

@media (hover: hover) and (pointer: fine) {
    .trail-button:hover { background: linear-gradient(120deg, white, var(--scene-ink) 63%); }
    .trail-button:hover .icon, .trail-collection:hover .icon { transform: translateX(-5px); }
    .trail-chooser button:hover { color: var(--scene-ink); }
    .trail-object:hover img { transform: scale(1.045); }
    .trail-motion:hover { border-color: var(--scene-ink); }
}
@media (max-width: 1050px) {
    .trail-frame { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); min-height: 490px; }
}
@media (max-width: 700px) {
    .trail-frame {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "stage" "copy";
        min-height: 0;
        padding: 0;
    }
    .trail-lab { min-height: clamp(270px, 75vw, 453px); }
    .trail-board { padding: 0 16px 18px; }
    .trail-word { font-size: clamp(112px, 32vw, 228px); }
    .trail-scene-stack { padding-block: 11px 16px; }
    .trail-scene h1, .trail-scene h2 { font-size: clamp(34px, 8.9vw, 53px); }
    .trail-scene p { margin-block: 8px 11px; }
    .trail-button { min-height: 42px; }
    .trail-motion { left: 11px; bottom: 10px; width: 36px; height: 36px; }
    .trail-index { font-size: 12px; }
    .trail-chooser button { min-height: 43px; padding: 4px 8px; }
    .trail-object { --drift: -14px; }
}
@media (prefers-reduced-motion: reduce) {
    .trail-gear-depth { transform: none !important; }
}
