/**
 * Metropolis Window Hero.
 */

.window-hero {
	padding-block: clamp(48px, 7vw, 96px) clamp(48px, 6vw, 80px);
}

.window-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: clamp(32px, 5vw, 72px);
	align-items: center;
}

.window-hero--solo .window-hero__inner {
	grid-template-columns: minmax(0, 1fr);
}

.window-hero--solo .display-title {
	max-width: 20ch;
}

/* Short ticked points under the buttons, side by side where they fit. */
.window-hero .window-hero__points {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	margin: 28px 0 0;
	font-size: 0.9375rem;
	color: var(--ink-soft);
}

.window-hero .window-hero__points li {
	grid-template-columns: 18px auto;
	gap: 8px;
}

.window-hero .window-hero__points .icon {
	width: 18px;
	height: 18px;
	margin-top: 2px;
}


/* ==========================
   The window
========================== */

.window {
	position: relative;
	margin: 0;
}

.window__frame {
	padding: 8px;
	background: var(--paper);
	border: 1px solid var(--mist-deep);
	border-radius: 8px;
	box-shadow: 0 24px 48px -28px rgba(12, 39, 31, 0.35);
}

.window__glass {
	position: relative;
	aspect-ratio: 16 / 10; /* website screenshots, taken at 1440×900 so nothing is cropped */
	overflow: hidden;
	border-radius: 4px;
	background: var(--fascia);
	isolation: isolate;
}

/* Fixed glass reflection. */
.window__glass::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	background: linear-gradient(120deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 32%);
}

/* The sheen: the page's one authored motion, on each change of project. */
.window__glass::after {
	content: "";
	position: absolute;
	inset: -10% -60%;
	z-index: 4;
	pointer-events: none;
	background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.55) 50%, transparent 58%);
	transform: translateX(-70%);
	opacity: 0;
}

.window__glass.is-sheen::after {
	animation: nm-sheen 400ms var(--ease-out);
}

@keyframes nm-sheen {
	0%   { transform: translateX(-70%); opacity: 1; }
	100% { transform: translateX(70%); opacity: 0; }
}

.window__etch {
	position: absolute;
	top: 22px;
	right: 28px;
	z-index: 2;
	font-family: var(--serif);
	font-size: 0.9375rem;
	color: var(--on-fascia);
	opacity: 0.7;
	text-shadow: 0 1px 8px rgba(12, 39, 31, 0.5);
}

.window__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	filter: blur(2px);
	transition: opacity 300ms var(--ease-out), filter 300ms var(--ease-out);
}

.window__slide.is-active {
	opacity: 1;
	filter: none;
}

.window__link,
.window__img {
	display: block;
	width: 100%;
	height: 100%;
}

.window__img {
	object-fit: cover;
	object-position: top center;
}

.window:focus-within .brackets::after {
	opacity: 1;
	transform: none;
}

@media (hover: hover) and (pointer: fine) {
	.window:hover .brackets::after {
		opacity: 1;
		transform: none;
	}
}


/* ==========================
   Sill: caption and controls
========================== */

.window__sill {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 4px 0;
}

.window__caption {
	font-size: 0.9375rem;
	color: var(--ink-soft);
}

.window__count {
	margin-right: 8px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--ink);
}

.window__controls {
	display: flex;
	align-items: center;
	gap: 4px;
}

.window__dots {
	display: flex;
}

.window__btn,
.window__dot {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: var(--fascia);
	cursor: pointer;
}

.window__btn .icon--play { display: none; }
.window__btn[aria-pressed="true"] .icon--pause { display: none; }
.window__btn[aria-pressed="true"] .icon--play { display: block; }

.window__dot::before {
	content: "";
	width: 9px;
	height: 9px;
	border: 1.5px solid var(--fascia);
	border-radius: 50%;
	transition: background-color 160ms ease;
}

.window__dot[aria-current="true"]::before {
	background: var(--fascia);
}

@media (hover: hover) and (pointer: fine) {
	.window__btn:hover,
	.window__dot:hover {
		background: var(--mist);
	}
}


/* ==========================
   Responsive
========================== */

@media (max-width: 960px) {
	.window-hero__inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
	.window-hero .actions .btn { width: 100%; }
	.window__sill { flex-wrap: wrap; row-gap: 0; }
	.window__controls { margin-left: -12px; }
}

@media (prefers-reduced-motion: reduce) {
	.window__glass.is-sheen::after { animation: none; }
	.window__slide { filter: none; transition: opacity 200ms ease; }
}
