/**
 * Intent TCG — visual polish layer
 *
 * Loaded after catalogue.css. Purely cosmetic: depth, motion and hover
 * states on top of the existing brand palette. No colours are invented
 * here — everything is built from the tokens below, which are the same
 * values already in use across the site.
 *
 * Rules this file keeps to:
 *   - Content is never hidden by default. Scroll reveal only engages once
 *     JS adds .itcg-motion to <html>, so with JS off everything is visible
 *     and indexable.
 *   - Every animation is disabled under prefers-reduced-motion.
 *   - Nothing shrinks a tap target below 44px.
 *   - Transforms and opacity only, so nothing triggers layout reflow.
 */

:root {
	--itcg-bg: #05080D;
	--itcg-panel: #09101A;
	--itcg-recess: #070B12;
	--itcg-line: #283246;
	--itcg-line-soft: #1D2635;
	--itcg-heading: #F7F7FA;
	--itcg-body: #AAB0BC;
	--itcg-accent: #7C3AED;
	--itcg-accent-hi: #8B5CF6;
	--itcg-link: #A78BFA;
	--itcg-pale: #D9C8FF;
	--itcg-violet-bd: #5B3C8E;
	--itcg-violet-dim: #51337F;

	--itcg-ease: cubic-bezier(.22, .61, .36, 1);
	--itcg-fast: 180ms var(--itcg-ease);
	--itcg-slow: 420ms var(--itcg-ease);

	--itcg-glow: 0 18px 50px -12px rgba(124, 58, 237, .45);
	--itcg-glow-soft: 0 10px 34px -14px rgba(124, 58, 237, .32);
	--itcg-lift: 0 22px 44px -20px rgba(0, 0, 0, .85);
}

/* Anchored sections must not hide under the sticky header. */
html {
	scroll-behavior: smooth;
}
[id] {
	scroll-margin-top: 96px;
}

::selection {
	background: rgba(124, 58, 237, .35);
	color: var(--itcg-heading);
}

/* A single, consistent focus ring. Keyboard users get a real one. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--itcg-link);
	outline-offset: 3px;
	border-radius: 6px;
}

/* ---------------------------------------------------------------- reveal */
/* .itcg-motion is set by polish.js. Without it these rules never apply. */

.itcg-motion .itcg-reveal {
	opacity: 0;
	transform: translate3d(0, 14px, 0);
	transition: opacity 460ms var(--itcg-ease), transform 460ms var(--itcg-ease);
	transition-delay: var(--itcg-delay, 0ms);
	will-change: opacity, transform;
}
.itcg-motion .itcg-reveal.is-in {
	opacity: 1;
	transform: none;
	will-change: auto;
}

/*
 * Elementor lazy-loads container backgrounds with:
 *
 *   .e-con.e-parent:nth-of-type(n+4):not(.e-lazyloaded):not(.e-no-lazyload),
 *   .e-con.e-parent:nth-of-type(n+4):not(.e-lazyloaded):not(.e-no-lazyload) *
 *     { background-image: none !important; }
 *
 * That descendant `*` strips background-image from everything inside the
 * fourth container onwards until its script marks the container loaded. On
 * this site that script never runs, so the strip is permanent. The bands
 * therefore carry Elementor's own opt-out class, e-no-lazyload, set from the
 * page builder — see band() in elementor-build/lib.mjs. Fighting it with
 * !important does not work: their selector is more specific than ours.
 *
 * Nothing that carries meaning is ever allowed to depend on a background.
 */
/* ------------------------------------------------------------ card tiles */

.itcg-card {
	position: relative;
}

.itcg-card__well {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	transition: transform var(--itcg-slow), border-color var(--itcg-slow), box-shadow var(--itcg-slow);
}

/* Light sweeping across the card face on hover. */
.itcg-card__well::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(115deg, transparent 30%, rgba(217, 200, 255, .16) 48%, transparent 62%);
	transform: translateX(-120%);
	transition: transform 900ms var(--itcg-ease);
}

.itcg-card__well img {
	transition: transform 700ms var(--itcg-ease);
}

.itcg-card:hover .itcg-card__well,
.itcg-card:focus-within .itcg-card__well {
	transform: translateY(-6px);
	border-color: var(--itcg-violet-bd);
	box-shadow: var(--itcg-lift), var(--itcg-glow-soft);
}
.itcg-card:hover .itcg-card__well::after,
.itcg-card:focus-within .itcg-card__well::after {
	transform: translateX(120%);
}
.itcg-card:hover .itcg-card__well img,
.itcg-card:focus-within .itcg-card__well img {
	transform: scale(1.05);
}
.itcg-card:hover .itcg-card__name a,
.itcg-card:focus-within .itcg-card__name a {
	color: var(--itcg-pale);
}
.itcg-card__name a {
	transition: color var(--itcg-fast);
}

/* Rarity earns its own treatment. Starlight gets a live gradient edge. */
.itcg-card__well.itcg-r-starlight-rares,
.itcg-hero-art.itcg-r-starlight-rares {
	position: relative;
	border-color: transparent;
	background-clip: padding-box;
}
.itcg-card__well.itcg-r-starlight-rares::before,
.itcg-hero-art.itcg-r-starlight-rares::before {
	content: "";
	position: absolute;
	inset: -1px;
	z-index: -1;
	border-radius: inherit;
	background: linear-gradient(120deg, #7C3AED, #D9C8FF, #5B3C8E, #8B5CF6, #7C3AED);
	background-size: 300% 300%;
	animation: itcg-sheen 7s linear infinite;
}
.itcg-card__well.itcg-r-secret-rares,
.itcg-card__well.itcg-r-ultra-rares {
	box-shadow: inset 0 1px 0 rgba(217, 200, 255, .07);
}
.itcg-card:hover .itcg-card__well.itcg-r-secret-rares,
.itcg-card:hover .itcg-card__well.itcg-r-ultra-rares {
	box-shadow: var(--itcg-lift), var(--itcg-glow);
}

@keyframes itcg-sheen {
	0% { background-position: 0% 50%; }
	100% { background-position: 300% 50%; }
}

/* Badges get a touch of dimension. */
.itcg-badge {
	transition: transform var(--itcg-fast), box-shadow var(--itcg-fast);
}
.itcg-badge.itcg-r-starlight-rares {
	background: linear-gradient(135deg, #7C3AED, #8B5CF6);
	box-shadow: 0 4px 14px -4px rgba(124, 58, 237, .7);
}

/* The availability dot should read as alive when in stock. */
.itcg-avail .itcg-dot {
	box-shadow: 0 0 0 0 rgba(167, 139, 250, .6);
	animation: itcg-pulse 2.8s ease-out infinite;
}
.itcg-avail.is-out .itcg-dot {
	animation: none;
}
@keyframes itcg-pulse {
	0% { box-shadow: 0 0 0 0 rgba(167, 139, 250, .5); }
	70% { box-shadow: 0 0 0 7px rgba(167, 139, 250, 0); }
	100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
}

/* -------------------------------------------------------------- buttons */

.itcg-btn,
[data-elementor-type="wp-page"] .elementor-button {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	transition: transform var(--itcg-fast), box-shadow var(--itcg-slow), background-color var(--itcg-fast), border-color var(--itcg-fast);
}

.itcg-btn::before,
[data-elementor-type="wp-page"] .elementor-button::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .22) 45%, transparent 65%);
	transform: translateX(-130%);
	transition: transform 780ms var(--itcg-ease);
}

.itcg-btn:hover,
[data-elementor-type="wp-page"] .elementor-button:hover,
[data-elementor-type="wp-page"] .elementor-button:focus-visible {
	transform: translateY(-2px);
}
.itcg-btn:hover::before,
[data-elementor-type="wp-page"] .elementor-button:hover::before {
	transform: translateX(130%);
}
.itcg-btn:active,
[data-elementor-type="wp-page"] .elementor-button:active {
	transform: translateY(0);
}

.itcg-btn--primary,
[data-elementor-type="wp-page"] .elementor-button:not([class*="ghost"]) {
	box-shadow: 0 10px 26px -12px rgba(124, 58, 237, .8);
}
.itcg-btn--primary:hover {
	box-shadow: var(--itcg-glow);
}

/* The eBay link on a card tile. */
.itcg-ebay span {
	display: inline-block;
	transition: transform var(--itcg-fast);
}
.itcg-ebay:hover span {
	transform: translateX(4px);
}

/* ---------------------------------------------------------- stat tiles */

.itcg-tile {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(165deg, rgba(124, 58, 237, .10), rgba(124, 58, 237, 0) 52%), #09101A;
	transition: transform var(--itcg-slow), border-color var(--itcg-slow), box-shadow var(--itcg-slow);
}
.itcg-tile::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(167, 139, 250, .55), transparent);
	opacity: .8;
}
.itcg-tile:hover {
	transform: translateY(-4px);
	border-color: var(--itcg-violet-bd);
	box-shadow: var(--itcg-lift), var(--itcg-glow-soft);
}
.itcg-tile__n {
	color: #F7F7FA;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 0 26px rgba(167, 139, 250, .35);
}
.itcg-tile.is-accent::before {
	background: linear-gradient(90deg, transparent, #8B5CF6, transparent);
	opacity: 1;
}

/* ---------------------------------------------------------- rarity rows */

.itcg-row {
	position: relative;
	overflow: hidden;
	transition: background-color var(--itcg-fast), padding-left var(--itcg-slow);
}
.itcg-row::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: linear-gradient(180deg, #7C3AED, #A78BFA);
	transform: scaleY(0);
	transform-origin: 50% 0;
	transition: transform var(--itcg-slow);
}
.itcg-row:hover {
	background: rgba(124, 58, 237, .05);
	padding-left: 14px;
}
.itcg-row:hover::before {
	transform: scaleY(1);
}
.itcg-row__go {
	display: inline-block;
	transition: transform var(--itcg-slow), color var(--itcg-fast);
}
.itcg-row:hover .itcg-row__go {
	transform: translateX(6px);
	color: var(--itcg-pale);
}
.itcg-row__n {
	font-variant-numeric: tabular-nums;
}

.itcg-pill {
	transition: transform var(--itcg-fast), border-color var(--itcg-fast), box-shadow var(--itcg-fast);
}
.itcg-pill:hover {
	transform: translateY(-2px);
	box-shadow: var(--itcg-glow-soft);
}

/* -------------------------------------------------------------- search */

.itcg-search__form {
	position: relative;
	transition: box-shadow var(--itcg-slow), border-color var(--itcg-slow);
	border-radius: 999px;
}
.itcg-search__form:focus-within {
	box-shadow: 0 0 0 3px rgba(124, 58, 237, .22), var(--itcg-glow-soft);
}
.itcg-search__icon {
	transition: color var(--itcg-fast), transform var(--itcg-fast);
}
.itcg-search__form:focus-within .itcg-search__icon {
	color: var(--itcg-link);
	transform: scale(1.08);
}

/* ------------------------------------------- Elementor page decoration */
/* Scoped to page content so the theme header and footer are untouched. */

[data-elementor-type="wp-page"] .elementor-widget-icon-box .elementor-icon-box-wrapper {
	position: relative;
	height: 100%;
	padding: 26px 24px;
	border: 1px solid var(--itcg-line-soft);
	border-radius: 16px;
	background: linear-gradient(165deg, rgba(124, 58, 237, .07), rgba(124, 58, 237, 0) 55%), #09101A;
	overflow: hidden;
	isolation: isolate;
	transition: transform var(--itcg-slow), border-color var(--itcg-slow), box-shadow var(--itcg-slow);
}
[data-elementor-type="wp-page"] .elementor-widget-icon-box .elementor-icon-box-wrapper::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(167, 139, 250, .5), transparent);
}
[data-elementor-type="wp-page"] .elementor-widget-icon-box:hover .elementor-icon-box-wrapper {
	transform: translateY(-5px);
	border-color: var(--itcg-violet-bd);
	box-shadow: var(--itcg-lift), var(--itcg-glow-soft);
}
[data-elementor-type="wp-page"] .elementor-widget-icon-box .elementor-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 4px;
	border-radius: 13px;
	border: 1px solid rgba(124, 58, 237, .30);
	background: linear-gradient(150deg, rgba(124, 58, 237, .20), rgba(124, 58, 237, .04));
	transition: transform var(--itcg-slow), border-color var(--itcg-slow), background var(--itcg-slow);
}
[data-elementor-type="wp-page"] .elementor-widget-icon-box:hover .elementor-icon {
	transform: translateY(-2px) scale(1.06);
	border-color: rgba(167, 139, 250, .6);
	background: linear-gradient(150deg, rgba(124, 58, 237, .34), rgba(124, 58, 237, .08));
}

/* Big display headings get a soft vertical gradient. */
[data-elementor-type="wp-page"] .elementor-widget-heading h1,
[data-elementor-type="wp-page"] .elementor-widget-heading h2 {
	text-wrap: balance;
}

/* A violet bloom behind the top of the page, behind all content. */
[data-elementor-type="wp-page"] > .e-con:first-child {
	position: relative;
	isolation: isolate;
}
[data-elementor-type="wp-page"] > .e-con:first-child::before {
	content: "";
	position: absolute;
	z-index: -1;
	pointer-events: none;
	top: -30%;
	left: 50%;
	width: min(1100px, 100%);
	max-width: 100%;
	aspect-ratio: 1.6;
	transform: translateX(-50%);
	background: radial-gradient(ellipse at center, rgba(124, 58, 237, .20), rgba(124, 58, 237, .06) 42%, transparent 68%);
	filter: blur(6px);
}

/* Accordion */
[data-elementor-type="wp-page"] .elementor-accordion .elementor-accordion-item {
	border-radius: 12px;
	margin-bottom: 10px;
	overflow: hidden;
	background: linear-gradient(165deg, rgba(124, 58, 237, .05), rgba(124, 58, 237, 0) 60%), #09101A;
	transition: border-color var(--itcg-slow), box-shadow var(--itcg-slow);
}
[data-elementor-type="wp-page"] .elementor-accordion .elementor-tab-title {
	transition: background-color var(--itcg-fast), color var(--itcg-fast);
	padding: 0;
}
/* The anchor is the thing a finger actually hits, so it carries the height
   and the padding rather than its wrapper. */
[data-elementor-type="wp-page"] .elementor-accordion .elementor-tab-title > a,
[data-elementor-type="wp-page"] .elementor-accordion a.elementor-accordion-title {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 56px;
	padding: 12px 20px;
	box-sizing: border-box;
}
[data-elementor-type="wp-page"] .elementor-accordion .elementor-tab-title:hover {
	background: rgba(124, 58, 237, .07);
}
[data-elementor-type="wp-page"] .elementor-accordion .elementor-accordion-item:has(.elementor-active) {
	border-color: var(--itcg-violet-bd);
	box-shadow: var(--itcg-glow-soft);
}
[data-elementor-type="wp-page"] .elementor-accordion .elementor-accordion-icon {
	transition: transform var(--itcg-slow);
}

/* Forms */
[data-elementor-type="wp-page"] .solaceform-input,
[data-elementor-type="wp-page"] textarea.solaceform-input {
	transition: border-color var(--itcg-fast), box-shadow var(--itcg-fast), background-color var(--itcg-fast);
}
[data-elementor-type="wp-page"] .solaceform-input:focus {
	border-color: var(--itcg-violet-bd);
	box-shadow: 0 0 0 3px rgba(124, 58, 237, .18);
	outline: none;
}

/* Definition rows on the trust pages and contact block. */
[data-elementor-type="wp-page"] .e-con-inner > .e-con[class*="elementor-element"] {
	transition: background-color var(--itcg-fast);
}

/* ------------------------------------------------------- accessibility */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
	.itcg-motion .itcg-reveal {
		opacity: 1;
		transform: none;
	}
	.itcg-card__well::after,
	.itcg-btn::before,
	[data-elementor-type="wp-page"] .elementor-button::before {
		display: none;
	}
}

/* Hover effects are pointless on touch and can stick. */
@media (hover: none) {
	.itcg-card:hover .itcg-card__well,
	.itcg-tile:hover,
	[data-elementor-type="wp-page"] .elementor-widget-icon-box:hover .elementor-icon-box-wrapper {
		transform: none;
		box-shadow: none;
	}
	.itcg-row:hover {
		padding-left: 0;
	}
}

/* Gradient text falls back to a solid colour where it would be unreadable. */
@media (forced-colors: active) {
	.itcg-tile__n,
	[data-elementor-type="wp-page"] .elementor-widget-heading h1,
	[data-elementor-type="wp-page"] .elementor-widget-heading h2 {
		background: none;
		color: CanvasText;
	}
}
