/* ==========================================================================
   Piotr Zgodziński — portfolio
   Ultra-modern, editorial single-page design
   Fonts preserved from original site: Raleway Light (body) + Roboto Slab (display)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
	/* Monochromatic palette — dark (default) */
	--bg: #0d0d0d;
	--bg-elevated: #141414;
	--surface: #1a1a1a;
	--surface-hover: #222222;
	--text: #f2f2f2;
	--text-strong: #ffffff;
	--text-muted: #b7b7b7;
	--text-faint: #8a8a8a;
	--line: rgba(255, 255, 255, 0.10);
	--line-strong: rgba(255, 255, 255, 0.18);
	--glass: rgba(13, 13, 13, 0.78);
	--accent: #c8a664;
	--accent-soft: rgba(200, 166, 100, 0.16);
	--cover-overlay: linear-gradient(180deg, rgba(10, 10, 10, 0.35) 0%, rgba(10, 10, 10, 0.55) 55%, rgba(10, 10, 10, 0.92) 100%);
	--hero-overlay: linear-gradient(180deg, rgba(10, 10, 10, 0.5) 0%, rgba(10, 10, 10, 0.25) 45%, rgba(10, 10, 10, 0.9) 100%);
	--shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);

	/* Type */
	--font-body: 'Raleway', 'RalewayLightLatinEx', system-ui, sans-serif;
	--font-display: 'Roboto Slab', 'RobotoSlabLatinEx', Georgia, serif;

	/* Layout */
	--nav-h: 76px;
	--gutter: clamp(1rem, 3.2vw, 3rem);
	--max-w: 1680px;
	--radius: 2px;

	/* Motion */
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--dur: 0.7s;
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--nav-h);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--font-body);
	font-weight: 400;
	line-height: 1.6;
	color: var(--text);
	background-color: var(--bg);
	letter-spacing: 0.01em;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

img { max-width: 100%; display: block; }

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

button {
	font-family: inherit;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 0;
}

h1, h2, h3 {
	font-family: var(--font-display);
	font-weight: 400;
	line-height: 1.02;
	letter-spacing: -0.035em;
	margin: 0;
	color: var(--text-strong);
}

::selection { background: var(--accent); color: #0d0d0d; }

.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--accent);
	color: #0d0d0d;
	padding: 0.6rem 1rem;
	z-index: 1000;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   Reveal-on-scroll (only when JS present)
   -------------------------------------------------------------------------- */
.js .reveal {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
	will-change: opacity, transform;
}
.js .reveal.in-view {
	opacity: 1;
	transform: none;
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
	position: fixed;
	inset: 0 0 auto 0;
	height: var(--nav-h);
	z-index: 100;
	transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
	border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
	background-color: var(--glass);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	backdrop-filter: blur(14px) saturate(140%);
	border-bottom-color: var(--line);
}

.nav {
	height: 100%;
	max-width: var(--max-w);
	margin: 0 auto;
	padding: 0 var(--gutter);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
}

.nav__brand { display: flex; flex-direction: column; line-height: 1.15; }
.nav__brand-name {
	font-family: var(--font-display);
	font-size: 1.02rem;
	letter-spacing: -0.01em;
	color: var(--text-strong);
}
.nav__brand-role {
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.nav__links {
	display: flex;
	gap: clamp(1rem, 2.4vw, 2.4rem);
	list-style: none;
	margin: 0;
	padding: 0;
}
.nav__link {
	position: relative;
	font-size: 0.84rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--text-muted);
	padding: 0.4rem 0;
	transition: color 0.3s var(--ease);
}
.nav__link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 1px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.4s var(--ease);
}
.nav__link:hover,
.nav__link.is-active { color: var(--text-strong); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav__actions { display: flex; align-items: center; gap: 0.9rem; }

/* Burger */
.nav__burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 8px;
}
.nav__burger span {
	display: block;
	height: 1.5px;
	width: 100%;
	background: var(--text-strong);
	transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}
.nav__burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Mobile drawer
   -------------------------------------------------------------------------- */
.drawer {
	position: fixed;
	inset: 0;
	z-index: 200;
	pointer-events: none;
}
.drawer.is-open { pointer-events: auto; }

.drawer__scrim {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(0, 0, 0, 0.55);
	opacity: 0;
	transition: opacity 0.4s var(--ease);
}
.drawer.is-open .drawer__scrim { opacity: 1; }

.drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	height: 100%;
	width: min(86vw, 400px);
	background: var(--bg-elevated);
	border-left: 1px solid var(--line);
	padding: calc(var(--nav-h) + 1rem) var(--gutter) 2rem;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transform: translateX(100%);
	transition: transform 0.5s var(--ease);
}
.drawer.is-open .drawer__panel { transform: translateX(0); }

.drawer__nav { display: flex; flex-direction: column; }
.drawer__link {
	display: flex;
	align-items: baseline;
	gap: 0.9rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--line);
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 6vw, 2.4rem);
	letter-spacing: -0.02em;
	color: var(--text-strong);
	transition: color 0.3s var(--ease), padding-left 0.3s var(--ease);
}
.drawer__link span { font-family: var(--font-body); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.2em; color: var(--accent); }
.drawer__link:hover { color: var(--accent); padding-left: 0.4rem; }

.drawer__social { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; }
.drawer__social a {
	font-size: 0.82rem;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-muted);
	transition: color 0.3s var(--ease);
}
.drawer__social a:hover { color: var(--text-strong); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
	position: relative;
	min-height: 100svh;
	display: grid;
	place-items: center;
	overflow: hidden;
}
.hero__media,
.hero__overlay {
	position: absolute;
	inset: 0;
}
.hero__media {
	background-image: url('images/headers/main.jpg');
	background-position: center top;
	background-size: cover;
	background-attachment: fixed;
	transform: scale(1.04);
	animation: heroZoom 2.4s var(--ease) forwards;
}
.hero__overlay { background: var(--hero-overlay); }

@keyframes heroZoom {
	from { transform: scale(1.12); }
	to { transform: scale(1.04); }
}

.hero__content {
	position: relative;
	z-index: 2;
	text-align: center;
	padding: 0 var(--gutter);
	color: #fff;
}

.hero__kicker {
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--accent);
	margin: 0 0 1.4rem;
	animation: fadeUp 1s var(--ease) 0.15s both;
}
.hero__title {
	font-size: clamp(3.4rem, 13vw, 10.5rem);
	line-height: 0.94;
	letter-spacing: -0.04em;
	animation: fadeUp 1s var(--ease) 0.3s both;
}
.hero__subtitle {
	margin: 1.8rem 0 0;
	font-size: clamp(1rem, 2.6vw, 1.45rem);
	font-weight: 400;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	animation: fadeUp 1s var(--ease) 0.5s both;
}

@keyframes fadeUp {
	from { opacity: 0; transform: translateY(26px); }
	to { opacity: 1; transform: none; }
}

.hero__scroll {
	position: absolute;
	left: 50%;
	bottom: 2.2rem;
	transform: translateX(-50%);
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.8rem;
	color: #fff;
}
.hero__scroll-line {
	width: 1px;
	height: 52px;
	background: currentColor;
	opacity: 0.55;
	overflow: hidden;
	position: relative;
}
.hero__scroll-line::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 40%;
	background: var(--accent);
	animation: scrollDrop 2s var(--ease) infinite;
}
@keyframes scrollDrop {
	0% { transform: translateY(-100%); }
	100% { transform: translateY(260%); }
}
.hero__scroll-text {
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Statement
   -------------------------------------------------------------------------- */
.statement {
	max-width: var(--max-w);
	margin: 0 auto;
	padding: clamp(5rem, 12vw, 11rem) var(--gutter);
	text-align: center;
}
.statement__text {
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 4.4vw, 3.4rem);
	line-height: 1.18;
	letter-spacing: -0.02em;
	color: var(--text-strong);
	margin: 0 0 1.8rem;
}
.statement__meta {
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin: 0;
}

/* --------------------------------------------------------------------------
   Work sections + covers
   -------------------------------------------------------------------------- */
.work-section {
	transition: opacity 0.5s var(--ease);
}

.section-cover {
	position: relative;
	min-height: clamp(340px, 68vh, 720px);
	display: grid;
	place-items: center;
	background-position: center center;
	background-size: cover;
	background-attachment: fixed;
	overflow: hidden;
}
.section-cover__overlay { position: absolute; inset: 0; background: var(--cover-overlay); }

/* Parallax background layer — mobile only (see script.js) */
.parallax-bg {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-position: center center;
	background-size: cover;
	background-repeat: no-repeat;
	pointer-events: none;
	display: none;
}

.section-cover__content {
	position: relative;
	z-index: 2;
	text-align: center;
	padding: 0 var(--gutter);
	color: #fff;
}

.section-cover__index {
	display: block;
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 1.2rem;
}
.section-cover__title {
	font-size: clamp(2.8rem, 9vw, 7rem);
	letter-spacing: -0.04em;
}

/* Clients list (publications) */
.clients {
	max-width: 1100px;
	margin: 0 auto;
	padding: clamp(3rem, 7vw, 6rem) var(--gutter) 0;
}
.clients__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0;
	column-gap: clamp(2rem, 6vw, 5rem);
}
.clients__list li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.95rem 0;
	border-bottom: 1px solid var(--line);
}
.clients__list span {
	font-family: var(--font-display);
	font-size: clamp(1rem, 2vw, 1.25rem);
	color: var(--text-strong);
}
.clients__list small {
	font-size: 0.82rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-muted);
	white-space: nowrap;
}

/* Section description (3d) */
.section-description {
	max-width: var(--max-w);
	margin: 0 auto;
	padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) 0;
	text-align: center;
}
.section-description p {
	font-family: var(--font-display);
	font-size: clamp(1.3rem, 3vw, 2.2rem);
	letter-spacing: -0.015em;
	color: var(--text-muted);
	margin: 0;
}

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */
.gallery {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: clamp(0.5rem, 1.4vw, 1.4rem);
	max-width: var(--max-w);
	margin: 0 auto;
	padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter) clamp(3rem, 7vw, 6rem);
}
.g-item {
	margin: 0;
	position: relative;
	overflow: hidden;
	cursor: zoom-in;
	background: var(--surface);
}
.g-item.wide { grid-column: 1 / -1; }

.g-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.9s var(--ease), filter 0.6s var(--ease);
	filter: saturate(0.96);
	aspect-ratio: 3 / 2;
}
.g-item.wide img { aspect-ratio: 21 / 9; }

.g-item::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.35) 100%);
	opacity: 0;
	transition: opacity 0.5s var(--ease);
	pointer-events: none;
}
.g-item:hover img {
	transform: scale(1.045);
	filter: saturate(1);
}
.g-item:hover::after { opacity: 1; }

/* "more" link */
.section-more {
	max-width: var(--max-w);
	margin: 0 auto;
	padding: 0 var(--gutter) clamp(3rem, 7vw, 6rem);
	text-align: center;
}
.section-more__link {
	display: inline-block;
	font-family: var(--font-display);
	font-size: clamp(1.1rem, 2.6vw, 1.7rem);
	letter-spacing: -0.01em;
	color: var(--text-strong);
	border-bottom: 1px solid var(--line-strong);
	padding-bottom: 0.2rem;
	transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.section-more__link span { display: inline-block; transition: transform 0.3s var(--ease); color: var(--accent); }
.section-more__link:hover { color: var(--accent); border-color: var(--accent); }
.section-more__link:hover span { transform: translateX(6px); }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact__body {
	max-width: var(--max-w);
	margin: 0 auto;
	padding: clamp(3rem, 7vw, 6rem) var(--gutter);
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(2rem, 6vw, 6rem);
	align-items: start;
}
.contact__links {
	display: grid;
	grid-template-columns: 1fr;
}
.contact__links a {
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 4.5vw, 3rem);
	letter-spacing: -0.02em;
	line-height: 1.25;
	color: var(--text-strong);
	border-bottom: 1px solid var(--line);
	padding: 0.55rem 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	transition: color 0.35s var(--ease), padding-left 0.35s var(--ease);
}
.contact__links a::after {
	content: "\2197";
	font-size: 0.5em;
	color: var(--accent);
	opacity: 0;
	transform: translate(-6px, 6px);
	transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.contact__links a:hover { color: var(--accent); padding-left: 0.5rem; }
.contact__links a:hover::after { opacity: 1; transform: translate(0, 0); }

.contact__info p {
	margin: 0 0 0.9rem;
	font-size: 1.05rem;
	font-weight: 400;
	color: var(--text-muted);
}
.contact__info a { color: var(--text-strong); border-bottom: 1px solid var(--line-strong); transition: color 0.3s var(--ease), border-color 0.3s var(--ease); }
.contact__info a:hover { color: var(--accent); border-color: var(--accent); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
	max-width: var(--max-w);
	margin: 0 auto;
	padding: clamp(2rem, 5vw, 3.5rem) var(--gutter);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	border-top: 1px solid var(--line);
	font-size: 0.85rem;
	font-weight: 400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
}
.site-footer__copy { margin: 0; }
.site-footer__links { display: flex; gap: 1.8rem; }
.site-footer__links a { transition: color 0.3s var(--ease); }
.site-footer__links a:hover { color: var(--text-strong); }

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 300;
	background: rgba(5, 5, 5, 0.94);
	display: grid;
	place-items: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__figure {
	margin: 0;
	max-width: min(92vw, 1500px);
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.2rem;
}
.lightbox__img {
	max-width: 100%;
	max-height: 78vh;
	object-fit: contain;
	box-shadow: var(--shadow);
	transform: scale(0.96);
	transition: transform 0.45s var(--ease);
}
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__caption {
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.lightbox__close {
	position: absolute;
	top: 1.4rem;
	right: 1.6rem;
	font-size: 2.6rem;
	font-weight: 300;
	line-height: 1;
	color: var(--text);
	transition: color 0.3s var(--ease), transform 0.3s var(--ease);
}
.lightbox__close:hover { color: var(--accent); transform: rotate(90deg); }

.lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 56px;
	height: 56px;
	font-size: 1.6rem;
	color: var(--text);
	border: 1px solid var(--line-strong);
	border-radius: 50%;
	transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.lightbox__nav:hover { background: var(--text-strong); color: #0d0d0d; border-color: var(--text-strong); }
.lightbox__nav--prev { left: 1.4rem; }
.lightbox__nav--next { right: 1.4rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
	.hero__media,
	.section-cover { background-attachment: scroll; }
}

@media (max-width: 900px) {
	.nav__links { display: none; }
	.nav__burger { display: flex; }
}

@media (max-width: 767px) {
	:root { --nav-h: 64px; }

	.hero__media { background-image: url('images/headers/main-mobile.jpg'); }

	.parallax-bg { display: block; }

	/* Clip the fixed background layer to each cover's box */
	.section-cover { clip-path: inset(0); }

	/* Publications header: anchor to the more interesting left side on mobile */
	.cover-left,
	.cover-left .parallax-bg { background-position: left center; }

	.gallery { grid-template-columns: 1fr; gap: 0.5rem; padding-left: 0.5rem; padding-right: 0.5rem; }
	.g-item.wide { grid-column: auto; }
	.g-item { cursor: default; }
	.g-item img,
	.g-item.wide img {
		width: 100%;
		height: auto;
		aspect-ratio: auto;
		object-fit: initial;
	}
	.g-item:hover img { transform: none; }
	.g-item:hover::after { opacity: 0; }

	.clients__list { grid-template-columns: 1fr; }
	.clients__list li { flex-wrap: wrap; }
	.clients__list small { white-space: normal; }

	.contact__body { grid-template-columns: 1fr; }

	.lightbox__nav { width: 44px; height: 44px; }
	.lightbox__nav--prev { left: 0.6rem; }
	.lightbox__nav--next { right: 0.6rem; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
	.js .reveal { opacity: 1; transform: none; }
	.hero__media { transform: none; }
}
