/*
 * home.css — homepage-only visuals (hero, category grid, popular grid, CTA).
 * Builds on the tokens defined in site.css.
 */

/* ---- Hero ---- */
.ics-hero {
	position: relative;
	padding: 72px 0 64px;
	text-align: center;
	overflow: hidden;
	background:
		radial-gradient(60% 120% at 50% -10%, var(--ics-primary-soft), transparent 60%);
}

.ics-hero::before,
.ics-hero::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	filter: blur(70px);
	opacity: 0.5;
	z-index: 0;
	pointer-events: none;
}

.ics-hero::before {
	width: 340px; height: 340px;
	background: rgba(79, 70, 229, 0.28);
	top: -120px; left: -60px;
}

.ics-hero::after {
	width: 300px; height: 300px;
	background: rgba(14, 165, 233, 0.22);
	top: -80px; right: -60px;
}

.ics-hero-inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
}

.ics-hero-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ics-ink-2);
	background: var(--ics-surface);
	border: 1px solid var(--ics-border);
	padding: 7px 16px;
	border-radius: var(--ics-r-pill);
	box-shadow: var(--ics-shadow-sm);
}

.ics-hero h1 {
	font-size: clamp(32px, 6vw, 54px);
	font-weight: 800;
	line-height: 1.08;
	max-width: 16ch;
	margin: 0;
}

.ics-hero-em {
	background: linear-gradient(120deg, var(--ics-primary), #22b8cf);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.ics-hero-sub {
	font-size: clamp(16px, 2.4vw, 19px);
	color: var(--ics-muted);
	max-width: 52ch;
	margin: 0;
}

.ics-hero-search {
	position: relative;
	width: 100%;
	max-width: 560px;
	margin-top: 6px;
}

.ics-hero-search-ico {
	position: absolute;
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--ics-muted);
	display: inline-flex;
	pointer-events: none;
}

.ics-hero-search input {
	width: 100%;
	font-family: inherit;
	font-size: 16px;
	padding: 16px 20px 16px 52px;
	border-radius: var(--ics-r-pill);
	border: 1px solid var(--ics-border-2);
	background: var(--ics-surface);
	color: var(--ics-ink);
	box-shadow: var(--ics-shadow);
}

.ics-hero-search input::placeholder { color: var(--ics-muted); }

.ics-hero-stats {
	display: flex;
	align-items: center;
	gap: 22px;
	margin-top: 10px;
}

.ics-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ics-stat-num { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ics-ink); }
.ics-stat-label { font-size: 12.5px; color: var(--ics-muted); font-weight: 500; }
.ics-stat-div { width: 1px; height: 34px; background: var(--ics-border-2); }

/* ---- Section blocks ---- */
.ics-block { padding: 60px 0; }
.ics-block-alt { background: var(--ics-surface-2); border-top: 1px solid var(--ics-border); border-bottom: 1px solid var(--ics-border); }

.ics-block-head { text-align: center; max-width: 60ch; margin: 0 auto 36px; }
.ics-block-head h2 { font-size: clamp(24px, 4vw, 32px); margin: 0 0 8px; }
.ics-block-head p { color: var(--ics-muted); margin: 0; font-size: 16px; }

/* ---- Category grid ---- */
.ics-cat-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.ics-cat-card {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px;
	background: var(--ics-surface);
	border: 1px solid var(--ics-border);
	border-radius: var(--ics-r-lg);
	color: var(--ics-ink);
	box-shadow: var(--ics-shadow-sm);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ics-cat-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--ics-shadow-lg);
	border-color: color-mix(in srgb, var(--ics-primary) 40%, var(--ics-border));
}

.ics-cat-ico {
	flex: 0 0 52px;
	width: 52px; height: 52px;
	border-radius: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--ics-primary);
	background: var(--ics-primary-soft);
}

.ics-cat-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ics-cat-name { font-weight: 700; font-size: 16px; }
.ics-cat-tag { font-size: 13px; color: var(--ics-muted); }
.ics-cat-count {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 700;
	color: var(--ics-ink-2);
	background: var(--ics-surface-3);
	border-radius: var(--ics-r-pill);
	min-width: 30px;
	height: 30px;
	padding: 0 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ---- Popular grid (card styles now live in calculator.css, shared with
   category + archive listings) ---- */
.ics-pop-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

/* ---- CTA ---- */
.ics-cta {
	text-align: center;
	background: linear-gradient(135deg, #1e1b4b, #312e81);
	color: #fff;
	border-radius: var(--ics-r-xl);
	padding: 52px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.ics-cta h2 { color: #fff; margin: 0; font-size: clamp(22px, 3.6vw, 30px); }
.ics-cta p { color: rgba(255, 255, 255, 0.82); margin: 0 0 8px; max-width: 46ch; }

/* ---- Live search dropdown ---- */
.ics-search-dropdown {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	right: 0;
	background: var(--ics-surface);
	border: 1px solid var(--ics-border);
	border-radius: var(--ics-r-lg);
	box-shadow: var(--ics-shadow-lg);
	overflow: hidden;
	max-height: 340px;
	overflow-y: auto;
	text-align: left;
	z-index: 30;
}

.ics-search-dropdown a {
	display: block;
	padding: 13px 20px;
	color: var(--ics-ink);
	font-size: 14.5px;
	font-weight: 500;
	border-bottom: 1px solid var(--ics-border);
}

.ics-search-dropdown a:last-child { border-bottom: none; }
.ics-search-dropdown a:hover { background: var(--ics-surface-3); color: var(--ics-primary); }
.ics-search-empty { padding: 16px 20px; color: var(--ics-muted); font-size: 14px; }

/* ---- Reveal animation ---- */
.ics-reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.55s ease, transform 0.55s ease;
	transition-delay: var(--d, 0ms);
}

.ics-reveal.ics-revealed { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
	.ics-cat-grid, .ics-pop-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
	.ics-cat-grid, .ics-pop-grid { grid-template-columns: 1fr; }
	.ics-hero { padding: 52px 0 48px; }
	.ics-hero-stats { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.ics-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
	.ics-cat-card, .ics-pop-card { transition: none !important; }
}
