/**
 * Homepage hero: featured content slideshow.
 * Full-bleed photos crossfade (with a slow drift); the slide text sits in a
 * glass panel on the right: 50% Dusk with a 3px backdrop blur.
 */

.home-slides {
	--hs-interval: 7000ms;
	position: relative; overflow: clip;
	min-height: max(760px, 100svh);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
	grid-template-rows: 1fr auto;
	align-items: center; column-gap: clamp(32px, 4vw, 72px); row-gap: clamp(28px, 3.5vh, 48px);
	padding: clamp(32px, 5vh, 64px) clamp(24px, 4.5vw, 72px) clamp(20px, 3vh, 32px);
	background: var(--ali-night); color: var(--ali-bone);
}
.home-slides.is-empty { grid-template-columns: minmax(0, 1fr); }

/* Welcome: left side, over the photos */
.hs-welcome { position: relative; z-index: 2; max-width: 560px; grid-column: 1; grid-row: 1; }
.hs-avatar {
	display: block; width: 84px; height: 84px; margin: 0 0 24px; border-radius: 50%; object-fit: cover;
	border: 3px solid rgba(237, 232, 222, .9); box-shadow: 0 6px 18px rgba(4, 10, 9, .3);
}
.hs-welcome-title {
	margin: 0; font: 400 clamp(64px, 6.4vw, 100px)/.95 var(--ali-font-display); letter-spacing: -.025em;
	color: var(--ali-bone); text-shadow: 0 2px 30px rgba(4, 10, 9, .3);
}
.hs-intro { margin: 24px 0 0; max-width: 440px; font-size: 18px; line-height: 1.55; color: rgba(237, 232, 222, .92); }
.hs-ready { margin: 32px 0 0; font: 500 26px/1.2 var(--ali-font-display); letter-spacing: -.005em; color: var(--ali-bone); }
.hs-start { margin-top: 16px; }
.hs-start .ali-icon { transition: transform .6s var(--ali-ease); }
.hs-start:hover .ali-icon { transform: translateY(4px); }
.hs-start:focus-visible { outline: 2px solid var(--ali-soul); outline-offset: 3px; }

/* Photos */
.hs-stage { position: absolute; inset: 0; z-index: 0; }
.hs-stage::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background:
		linear-gradient(90deg, rgba(11, 23, 22, .35) 0%, rgba(11, 23, 22, 0) 50%),
		linear-gradient(0deg, rgba(11, 23, 22, .45) 0%, rgba(11, 23, 22, 0) 28%);
}
.hs-media { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s var(--ali-ease); }
.hs-media.is-active { opacity: .5; z-index: 1; } /* half-strength photos over Night, so the Welcome reads */
.hs-img {
	display: block; width: 100%; height: 100%; object-fit: cover;
	transform: scale(1.07);
	transition: transform 0s linear 1.4s; /* reset only after it has faded out */
}
.hs-media.is-active .hs-img { transform: scale(1); transition: transform calc(var(--hs-interval) + 2s) linear; }

/* Glass panel */
.hs-panel {
	position: relative; z-index: 2; grid-column: 2; grid-row: 1;
	width: min(500px, 100%);
	padding: clamp(28px, 3vw, 40px);
	border: 1px solid rgba(237, 232, 222, .14); border-radius: 22px;
	background: rgba(16, 32, 30, .5);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	box-shadow: 0 24px 60px rgba(4, 10, 9, .25);
}

/* Slide text: stacked in one grid cell so the panel keeps the height of the longest slide */
.hs-texts { display: grid; }
.hs-text {
	grid-area: 1 / 1; align-self: end;
	opacity: 0; visibility: hidden;
	transition: opacity .5s var(--ali-ease), visibility 0s linear .5s;
}
.hs-text.is-active { opacity: 1; visibility: visible; transition: opacity .7s var(--ali-ease) .25s, visibility 0s; }
.hs-text > * { transform: translateY(14px); transition: transform .9s var(--ali-ease); }
.hs-text.is-active > * { transform: none; }
.hs-text.is-active > :nth-child(1) { transition-delay: .25s; }
.hs-text.is-active > :nth-child(2) { transition-delay: .32s; }
.hs-text.is-active > :nth-child(3) { transition-delay: .39s; }
.hs-text.is-active > :nth-child(4) { transition-delay: .46s; }

.hs-kind {
	display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
	font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
	color: var(--ali-soul);
}
.hs-kind::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }
.hs-title {
	margin: 0 0 14px;
	font: 500 clamp(34px, 3.3vw, 50px)/1.04 var(--ali-font-display); letter-spacing: -.02em;
	color: var(--ali-bone); text-wrap: balance;
}
.hs-headline {
	margin: 0 0 28px;
	font-size: 17px; line-height: 1.55; color: rgba(237, 232, 222, .88);
	display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

/* Controls */
.hs-controls {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(237, 232, 222, .16);
}
.hs-dots { display: flex; gap: 6px; }
.hs-dot {
	position: relative; width: 34px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer;
}
.hs-dot::before, .hs-fill {
	content: ""; position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px;
}
.hs-dot::before { right: 0; background: rgba(237, 232, 222, .25); transition: background .3s; }
.hs-dot:hover::before { background: rgba(237, 232, 222, .5); }
.hs-fill { width: 0; background: var(--ali-bone); }
.hs-dot.is-active .hs-fill { width: 100%; }
.home-slides.is-playing .hs-dot.is-active .hs-fill { animation: hs-fill var(--hs-interval) linear both; }
.home-slides.is-held .hs-dot.is-active .hs-fill { animation-play-state: paused; }
@keyframes hs-fill { from { width: 0; } to { width: 100%; } }

.hs-nav { display: flex; align-items: center; gap: 8px; }
.hs-count { margin-right: 6px; font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .04em; color: var(--ali-sage); }
.hs-count b { font-weight: 600; color: var(--ali-bone); }
.hs-arrow {
	display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
	border: 1px solid rgba(237, 232, 222, .28); border-radius: 50%;
	background: transparent; color: var(--ali-bone); cursor: pointer;
	transition: background .3s, color .3s, border-color .3s;
}
.hs-arrow:hover { background: var(--ali-bone); border-color: var(--ali-bone); color: var(--ali-dusk); }
.hs-dot:focus-visible, .hs-arrow:focus-visible, .hs-btn:focus-visible { outline: 2px solid var(--ali-soul); outline-offset: 3px; }
.hs-toggle .i-play, .hs-toggle .i-pause { display: grid; }
.hs-toggle .i-play { display: none; }
.home-slides.is-paused .hs-toggle .i-play { display: grid; }
.home-slides.is-paused .hs-toggle .i-pause { display: none; }

/* No script: just the first slide */
.no-js .hs-controls { display: none; }

/* Year in numbers: full width along the bottom, same glass as the panel */
.hs-stats {
	position: relative; z-index: 2; grid-column: 1 / -1; grid-row: 2;
	container-type: inline-size;
	display: flex; flex-wrap: wrap; align-items: center; gap: 14px clamp(20px, 3vw, 48px);
	padding: 22px clamp(24px, 3vw, 40px);
	border: 1px solid rgba(237, 232, 222, .14); border-radius: 22px;
	background: rgba(16, 32, 30, .5);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}
.hs-stats-head { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hs-stats-year { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ali-soul); }
.hs-stats-link {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 14px; font-weight: 600; color: #FFFFFF; text-decoration: none;
}
.hs-stats-link .ali-icon { transition: transform .5s var(--ali-ease); }
.hs-stats-link:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 4px; }
.hs-stats-link:hover .ali-icon { transform: translateX(4px); }
.hs-stats-link:focus-visible { outline: 2px solid var(--ali-soul); outline-offset: 3px; border-radius: 4px; }
.hs-stats-list { flex: 1 1 620px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.hs-stat {
	display: flex; flex-direction: column; justify-content: space-between;
	padding: 2px clamp(16px, 2.5vw, 36px); border-left: 1px solid rgba(237, 232, 222, .16);
}
.hs-stat dt {
	display: flex; align-items: center; gap: 8px; margin: 0 0 6px;
	font-size: 13px; font-weight: 500; color: var(--ali-sage);
}
.hs-stat dt .ali-icon { color: rgba(237, 232, 222, .7); }
.hs-stat dd {
	margin: 0; font: 400 clamp(24px, 4.4cqi, 42px)/1 var(--ali-font-display); letter-spacing: -.02em;
	font-variant-numeric: tabular-nums; color: var(--ali-bone);
}
.hs-stat-short { display: none; }
/* When the strip is too narrow for one row, the year sits above the numbers */
@container (max-width: 860px) {
	.hs-stats-head { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
	.hs-stat:first-child { border-left: 0; padding-left: 0; }
	.hs-stat dd { font-size: clamp(24px, 5.6cqi, 40px); }
}

/* Narrower screens: Welcome on top, the slide panel below it */
@media (max-width: 1199.98px) {
	.home-slides { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; align-content: space-between; align-items: start; row-gap: 40px; padding-top: 48px; }
	.hs-welcome, .hs-panel, .hs-stats { grid-column: 1; grid-row: auto; }
	.hs-panel { justify-self: stretch; width: 100%; }
	.hs-stage::after { background: linear-gradient(180deg, rgba(11, 23, 22, .6) 0%, rgba(11, 23, 22, .1) 45%, rgba(11, 23, 22, .1) 65%, rgba(11, 23, 22, .45) 100%); }
}

@media (max-width: 767.98px) {
	.home-slides { min-height: max(600px, 100svh); row-gap: 28px; padding: 36px 16px 16px; }
	.hs-avatar { width: 64px; height: 64px; margin-bottom: 18px; }
	.hs-welcome-title { font-size: 60px; }
	.hs-intro { margin-top: 18px; font-size: 16px; }
	.hs-stats { padding: 18px 20px 16px; border-radius: 18px; row-gap: 12px; }
	.hs-stat { padding: 0 12px; }
	.hs-stat:first-child { padding-left: 0; }
	.hs-stat dt { font-size: 11.5px; gap: 6px; }
	.hs-stat dt .ali-icon { display: none; }
	.hs-stat dd { font-size: 26px; margin-top: 4px; }
	.hs-stat-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* still read aloud */
	.hs-stat-short { display: inline; }
	.hs-ready { margin-top: 26px; font-size: 22px; }
	.hs-panel { justify-self: stretch; }
	.hs-panel { width: 100%; padding: 24px; border-radius: 18px; }
	.hs-title { font-size: 32px; }
	.hs-headline { font-size: 16px; margin-bottom: 22px; -webkit-line-clamp: 3; }
	.hs-controls { margin-top: 22px; padding-top: 18px; }
	.hs-dot { width: 24px; }
	.hs-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hs-img, .hs-media.is-active .hs-img { transform: none; transition: none; }
	.hs-text > *, .hs-text.is-active > * { transform: none; }
}
