/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* the top of the home page: what the components are */
.showcase {
	background:
		radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent, var(--primary)) 45%, transparent), transparent 55%),
		linear-gradient(135deg, var(--primary-dark), var(--primary));
	color: var(--on-primary, #fff);
	padding: 40px 0;
}
/* what the components are on the left, the figures beside it on the right */
.showcase__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 24px 48px;
}
.showcase h1 {
	margin: 0 0 12px;
	font-size: clamp(30px, 4.4vw, 52px);
	line-height: 1.08;
	letter-spacing: -.5px;
}
.showcase .hero__lead { max-width: 34em; }
.showcase__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 28px 0 0;
}
.showcase__primary,
.showcase__secondary {
	padding: 10px 22px;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
}
.showcase__primary {
	background: var(--on-primary, #fff);
	color: var(--primary-dark);
}
.showcase__primary:hover { background: color-mix(in srgb, var(--on-primary, #fff) 88%, transparent); }
.showcase__secondary {
	border: 1px solid color-mix(in srgb, var(--on-primary, #fff) 60%, transparent);
	color: inherit;
}
.showcase__secondary:hover { background: color-mix(in srgb, var(--on-primary, #fff) 12%, transparent); }
.showcase__side {
	padding: 20px 28px;
	border: 1px solid color-mix(in srgb, var(--on-primary, #fff) 30%, transparent);
	border-radius: 16px;
	background: color-mix(in srgb, var(--on-primary, #fff) 8%, transparent);
}
.showcase__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 36px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	opacity: .9;
}
.showcase__facts strong { display: block; font-size: 40px; line-height: 1.1; }
.showcase .hero__meta { margin-top: 16px; }
.showcase .ws-status { color: inherit; }

/* every demo by category, with a preview of the one the pointer or the focus is on */
.index { padding-top: 40px; padding-bottom: 56px; }
.index__title { margin: 0 0 4px; font-size: 24px; }
.index__lead { margin: 0 0 20px; color: var(--muted); }
.index__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
	align-items: start;
	gap: 32px;
}
.index__columns { columns: 3 220px; column-gap: 24px; }
.index__group {
	break-inside: avoid;
	margin-bottom: 20px;
	padding: 14px 10px 10px;
	border-top: 3px solid var(--primary);
	background: var(--surface);
	border-radius: 0 0 var(--radius) var(--radius);
}
.index__category {
	margin: 0 6px 6px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .8px;
}
.index__list { margin: 0; padding: 0; list-style: none; }
.index__list li { display: flex; align-items: center; gap: 2px; }
.index__list .index__link { flex: 1; min-width: 0; }
/* opens what the demo is about */
.index__details {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}
.index__details:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.index__details:focus-visible { outline: 2px solid var(--accent, var(--primary)); outline-offset: -2px; }
.index__link {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px;
	border-radius: 8px;
	color: var(--text);
	text-decoration: none;
}
.index__name { flex: 1; min-width: 0; font-weight: 500; }
.index__link:hover,
.index__link--previewed { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.index__link:focus-visible { outline: 2px solid var(--accent, var(--primary)); outline-offset: -2px; }
.index__frameworks {
	padding: 0 5px;
	border-radius: 4px;
	background: color-mix(in srgb, var(--primary) 12%, transparent);
	color: var(--primary);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .5px;
}

.index__preview {
	display: none;
	position: sticky;
	top: 16px;
	padding: 12px;
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: 0 10px 30px rgba(28, 35, 51, .08);
}
.index__preview--ready { display: block; }
.index__preview-shot {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	object-fit: cover;
	object-position: top left;
	background: var(--bg);
}
.index__preview-name { margin: 12px 4px 4px; font-size: 18px; font-weight: 600; }
.index__preview-description { margin: 0 4px 4px; color: var(--muted); font-size: 14px; }
.index__preview--fresh { animation: index-preview .25s ease; }
@keyframes index-preview {
	from { opacity: .4; transform: translateY(4px); }
	to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.index__preview--fresh { animation: none; }
}
/* on narrow screens the index only, without the preview */
@media (max-width: 900px) {
	.showcase__inner { grid-template-columns: minmax(0, 1fr); }
	.showcase__side { justify-self: start; }
	.index__body { grid-template-columns: minmax(0, 1fr); }
	.index__preview--ready { display: none; }
}
