.order-guide {
    --guide-ink: #f3f4ff;
    --guide-muted: #b8bfd8;
    --guide-accent: #a5adff;
    --guide-line: #343a5a;
    --guide-number: clamp(2.65rem, 3.4vw, 3rem);
    --guide-inset: clamp(.75rem, 1.6vw, 1.25rem);
    padding-block: clamp(2.75rem, 5vw, 5rem);
    scroll-margin-top: 5rem;
    background: #10132b;
    color: var(--guide-ink);
}

.order-guide__heading {
    margin: 0 0 clamp(1.25rem, 2.7vw, 2.25rem);
    color: inherit;
    font: inherit;
    font-size: clamp(2rem, 3.5vw, 2.875rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.04em;
    text-align: start;
}

.order-guide__steps {
    display: grid;
    gap: .25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.order-guide__item {
    position: relative;
    min-width: 0;
}

.order-guide__choice {
    position: absolute;
    inset-inline-start: var(--guide-inset);
    inset-block-start: 1.5rem;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.order-guide__row {
    position: relative;
    display: grid;
    grid-template-columns: var(--guide-number) minmax(0, 1fr);
    align-content: center;
    column-gap: clamp(.875rem, 1.4vw, 1.125rem);
    row-gap: .2rem;
    min-height: 4.65rem;
    padding: .875rem var(--guide-inset);
    border: 1px solid transparent;
    border-radius: .875rem;
    overflow-wrap: anywhere;
}

.order-guide__row::before {
    position: absolute;
    inset-block: -.375rem;
    inset-inline-start: calc(var(--guide-inset) + var(--guide-number) / 2);
    width: 1px;
    background: var(--guide-line);
    content: "";
    pointer-events: none;
}

.order-guide__item:first-child .order-guide__row::before { inset-block-start: 50%; }
.order-guide__item:last-child .order-guide__row::before { inset-block-end: 50%; }

.order-guide__number {
    position: relative;
    display: grid;
    grid-area: 1 / 1 / span 2;
    place-items: center;
    align-self: center;
    width: var(--guide-number);
    height: var(--guide-number);
    border: 1px solid #464e73;
    border-radius: 50%;
    background: #1a1f39;
    color: #c5cbe5;
    font-size: 1.0625rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.order-guide__title,
.order-guide__copy {
    grid-column: 2;
    margin: 0;
}

.order-guide__title {
    color: var(--guide-ink);
    font-size: clamp(1.0625rem, 1.45vw, 1.25rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.018em;
}

.order-guide__copy {
    color: var(--guide-muted);
    font-size: .96875rem;
    line-height: 1.45;
}

.order-guide__copy > :first-child { margin-block-start: 0; }
.order-guide__copy > :last-child { margin-block-end: 0; }
.order-guide__copy a { position: relative; z-index: 1; color: #c5cbff; text-decoration: underline; }

.order-guide__choice + .order-guide__row {
    padding-inline-end: calc(var(--guide-inset) + 1rem);
}

.order-guide__choice + .order-guide__row label::before {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-end: var(--guide-inset);
    width: .45rem;
    height: .45rem;
    border: solid #9099bd;
    border-width: 1.5px 1.5px 0 0;
    content: "";
    transform: translateY(-50%) rotate(45deg);
}

.order-guide__choice + .order-guide__row label::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    content: "";
    cursor: pointer;
}

.order-guide__choice:checked + .order-guide__row {
    border-color: #707ab4;
    background: linear-gradient(100deg, #2c335c, #202541);
}

.order-guide__choice:checked + .order-guide__row .order-guide__number {
    border-color: var(--guide-accent);
    background: var(--guide-accent);
    color: #161a35;
}

/* WebKit moves radio focus with arrow keys without retaining :focus-visible. */
.order-guide__choice:focus + .order-guide__row,
.order-guide__copy a:focus-visible {
    outline: 3px solid #d2d8ff;
    outline-offset: 2px;
}

.order-guide__preview {
    display: none;
    min-width: 0;
    margin: .5rem 0 .75rem;
    overflow: hidden;
    border: 1px solid #3b4367;
    border-radius: 1rem;
    background: #171c36;
    color: var(--guide-muted);
}

.order-guide__choice:checked ~ .order-guide__preview { display: block; }

.order-guide__scene {
    position: relative;
    display: grid;
    place-items: center start;
    aspect-ratio: 1.56;
    padding: 5% 7% max(5%, 2rem);
    background: #161b39 url("../assets/img/storefront-horizon.webp") 90% center / cover no-repeat;
}

.order-guide__scene img {
    display: block;
    width: 82%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border: 1px solid #606b94;
    border-radius: .75rem;
    background: #161c37;
    box-shadow: 0 .75rem 2rem #080b1d80;
}

@media (max-width: 575px) {
    .order-guide__scene { background-image: url("../assets/img/storefront-horizon-mobile.webp"); }
}

.order-guide__position {
    position: absolute;
    inset-block-end: .5rem;
    inset-inline-end: .625rem;
    padding: .125rem .5rem;
    border-radius: .375rem;
    background: #14182e;
    color: var(--guide-muted);
    font-size: .75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    white-space: nowrap;
}

.order-guide__position b { color: #d4d8ff; }

@media (min-width: 52rem) {
    .order-guide__steps--illustrated {
        grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
        grid-template-rows: repeat(var(--guide-count), auto);
        column-gap: clamp(2rem, 4.6vw, 4.5rem);
    }

    /* Each step keeps one preview in the DOM across both layouts. */
    .order-guide__steps--illustrated .order-guide__item { display: contents; }
    .order-guide__steps--illustrated .order-guide__row,
    .order-guide__steps--illustrated .order-guide__choice { grid-area: var(--guide-row) / 1; }
    .order-guide__steps--illustrated .order-guide__choice {
        position: static;
        align-self: center;
        margin-inline-start: var(--guide-inset);
    }
    .order-guide__preview {
        grid-area: 1 / 2 / -1;
        align-self: center;
        margin: 0;
    }
}

@media (max-width: 51.999rem) {
    .order-guide__choice:checked + .order-guide__row label::before {
        transform: translateY(-75%) rotate(135deg);
    }
}

@media (max-width: 35rem) {
    .order-guide { --guide-number: 2.25rem; }
    .order-guide__number { font-size: .9375rem; }
    .order-guide__copy { font-size: .9375rem; }
    .order-guide__scene { aspect-ratio: 1.42; padding: 4% 5% max(4%, 2rem); }
    .order-guide__scene img { width: 92%; }
}

@media (hover: hover) {
    .order-guide__choice:not(:checked) + .order-guide__row:hover { background: #1c213b; }
}

@media (prefers-reduced-motion: no-preference) {
    .order-guide__choice[data-visited]:checked ~ .order-guide__preview img {
        animation: order-guide-slide-in 200ms cubic-bezier(.2, .7, .3, 1);
    }

    @keyframes order-guide-slide-in {
        from { transform: translateY(.75rem); }
        to { transform: translateY(0); }
    }
}

@media (forced-colors: active) {
    .order-guide__choice:checked + .order-guide__row { border-color: Highlight; }
    .order-guide__choice:checked + .order-guide__row .order-guide__number {
        forced-color-adjust: none;
        background: Highlight;
        color: HighlightText;
    }
}
