/* Вход hnatiuk.net/start/ — тёмный зал, подпись в центре. */

:root {
	--hn-ink: #101010;
	--hn-text: #f2f2f2;
	--hn-muted: rgba(242, 242, 242, 0.44);
	--hn-accent: #d0a742;
	--hn-ui: "Manrope", system-ui, -apple-system, sans-serif;
	--hn-display: "Cormorant Garamond", Georgia, serif;
	--e-display: cubic-bezier(0.16, 1, 0.3, 1);
	--e-body: cubic-bezier(0.25, 0.46, 0.45, 0.94);
	--e-ui: cubic-bezier(0.4, 0, 0.2, 1);
	--pad: clamp(18px, 3vw, 34px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	background: var(--hn-ink);
	color: var(--hn-text);
	font-family: var(--hn-ui);
	-webkit-font-smoothing: antialiased;
}

body.hn-start {
	overflow: hidden;
	overscroll-behavior: none;
}

a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------------ холст */

.hn-canvas {
	position: fixed;
	inset: 0;
	z-index: 1;
}

.hn-canvas canvas {
	display: block;
	touch-action: none;
}

/* Свет зала: зерно и виньетка снимают с картинки цифровую ровность. */
.hn-grain {
	position: fixed;
	inset: -60%;
	z-index: 5;
	pointer-events: none;
	opacity: 0.075;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
	background-size: 180px 180px;
	animation: hn-grain 1.1s steps(5) infinite;
}

@keyframes hn-grain {
	0%   { transform: translate3d(0, 0, 0); }
	20%  { transform: translate3d(-6%, 4%, 0); }
	40%  { transform: translate3d(4%, -5%, 0); }
	60%  { transform: translate3d(-3%, 6%, 0); }
	80%  { transform: translate3d(5%, 3%, 0); }
	100% { transform: translate3d(0, 0, 0); }
}

.hn-vignette {
	position: fixed;
	inset: 0;
	z-index: 4;
	pointer-events: none;
	background: radial-gradient(ellipse at 50% 48%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.52) 100%);
}

/* Середина зала не освещена — на этом тёмном месте и стоит подпись. */
.hn-pool {
	position: fixed;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	background: radial-gradient(
		ellipse 52% 44% at 50% 50%,
		rgba(12, 12, 12, 0.88) 0%,
		rgba(12, 12, 12, 0.6) 46%,
		rgba(12, 12, 12, 0) 86%
	);
}

/* Тонировка направленная: темнеет там, где лежит текст, а не весь кадр. */
.hn-scrim {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 22;
	height: 150px;
	pointer-events: none;
}

.hn-scrim--top {
	top: 0;
	background: linear-gradient(to bottom, rgba(10, 10, 10, 0.72), rgba(10, 10, 10, 0));
}

.hn-scrim--bottom {
	bottom: 0;
	background: linear-gradient(to top, rgba(10, 10, 10, 0.78), rgba(10, 10, 10, 0));
}

/* --------------------------------------------------------------- занавес */

.hn-loader {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: grid;
	place-items: center;
	background: #0b0b0b;
	transition: opacity 0.8s var(--e-body);
}

.hn-loader__bar {
	width: clamp(120px, 18vw, 200px);
	height: 1px;
	background: rgba(242, 242, 242, 0.14);
	overflow: hidden;
}

.hn-loader__fill {
	height: 100%;
	background: var(--hn-accent);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.45s var(--e-body);
}

body.is-ready .hn-loader {
	opacity: 0;
	pointer-events: none;
}

/* ------------------------------------------------------------------ центр */

.hn-center {
	position: fixed;
	inset: 0;
	z-index: 20;
	display: grid;
	place-items: center;
	pointer-events: none;
	padding: var(--pad);
}

.hn-sign {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(14px, 2.4vw, 26px);
	pointer-events: auto;
}

/* Тёплое пятно под подписью — единственный источник цвета на экране. */
.hn-sign::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 44%;
	width: 150%;
	height: 260%;
	transform: translate(-50%, -50%);
	background: radial-gradient(closest-side, rgba(208, 167, 66, 0.16), rgba(208, 167, 66, 0) 72%);
	filter: blur(14px);
	pointer-events: none;
	opacity: 0;
	transition: opacity 1.6s var(--e-body) 0.25s;
}

body.is-ready .hn-sign::before {
	opacity: 1;
	animation: hn-breathe 11s var(--e-body) 2s infinite;
}

@keyframes hn-breathe {
	0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
	50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.07); }
}

.hn-sign__mark {
	display: block;
	width: clamp(240px, 36vw, 500px);
	height: auto;
	/* Подпись пишется слева направо, а не проявляется. */
	-webkit-mask-image: linear-gradient(100deg, #000 38%, rgba(0, 0, 0, 0.35) 52%, transparent 60%);
	mask-image: linear-gradient(100deg, #000 38%, rgba(0, 0, 0, 0.35) 52%, transparent 60%);
	-webkit-mask-size: 300% 100%;
	mask-size: 300% 100%;
	-webkit-mask-position: 100% 0;
	mask-position: 100% 0;
}

body.is-ready .hn-sign__mark {
	animation: hn-write 1.35s var(--e-display) 0.15s forwards;
}

@keyframes hn-write {
	to {
		-webkit-mask-position: 0% 0;
		mask-position: 0% 0;
	}
}

.hn-sign__mark--text {
	font-family: var(--hn-display);
	font-size: clamp(38px, 7vw, 86px);
	line-height: 0.9;
	letter-spacing: -0.02em;
	color: #d7d3a0;
}

.hn-sign__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	font-size: clamp(10px, 1.05vw, 12px);
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--hn-accent);
	padding-bottom: 7px;
	border-bottom: 1px solid rgba(208, 167, 66, 0.3);
	opacity: 0;
	transform: translateY(10px);
	transition: border-color 0.4s var(--e-ui), gap 0.4s var(--e-ui);
}

.hn-sign__cta i {
	font-style: normal;
	transition: transform 0.45s var(--e-display);
}

body.is-ready .hn-sign__cta {
	animation: hn-rise 0.9s var(--e-display) 1.05s forwards;
}

.hn-sign:hover .hn-sign__cta,
.hn-sign:focus-visible .hn-sign__cta {
	border-color: var(--hn-accent);
}

.hn-sign:hover .hn-sign__cta i {
	transform: translateX(6px);
}

@keyframes hn-rise {
	to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------- языки и бургер */

.hn-lang,
.hn-burger {
	position: fixed;
	top: var(--pad);
	z-index: 30;
	opacity: 0;
}

/* Кнопка остаётся над панелью: ею же меню и закрывают. */
.hn-burger { z-index: 50; }

body.is-ready .hn-lang { animation: hn-fade 0.8s var(--e-body) 1.35s forwards; }
body.is-ready .hn-burger { animation: hn-fade 0.8s var(--e-body) 1.25s forwards; }

@keyframes hn-fade { to { opacity: 1; } }

.hn-lang { left: var(--pad); }

.hn-lang .hn-language-switcher {
	display: flex;
	gap: 12px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
}

.hn-lang a {
	color: rgba(242, 242, 242, 0.42);
	transition: color 0.3s var(--e-ui);
}

.hn-lang a:hover { color: var(--hn-text); }
.hn-lang a.is-active { color: var(--hn-accent); }

.hn-burger {
	right: var(--pad);
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 0;
	background: none;
	border: 0;
	color: var(--hn-text);
	font: inherit;
	cursor: pointer;
}

.hn-burger__label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(242, 242, 242, 0.55);
	transition: color 0.3s var(--e-ui);
}

.hn-burger:hover .hn-burger__label { color: var(--hn-text); }

.hn-burger__bars {
	display: grid;
	gap: 5px;
	width: 26px;
	padding: 9px 0;
	box-sizing: content-box;
}

.hn-burger__bars i {
	display: block;
	height: 1px;
	background: currentColor;
	transition: transform 0.45s var(--e-display), opacity 0.2s var(--e-ui);
}

body.menu-open .hn-burger__bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.menu-open .hn-burger__bars i:nth-child(2) { opacity: 0; }
body.menu-open .hn-burger__bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* -------------------------------------------------------------------- меню */

.hn-menu {
	position: fixed;
	inset: 0;
	z-index: 45;
	visibility: hidden;
	transition: visibility 0s linear 0.52s;
}

body.menu-open .hn-menu {
	visibility: visible;
	transition-delay: 0s;
}

.hn-menu__veil {
	position: absolute;
	inset: 0;
	background: rgba(6, 6, 6, 0.62);
	backdrop-filter: blur(5px);
	opacity: 0;
	transition: opacity 0.5s var(--e-ui);
}

body.menu-open .hn-menu__veil { opacity: 1; }

/* Панель не выезжает плашкой, а раскрывается шторкой — поверхность уходит
   вправо, а содержимое внутри идёт следом с отставанием. */
.hn-menu__panel {
	position: absolute;
	inset: 0 0 0 auto;
	width: min(520px, 100vw);
	background:
		radial-gradient(120% 60% at 100% 0%, rgba(208, 167, 66, 0.07), rgba(208, 167, 66, 0) 62%),
		linear-gradient(200deg, #151412 0%, #0e0e0e 55%, #0a0a0a 100%);
	clip-path: inset(0 0 0 100%);
	transition: clip-path 0.42s var(--e-ui);
	will-change: clip-path;
}

body.menu-open .hn-menu__panel {
	clip-path: inset(0 0 0 0);
	transition: clip-path 0.62s var(--e-display);
}

.hn-menu__edge {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 1px;
	background: linear-gradient(
		to bottom,
		rgba(208, 167, 66, 0),
		rgba(208, 167, 66, 0.7) 16%,
		rgba(208, 167, 66, 0.7) 84%,
		rgba(208, 167, 66, 0)
	);
	transform: scaleY(0);
	transform-origin: top center;
	transition: transform 0.3s var(--e-ui);
}

body.menu-open .hn-menu__edge {
	transform: scaleY(1);
	transition: transform 0.56s var(--e-display) 0.1s;
}

.hn-menu__scroll {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: calc(var(--pad) * 3) clamp(24px, 3.4vw, 46px) calc(var(--pad) * 1.6);
	display: flex;
	flex-direction: column;
	gap: clamp(26px, 3.2vw, 38px);
	transform: translateX(28px);
	opacity: 0;
	transition: transform 0.34s var(--e-ui), opacity 0.24s var(--e-ui);
}

body.menu-open .hn-menu__scroll {
	transform: none;
	opacity: 1;
	transition: transform 0.66s var(--e-display) 0.06s, opacity 0.4s var(--e-body) 0.06s;
}

.hn-menu__list,
.hn-menu__social {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Пункты не проявляются, а выезжают из-под собственной кромки. */
.hn-menu__list a {
	display: block;
	overflow: hidden;
	padding: 3px 0;
	font-family: var(--hn-display);
	font-size: clamp(32px, 4.4vw, 46px);
	line-height: 1.16;
	color: var(--hn-text);
}

.hn-menu__list a span {
	display: block;
	transform: translateY(108%);
	transition: transform 0.32s var(--e-ui), color 0.3s var(--e-ui);
}

body.menu-open .hn-menu__list a span {
	transform: none;
	transition: transform 0.66s var(--e-display) calc(0.16s + var(--i) * 0.07s), color 0.3s var(--e-ui);
}

.hn-menu__list a:hover span { color: var(--hn-accent); }

.hn-menu__about {
	border-top: 1px solid rgba(242, 242, 242, 0.09);
	padding-top: clamp(20px, 2.4vw, 28px);
	max-width: 46ch;
}

.hn-menu__about > * {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.24s var(--e-ui), transform 0.24s var(--e-ui);
}

body.menu-open .hn-menu__about > * {
	opacity: 1;
	transform: none;
	transition: opacity 0.6s var(--e-body) var(--d, 0.3s), transform 0.66s var(--e-display) var(--d, 0.3s);
}

body.menu-open .hn-menu__about > *:nth-child(1) { --d: 0.30s; }
body.menu-open .hn-menu__about > *:nth-child(2) { --d: 0.35s; }
body.menu-open .hn-menu__about > *:nth-child(3) { --d: 0.41s; }
body.menu-open .hn-menu__about > *:nth-child(4) { --d: 0.47s; }
body.menu-open .hn-menu__about > *:nth-child(5) { --d: 0.53s; }
body.menu-open .hn-menu__about > *:nth-child(6) { --d: 0.59s; }

.hn-menu__eyebrow {
	margin: 0 0 10px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(208, 167, 66, 0.78);
}

.hn-menu__name {
	margin: 0 0 14px;
	font-family: var(--hn-display);
	font-size: clamp(26px, 2.6vw, 32px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.01em;
	color: var(--hn-text);
}

.hn-menu__about p {
	margin: 0 0 12px;
	font-size: 13.5px;
	line-height: 1.68;
	color: rgba(242, 242, 242, 0.6);
}

.hn-menu__more {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	margin-top: 6px;
	padding-bottom: 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--hn-accent);
	border-bottom: 1px solid rgba(208, 167, 66, 0.3);
	transition: border-color 0.3s var(--e-ui);
}

.hn-menu__more i {
	font-style: normal;
	transition: transform 0.45s var(--e-display);
}

.hn-menu__more:hover { border-color: var(--hn-accent); }
.hn-menu__more:hover i { transform: translateX(5px); }

.hn-menu__foot {
	margin-top: auto;
	padding-top: 22px;
	border-top: 1px solid rgba(242, 242, 242, 0.09);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.24s var(--e-ui), transform 0.24s var(--e-ui);
}

body.menu-open .hn-menu__foot {
	opacity: 1;
	transform: none;
	transition: opacity 0.6s var(--e-body) 0.62s, transform 0.66s var(--e-display) 0.62s;
}

.hn-menu__social {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--hn-muted);
}

.hn-menu__social a { transition: color 0.3s var(--e-ui); }
.hn-menu__social a:hover { color: var(--hn-text); }

.hn-menu__lang .hn-language-switcher {
	display: flex;
	gap: 12px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
}

.hn-menu__lang a {
	color: rgba(242, 242, 242, 0.42);
	transition: color 0.3s var(--e-ui);
}

.hn-menu__lang a:hover { color: var(--hn-text); }
.hn-menu__lang a.is-active { color: var(--hn-accent); }

/* Пока панель открыта, страница под ней уходит из внимания. */
body.menu-open .hn-chrome,
body.menu-open .hn-hint {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s var(--e-ui);
}

body.menu-open .hn-center {
	opacity: 0.22;
	filter: blur(1px);
	transition: opacity 0.5s var(--e-body), filter 0.5s var(--e-body);
}

.hn-center {
	transition: opacity 0.5s var(--e-body), filter 0.5s var(--e-body);
}

/* ------------------------------------------------------------- подсказка */

.hn-hint {
	position: fixed;
	left: 50%;
	bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px));
	z-index: 25;
	margin: 0;
	transform: translateX(-50%);
	font-size: 11px;
	letter-spacing: 0.1em;
	color: rgba(242, 242, 242, 0.34);
	text-align: center;
	pointer-events: none;
	opacity: 0;
}

body.is-ready .hn-hint { animation: hn-fade 1.1s var(--e-body) 1.9s forwards; }

.hn-hint__pointer,
.hn-hint__touch {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 0.5em;
}

.hn-hint__pointer > span,
.hn-hint__touch > span { white-space: nowrap; }

.hn-hint__pointer > span + span::before,
.hn-hint__touch > span + span::before {
	content: "·";
	margin-right: 0.5em;
	opacity: 0.6;
}

.hn-hint__touch { display: none; }

@media (pointer: coarse) {
	.hn-hint__pointer { display: none; }
	.hn-hint__touch { display: inline-flex; }
}

/* --------------------------------------------------------------- подпись */

.hn-label {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 28;
	max-width: 280px;
	padding: 12px 16px 13px;
	background: rgba(12, 12, 12, 0.82);
	border-top: 1px solid rgba(208, 167, 66, 0.45);
	backdrop-filter: blur(8px);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.22s var(--e-ui), transform 0.12s linear;
}

.hn-label.is-visible { opacity: 1; }

.hn-label__title {
	display: block;
	font-family: var(--hn-display);
	font-size: 19px;
	line-height: 1.1;
}

.hn-label__meta {
	display: block;
	margin-top: 5px;
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hn-muted);
}

.hn-label__meta:empty { display: none; }

/* ------------------------------------------------------------ без WebGL */

body.no-webgl {
	overflow: auto;
}

body.no-webgl .hn-center {
	position: relative;
	inset: auto;
	min-height: 62svh;
}

body.no-webgl .hn-hint,
body.no-webgl .hn-vignette { display: none; }

.hn-fallback {
	position: relative;
	z-index: 20;
	padding: 0 var(--pad) calc(var(--pad) * 2);
}

.hn-fallback__note {
	max-width: 48ch;
	margin: 0 auto 26px;
	font-size: 12px;
	letter-spacing: 0.04em;
	color: var(--hn-muted);
	text-align: center;
}

.hn-fallback__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
}

.hn-fallback__grid img {
	display: block;
	width: 100%;
	height: auto;
	opacity: 0.78;
	transition: opacity 0.35s var(--e-ui);
}

.hn-fallback__grid a:hover img { opacity: 1; }

/* -------------------------------------------------------------- служебное */

.hn-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

:focus-visible {
	outline: 2px solid var(--hn-accent);
	outline-offset: 3px;
}

@media (max-width: 600px) {
	.hn-sign__mark { width: 74vw; }

	/* На узком фразы встают строками, и точка-разделитель между ними не нужна. */
	.hn-hint__pointer,
	.hn-hint__touch { flex-direction: column; gap: 3px; }

	.hn-hint__pointer > span + span::before,
	.hn-hint__touch > span + span::before { content: none; }

	.hn-burger__label { display: none; }
	.hn-hint { font-size: 10px; letter-spacing: 0.06em; max-width: 86vw; }
	.hn-label { max-width: 62vw; }
}

@media (prefers-reduced-motion: reduce) {
	.hn-grain { animation: none; }

	body.is-ready .hn-sign::before { animation: none; opacity: 1; }

	body.is-ready .hn-sign__mark {
		animation: none;
		-webkit-mask-image: none;
		mask-image: none;
	}

	body.is-ready .hn-sign__cta,
	body.is-ready .hn-lang,
	body.is-ready .hn-burger,
	body.is-ready .hn-hint {
		animation: none;
		opacity: 1;
		transform: none;
	}

	.hn-menu__panel,
	.hn-menu__edge,
	.hn-menu__scroll,
	.hn-menu__list a span,
	.hn-menu__about > *,
	.hn-menu__foot {
		transition-duration: 0.12s;
		transition-delay: 0s;
	}

	body.menu-open .hn-center { filter: none; }
}
