/*
 * Slidestory options: one large picture with a rail of the other tellings, plus the badges, chips and tags
 * that the gallery and the landing page share.
 */

/* shared bits */
.cbadge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; line-height: 1.2; padding: 5px 11px 5px 9px; border-radius: 999px; background: var(--na-bg); color: var(--na-fg); }
.cbadge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.cbadge[data-s="ok"] { background: var(--ok-bg); color: var(--ok-fg); }
.cbadge[data-s="warn"] { background: var(--tune-bg); color: var(--tune-fg); }
.cslot { display: inline-flex; }
.cslot:empty { display: none; }
.vc-form { justify-self: start; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.opt-tag { font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--mark); color: var(--mark-ink); }
.tchip { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 700; padding: 7px 14px 7px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.tchip::before { content: ""; width: 11px; height: 10px; background: var(--accent); clip-path: polygon(50% 0, 100% 100%, 0 100%); flex: none; }
.tchip[data-d="down"]::before { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.opt-pk { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transform: scale(0); transition: transform .3s cubic-bezier(.3, 1.5, .5, 1); pointer-events: none; }
.opt-pk svg { width: 13px; height: 13px; stroke-width: 3.2; }
[data-picked="1"] > .opt-pk { transform: scale(1); }
.still * { animation: none !important; }
.sk, .skel { display: block; }

/* ---------- inline options ---------- */
.opts { display: grid; grid-template-columns: minmax(0, 1fr) clamp(170px, 20%, 220px); gap: clamp(14px, 2vw, 22px); align-items: start; }
.opt-main { display: grid; gap: 14px; min-width: 0; }
.opt-art { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: #fff; overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow-frame); transition: transform .35s var(--ease), box-shadow .35s; }
.opt-art:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -22px rgba(14, 21, 48, .55); }
.opt-svg { display: block; width: 100%; height: 100%; }
.opt-svg svg { display: block; width: 100%; height: 100%; }
.opt-svg.swap { animation: optIn .5s var(--ease) both; }
.opt-svg.swap[data-dir="next"] { --fx: 26px; }
.opt-svg.swap[data-dir="prev"] { --fx: -26px; }
.opt-svg.swap[data-dir="none"] { --fx: 0px; }
@keyframes optIn { from { opacity: 0; transform: translateX(var(--fx, 0)) scale(.985); } }
.opt-zoom { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); opacity: 0; transform: scale(.7); transition: opacity .25s, transform .3s cubic-bezier(.3, 1.4, .5, 1); box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .5); }
.opt-zoom svg { width: 18px; height: 18px; }
.opt-art:hover .opt-zoom, .opt-art:focus-visible .opt-zoom { opacity: 1; transform: none; }
@media (hover: none) { .opt-zoom { opacity: .92; transform: none; } }
.opt-info { display: grid; gap: 12px; }
.opt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.opt-why { font-size: 16.5px; line-height: 1.45; color: var(--ink); max-width: 62ch; text-wrap: pretty; }
.opt-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.opt-more { display: inline-flex; align-items: center; gap: 8px; }

.opt-rail { display: grid; gap: 12px; align-content: start; }
.opt { position: relative; display: grid; gap: 7px; padding: 7px 7px 9px; text-align: left; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; transition: transform .3s var(--ease), border-color .2s, box-shadow .3s, background .2s, opacity .3s; }
.opt:hover { transform: translateX(-3px); border-color: var(--line-2); }
.opt[data-on="1"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent); background: var(--accent-soft); transform: translateX(-6px); }
.opt-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.opt-thumb svg { display: block; width: 100%; height: 100%; }
.opt-name { font-size: 13.5px; font-weight: 700; padding: 0 3px; color: var(--ink); }
.opts[data-has="1"] .opt:not([data-picked="1"]):not([data-on="1"]) { opacity: .72; }
.opts.fresh .opt { animation: optDeal .6s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 250ms); }
.opts.fresh .opt-art { animation: optArt .7s var(--ease) both; }
@keyframes optDeal { from { opacity: 0; transform: translateX(34px) scale(.92); } }
@keyframes optArt { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.opts.skeleton .opt-art.sk { display: grid; place-items: center; cursor: default; background: linear-gradient(100deg, var(--sunk) 20%, var(--line) 45%, var(--sunk) 70%); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; box-shadow: none; }
.opts.skeleton .opt-art.sk:hover { transform: none; }
.opts.skeleton .opt { cursor: default; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 90ms); }
.opts.skeleton .opt:hover { transform: none; }
.opt-thumb.sk { background: linear-gradient(100deg, var(--sunk) 20%, var(--line) 45%, var(--sunk) 70%); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; }
.opts.skeleton .opt-info .skel { height: 14px; } .opts.skeleton .opt-info .skel + .skel { width: 60%; }

@media (max-width: 900px) {
  .opts { grid-template-columns: minmax(0, 1fr); }
  .opt-rail { display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 10px; margin-inline: -4px; scroll-snap-type: x proximity; scrollbar-width: thin; }
  .opt { flex: 0 0 clamp(150px, 38vw, 210px); scroll-snap-align: start; }
  .opt:hover, .opt[data-on="1"] { transform: translateY(-3px); }
}

/* ---------- the announcement: "Here are your four options" ---------- */
.opt-banner { grid-column: 1 / -1; position: relative; isolation: isolate; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 18px 8px 9px; border-radius: 999px; background: var(--ink); color: var(--paper); overflow: hidden; }
.opt-banner::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(100deg, transparent 38%, color-mix(in srgb, var(--paper) 38%, transparent) 50%, transparent 62%); transform: translateX(-130%); }
.ob-spark { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--mark); color: var(--mark-ink); }
.ob-spark svg { width: 19px; height: 19px; }
.ob-t { font: 700 clamp(17px, 2vw, 21px)/1.15 var(--display); font-variation-settings: "wdth" 94; letter-spacing: -.015em; }
.ob-w { display: inline-block; }
.ob-w.hl { position: relative; isolation: isolate; color: var(--mark-ink); padding: 0 .3em; margin: 0 -.05em; }
.ob-w.hl::before { content: ""; position: absolute; inset: .06em 0 0; z-index: -1; border-radius: .32em; background: var(--mark); transform-origin: 0 50%; }
.ob-hint { margin-left: 4px; font-size: 14px; opacity: .72; }
.ob-dots { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.ob-dots i { display: block; width: 8px; height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--paper) 38%, transparent); transition: width .35s var(--ease), background .25s; }
.ob-dots i[data-on="1"] { width: 24px; background: var(--mark); }
.opts.skeleton .opt-banner.sk { background: linear-gradient(100deg, var(--sunk) 20%, var(--line) 45%, var(--sunk) 70%); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; }
.opts.skeleton .opt-banner.sk::after { display: none; }

/* when options arrive: the line glides in, the rail is swept by a light, the card blooms a ring */
.opts.fresh .opt-banner { animation: obGlide .9s var(--ease) both; }
.opts.fresh .opt-banner::after { animation: obShine 1.2s .7s var(--ease) both; }
.opts.fresh .ob-spark { animation: obSpark .9s .25s var(--ease) both; }
.opts.fresh .ob-w { animation: obWord .7s var(--ease) both; animation-delay: calc(var(--w) * 90ms + 380ms); }
.opts.fresh .ob-w.hl::before { animation: obMark .6s 1s var(--ease) both; }
.opts.fresh .ob-hint { animation: fadeIn .6s 1.1s both; }
.opts.fresh .ob-dots i { animation: vzPop .5s var(--ease) both; animation-delay: calc(var(--i) * 80ms + 900ms); }
.opts.fresh .opt-info { animation: rise .6s .55s var(--ease) both; }
.opt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--mark) 70%, transparent) 50%, transparent 70%); background-size: 260% 100%; }
.opts.fresh .opt::after { animation: optSheen 1.1s var(--ease) both; animation-delay: calc(var(--i) * 150ms + 1100ms); }
.opts.hold *, .opts.hold *::before, .opts.hold *::after { animation-play-state: paused !important; }
@keyframes obGlide { from { opacity: 0; transform: translateX(-34px); clip-path: inset(0 100% 0 0 round 999px); } to { clip-path: inset(0 0 0 0 round 999px); } }
@keyframes obShine { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@keyframes obSpark { from { opacity: 0; transform: scale(.3) rotate(-120deg); } }
@keyframes obWord { from { opacity: 0; transform: translateY(.5em); filter: blur(4px); } }
@keyframes obMark { from { transform: scaleX(0); } }
@keyframes optSheen { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 0; background-position: -20% 0; } }
.sx-status.pop { padding: 3px 11px; border-radius: 999px; animation: statPop 1.4s var(--ease) both; }
@keyframes statPop { 0% { transform: scale(.4); background: var(--mark); color: var(--mark-ink); } 30% { transform: scale(1.2); } 60% { transform: none; background: var(--mark); color: var(--mark-ink); } 100% { background: transparent; } }
.sx.arrived::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent); pointer-events: none; opacity: 0; animation: arriveRing 1.8s .1s var(--ease) both; }
@keyframes arriveRing { 0% { opacity: 0; transform: scale(1.015); } 22% { opacity: .85; } 100% { opacity: 0; transform: scale(1); } }
@media (max-width: 700px) { .ob-hint { display: none; } .opt-banner { padding-right: 14px; } }
