/* ==========================================================================
   Castra Front Page
   Cinematic hero, category cards, latest relics, benefits strip.
   Uses existing theme variables: --bg --fg --gold --rust --muted --line.
   ========================================================================== */

/* Hero
   -------------------------------------------------------------- */
.hero {
	position: relative;
	height: 100vh;
	height: 100svh;
	overflow: hidden;
	background: var(--bg);
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.hero .fallback-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-size: cover;
	background-position: 70% center;
	opacity: 1;
	transition: opacity .8s ease;
}

.hero #hero-video {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 0% 55%;
	background: var(--bg);
	pointer-events: none;
	will-change: transform, filter;
}

.hero .scrim {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(11,10,9,.92) 0%, rgba(11,10,9,.75) 30%, rgba(11,10,9,.25) 52%, transparent 68%),
		linear-gradient(0deg, rgba(11,10,9,0) 82%, rgba(11,10,9,.6) 100%);
}

.hero .scrim::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.38) 100%);
}

.hero-content {
	position: relative;
	z-index: 3;
	width: 100%;
	max-width: 1320px;
	margin: 0;
	padding: 88px 24px max(72px, 10vh);
	pointer-events: none;
	box-sizing: border-box;
}

.hero-text {
	max-width: min(560px, 90vw);
	pointer-events: auto;
	will-change: transform, opacity;
}

.hero-text h1 {
	font-family: Cinzel, Georgia, serif;
	font-weight: 600;
	font-size: clamp(3rem, 9vw, 6.5rem);
	line-height: 1;
	color: var(--fg);
	margin: 0 0 16px;
	letter-spacing: .08em;
	text-shadow: 0 0 32px rgba(217,165,33,.35), 0 2px 14px rgba(0,0,0,.8);
}

.hero-text .subline {
	font-size: 1.2rem;
	color: var(--fg);
	opacity: .85;
	font-weight: 300;
	letter-spacing: .04em;
	line-height: 1.6;
	margin: 0 0 28px;
	max-width: 520px;
	text-wrap: balance;
}

.hero-ctas {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 8px;
}

.hero-fade {
	position: absolute;
	inset: 0;
	z-index: 4;
	background: radial-gradient(ellipse at 60% 45%, #2a0903 0%, #170604 55%, var(--bg) 100%);
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 767px) {
	.hero {
		height: 100svh;
		align-items: flex-end;
	}

	.hero #hero-video {
		object-position: 70% 50%;
	}

	.hero .scrim {
		background: linear-gradient(to top, rgba(11,10,9,.92) 0%, transparent 60%);
	}

	.hero-content {
		padding: 64px 16px 56px;
	}

	.hero-text h1 {
		font-size: clamp(2.2rem, 12vw, 3.6rem);
		letter-spacing: .06em;
		overflow-wrap: break-word;
	}

	.hero-text .subline {
		font-size: .92rem;
		margin-bottom: 20px;
	}

	.hero-ctas {
		flex-direction: column;
		gap: 12px;
	}

	.hero-ctas .btn {
		flex: none;
		width: 100%;
		text-align: center;
	}
}

/* Sections
   -------------------------------------------------------------- */
.section-pad {
	padding: 96px 0;
}

.section-head {
	margin-bottom: 48px;
	text-align: center;
}

.section-title {
	font-family: Cinzel, Georgia, serif;
	font-weight: 600;
	font-size: clamp(2rem, 4vw, 3rem);
	letter-spacing: .14em;
	color: var(--fg);
	margin: 0 0 8px;
}

.section-kicker {
	color: var(--gold);
	text-transform: uppercase;
	letter-spacing: .18em;
	font-size: .8rem;
	margin: 0;
}

.section-action {
	margin-top: 40px;
	text-align: center;
}

/* Category Cards
   -------------------------------------------------------------- */
.cat-grid {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 1.5rem;
}

.cat-card {
	position: relative;
	display: block;
	min-height: 340px;
	border: 1px solid var(--line);
	border-radius: 4px;
	overflow: hidden;
	text-decoration: none;
	color: var(--fg);
	background-size: cover;
	background-position: center;
	background-color: var(--bg);
	isolation: isolate;
	transition: transform .45s cubic-bezier(.2,.8,.2,1), border-color .3s ease, box-shadow .3s ease;
}

/* 7 категории: 6+6 / 4+4+4 / 6+6 (bak_cat1105: старо за 5 категории) */
.cat-card:nth-child(1) { grid-column: span 6; min-height: 420px; }
.cat-card:nth-child(2) { grid-column: span 6; min-height: 420px; }
.cat-card:nth-child(3) { grid-column: span 4; }
.cat-card:nth-child(4) { grid-column: span 4; }
.cat-card:nth-child(5) { grid-column: span 4; }
.cat-card:nth-child(6) { grid-column: span 6; }
.cat-card:nth-child(7) { grid-column: span 6; }

.cat-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(11,10,9,.9) 0%, rgba(11,10,9,.45) 45%, rgba(11,10,9,.15) 75%, rgba(11,10,9,.05) 100%);
	transition: background .3s ease;
}

.cat-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(11,10,9,.85) 0%, rgba(11,10,9,0) 45%);
}

.cat-card-content {
	position: absolute;
	left: 28px;
	right: 28px;
	bottom: 28px;
	z-index: 1;
}

.cat-card h3 {
	font-family: Cinzel, Georgia, serif;
	font-weight: 600;
	font-size: 1.9rem;
	letter-spacing: .08em;
	margin: 0 0 6px;
	color: var(--fg);
}

.cat-card .cat-card-count {
	display: block;
	color: var(--muted);
	font-size: .85rem;
	letter-spacing: .04em;
}

.cat-card .cat-card-arrow {
	position: absolute;
	top: 0;
	right: 0;
	font-size: 1.8rem;
	line-height: 1;
	color: var(--gold);
	opacity: 0;
	transform: translateX(-8px);
	transition: opacity .3s ease, transform .3s ease;
}

.cat-card:hover {
	transform: translateY(-6px);
	border-color: rgba(217,165,33,.5);
	box-shadow: 0 20px 40px rgba(0,0,0,.45);
}

.cat-card:hover::before {
	background: linear-gradient(135deg, rgba(11,10,9,.94) 0%, rgba(11,10,9,.55) 50%, rgba(11,10,9,.2) 80%, rgba(11,10,9,.1) 100%);
}

.cat-card:hover .cat-card-arrow {
	opacity: 1;
	transform: translateX(0);
}

@media (max-width: 1023px) {
	.cat-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.cat-card:nth-child(1),
	.cat-card:nth-child(2),
	.cat-card:nth-child(3),
	.cat-card:nth-child(4),
	.cat-card:nth-child(5) {
		grid-column: span 1;
		min-height: 280px;
	}

	.cat-card:nth-child(1) {
		grid-column: 1 / -1;
		min-height: 340px;
	}
}

@media (max-width: 599px) {
	.cat-grid {
		grid-template-columns: 1fr;
	}

	.cat-card:nth-child(n) {
		grid-column: span 1;
		min-height: 260px;
	}
}

/* Latest Relics
   -------------------------------------------------------------- */
.front-latest-grid {
	margin-top: 0;
}

.empty-note {
	color: var(--muted);
	text-align: center;
	padding: 32px 0;
}

/* Benefits Strip
   -------------------------------------------------------------- */
.benefits-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
	padding: 48px 0;
}

.benefit {
	text-align: center;
	padding: 32px 20px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: rgba(255,255,255,.02);
}

.benefit svg {
	width: 36px;
	height: 36px;
	stroke: var(--gold);
	fill: none;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	margin-bottom: 16px;
}

.benefit h3 {
	font-family: Cinzel, Georgia, serif;
	font-weight: 600;
	font-size: 1.1rem;
	letter-spacing: .06em;
	color: var(--fg);
	margin: 0 0 8px;
}

.benefit p {
	color: var(--muted);
	font-size: .9rem;
	margin: 0;
}

@media (max-width: 767px) {
	.section-pad {
		padding: 64px 0;
	}

	.section-head {
		margin-bottom: 32px;
	}

	.benefits-grid {
		grid-template-columns: 1fr;
		gap: 16px;
		padding: 24px 0;
	}
}

/* Lead fix 24.10: topbar overlays the hero so the hero is exactly one viewport tall */
body.home .topbar { position: fixed; left: 0; right: 0; top: 0; }
body.admin-bar.home .topbar { top: 32px; }
