/**
 * Memories: the homepage's story cards, the event pages' story rings and the
 * full-screen story viewer. Cards and rings follow SmartMag's light and dark schemes
 * through its variables; the viewer is always dark, like the photos it shows.
 */

/* Story cards */

.xy-mem {
	--xym-ink: var(--c-contrast-900, #161616);
	--xym-accent: #c25e00;
	--xym-ring: conic-gradient(from 210deg, #e40666, #ff7a45, #ffb35c, #3c3fde, #e40666);
	--xym-day: conic-gradient(from 0deg, #ffb35c, #ff7a45, #ffb35c, #ffd69a, #ffb35c);
	--xym-card-w: 138px;
	--xym-card-h: 230px;
	--xym-day-w: 180px;

	margin: 22px 0 8px;
	font-family: var(--ui-font, system-ui, sans-serif);
}

.s-dark .xy-mem {
	--xym-accent: #ffad5c;
}

.xy-mem-head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 0 0 12px;
}

.xy-mem-title {
	margin: 0;
	font: 700 19px/1.2 var(--ui-font, system-ui, sans-serif);
	color: var(--xym-ink);
	letter-spacing: -0.01em;
}

.xy-mem-sub {
	font: 600 12.5px/1.2 var(--ui-font, system-ui, sans-serif);
	color: var(--xym-accent);
}

.xy-mem-row {
	display: flex;
	gap: 12px;
	margin: 0;
	padding: 2px 0 6px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.xy-mem-row::-webkit-scrollbar {
	display: none;
}

.xy-mem-item {
	flex: none;
	margin: 0;
	padding: 0;
	scroll-snap-align: start;
}

.xy-mem-item::before {
	display: none;
}

.xy-mem-card {
	position: relative;
	display: block;
	width: var(--xym-card-w);
	height: var(--xym-card-h);
	overflow: hidden;
	border-radius: 14px;
	background: #222;
	color: #fff;
	text-decoration: none;
	isolation: isolate;
	-webkit-tap-highlight-color: transparent;
}

.xy-mem-card.is-day {
	width: var(--xym-day-w);
}

.xy-mem-card::after {
	position: absolute;
	inset: 0;
	z-index: 1;
	content: "";
	background: linear-gradient(rgb(0 0 0 / 35%), transparent 30%, transparent 48%, rgb(0 0 0 / 82%));
	pointer-events: none;
}

.xy-mem-card:focus-visible {
	outline: 3px solid var(--c-main, #3c3fde);
	outline-offset: 3px;
}

.xy-mem-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease, opacity 0.5s ease;
}

.xy-mem-img.is-next {
	opacity: 0;
}

.xy-mem-ring {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	width: 38px;
	height: 38px;
	box-sizing: border-box;
	padding: 2px;
	border-radius: 50%;
	background: var(--xym-ring);
}

.xy-mem-card.is-day .xy-mem-ring {
	background: var(--xym-day);
}

.xy-mem-ring img {
	display: block;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	border: 2px solid #000;
	border-radius: 50%;
	object-fit: cover;
}

.xy-mem-text {
	position: absolute;
	right: 10px;
	bottom: 10px;
	left: 10px;
	z-index: 2;
	display: grid;
	gap: 3px;
}

.xy-mem-kicker {
	font: 700 10.5px/1.2 var(--ui-font, system-ui, sans-serif);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #ffb35c;
}

.xy-mem-name {
	display: -webkit-box;
	overflow: hidden;
	font: 700 13px/1.25 var(--ui-font, system-ui, sans-serif);
	color: #fff;
	text-wrap: balance;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
}

.xy-mem-card.is-day .xy-mem-name {
	font-size: 15px;
}

.xy-mem-card.is-seen .xy-mem-ring {
	background: rgb(255 255 255 / 40%);
}

.xy-mem-card.is-seen .xy-mem-img,
.xy-mem-card.is-seen .xy-mem-text {
	opacity: 0.68;
}

@media (hover: hover) {
	.xy-mem-card:hover .xy-mem-img {
		transform: scale(1.07);
	}

	.xy-mem-card:hover .xy-mem-img.is-next {
		opacity: 1;
	}
}

/* Story rings, on event pages. Shown only where the script runs, which fills them in. */

.xy-mem-rings {
	--xym-gap: var(--c-contrast-0, #fff);
	--xym-seen: rgb(128 128 132 / 38%);

	display: none;
	margin: 18px 0 4px;
}

.xy-js .xy-mem-rings {
	display: block;
}

.xy-mem-rings .xy-mem-in {
	display: flex;
	align-items: center;
	gap: 26px;
}

.xy-mem-rings .xy-mem-head {
	flex: none;
	display: grid;
	gap: 3px;
	margin: 0;
}

.xy-mem-rings .xy-mem-title {
	font-size: 17px;
}

.xy-mem-rings .xy-mem-row {
	flex: 1;
	min-width: 0;
	gap: 18px;

	/* Room for the focus outline, 6px outside the ring, in the scrolling row. */
	padding-top: 7px;
	padding-bottom: 4px;
}

.xy-ring {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	width: 82px;
	color: var(--xym-ink);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}

.xy-ring-av {
	position: relative;
	display: block;
	width: 74px;
	height: 74px;
	box-sizing: border-box;
	padding: 3px;
	border-radius: 50%;
	background: var(--xym-ring);
	transition: transform 0.15s;
}

.xy-ring.is-day .xy-ring-av {
	background: var(--xym-day);
}

.xy-ring-av img {
	display: block;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	border: 3px solid var(--xym-gap);
	border-radius: 50%;
	object-fit: cover;
}

.xy-ring-badge {
	position: absolute;
	bottom: -5px;
	left: 50%;
	padding: 1px 7px;
	border: 2px solid var(--xym-gap);
	border-radius: 999px;
	background: #ffa040;
	color: #1a1006;
	font: 700 10.5px/16px var(--ui-font, system-ui, sans-serif);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	transform: translateX(-50%);
}

.xy-ring-name {
	display: -webkit-box;
	max-width: 82px;
	min-height: 2.5em;
	overflow: hidden;
	font: 500 11.5px/1.25 var(--ui-font, system-ui, sans-serif);
	text-align: center;
	text-wrap: balance;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.xy-ring.is-seen .xy-ring-av {
	background: var(--xym-seen);
}

.xy-ring.is-seen .xy-ring-badge {
	background: #d4d4da;
	color: #333;
}

.s-dark .xy-ring.is-seen .xy-ring-badge {
	background: #3a3a44;
	color: #ddd;
}

.xy-ring.is-seen .xy-ring-name {
	opacity: 0.6;
}

.xy-ring:focus-visible {
	outline: none;
}

.xy-ring:focus-visible .xy-ring-av {
	outline: 3px solid var(--c-main, #3c3fde);
	outline-offset: 3px;
}

.xy-ring:active .xy-ring-av {
	transform: scale(0.96);
}

/* Waiting rings hold the row's place while today's stories load. */
.xy-ring.is-waiting .xy-ring-av {
	background: var(--c-contrast-75, #ededed);
}

.xy-ring.is-waiting .xy-ring-name {
	width: 56px;
	min-height: 0;
	height: 10px;

	/* The two lines of a name, so the row keeps its height when the rings arrive. */
	margin: 3px 0 calc(2.5em - 13px);
	border-radius: 5px;
	background: var(--c-contrast-75, #ededed);
}

@media (hover: hover) {
	.xy-ring:hover .xy-ring-av {
		transform: scale(1.05);
	}
}

/* Phones and tablets: the row runs to the screen edges, past SmartMag's page padding. */
@media (width <= 940px) {
	.xy-mem-row {
		margin: 0 -35px;
		padding-right: 35px;
		padding-left: 35px;
		scroll-padding-inline: 35px;
	}
}

/* Tablets and phones: the rings run edge to edge; the heading stays for screen readers. */
@media (width <= 940px) {
	.xy-mem-rings .xy-mem-in {
		display: block;
	}

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

@media (width <= 767px) {
	.xy-mem-row {
		margin: 0 -25px;
		padding-right: 25px;
		padding-left: 25px;
		scroll-padding-inline: 25px;
	}
}

@media (width <= 600px) {
	.xy-mem {
		--xym-card-w: 104px;
		--xym-card-h: 176px;
		--xym-day-w: 128px;

		margin-top: 16px;
	}

	.xy-mem-head {
		margin-bottom: 10px;
	}

	.xy-mem-row {
		gap: 8px;
	}

	.xy-mem-card {
		border-radius: 12px;
	}

	.xy-mem-ring {
		top: 8px;
		left: 8px;
		width: 32px;
		height: 32px;
	}

	.xy-mem-name {
		font-size: 11.5px;
	}

	.xy-mem-card.is-day .xy-mem-name {
		font-size: 13px;
	}

	.xy-mem-rings {
		margin-top: 12px;
	}

	.xy-mem-rings .xy-mem-row {
		gap: 12px;
	}

	.xy-ring {
		width: 70px;
	}

	.xy-ring-av {
		width: 64px;
		height: 64px;
	}

	.xy-ring-name {
		max-width: 70px;
		font-size: 11px;
	}
}

/* Viewer frame */

.xy-story-open,
.xy-story-open body {
	overflow: hidden;
}

.xy-story {
	--btn-height: auto;
	--btn-l-height: inherit;
	--btn-pad: 0;
	--xys-font: var(--ui-font, system-ui, sans-serif);
	--xys-orange: #ffa040;
	--xys-blue: #3c3fde;

	position: fixed;
	inset: 0;
	z-index: 100001;
	color: #fff;
	font-family: var(--xys-font);
	user-select: none;
	touch-action: none;
	-webkit-tap-highlight-color: transparent;
	animation: xy-story-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.xy-story[hidden] {
	display: none;
}

.xy-story:focus {
	outline: none;
}

.xy-story.is-closing {
	animation: xy-story-out 0.2s ease-in forwards;
}

.xy-story button {
	box-sizing: border-box;
	margin: 0;
	border: 0;
	box-shadow: none;
	font-family: var(--xys-font);
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	appearance: none;
}

.xy-story a {
	text-decoration: none;
}

.xy-story-icon {
	display: block;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentcolor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@keyframes xy-story-in {
	from {
		opacity: 0;
		transform: scale(0.94);
	}
}

@keyframes xy-story-out {
	to {
		opacity: 0;
		transform: scale(0.94);
	}
}

.xy-story-backdrop {
	position: absolute;
	inset: 0;
	background: #000;
}

.xy-story-deck {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 34px;
}

.xy-story-stage {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #000;
	perspective: 1400px;
}

.xy-story-brand,
.xy-story-x,
.xy-story-arrow,
.xy-story-side {
	display: none;
}

/* Wide screens: a phone-shaped stage with the neighbors on either side. */
@media (width >= 700px) and (height >= 560px) {
	.xy-story {
		--xys-h: min(780px, calc(100vh - 56px));
	}

	.xy-story-backdrop {
		background: #08080c;
	}

	.xy-story-stage {
		flex: none;
		width: calc(var(--xys-h) * 9 / 16);
		height: var(--xys-h);
		border-radius: 12px;
	}

	.xy-story-brand {
		position: absolute;
		top: 22px;
		left: 24px;
		z-index: 3;
		display: block;
		font: 800 19px/1 var(--xys-font);
		color: #fff;
		opacity: 0.85;
	}

	.xy-story-x {
		position: absolute;
		top: 16px;
		right: 18px;
		z-index: 3;
		display: grid;
		width: 44px;
		height: 44px;
		place-items: center;
		border-radius: 50%;
		background: transparent;
		color: #fff;
	}

	.xy-story-x:hover {
		background: rgb(255 255 255 / 12%);
	}

	.xy-story-x .xy-story-icon {
		width: 26px;
		height: 26px;
	}

	.xy-story-round.xy-story-close {
		display: none;
	}

	.xy-story-arrow {
		position: absolute;
		top: 50%;
		z-index: 3;
		display: grid;
		width: 40px;
		height: 40px;
		margin-top: -20px;
		place-items: center;
		border-radius: 50%;
		background: rgb(255 255 255 / 92%);
		color: #111;
	}

	.xy-story-arrow.is-prev {
		left: calc(50% - var(--xys-h) * 9 / 32 - 56px);
	}

	.xy-story-arrow.is-next {
		right: calc(50% - var(--xys-h) * 9 / 32 - 56px);
	}

	.xy-story-side {
		position: relative;
		display: block;
		flex: none;
		width: 168px;
		height: 298px;
		overflow: hidden;
		padding: 0;
		border-radius: 10px;
		background: #222;
		opacity: 0.55;
		transition: opacity 0.2s, transform 0.2s;
	}

	.xy-story-side:hover {
		opacity: 0.9;
		transform: scale(1.03);
	}

	.xy-story-side.is-empty {
		visibility: hidden;
	}

	.xy-story-side img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.xy-story-side span {
		position: absolute;
		right: 0;
		bottom: 0;
		left: 0;
		padding: 14px 10px;
		background: linear-gradient(transparent, rgb(0 0 0 / 85%));
		font: 700 12.5px/1.25 var(--xys-font);
		color: #fff;
		text-align: center;
	}
}

@media (width >= 700px) and (width < 1000px) and (height >= 560px) {
	.xy-story-side {
		display: none;
	}
}

/* Slides */

.xy-story-face {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #000;
	backface-visibility: hidden;
}

.xy-story-face.is-leaving-next {
	transform-origin: 0% 50%;
	animation: xy-cube-out-left 0.45s ease-in-out forwards;
}

.xy-story-face.is-entering-next {
	transform-origin: 100% 50%;
	animation: xy-cube-in-right 0.45s ease-in-out;
}

.xy-story-face.is-leaving-prev {
	transform-origin: 100% 50%;
	animation: xy-cube-out-right 0.45s ease-in-out forwards;
}

.xy-story-face.is-entering-prev {
	transform-origin: 0% 50%;
	animation: xy-cube-in-left 0.45s ease-in-out;
}

@keyframes xy-cube-out-left {
	to {
		transform: translateX(-100%) rotateY(-90deg);
	}
}

@keyframes xy-cube-in-right {
	from {
		transform: translateX(100%) rotateY(90deg);
	}
}

@keyframes xy-cube-out-right {
	to {
		transform: translateX(100%) rotateY(90deg);
	}
}

@keyframes xy-cube-in-left {
	from {
		transform: translateX(-100%) rotateY(-90deg);
	}
}

.xy-story-media {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.xy-story-fill {
	position: absolute;
	inset: -40px;
	background-position: center;
	background-size: cover;
	filter: blur(28px) brightness(0.5) saturate(1.2);
}

.xy-story-photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.xy-story-photo.is-whole {
	object-fit: contain;
}

.xy-story-photo.is-in {
	animation: xy-zoom-in var(--xy-dur, 5s) linear forwards;
}

.xy-story-photo.is-out {
	animation: xy-zoom-out var(--xy-dur, 5s) linear forwards;
}

.xy-story-photo.is-whole.is-in,
.xy-story-photo.is-whole.is-out {
	animation-name: xy-zoom-whole;
}

@keyframes xy-zoom-in {
	from {
		transform: scale(1.02) translate(0, 0);
	}

	to {
		transform: scale(1.14) translate(-2%, -2.5%);
	}
}

@keyframes xy-zoom-out {
	from {
		transform: scale(1.14) translate(2%, 1%);
	}

	to {
		transform: scale(1.03) translate(0, 0);
	}
}

@keyframes xy-zoom-whole {
	from {
		transform: scale(1);
	}

	to {
		transform: scale(1.06);
	}
}

.xy-story-face.is-loading .xy-story-media::after {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 34px;
	height: 34px;
	margin: -17px 0 0 -17px;
	box-sizing: border-box;
	content: "";
	border: 3px solid rgb(255 255 255 / 25%);
	border-top-color: #fff;
	border-radius: 50%;
	animation: xy-spin 0.8s linear infinite;
}

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

.xy-story-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(rgb(0 0 0 / 55%), transparent 22%, transparent 58%, rgb(0 0 0 / 78%));
	pointer-events: none;
}

.xy-story-top {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 6;
	padding: 10px 10px 0;
	transition: opacity 0.2s;
}

.xy-story-bars {
	display: flex;
	gap: 4px;
}

.xy-story-bar {
	flex: 1;
	height: 3px;
	overflow: hidden;
	border-radius: 3px;
	background: rgb(255 255 255 / 32%);
}

.xy-story-bar i {
	display: block;
	width: calc(var(--xy-p, 0) * 100%);
	height: 100%;
	border-radius: 3px;
	background: #fff;
}

.xy-story-bar.is-done i {
	width: 100%;
}

.xy-story-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 10px 2px 0;
}

.xy-story-avatar {
	flex: none;
	width: 34px;
	height: 34px;
	box-sizing: border-box;
	border: 2px solid var(--xys-orange);
	border-radius: 50%;
	object-fit: cover;
}

.xy-story-who {
	display: grid;
	flex: 1;
	min-width: 0;
}

.xy-story-who b {
	overflow: hidden;
	font: 700 13.5px/1.25 var(--xys-font);
	color: #fff;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.xy-story-when {
	font: 500 11.5px/1.3 var(--xys-font);
	color: rgb(255 255 255 / 80%);
}

.xy-story-round {
	display: grid;
	flex: none;
	width: 42px;
	height: 42px;
	padding: 0;
	place-items: center;
	border: 1px solid rgb(255 255 255 / 45%) !important;
	border-radius: 50%;
	background: rgb(0 0 0 / 25%);
	color: #fff;
}

.xy-story-round.is-plain {
	width: 38px;
	height: 38px;
	border: 0 !important;
	background: transparent;
}

.xy-story-round:hover {
	background: rgb(255 255 255 / 15%);
}

.xy-story-pause {
	display: block;
	width: 10px;
	height: 13px;
	box-sizing: border-box;
	border-right: 3.5px solid #fff;
	border-left: 3.5px solid #fff;
}

.xy-story-play {
	display: none;
	width: 0;
	height: 0;
	margin-left: 3px;
	border-width: 7px 0 7px 11px;
	border-style: solid;
	border-color: transparent transparent transparent #fff;
}

.xy-story-mark {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 7;
	display: none;
	width: 64px;
	height: 64px;
	margin: -32px 0 0 -32px;
	place-items: center;
	border-radius: 50%;
	background: rgb(0 0 0 / 45%);
	pointer-events: none;
}

.xy-story-mark .xy-story-pause {
	width: 18px;
	height: 22px;
	border-width: 0 6px;
}

.xy-story-over {
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
	transition: opacity 0.2s;
}

.xy-story-over > * {
	pointer-events: auto;
}

.xy-story-stamp {
	position: absolute;
	right: 16px;
	bottom: 98px;
	font: 500 19px/1 ui-monospace, "SF Mono", Menlo, monospace;
	letter-spacing: 0.08em;
	color: var(--xys-orange);
	text-shadow: 0 0 1px #ff7a00, 0 0 8px rgb(255 122 0 / 65%), 0 1px 2px rgb(0 0 0 / 60%);
	pointer-events: none;
}

.xy-story-number {
	position: absolute;
	bottom: 100px;
	left: 16px;
	font: 500 10.5px/1 ui-monospace, "SF Mono", Menlo, monospace;
	color: rgb(255 255 255 / 60%);
	pointer-events: none;
}

.xy-story-cover {
	position: absolute;
	right: 18px;
	bottom: 128px;
	left: 18px;
	display: grid;
	gap: 8px;
	pointer-events: none;
}

.xy-story-cover > * {
	animation: xy-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.xy-story-cover > :nth-child(2) {
	animation-delay: 0.08s;
}

.xy-story-cover > :nth-child(3) {
	animation-delay: 0.16s;
}

@keyframes xy-rise {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
}

.xy-story-kicker {
	justify-self: start;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--xys-orange);
	font: 700 11.5px/1.2 var(--xys-font);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #1a1006;
}

.xy-story-title {
	margin: 0;
	font: 800 26px/1.14 var(--xys-font);
	letter-spacing: -0.02em;
	color: #fff;
	text-shadow: 0 2px 18px rgb(0 0 0 / 50%);
	text-wrap: balance;
}

.xy-story-meta {
	margin: 0;
	font: 500 13px/1.4 var(--xys-font);
	color: rgb(255 255 255 / 85%);
}

.xy-story-bottom {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 6;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 12px max(16px, env(safe-area-inset-bottom));
	transition: opacity 0.2s;
}

.xy-story-link {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 0 16px 0 10px;
	border-radius: 999px;
	background: #fff;
	color: #111;
	font: 700 13.5px/1 var(--xys-font);
	box-shadow: 0 6px 20px rgb(0 0 0 / 35%) !important;
}

.xy-story-up {
	display: grid;
	width: 24px;
	height: 24px;
	place-items: center;
	border-radius: 50%;
	background: var(--xys-blue);
	color: #fff;
	animation: xy-bob 1.6s ease-in-out infinite;
}

.xy-story-up .xy-story-icon {
	width: 15px;
	height: 15px;
	stroke-width: 2.6;
}

@keyframes xy-bob {
	50% {
		transform: translateY(-3px);
	}
}

.xy-story-space {
	flex: 1;
}

/* Reactions, sharing and notes */

.xy-story-react {
	position: absolute;
	right: 12px;
	bottom: 68px;
	z-index: 8;
	display: flex;
	gap: 4px;
	padding: 6px;
	border-radius: 999px;
	background: rgb(20 20 26 / 94%);
	box-shadow: 0 8px 26px rgb(0 0 0 / 50%);
	transform-origin: 90% 100%;
	animation: xy-pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.xy-story-react button {
	display: grid;
	width: 44px;
	height: 44px;
	padding: 4px;
	place-items: center;
	border-radius: 50%;
	background: none;
	transition: transform 0.12s;
}

.xy-story-react button:hover {
	transform: scale(1.22) translateY(-3px);
}

.xy-story-react img {
	display: block;
	width: 34px;
	height: 34px;
}

@keyframes xy-pop {
	from {
		opacity: 0;
		transform: scale(0.4);
	}
}

.xy-story-fly {
	position: absolute;
	bottom: 80px;
	z-index: 9;
	width: 34px;
	height: 34px;
	pointer-events: none;
	animation: xy-fly 1.6s ease-out forwards;
}

@keyframes xy-fly {
	0% {
		opacity: 0;
		transform: translate(0, 0) scale(0.5);
	}

	15% {
		opacity: 1;
		transform: translate(var(--xy-dx1), -60px) scale(1.15);
	}

	100% {
		opacity: 0;
		transform: translate(var(--xy-dx2), -380px) scale(0.9) rotate(var(--xy-rot));
	}
}

.xy-story-share {
	position: absolute;
	right: 12px;
	bottom: 70px;
	left: 12px;
	z-index: 9;
	display: grid;
	gap: 6px;
	padding: 12px;
	border-radius: 16px;
	background: rgb(20 20 26 / 96%);
	animation: xy-pop 0.2s;
}

.xy-story-share b {
	padding: 2px 4px 6px;
	font: 700 13px/1.2 var(--xys-font);
	color: #fff;
}

.xy-story-share-item {
	display: flex;
	align-items: center;
	height: 42px;
	padding: 0 14px;
	border-radius: 10px;
	background: #26262f;
	font: 600 13.5px/1 var(--xys-font);
	color: #fff !important;
	text-align: left;
}

.xy-story-share-item:first-of-type {
	background: #1faa59;
}

.xy-story-toast {
	position: absolute;
	top: 84px;
	left: 50%;
	z-index: 13;
	max-width: calc(100% - 32px);
	padding: 8px 14px;
	border-radius: 999px;
	background: rgb(255 255 255 / 95%);
	font: 600 12.5px/1.3 var(--xys-font);
	color: #111;
	text-align: center;
	transform: translateX(-50%);
	animation: xy-pop 0.2s;
}

/* Stickers: Guess the year and Were you there? */

.xy-sticker {
	position: absolute;
	top: 46%;
	left: 50%;
	box-sizing: border-box;
	width: 76%;
	max-width: 300px;
	padding: 16px 16px 14px;
	border-radius: 18px;
	background: #fff;
	color: #111;
	box-shadow: 0 16px 40px rgb(0 0 0 / 45%);
	transform: translate(-50%, -50%) rotate(-2deg);
	animation: xy-sticker-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25) 0.15s both;
}

.xy-sticker.is-waiting {
	animation: xy-sticker-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25) 0.15s both, xy-sticker-pulse 1.6s ease-in-out 0.6s infinite;
}

@keyframes xy-sticker-in {
	from {
		opacity: 0;
		transform: translate(-50%, -40%) rotate(-8deg) scale(0.7);
	}
}

@keyframes xy-sticker-pulse {
	50% {
		transform: translate(-50%, -50%) rotate(-2deg) scale(1.03);
	}
}

.xy-sticker-band {
	margin: -16px -16px 12px;
	padding: 10px 16px;
	border-radius: 18px 18px 0 0;
	background: linear-gradient(90deg, #e40666, #3c3fde);
	font: 800 15px/1.2 var(--xys-font);
	color: #fff;
	text-align: center;
}

.xy-sticker-title {
	margin: 0 0 12px;
	font: 800 19px/1.15 var(--xys-font);
	letter-spacing: -0.01em;
	color: #111;
	text-align: center;
}

.xy-sticker-options {
	display: grid;
	gap: 7px;
}

.xy-sticker-option {
	height: 44px;
	padding: 0 14px;
	border: 1.5px solid #e4e4ea !important;
	border-radius: 12px;
	background: #fff;
	font: 700 15px/1 var(--xys-font);
	color: #111;
	transition: transform 0.12s, border-color 0.12s;
}

.xy-sticker-option:hover {
	border-color: var(--xys-blue) !important;
}

.xy-sticker-option:active {
	transform: scale(0.97);
}

.xy-sticker-option:disabled {
	cursor: default;
}

.xy-sticker-option.is-right {
	border-color: #19a463 !important;
	background: #19a463;
	color: #fff;
}

.xy-sticker-option.is-wrong {
	border-color: #ef3b4f !important;
	background: #ef3b4f;
	color: #fff;
	animation: xy-shake 0.35s;
}

.xy-sticker-option.is-mute {
	opacity: 0.45;
}

.xy-sticker-option.is-mine {
	border-color: var(--xys-blue) !important;
	background: #eef0ff;
}

.xy-sticker.is-poll .xy-sticker-option {
	text-align: left;
}

@keyframes xy-shake {
	25% {
		transform: translateX(-6px);
	}

	50% {
		transform: translateX(6px);
	}

	75% {
		transform: translateX(-3px);
	}
}

.xy-sticker-result {
	margin: 12px 0 0;
	font: 600 13px/1.4 var(--xys-font);
	color: #333;
	text-align: center;
}

.xy-sticker-go {
	display: inline-flex;
	margin-top: 8px;
	padding: 9px 16px;
	border-radius: 999px;
	background: var(--xys-blue);
	font: 700 13px/1.2 var(--xys-font);
	color: #fff;
}

.xy-burst {
	position: absolute;
	z-index: 8;
	pointer-events: none;
}

.xy-burst-bit {
	position: absolute;
	width: 8px;
	height: 14px;
	border-radius: 2px;
	animation: xy-confetti 1.1s ease-out forwards;
}

@keyframes xy-confetti {
	from {
		opacity: 1;
		transform: translate(0, 0) rotate(0);
	}

	to {
		opacity: 0;
		transform: translate(var(--xy-x), var(--xy-y)) rotate(var(--xy-r));
	}
}

/* Then and now */

.xy-compare {
	position: absolute;
	inset: 0;
	cursor: ew-resize;
}

.xy-compare img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.xy-compare-then {
	filter: sepia(0.25) saturate(0.9);
	clip-path: inset(0 calc(100% - var(--xy-x, 50%)) 0 0);
}

.xy-compare-line {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--xy-x, 50%);
	width: 3px;
	margin-left: -1.5px;
	background: #fff;
	box-shadow: 0 0 12px rgb(0 0 0 / 50%);
}

.xy-compare-handle {
	position: absolute;
	top: 50%;
	left: var(--xy-x, 50%);
	display: grid;
	width: 46px;
	height: 46px;
	margin: -23px 0 0 -23px;
	place-items: center;
	border-radius: 50%;
	background: #fff;
	color: #111;
	box-shadow: 0 6px 20px rgb(0 0 0 / 45%);
}

.xy-compare.is-hint .xy-compare-line,
.xy-compare.is-hint .xy-compare-handle {
	transition: left 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.xy-compare.is-hint .xy-compare-then {
	transition: clip-path 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.xy-compare-tag {
	position: absolute;
	top: 96px;
	padding: 5px 10px;
	border-radius: 8px;
	background: rgb(0 0 0 / 60%);
	font: 800 15px/1.2 var(--xys-font);
	color: #fff;
}

.xy-compare-tag small {
	display: block;
	font: 500 10.5px/1.3 ui-monospace, "SF Mono", Menlo, monospace;
	color: rgb(255 255 255 / 80%);
}

.xy-compare-tag.is-then {
	left: 14px;
}

.xy-compare-tag.is-now {
	right: 14px;
	text-align: right;
}

.xy-story-caption {
	position: absolute;
	right: 18px;
	bottom: 128px;
	left: 18px;
	display: grid;
	gap: 6px;
	pointer-events: none;
}

.xy-story-caption b {
	font: 800 23px/1.15 var(--xys-font);
	color: #fff;
	text-shadow: 0 2px 14px rgb(0 0 0 / 60%);
}

.xy-story-caption span {
	font: 500 13px/1.3 var(--xys-font);
	color: rgb(255 255 255 / 88%);
	text-shadow: 0 1px 8px rgb(0 0 0 / 60%);
}

/* End card */

.xy-story-end {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 11px;
	padding: 96px 22px max(22px, env(safe-area-inset-bottom));
}

.xy-story-end small {
	font: 700 11.5px/1.2 var(--xys-font);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #ffad5c;
}

.xy-story-end .xy-story-title {
	font-size: 23px;
}

.xy-story-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 4px;
	margin: 4px 0;
}

.xy-story-grid img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	border-radius: 6px;
	object-fit: cover;
}

.xy-story-big {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	border-radius: 14px;
	background: #fff;
	font: 800 15px/1 var(--xys-font);
	color: #111;
}

.xy-story-big:hover {
	background: #ffe2c2;
}

.xy-story-next {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 14px;
	background: rgb(255 255 255 / 10%);
	color: #fff;
	text-align: left;
}

.xy-story-next img {
	flex: none;
	width: 42px;
	height: 42px;
	box-sizing: border-box;
	border: 2px solid var(--xys-orange);
	border-radius: 50%;
	object-fit: cover;
}

.xy-story-next span {
	display: grid;
	flex: 1;
	min-width: 0;
}

.xy-story-next small {
	font: 600 10.5px/1.3 var(--xys-font);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgb(255 255 255 / 70%);
}

.xy-story-next b {
	overflow: hidden;
	font: 700 13.5px/1.3 var(--xys-font);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.xy-story-countdown {
	flex: none;
	width: 30px;
	height: 30px;
	transform: rotate(-90deg);
}

.xy-story-countdown circle {
	fill: none;
	stroke: var(--xys-orange);
	stroke-width: 3;
	stroke-dasharray: 82;
	stroke-dashoffset: 82;
	animation: xy-countdown var(--xy-dur, 7s) linear forwards;
}

.xy-story-countdown .is-track {
	stroke: rgb(255 255 255 / 20%);
	stroke-dashoffset: 0;
	animation: none;
}

@keyframes xy-countdown {
	to {
		stroke-dashoffset: 0;
	}
}

/* Event sheet */

.xy-story-sheet {
	position: absolute;
	inset: 0;
	z-index: 12;
}

.xy-sheet-dim {
	position: absolute;
	inset: 0;
	background: rgb(0 0 0 / 45%);
	animation: xy-fade 0.25s;
}

@keyframes xy-fade {
	from {
		opacity: 0;
	}
}

.xy-sheet-panel {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	max-height: 88%;
	overflow-y: auto;
	border-radius: 18px 18px 0 0;
	background: #101016;
	color: #ececec;
	scrollbar-width: none;
	touch-action: pan-y;
	animation: xy-sheet-up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes xy-sheet-up {
	from {
		transform: translateY(100%);
	}
}

.xy-sheet-grab {
	width: 40px;
	height: 4px;
	margin: 9px auto 0;
	border-radius: 4px;
	background: rgb(255 255 255 / 30%);
}

.xy-sheet-hero {
	position: relative;
	margin: 10px 12px 0;
	overflow: hidden;
	border-radius: 12px;
	aspect-ratio: 16 / 9;
}

.xy-sheet-hero img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.xy-sheet-chip {
	position: absolute;
	bottom: 0;
	left: 0;
	padding: 0 8px;
	border-radius: 0 4px 0 0;
	background: var(--c-main, #3c3fde);
	font: 600 10px/20px var(--xys-font);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #fff;
}

.xy-sheet-body {
	display: grid;
	gap: 9px;
	padding: 14px 16px max(18px, env(safe-area-inset-bottom));
}

.xy-sheet-title {
	margin: 0;
	font: 600 18px/1.3 var(--body-font, system-ui, sans-serif);
	color: #f0f0f0;
	text-wrap: balance;
}

.xy-sheet-meta {
	font: 500 12px/1.4 var(--xys-font);
	color: rgb(255 255 255 / 65%);
}

.xy-sheet-views {
	color: #ff6a50;
}

.xy-sheet-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 3px;
	margin: 4px 0;
}

.xy-sheet-grid img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 4px;
	object-fit: cover;
}

.xy-sheet-years {
	display: grid;
	gap: 7px;
	margin: 2px 0 4px;
}

.xy-sheet-years b {
	font: 700 12.5px/1.3 var(--xys-font);
	color: rgb(255 255 255 / 85%);
}

.xy-sheet-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.xy-sheet-year {
	padding: 5px 10px;
	border-radius: 999px;
	background: #1f1f28;
	font: 600 12.5px/1.2 var(--xys-font);
	color: #ddd !important;
}

a.xy-sheet-year:hover {
	background: #2c2c38;
}

.xy-sheet-year.is-here {
	background: var(--xys-orange);
	color: #1a1006 !important;
}

.xy-sheet-go {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 46px;
	border-radius: 12px;
	background: var(--xys-blue);
	font: 700 14.5px/1 var(--xys-font);
	color: #fff !important;
}

.xy-sheet-photo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	border-radius: 12px;
	background: #1f1f28;
	font: 600 13px/1 var(--xys-font);
	color: #fff !important;
}

.xy-sheet-back {
	height: 40px;
	border-radius: 12px;
	background: transparent;
	font: 600 13px/1 var(--xys-font);
	color: rgb(255 255 255 / 70%);
}

/* States: focus, paused and held */

.xy-story button:focus-visible,
.xy-story a:focus-visible,
.xy-story [tabindex="0"]:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.xy-story.is-paused .xy-story-photo,
.xy-story.is-paused .xy-sticker.is-waiting,
.xy-story.is-paused .xy-story-countdown circle,
.xy-story-face.is-loading .xy-story-photo {
	animation-play-state: paused;
}

.xy-story.is-paused .xy-story-head .xy-story-pause {
	display: none;
}

.xy-story.is-paused .xy-story-head .xy-story-play {
	display: block;
}

.xy-story.is-paused:not(.is-holding, .is-sheet) .xy-story-mark {
	display: grid;
}

.xy-story.is-holding .xy-story-top,
.xy-story.is-holding .xy-story-bottom,
.xy-story.is-holding .xy-story-over {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.xy-story,
	.xy-story-face,
	.xy-story-photo,
	.xy-story-cover > *,
	.xy-story-up,
	.xy-sticker,
	.xy-sticker.is-waiting,
	.xy-sheet-panel,
	.xy-mem-img,
	.xy-ring-av {
		transition: none;
		animation: none !important;
	}

	.xy-ring:hover .xy-ring-av,
	.xy-ring:active .xy-ring-av {
		transform: none;
	}
}
