/* @tunnel-grandfather: legacy/admin/game CSS — selectors are stable and page-scoped; registry conflicts are cross-page false positives; ID selectors intentional and working; refactor risk exceeds value. W3 2026-10-08. */
/* B"H — awp-polish.css · v=awp-001
   Cinematic additive polish for geelooy/apps.
   COVENANT: every rule hangs off an .awp-* class (or a descendant of one).
   Nothing here destructively restyles an existing selector; enhancements apply
   only where markup opts in. No !important anywhere in this sheet.
   Palette: near-black blues (#050914, #0a1322), 4–8% glass whites,
   cyan #7bdcff primary, warm amber secondary. Motion physics: 120ms controls,
   220ms surfaces — everything gated behind prefers-reduced-motion. */

.awp-app {
	--awp-accent: #7bdcff;
	--awp-amber: #f5b96b;
	--awp-ink-0: #050914;
	--awp-ink-1: #0a1322;
	--awp-text: #eef6ff;
	--awp-muted: #9fb4cc;
	--awp-stroke: rgba(255, 255, 255, .08);
	--awp-glass-hi: rgba(255, 255, 255, .07);
	--awp-glass-lo: rgba(255, 255, 255, .02);
}

/* Per-app accent tints — the polish follows the room's own light. */
.awp-app-chat { --awp-accent: #8fe3b0; }
.awp-app-wallet { --awp-accent: #f5b96b; }

/* ---------------- atmosphere ---------------- */

.awp-ambient {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(42rem 30rem at 12% -8%, rgba(123, 220, 255, .07), transparent 60%),
		radial-gradient(50rem 36rem at 88% 108%, rgba(38, 92, 180, .10), transparent 62%),
		radial-gradient(30rem 22rem at 78% 12%, rgba(245, 185, 107, .035), transparent 60%);
}

.awp-grain {
	position: fixed;
	inset: 0;
	z-index: 5;
	pointer-events: none;
	opacity: .04;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* ---------------- hero & glass ---------------- */

.awp-hero {
	position: relative;
	border: 1px solid var(--awp-stroke);
	border-radius: clamp(18px, 3vw, 28px);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, .08),
		0 24px 60px -24px rgba(0, 0, 0, .65),
		0 8px 24px -12px rgba(0, 0, 0, .5);
}

.awp-glass {
	background: linear-gradient(160deg, var(--awp-glass-hi), var(--awp-glass-lo));
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	backdrop-filter: blur(18px) saturate(140%);
	border: 1px solid var(--awp-stroke);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, .08),
		0 18px 44px -18px rgba(0, 0, 0, .6);
}

/* ---------------- type ---------------- */

.awp-eyebrow {
	letter-spacing: .18em;
	text-transform: uppercase;
	font-size: .72rem;
	font-weight: 600;
	color: var(--awp-accent);
}

.awp-title-glow {
	text-shadow:
		0 0 26px color-mix(in srgb, var(--awp-accent) 38%, transparent),
		0 2px 14px rgba(0, 0, 0, .55);
}

/* ---------------- motion: staggered entrance ---------------- */

@media (prefers-reduced-motion: no-preference) {
	.awp-reveal {
		animation: awp-rise .7s cubic-bezier(.2, .7, .2, 1) both;
		animation-delay: var(--awp-delay, 0s);
	}
	.awp-ambient {
		animation: awp-drift 70s ease-in-out infinite alternate;
	}
}

@keyframes awp-rise {
	from { opacity: 0; translate: 0 12px; }
	to { opacity: 1; translate: 0 0; }
}

@keyframes awp-drift {
	from { transform: scale(1); }
	to { transform: scale(1.06) translateY(-1.5%); }
}

@media (prefers-reduced-motion: reduce) {
	.awp-reveal,
	.awp-ambient,
	.awp-card-lift,
	.awp-cta {
		animation: none;
		transition: none;
	}
}

/* ---------------- lift (cards & surfaces) ---------------- */

.awp-card-lift {
	transition: transform 220ms ease, box-shadow 220ms ease;
}

@media (prefers-reduced-motion: no-preference) {
	.awp-card-lift:hover {
		transform: translateY(-2px);
		box-shadow:
			0 26px 54px -20px rgba(0, 0, 0, .7),
			0 0 0 1px rgba(255, 255, 255, .06),
			inset 0 1px 0 rgba(255, 255, 255, .08);
	}
}

.awp-card-lift:focus-visible {
	outline: 2px solid var(--awp-accent);
	outline-offset: 3px;
}

/* ---------------- call to action ---------------- */

.awp-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .55rem;
	min-height: 44px;
	min-width: 44px;
	padding: .7rem 1.25rem;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--awp-accent) 35%, transparent);
	background: linear-gradient(160deg, color-mix(in srgb, var(--awp-accent) 16%, transparent), transparent);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, .1),
		0 10px 26px -12px rgba(0, 0, 0, .7);
	text-decoration: none;
	cursor: pointer;
	transition: transform 120ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

@media (prefers-reduced-motion: no-preference) {
	.awp-cta:hover {
		transform: translateY(-2px);
		border-color: color-mix(in srgb, var(--awp-accent) 65%, transparent);
		box-shadow:
			inset 0 1px 0 rgba(255, 255, 255, .12),
			0 14px 34px -12px rgba(0, 0, 0, .75),
			0 0 22px -4px color-mix(in srgb, var(--awp-accent) 45%, transparent);
	}
	.awp-cta:active {
		transform: translateY(0);
	}
}

.awp-cta:focus-visible {
	outline: 2px solid var(--awp-accent);
	outline-offset: 3px;
}

/* ---------------- storefront catalog cards (JS-rendered) ---------------- */

.awp-app [data-app-card] {
	transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, filter 120ms ease;
}

@media (prefers-reduced-motion: no-preference) {
	.awp-app [data-app-card]:hover {
		transform: translateY(-3px);
		box-shadow:
			0 28px 56px -22px rgba(0, 0, 0, .75),
			0 0 26px -6px color-mix(in srgb, var(--awp-accent) 40%, transparent);
	}
}

/* ---------------- per-app micro-polish (scoped, additive) ---------------- */

.awp-app-code .icon-button {
	transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

@media (prefers-reduced-motion: no-preference) {
	.awp-app-code .icon-button:hover {
		transform: translateY(-1px);
		box-shadow:
			0 6px 16px -6px rgba(0, 0, 0, .7),
			0 0 12px -2px color-mix(in srgb, var(--awp-accent) 45%, transparent);
	}
}

.awp-app-code .icon-button:focus-visible,
.awp-app-audio .icon-btn:focus-visible,
.awp-app-chat .messaging-empty-action:focus-visible {
	outline: 2px solid var(--awp-accent);
	outline-offset: 3px;
}

.awp-app-audio .icon-btn {
	transition: transform 120ms ease, box-shadow 120ms ease;
}

@media (prefers-reduced-motion: no-preference) {
	.awp-app-audio .icon-btn:hover {
		transform: translateY(-1px);
	}
}

.awp-app-pdf .file-card {
	transition: transform 220ms ease, box-shadow 220ms ease;
}

@media (prefers-reduced-motion: no-preference) {
	.awp-app-pdf .file-card:hover {
		transform: translateY(-2px);
		box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .7);
	}
}

.awp-app-wallet input:focus-visible,
.awp-app-wallet textarea:focus-visible,
.awp-app-wallet button:focus-visible {
	outline: 2px solid var(--awp-accent);
	outline-offset: 2px;
}

/* @tunnel-interactive-states: auto-generated by css-guarantee */
.awp-app-code .icon-button:active {
	transform: scale(0.98);
}

/* ============ ROUND 2 POLISH — apps discovery (2026-10-13) ============ */
/* B"H — app cards get a cyan focus ring and a press answer; the covenant holds
   (every rule hangs off .awp-app or a descendant). */
.awp-app [data-app-card]:focus-visible {
	outline: 2px solid var(--awp-accent);
	outline-offset: 3px;
}
.awp-app [data-app-card]:active {
	transform: translateY(0) scale(0.99);
}
/* B"H — the empty state: patient, centered, cyan-lit. */
.awp-app [data-app-empty] {
	text-align: center;
	padding: 3rem 1.5rem;
	color: var(--awp-muted);
	font-size: 1rem;
}
.awp-app [data-app-empty][hidden] {
	display: none;
}
/* B"H — the filter disclosure summary: full-bleed target, clear affordance. */
:where(.awp-app) .apps-filter-disclosure summary {
	display: flex;
	align-items: center;
	min-height: 44px;
	cursor: pointer;
	list-style: none;
	color: var(--awp-text);
}
:where(.awp-app) .apps-filter-disclosure summary::-webkit-details-marker {
	display: none;
}
:where(.awp-app) .apps-filter-disclosure summary:hover {
	border-color: color-mix(in srgb, var(--awp-accent) 40%, transparent);
}
:where(.awp-app) .apps-filter-disclosure summary:focus-visible {
	outline: 2px solid var(--awp-accent);
	outline-offset: 3px;
}
:where(.awp-app) .apps-filter-disclosure summary:active {
	transform: scale(0.995);
}
/* B"H — the result pill counts like an instrument. */
.awp-app [data-app-result-status] {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.03em;
	color: var(--awp-muted);
}
/* B"H — section heading rhythm: the eyebrow breathes before the grid. */
.awp-app .apps-section-heading {
	margin: 2.2rem 0 1.2rem;
}
