/* Ján Turský — single screen. Palette and motion follow the design canvas.
   No build step: everything here is hand-written and served as-is. */

:root {
	--bg: #f6f5f2;
	--ink: #17171a;
	--mute: #a3a19a;
	--accent: #c2410c;
	--ok: #3f7d4e;

	--pad-x: 38px;
	--pad-top: clamp(20px, 3.6vh, 34px);
	--pad-bottom: clamp(18px, 3.2vh, 30px);

	/* GSAP equivalents: expo.out for the line masks, power2.out for fades. */
	--ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-power2: cubic-bezier(0.33, 1, 0.68, 1);
}

/* Follows the OS setting, no toggle. Same four roles, accent lifted so the
   hover colour keeps its contrast on the dark ground. */
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #121211;
		--ink: #ecebe6;
		--mute: #85837c;
		--accent: #f0703a;
		--ok: #6fb07f;
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
}

html {
	background: var(--bg);
	color-scheme: light dark;
}

body {
	background: var(--bg);
	color: var(--ink);
	font-family: 'Schibsted Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	letter-spacing: -0.005em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: inherit;
	text-decoration: none;
}

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

h1,
h2 {
	margin: 0;
	font-weight: 400;
	font-size: inherit;
}

/* Language: one page, both mutations inline, visibility is pure CSS. */
html[data-lang="en"] .t-sk,
html[data-lang="sk"] .t-en {
	display: none;
}


/* ---------- layout ---------- */

.page {
	min-height: 100vh;
	min-height: 100svh;
	display: grid;
	grid-template-rows: auto 1fr auto auto;
	padding: var(--pad-top) var(--pad-x) var(--pad-bottom);
}

.topbar {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 24px;
}

.ident {
	display: flex;
	align-items: baseline;
	gap: 11px;
	flex-wrap: wrap;
}

.ident-name {
	font-weight: 500;
}

.ident-role {
	color: var(--mute);
}

.topbar-meta {
	display: flex;
	align-items: baseline;
	gap: 16px;
	color: var(--mute);
}

.clock {
	font-variant-numeric: tabular-nums;
}

.lang-switch {
	display: flex;
	align-items: baseline;
	gap: 7px;
}

.lang-switch button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	letter-spacing: inherit;
	color: var(--mute);
	cursor: pointer;
	transition: color 0.25s var(--ease-power2);
}

.lang-switch button[aria-pressed="true"] {
	color: var(--ink);
}

.lang-switch button:hover {
	color: var(--ink);
}


/* ---------- headline ---------- */

.intro {
	display: flex;
	align-items: center;
	padding: clamp(28px, 7vh, 88px) 0 clamp(30px, 8vh, 96px);
	max-width: 1240px;
}

.intro-title {
	font-size: clamp(26px, min(3.5vw, 6.2vh), 53px);
	line-height: 1.14;
	letter-spacing: -0.028em;
	text-wrap: pretty;
}

.line {
	display: block;
	overflow: hidden;
	padding-bottom: 0.06em;
}

.line-in {
	display: block;
}

.line.is-mute {
	color: var(--mute);
}


/* ---------- columns ---------- */

.cols {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 38px;
	align-items: start;
	padding-bottom: clamp(24px, 5vh, 56px);
}

.col-label {
	color: var(--mute);
	margin-bottom: 16px;
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.09em;
}

.col-list {
	display: flex;
	flex-direction: column;
}

.item {
	display: block;
	padding: 1px 0;
	transition: opacity 0.3s var(--ease-power2), color 0.2s var(--ease-power2);
}

/* Hovering one entry dims every other entry in the block. Pure CSS, so it
   also works while the intro animation is still running. */
.cols:hover .item {
	opacity: 0.32;
}

.cols .item:hover {
	opacity: 1;
}

a.item:hover {
	color: var(--accent);
}

/* Selected work: project name on the left, where it lives on the right. */
.item-work {
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.item-name {
	flex: none;
}

.item-meta {
	margin-left: auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 13px;
	color: var(--mute);
}

.item-more {
	color: var(--mute);
}

.item-hint {
	margin-left: 4px;
	font-size: 13px;
	color: var(--mute);
}


/* ---------- footer ---------- */

.statusbar {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 24px;
	color: var(--mute);
}

.status {
	display: flex;
	align-items: baseline;
	gap: 9px;
}

.status-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--ok);
	display: inline-block;
	align-self: center;
}


/* ---------- intro motion ----------
   Everything animates from hidden to the authored state with fill-mode both,
   so a blocked stylesheet or a stalled paint degrades to the finished layout
   rather than to a blank page. */

@keyframes line-rise {
	from { transform: translateY(100%); }
	to   { transform: translateY(0); }
}

@keyframes fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes item-in {
	from { opacity: 0; transform: translateY(7px); }
	to   { opacity: 1; transform: translateY(0); }
}

.line-in {
	animation: line-rise 1.1s var(--ease-expo) both;
	animation-delay: 0.12s;
}

.line:nth-child(2) .line-in { animation-delay: 0.195s; }
.line:nth-child(3) .line-in { animation-delay: 0.27s; }

[data-fade] {
	animation: fade-in 0.7s var(--ease-power2) both;
	animation-delay: 0.3s;
}

.ident-role { animation-delay: 0.35s; }
.topbar-meta { animation-delay: 0.4s; }
.col-label { animation-delay: 0.45s; }
.statusbar { animation-delay: 0.5s; }

.item {
	animation: item-in 0.55s var(--ease-power2) both;
}

/* Stagger runs across the row first, so the four blocks fill in together. */
.col-list li:nth-child(1) .item  { animation-delay: calc(var(--base, 0.50s) + 0.000s); }
.col-list li:nth-child(2) .item  { animation-delay: calc(var(--base, 0.50s) + 0.036s); }
.col-list li:nth-child(3) .item  { animation-delay: calc(var(--base, 0.50s) + 0.072s); }
.col-list li:nth-child(4) .item  { animation-delay: calc(var(--base, 0.50s) + 0.108s); }
.col-list li:nth-child(5) .item  { animation-delay: calc(var(--base, 0.50s) + 0.144s); }
.col-list li:nth-child(6) .item  { animation-delay: calc(var(--base, 0.50s) + 0.180s); }
.col-list li:nth-child(7) .item  { animation-delay: calc(var(--base, 0.50s) + 0.216s); }
.col-list li:nth-child(8) .item  { animation-delay: calc(var(--base, 0.50s) + 0.252s); }
.col-list li:nth-child(9) .item  { animation-delay: calc(var(--base, 0.50s) + 0.288s); }
.col-list li:nth-child(10) .item { animation-delay: calc(var(--base, 0.50s) + 0.324s); }

.col:nth-child(1) { --base: 0.50s; }
.col:nth-child(2) { --base: 0.52s; }
.col:nth-child(3) { --base: 0.54s; }
.col:nth-child(4) { --base: 0.56s; }

/* Replayed on a language switch: the class is dropped and re-added, which
   restarts every animation above. */
.page.is-replaying .line-in,
.page.is-replaying [data-fade],
.page.is-replaying .item {
	animation: none;
}


/* ---------- responsive ---------- */

@media (max-width: 900px) {
	:root {
		--pad-x: 24px;
		--pad-top: 26px;
		--pad-bottom: 24px;
	}

	.cols {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 30px 24px;
		padding-bottom: 40px;
	}

	.intro {
		padding: 56px 0 60px;
	}

	/* Below the four-column breakpoint the page scrolls anyway, so the
	   height-derived caps above would only shrink type for no gain. */
	.intro-title {
		font-size: clamp(26px, 3.5vw, 53px);
	}
}

@media (max-width: 560px) {
	.cols {
		grid-template-columns: minmax(0, 1fr);
	}

	.topbar {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.intro {
		padding: 44px 0 48px;
	}
}


/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.line-in,
	[data-fade],
	.item {
		animation: none;
	}

	.item,
	.lang-switch button {
		transition: none;
	}
}
