/*
 * The homepage only. Loaded by index.html after components.css; every colour,
 * radius, shadow and easing comes from theme.css, and the few values declared
 * here are ones no token covers: the violet half of the hero wash, and the
 * plastic of the laptop frames.
 */

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.home-hero {
	--home-violet: rgb(96 86 224 / 0.5);
	--home-blue: rgb(37 99 235 / 0.32);
	--home-teal: color-mix(in srgb, var(--accent) 55%, transparent);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding-block: calc(var(--header-height) + 54px) 72px;
}

.home-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;
	background-image:
		radial-gradient(115% 92% at 16% -6%, var(--home-violet), transparent 64%),
		radial-gradient(100% 96% at 92% 112%, var(--home-teal), transparent 62%),
		radial-gradient(120% 130% at 48% 42%, var(--home-blue), transparent 72%);
}

/* The band has to end somewhere, and a hard edge across the page reads as a
   seam rather than as sky. */
.home-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: linear-gradient(to bottom, transparent 58%, var(--bg));
	pointer-events: none;
}

.home-swirl {
	position: absolute;
	inset: 0;
	z-index: -2;
	overflow: hidden;
	pointer-events: none;
}

.home-swirl span {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	inline-size: 170%;
	block-size: 230%;
	translate: -50% -50%;
	border-radius: 50%;
	mix-blend-mode: screen;
	opacity: 0.5;
}

.home-swirl-a {
	background-image: conic-gradient(
		from 0deg,
		var(--home-violet),
		var(--home-teal),
		transparent 46%,
		var(--home-blue),
		var(--home-violet)
	);
	filter: blur(46px);
}

.home-swirl-b {
	inline-size: 190%;
	block-size: 250%;
	background-image: conic-gradient(from 140deg, transparent 8%, var(--home-teal), transparent 52%, var(--home-violet), transparent 92%);
	filter: blur(62px);
	opacity: 0.42;
}

.home-hero-grid {
	position: relative;
	display: grid;
	gap: 34px;
	justify-items: center;
}

.home-hero-words {
	display: grid;
	gap: 18px;
	justify-items: center;
	order: -1;
}

.home-title {
	margin: 0;
	font-size: clamp(2.1rem, 6.6vw, 3.1rem);
	line-height: 1.06;
	letter-spacing: -0.01em;
}

.home-claim {
	font-size: clamp(19px, 2.1vw, 27px);
	line-height: 1.35;
	max-width: 24ch;
}

.home-cta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
	margin-block-start: 6px;
}

.home-hero-note {
	max-width: 44ch;
	margin: 0;
}

.home-laptop {
	--home-bezel: #0b0f16;
	--home-hinge: #232b39;
	inline-size: min(100%, 440px);
}

.home-laptop-lid {
	border: 8px solid var(--home-bezel);
	border-block-end-width: 15px;
	border-radius: 12px 12px 5px 5px;
	background-color: var(--home-bezel);
	box-shadow: var(--shadow-lg), inset 0 0 0 1px rgb(255 255 255 / 0.07);
	overflow: hidden;
}

.home-laptop-screen {
	border-radius: 4px;
	overflow: hidden;
	background-color: var(--bg);
}

.home-laptop-screen img {
	display: block;
	inline-size: 100%;
	block-size: auto;
}

.home-laptop-base {
	display: block;
	block-size: 9px;
	inline-size: 114%;
	margin-inline: -7%;
	border-radius: 0 0 9px 9px;
	background-image: linear-gradient(to bottom, var(--home-hinge), var(--home-bezel));
	box-shadow: 0 12px 22px rgb(0 0 0 / 0.45);
}

@media (min-width: 1000px) {
	.home-hero {
		padding-block: calc(var(--header-height) + 70px) 92px;
	}

	.home-hero-grid {
		grid-template-columns: minmax(0, 1fr) minmax(340px, 38%) minmax(0, 1fr);
		align-items: center;
		gap: 26px;
	}

	.home-hero-words { order: 0; }
	.home-laptop { inline-size: 100%; }
}

/* One frame is the whole idea on a phone; the second is the same picture again. */
@media (max-width: 999.98px) {
	.home-hero-grid > .home-laptop:last-child { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
	.home-swirl-a { animation: home-turn 44s linear infinite; }
	.home-swirl-b { animation: home-turn 67s linear infinite reverse; }
}

@keyframes home-turn {
	to { rotate: 360deg; }
}

/* --------------------------------------------------------------------------
   Capability marquee
   -------------------------------------------------------------------------- */

.home-marq {
	overflow: hidden;
	/* Both edges fade instead of stopping, so the row reads as longer than the window. */
	mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}

.home-marq-track {
	display: flex;
	inline-size: max-content;
}

.home-marq-set {
	display: flex;
	gap: 10px;
	margin: 0;
	padding-inline: 5px;
	list-style: none;
}

.home-pill {
	padding-block: 8px;
	padding-inline: 15px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background-color: var(--panel);
	background-image: var(--surface);
	color: var(--text-dim);
	font-size: 13.5px;
	font-weight: 500;
	white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
	.home-marq.is-awake .home-marq-track { animation: home-slide 64s linear infinite; }

	/* Gated to a real pointer: a tap on a phone fires hover and never releases it. */
	@media (hover: hover) {
		.home-marq:hover .home-marq-track { animation-play-state: paused; }
	}

	.home-marq:focus-within .home-marq-track { animation-play-state: paused; }
}

@keyframes home-slide {
	to { translate: -50% 0; }
}

/* --------------------------------------------------------------------------
   Chapters
   -------------------------------------------------------------------------- */

.home-body {
	max-width: 58ch;
	font-size: 14.5px;
	line-height: 1.7;
	color: var(--text-dim);
}

.center .home-body { margin-inline: auto; }

.chapter-head.center { margin-inline: auto; }

.home-wide { max-width: none; }

/* An auto inline margin turns off a grid item's stretch, so the pair of mocks
   would sit at max-content in the middle of the column. */
.stack-lg > .hero-mock { margin-block: 0; margin-inline: 0; }

.home-trio { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (min-width: 900px) {
	.home-trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Tabbed showcase
   -------------------------------------------------------------------------- */

.home-show {
	display: grid;
	gap: 26px;
}

.home-show-list {
	display: grid;
	gap: 4px;
	order: 1;
}

.home-show-tab {
	display: grid;
	gap: 5px;
	padding-block: 14px;
	padding-inline: 18px;
	border: 0;
	border-inline-start: 2px solid transparent;
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	background-color: transparent;
	color: inherit;
	font: inherit;
	text-align: start;
	cursor: pointer;
	transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}

.home-show-tab:hover { background-color: var(--panel); }

.home-show-tab[aria-selected="true"] {
	border-inline-start-color: var(--accent);
	background-color: var(--panel);
	background-image: var(--surface);
}

.home-show-tab:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}

.home-show-title {
	font-size: 17px;
	font-weight: 600;
	color: var(--text-dim);
}

.home-show-tab[aria-selected="true"] .home-show-title { color: var(--text); }

.home-show-note {
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--text-faint);
}

.home-show-frame {
	position: relative;
	aspect-ratio: 1280 / 800;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background-color: var(--panel);
	box-shadow: var(--shadow-lg);
	overflow: hidden;
}

.home-show-shot {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	object-position: top center;
	opacity: 0;
	visibility: hidden;
}

.home-show-shot.is-live {
	opacity: 1;
	visibility: visible;
}

@media (prefers-reduced-motion: no-preference) {
	.home-show-shot { transition: opacity 0.45s ease, visibility 0.45s; }
}

/* A 1280-wide screenshot scaled to a phone is texture, not a product shot: crop into the
   top-left of it instead, where the rail and the first rows are still legible. */
@media (max-width: 999.98px) {
	.home-show-frame { aspect-ratio: 5 / 4; }
	.home-show-shot { object-position: top left; object-fit: cover; scale: 1.35; transform-origin: top left; }
}

@media (min-width: 1000px) {
	.home-show {
		grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
		gap: 40px;
		/* The tab list and the frame start on the same line: centring dropped the frame ~140px. */
		align-items: start;
	}

	.home-show-list { order: 0; }
}

/* --------------------------------------------------------------------------
   Transcript routing
   -------------------------------------------------------------------------- */

.home-routes {
	padding: 22px;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background-color: var(--panel);
	background-image: var(--surface);
	box-shadow: var(--shadow);
}

.home-routes-stage {
	position: relative;
	display: grid;
	gap: 16px;
	justify-items: center;
}

.home-routes-wires { display: none; }

.home-rt-card {
	inline-size: 100%;
	max-inline-size: 320px;
	padding-block: 12px;
	padding-inline: 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background-color: var(--bg-raised);
}

.home-rt-file {
	display: grid;
	gap: 6px;
	justify-items: center;
	max-inline-size: 220px;
	text-align: center;
	border-color: var(--accent-glow);
	box-shadow: 0 0 34px -8px var(--accent-glow);
}

.home-rt-glyph {
	inline-size: 38px;
	block-size: 38px;
	display: grid;
	place-items: center;
	border-radius: var(--radius-sm);
	background-color: var(--accent-soft);
	box-shadow: inset 0 0 0 1px var(--accent-glow);
	color: var(--accent);
}

.home-rt-name {
	font-family: var(--mono);
	font-size: 13px;
	color: var(--text);
}

.home-rt-lines {
	display: grid;
	gap: 5px;
	margin-block-end: 10px;
}

.home-rt-lines i {
	display: block;
	block-size: 6px;
	border-radius: 999px;
	background-color: var(--line-strong);
}

.home-rt-lines i:nth-child(2) { inline-size: 72%; }
.home-rt-lines i:nth-child(3) { inline-size: 46%; }

.home-rt-dests {
	display: grid;
	gap: 12px;
	inline-size: 100%;
	max-inline-size: 320px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.home-rt-dest {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-block: 11px;
	padding-inline: 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background-color: var(--bg-raised);
	font-size: 13.5px;
	color: var(--text-dim);
}

.home-rt-dest .chip { margin-inline-start: auto; }

.home-rt-drop {
	display: block;
	inline-size: 2px;
	block-size: 22px;
	border-radius: 999px;
	background-image: linear-gradient(to bottom, var(--accent), transparent);
}

@media (min-width: 1000px) {
	.home-routes-stage {
		display: block;
		aspect-ratio: 1000 / 320;
	}

	.home-routes-wires {
		display: block;
		position: absolute;
		inset: 0;
		inline-size: 100%;
		block-size: 100%;
	}

	.home-rt-card {
		position: absolute;
		max-inline-size: none;
	}

	.home-rt-source {
		inset-inline-start: 3%;
		inset-block-start: 50%;
		inline-size: 22%;
		translate: 0 -50%;
	}

	.home-rt-file {
		inset-inline-start: 34%;
		inset-block-start: 50%;
		inline-size: 16%;
		translate: 0 -50%;
	}

	.home-rt-dests {
		position: absolute;
		inset-block: 0;
		inset-inline-start: 62%;
		inline-size: 35%;
		max-inline-size: none;
		gap: 0;
		align-content: space-between;
	}

	.home-rt-drop { display: none; }
}

.home-wire-halo {
	fill: none;
	stroke: var(--accent-glow);
	stroke-width: 9;
	stroke-linecap: round;
	opacity: 0.25;
}

.home-wire-core {
	fill: none;
	stroke: var(--accent);
	stroke-width: 2;
	stroke-linecap: round;
}

@media (prefers-reduced-motion: no-preference) {
	.home-routes.is-awake .home-wire-core {
		stroke-dasharray: 6 100;
		animation: home-pulse 4.8s ease-in-out infinite;
	}

	.home-routes.is-awake .home-wire:nth-child(2) .home-wire-core,
	.home-routes.is-awake .home-wire:nth-child(3) .home-wire-core,
	.home-routes.is-awake .home-wire:nth-child(4) .home-wire-core {
		animation-delay: 1.4s;
	}
}

/* pathLength normalises every wire to 100, so one dash length crosses the
   short straight run and the long curve at the same speed. */
@keyframes home-pulse {
	0% { stroke-dashoffset: 106; }
	55%, 100% { stroke-dashoffset: 0; }
}

/* --------------------------------------------------------------------------
   Open tickets and the queue
   -------------------------------------------------------------------------- */

.home-queue {
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background-color: var(--panel);
	background-image: var(--surface);
	box-shadow: var(--shadow-lg);
	overflow: hidden;
}

.home-queue-bar {
	display: flex;
	align-items: center;
	gap: 7px;
	padding-block: 11px;
	padding-inline: 14px;
	border-block-end: 1px solid var(--hairline);
	background-color: var(--bg-raised);
}

.home-queue-bar i {
	inline-size: 8px;
	block-size: 8px;
	border-radius: 50%;
	background-color: var(--line-strong);
}

.home-queue-path {
	margin-inline-start: 8px;
	font-size: 12.5px;
	color: var(--text-faint);
}

.home-queue-table {
	display: grid;
	grid-template-columns: 72px 76px minmax(0, 1fr) 98px;
	font-size: 13px;
}

.home-queue-table > * {
	padding-block: 11px;
	padding-inline: 10px;
	border-block-end: 1px solid var(--hairline);
	color: var(--text-dim);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.home-queue-head {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--text-faint);
}

.home-queue-pos {
	font-family: var(--mono);
	font-size: 12.5px;
	color: var(--accent);
}

.home-queue-id {
	font-family: var(--mono);
	font-size: 12.5px;
	color: var(--text);
}

@media (max-width: 619.98px) {
	.home-queue-table { grid-template-columns: 58px 66px minmax(0, 1fr) 92px; }
	.home-queue-table > * { padding-inline: 7px; }
}

/* --------------------------------------------------------------------------
   Premium
   -------------------------------------------------------------------------- */

.home-prem-figure {
	display: grid;
	gap: 6px;
	justify-items: start;
	max-width: 42ch;
}

.home-prem-amount {
	font-size: clamp(38px, 5vw, 62px);
	font-weight: 300;
	line-height: 1;
	background-image: var(--premium-ramp);
	background-clip: text;
	color: transparent;
}

.home-prem-list {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.home-prem-item {
	display: flex;
	align-items: start;
	gap: 10px;
	padding-block: 13px;
	border-block-start: 1px solid var(--hairline);
	font-size: 14px;
	color: var(--text-dim);
}

.home-prem-item::before {
	content: "";
	flex: none;
	inline-size: 13px;
	block-size: 7px;
	margin-block-start: 5px;
	border-inline-start: 2px solid var(--good);
	border-block-end: 2px solid var(--good);
	rotate: -45deg;
}

@media (min-width: 820px) {
	.home-prem-list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
}

/* --------------------------------------------------------------------------
   Steps
   -------------------------------------------------------------------------- */

.home-steps {
	display: grid;
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: home-step;
}

.home-step {
	display: grid;
	gap: 7px;
	align-content: start;
	padding-block-start: 16px;
	border-block-start: 1px solid var(--hairline);
	counter-increment: home-step;
}

.home-step-badge {
	inline-size: 22px;
	block-size: 22px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background-color: var(--panel-hover);
	color: var(--text-faint);
	font-size: 11px;
	font-weight: 700;
}

.home-step-badge::before { content: counter(home-step); }

.home-step-badge.is-yours {
	background-color: var(--accent);
	color: var(--accent-ink);
}

.home-step-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
}

.home-step-note {
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--text-faint);
}

@media (min-width: 700px) {
	.home-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
	.home-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Closer
   -------------------------------------------------------------------------- */

.home-closer {
	display: grid;
	gap: 34px;
}

.home-closer-ask {
	display: grid;
	gap: 20px;
	justify-items: start;
	align-content: start;
}

.home-closer-links {
	display: grid;
	gap: 26px;
}

.home-closer-link {
	display: grid;
	gap: 8px;
	align-content: start;
	padding-block-start: 16px;
	border-block-start: 1px solid var(--hairline);
}

.home-closer-lead {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
}

.home-closer-note {
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--text-faint);
}

.home-closer-more {
	font-size: 13.5px;
	color: var(--text-dim);
}

@media (min-width: 700px) {
	.home-closer-links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
}

@media (min-width: 1100px) {
	.home-closer { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.85fr); gap: 48px; }
}
