/*
 * THYMOTHEUS.ART — Polish homepage v12
 *
 * Key change from v11:
 * the homepage footer is removed from normal flex flow and anchored at the
 * bottom of the viewport. Its icons keep their global size; only the large
 * vertical footer padding is removed on /pl/. The middle layout therefore
 * no longer gets prematurely reduced merely to make room for a 200px-high
 * footer box.
 *
 * Reference:
 * 1240px viewport width -> 360px circles while preserving the 386.7px centre distance.
 */

body.home {
	--home-circle-size: 360px;
	--home-circle-gap: 26.7px;
	--home-label-size: 30px;
	--home-label-spacing: 10px;
	--home-label-optical-shift: 5px;
	--home-status-size: 57px;
	--home-status-spacing: 7.9px;
	--home-status-margin: 23px;

	--home-brand-size: 30px;
	--home-brand-spacing: 5px;
	--home-brand-margin-top: 30px;
	--home-brand-origin: 19px;
	--home-header-column-gap: 26.7px;
	--home-header-row-gap: 0px;

	--home-footer-reserve: 72px;

	position: relative;
	height: 100dvh;
	min-height: 100dvh;
	overflow: hidden;
}

/*
 * Homepage footer:
 * same icon sizes and SVGs as the rest of the site, but without the large
 * page-footer padding. This is positioning, not scaling.
 */
body.home .site-footer {
	position: absolute;
	z-index: 5;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: 0 20px 24px;
}

/*
 * The Home brand is the SAME global header used by Works, Bio and archives.
 * Keep its three desktop columns and max-width from site-shell.css: none of
 * the circle sizes/gaps may change where the three name labels are painted.
 * Only Home's small-screen fit fallback may reduce typography at extreme
 * heights. On touch phones the two-row brand keeps the global mobile grid.
 */
body.home .site-header__inner {
	margin-top: var(--home-brand-margin-top);
}

/* Keep the actual shared brand geometry in lockstep with Works when the
 * header must zoom for extremely short viewport heights. The fit script
 * derives this factor from the same shell budgeting used by Works. */
body.home .site-header {
	zoom: var(--home-header-shell-scale, 1);
}

body.home .site-brand {
	font-size: var(--home-brand-size);
	letter-spacing: var(--home-brand-spacing);
}

body.home .site-brand__label {
	transform-origin: 50% var(--home-brand-origin);
}

/*
 * Homepage-only enlarged hover target.
 * It extends beyond the existing padding without moving the visible word.
 */
@media (min-width: 768px) {
	body.home .site-brand__word {
		position: relative;
	}

	body.home .site-brand__word::before {
		content: "";
		position: absolute;
		inset: -12px -20px;
	}
}

body.home .site-main {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.home-page {
	width: 100%;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;

	/*
	 * Reserve only the actual footer-icon zone. Since the content is centred
	 * in the remaining area, the header→circles and status→footer gaps stay
	 * visually balanced.
	 */
	padding: 0 0 var(--home-footer-reserve);
}

.home-content {
	flex: 0 0 auto;

	/*
	 * Reserve the status line's former flow height so centring the main block
	 * does not push the circles downward. The visible status itself remains
	 * absolutely positioned between circles and footer icons.
	 */
	padding-bottom: calc(var(--home-status-margin) + var(--home-status-size));
}

.home-nav {
	display: grid;
	grid-template-columns: repeat(3, var(--home-circle-size));
	justify-content: center;
	align-items: center;
	column-gap: var(--home-circle-gap);
	row-gap: 0;
}

.home-nav__link,
.home-nav__button {
	display: block;
	width: var(--home-circle-size);
	height: var(--home-circle-size);
}

.home-nav__link {
	color: #fff;
	text-decoration: none;
}

.home-nav__button {
	position: relative;
	cursor: pointer;
	transition: transform 0.3s ease;
}

.home-nav__circle {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	transform-origin: center;
}

.home-nav__circle circle {
	fill: transparent;
	stroke: #fff;
	stroke-width: 1.5;
	transition: fill 0.3s ease;
}

.home-nav__label {
	position: absolute;
	top: 50%;
	left: calc(50% + var(--home-label-optical-shift));
	transform: translate(-50%, -50%);
	white-space: nowrap;
	pointer-events: none;
	font-family: "Futura", Arial, sans-serif;
	font-size: var(--home-label-size);
	font-weight: 500;
	line-height: 1;
	letter-spacing: var(--home-label-spacing);
	color: #fff;
	transition: color 0.3s ease;
}

.home-status {
	position: absolute;
	z-index: 4;
	top: var(--home-status-top, 50%);
	left: 50%;
	transform: translate(-50%, -0.21em);
	margin: 0;
	padding: 0;
	text-align: center;
	white-space: nowrap;
	font-family: "Futura", Arial, sans-serif;
	font-size: var(--home-status-size);
	font-weight: 600;
	line-height: 1;
	letter-spacing: var(--home-status-spacing);
	color: #fff;
}

@media (hover: hover) and (pointer: fine) {
	.home-nav__link:hover .home-nav__button,
	.home-nav__link:focus-visible .home-nav__button {
		transform: scale(1.1);
	}

	.home-nav__link:hover .home-nav__circle circle,
	.home-nav__link:focus-visible .home-nav__circle circle {
		fill: #fff;
	}

	.home-nav__link:hover .home-nav__label,
	.home-nav__link:focus-visible .home-nav__label {
		color: #000;
	}
}

/*
 * Click/tap feedback while the destination is being opened.
 * It intentionally mirrors the desktop hover state and also works on touch.
 */
.home-nav__link.is-activating .home-nav__button {
	transform: scale(1.1);
}

.home-nav__link.is-activating .home-nav__circle circle {
	fill: #fff;
}

.home-nav__link.is-activating .home-nav__label {
	color: #000;
}

/*
 * Mobile keeps the vertical stack. The circle size immediately below the
 * breakpoint remains close to the horizontal size immediately above it.
 */
@media (max-width: 767px) and (hover: none) and (pointer: coarse) {
	.home-status {
		transform: translateX(-50%);
	}

	body.home {
		--home-circle-size: 182px;
		--home-circle-gap: 24px;
		--home-label-size: 19px;
		--home-label-spacing: 5px;
		--home-label-optical-shift: 2.5px;
		--home-status-size: 17px;
		--home-status-spacing: 9.1px;
		--home-status-margin: 25px;

		--home-brand-size: 30px;
		--home-brand-spacing: 5px;
		--home-brand-margin-top: 0px;
		--home-brand-origin: 19px;
		--home-header-column-gap: 5px;
		--home-header-row-gap: 11px;

		--home-footer-reserve: 56px;
	}

	body.home .site-footer {
		padding: 0 20px 10px;
	}

	body.home .site-header__inner {
		width: 100%;
		max-width: none;
		margin-top: var(--home-brand-margin-top);
		padding: 0 10px;
		box-sizing: border-box;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: var(--home-header-column-gap);
		row-gap: var(--home-header-row-gap);
	}

	body.home .site-brand--tymoteusz {
		grid-column: 1 / -1;
	}

	body.home .site-brand--karas {
		grid-column: 1;
	}

	body.home .site-brand--tecza {
		grid-column: 2;
	}

	.home-nav {
		grid-template-columns: var(--home-circle-size);
		column-gap: 0;
		row-gap: var(--home-circle-gap);
	}

	.home-nav__label,
	.home-status {
		font-weight: 600;
	}
}

/* Homepage: mobile landscape adopts the horizontal 3-column navigation.
 * Brand typography/grid match the global shell, while home-fit.js continues
 * fitting circles/status/footer into 100dvh without document scrolling. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1024px) and (hover: none) and (pointer: coarse) {
	body.home .site-header__inner {
		width: 100%;
		max-width: 1100px;
		margin-top: 7px;
		padding: 0 10px;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		column-gap: 0;
		row-gap: 3px;
	}

	body.home .site-brand--tymoteusz,
	body.home .site-brand--karas,
	body.home .site-brand--tecza {
		grid-column: auto;
		padding-top: 0;
	}

	body.home .site-brand {
		font-size: clamp(16px, 2.6vw, 24px);
		letter-spacing: clamp(1.5px, 0.40vw, 4px);
	}

	.home-nav {
		grid-template-columns: repeat(3, var(--home-circle-size));
		column-gap: var(--home-circle-gap);
		row-gap: 0;
	}

	/* Keep the top of the circles clear of the shared one-line brand. */
	.home-page {
		padding-top: 28px;
	}

	body.home .site-footer {
		padding-bottom: max(6px, env(safe-area-inset-bottom));
	}
}
