/* =========================================================================
   Services — Kinetic (v2)
   Все стили строго scoped под .svc-k, чтобы не ломать другие страницы.
   Основной шаблон (page-services.php) остаётся без изменений.
   ========================================================================= */

/* Anchor offset for the home-page #services section.
   The "Our Services" hero button scrolls to #services via the URL hash, and
   the sticky site-header would otherwise crop the section heading. We push
   the scroll-snap point down by (header height + 30px breathing room) so the
   "The Architectural Workflow" title lands fully below the header. */
.svc-k--in-home {
	scroll-margin-top: calc(var(--header-height, 76px) + 30px);
}

.svc-k {
	--k-surface:            #f7f9fb;
	--k-surface-low:        #f2f4f6;
	--k-surface-lowest:     #ffffff;
	--k-on-surface:         #191c1e;
	--k-slate-50:           #f8fafc;
	--k-slate-100:          #f1f5f9;
	--k-slate-200:          #e2e8f0;
	--k-slate-300:          #cbd5e1;
	--k-slate-400:          #94a3b8;
	--k-slate-500:          #64748b;
	--k-slate-600:          #475569;
	--k-slate-700:          #334155;
	--k-slate-800:          #1e293b;
	--k-slate-900:          #0f172a;
	--k-primary:            #b90538;
	--k-primary-container:  #dc2c4f;
	--k-on-primary:         #ffffff;
	--k-secondary:          #00687a;
	--k-secondary-fixed:    #acedff;
	--k-outline-variant:    #e3bdbf;
	--k-accent-soft:        rgba(185, 5, 56, 0.08);

	--k-font-head: 'Space Grotesk', var(--font-heading, 'Inter'), system-ui, sans-serif;
	--k-font-body: 'Manrope',       var(--font-primary,  'Inter'), system-ui, sans-serif;

	font-family: var(--k-font-body);
	color: var(--k-on-surface);
	background: var(--k-surface);
	display: block;
}

.svc-k * { box-sizing: border-box; }

/* CTA-only wrapper (home + legal pages) uses a slightly cooler
   surface tone (#f3f4f5) to separate the dark CTA card from the
   surrounding page background. */
.svc-k.svc-k--cta-only {
	background-color: #f3f4f5;
}

/* Общий контейнер наследует ширину от --container-width (1300px) */
.svc-k__container {
	width: 100%;
	max-width: var(--container-width, 1300px);
	margin-inline: auto;
	padding-inline: 32px;
}
@media (max-width: 640px) {
	.svc-k__container { padding-inline: 16px; }
}

/* ---------- Material Symbols helper ------------------------------------ */
.svc-k .material-symbols-outlined {
	font-family: 'Material Symbols Outlined';
	font-weight: normal;
	font-style: normal;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	white-space: nowrap;
	word-wrap: normal;
	direction: ltr;
	-webkit-font-feature-settings: 'liga';
	-webkit-font-smoothing: antialiased;
	font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
	vertical-align: middle;
}

/* =========================================================================
   HERO
   ========================================================================= */

.svc-k__hero {
	position: relative;
	overflow: hidden;
	background: var(--k-surface-low);
	padding: 120px 0 96px;
	isolation: isolate;
}

.svc-k__hero-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	z-index: 1;
	opacity: 0.55;
	pointer-events: none;
}

.svc-k__hero-grid {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	opacity: 0.35;
	background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
	background-size: 24px 24px;
	mask-image: radial-gradient(ellipse at 50% 40%, #000 40%, transparent 75%);
	-webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 40%, transparent 75%);
}

.svc-k__hero-inner {
	position: relative;
	z-index: 3;
}

.svc-k__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--k-secondary-fixed);
	color: var(--k-secondary);
	padding: 6px 12px;
	border-radius: 2px;
	margin-bottom: 24px;
	font-family: var(--k-font-body);
}

.svc-k__badge-icon { font-size: 16px; }

.svc-k__badge-text {
	font-family: var(--k-font-body);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.svc-k__hero-title {
	font-family: var(--k-font-head);
	font-size: clamp(40px, 6vw, 80px);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.05;
	color: var(--k-on-surface);
	max-width: 56rem;
	margin: 0 0 24px;
}

.svc-k__hero-title-line {
	display: block;
}

.svc-k__hero-title-line--accent {
	color: var(--k-primary);
	position: relative;
}

.svc-k__hero-title-line--accent::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -4px;
	height: 2px;
	background: linear-gradient(90deg, var(--k-primary) 0%, transparent 70%);
	transform-origin: left;
	transform: scaleX(0);
	animation: svc-k-line-in 1.6s ease 0.8s forwards;
}

@keyframes svc-k-line-in {
	to { transform: scaleX(1); }
}

.svc-k__hero-lede {
	font-family: var(--k-font-body);
	font-size: clamp(16px, 1.3vw, 20px);
	line-height: 1.6;
	color: var(--k-slate-600);
	max-width: 42rem;
	margin: 0;
}

.svc-k__hero-meta {
	margin-top: 32px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	font-family: var(--k-font-body);
	font-size: 11px;
	color: var(--k-slate-400);
}

.svc-k__hero-meta-item {
	letter-spacing: 0.2em;
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
}

.svc-k__hero-meta-dot {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--k-slate-400);
}

.svc-k__ticker {
	display: inline-block;
	min-width: 3ch;
	color: var(--k-primary);
	font-weight: 700;
}

/* =========================================================================
   SERVICES GRID
   ========================================================================= */

.svc-k__services {
	padding: 96px 0;
}

.svc-k__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

@media (min-width: 768px) {
	.svc-k__grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}

@media (min-width: 1024px) {
	.svc-k__grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}

/* ----------  CARD  ---------------------------------------------------- */

.svc-k__card {
	position: relative;
	display: block;
	background: var(--k-surface-lowest);
	border: 1px solid rgba(227, 189, 191, 0.28);
	border-radius: 12px;
	padding: 32px;
	color: inherit;
	text-decoration: none;
	overflow: hidden;
	transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
	transform-style: preserve-3d;
	will-change: transform;
}

.svc-k__card:hover,
.svc-k__card:focus-visible {
	border-color: rgba(185, 5, 56, 0.35);
	outline: none;
	box-shadow: 0 24px 60px -24px rgba(15, 23, 42, 0.18);
}

.svc-k__card--wide {
	grid-column: 1 / -1;
	border-radius: 16px;
	padding: 40px;
}

.svc-k__card-inner {
	position: relative;
	z-index: 2;
	display: block;
}

.svc-k__card-glow {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.4s ease;
	background: radial-gradient(
		600px circle at var(--svc-k-x, 50%) var(--svc-k-y, 50%),
		rgba(185, 5, 56, 0.08),
		transparent 40%
	);
}

.svc-k__card:hover .svc-k__card-glow { opacity: 1; }

.svc-k__card-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 48px;
}

.svc-k__card-code {
	font-family: var(--k-font-head);
	font-size: 11px;
	font-weight: 700;
	/* WCAG AAA: slate-400 (#94a3b8) on white = 2.85:1 (AA fail).
	   slate-600 (#475569) on white = 7.22:1 → AAA pass. */
	color: var(--k-slate-600);
	letter-spacing: 0.2em;
	font-variant-numeric: tabular-nums;
}

.svc-k__card-icon {
	font-size: 32px !important;
	color: var(--k-primary);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.svc-k__card:hover .svc-k__card-icon { transform: scale(1.12) rotate(-3deg); }

.svc-k__card-icon--xl {
	font-size: 72px !important;
}

.svc-k__card-tag-wrap { margin-bottom: 16px; }

.svc-k__card-tag {
	display: inline-block;
	font-family: var(--k-font-body);
	font-size: 10px;
	font-weight: 700;
	/* WCAG AAA: --k-secondary (#00687a) on rgba(172,237,255,0.3) (effective ≈#e8f9ff)
	   = ~6.5:1 (AAA fail, need 7:1). Darken to #004a59 → ~9:1 AAA pass. */
	color: #004a59;
	background: rgba(172, 237, 255, 0.3);
	padding: 3px 8px;
	border-radius: 2px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.svc-k__card-title {
	font-family: var(--k-font-head);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 16px;
	color: var(--k-on-surface);
}

.svc-k__card-title--lg {
	font-size: clamp(26px, 2.4vw, 34px);
}

.svc-k__card-desc {
	font-family: var(--k-font-body);
	font-size: 14px;
	line-height: 1.6;
	color: var(--k-slate-600);
	margin: 0 0 24px;
}

.svc-k__card-desc--lg {
	font-size: 16px;
	max-width: 48rem;
}

.svc-k__card-divider {
	display: block;
	height: 1px;
	width: 100%;
	background: var(--k-slate-100);
	margin-bottom: 20px;
}

.svc-k__card-cta {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: var(--k-font-head);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	/* WCAG AAA: --k-primary (#b90538) on white card surface ~7.55:1 — borderline AAA
	   for 11px small text. Darken to #8c0028 → ~10.5:1 AAA solid pass. */
	color: #8c0028;
	transition: gap 0.3s ease, color 0.3s ease;
}

/* Hover stays in oxblood family but goes one shade darker (#6a0020 → ~13:1 AAA). */
.svc-k__card:hover .svc-k__card-cta { gap: 12px; color: #6a0020; }

.svc-k__card-cta-icon {
	font-size: 16px !important;
	transition: transform 0.3s ease;
}

/* ----------  WIDE card layout  --------------------------------------- */

.svc-k__card-wide-body {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 24px;
}

@media (min-width: 768px) {
	.svc-k__card-wide-body {
		flex-direction: row;
		align-items: center;
	}
}

.svc-k__card-wide-content { flex: 1; }

.svc-k__card-wide-meta {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
}

.svc-k__card-wide-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: var(--k-slate-50);
	border-radius: 12px;
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.svc-k__card--wide:hover .svc-k__card-wide-icon {
	transform: rotate(12deg) scale(1.04);
}

/* =========================================================================
   CTA
   ========================================================================= */

.svc-k__cta-section {
	padding-bottom: 96px;
}

.svc-k__cta {
	position: relative;
	overflow: hidden;
	background: var(--k-slate-900);
	border-radius: 32px;
	padding: 0;
	isolation: isolate;
}

.svc-k__cta-grid {
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: 0.1;
	background-image: radial-gradient(circle, #94a3b8 1px, transparent 1px);
	background-size: 24px 24px;
}

.svc-k__cta-blob {
	position: absolute;
	right: -96px;
	bottom: -96px;
	width: 384px;
	height: 384px;
	background: var(--k-primary);
	opacity: 0.25;
	filter: blur(100px);
	border-radius: 50%;
	z-index: 1;
	animation: svc-k-blob 8s ease-in-out infinite alternate;
}

@keyframes svc-k-blob {
	0%   { transform: translate(0, 0) scale(1); }
	100% { transform: translate(-40px, -30px) scale(1.1); }
}

.svc-k__cta-inner {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 48px;
	padding: 80px 32px;
	align-items: center;
	text-align: center;
}

@media (min-width: 768px) {
	.svc-k__cta-inner {
		flex-direction: row;
		justify-content: space-between;
		text-align: left;
		padding: 80px 64px;
	}
}

.svc-k__cta-text { max-width: 32rem; }

.svc-k__cta-title {
	font-family: var(--k-font-head);
	font-size: clamp(32px, 4vw, 52px);
	font-weight: 700;
	line-height: 1.1;
	color: #ffffff;
	margin: 0 0 24px;
	letter-spacing: -0.02em;
}

.svc-k__cta-lede {
	font-family: var(--k-font-body);
	font-size: 18px;
	line-height: 1.6;
	color: var(--k-slate-400);
	margin: 0;
}

.svc-k__cta-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	/* WCAG AAA: var(--k-primary) #b90538 vs white = ~7.78:1 (borderline AAA for 13px text).
	   #8c0028 vs white = ~10.5:1 → AAA solid pass. Keeps brand oxblood family. */
	background: #8c0028;
	color: var(--k-on-primary);
	padding: 20px 32px;
	border-radius: 6px;
	font-family: var(--k-font-head);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
	box-shadow: 0 20px 50px -12px rgba(140, 0, 40, 0.35);
	flex-shrink: 0;
	will-change: transform;
}

.svc-k__cta-button:hover {
	background: var(--k-primary-container);
	box-shadow: 0 30px 60px -12px rgba(220, 44, 79, 0.45);
}

.svc-k__cta-button-icon {
	font-size: 20px !important;
	transition: transform 0.3s ease;
}

.svc-k__cta-button:hover .svc-k__cta-button-icon {
	transform: translateX(4px);
}

/* =========================================================================
   Reveal / scramble initial states (GSAP applies final state)
   ========================================================================= */

.svc-k [data-reveal] {
	opacity: 0;
	transform: translateY(32px);
}

.svc-k.is-ready [data-reveal] {
	transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
	            transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Fallback для пользователей без JS / reduced-motion. */
@media (prefers-reduced-motion: reduce) {
	.svc-k [data-reveal] {
		opacity: 1 !important;
		transform: none !important;
	}
	.svc-k__hero-title-line--accent::after { animation: none; transform: scaleX(1); }
	.svc-k__cta-blob { animation: none; }
}

/* Если JS не инициализировался, в течение 1.2 секунды — показываем контент. */
.svc-k:not(.is-ready) [data-reveal] {
	animation: svc-k-fallback-in 1.2s ease 1s forwards;
}
@keyframes svc-k-fallback-in {
	to { opacity: 1; transform: none; }
}
