/*
	Brutalist theme for David Novicki's portfolio.
	Raw structure, hard edges, high contrast. No border-radius, no soft shadows, no gradients.
*/

:root {
	--bg:				#f2f0e6;
	--fg:				#0a0a0a;
	--fg-muted:			#4a4a44;
	--panel:			#fffdf7;
	--ink:				#0a0a0a;
	--paper:			#ffffff;
	--accent:			#ddff00;
	--accent-2:			#7b2fff;
	--border:			4px;
	--border-thin:		2px;
	--shadow-x:			8px;
	--shadow-y:			8px;
	--gutter:			clamp(1.25rem, 4vw, 3rem);
	--max:				1200px;
	--font-display:		'Archivo Black', 'Arial Black', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	--font-mono:		'Space Mono', 'Courier New', Courier, monospace;
}

* { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
}

body {
	background: var(--bg);
	background-image:
		linear-gradient(var(--fg) 1px, transparent 1px),
		linear-gradient(90deg, var(--fg) 1px, transparent 1px);
	background-size: 40px 40px;
	background-position: -1px -1px;
	background-attachment: fixed;
	color: var(--fg);
	font-family: var(--font-mono);
	font-size: 16px;
	line-height: 1.65;
	margin: 0;
	-webkit-font-smoothing: antialiased;
}

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

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

::selection {
	background: var(--ink);
	color: var(--accent);
}

a {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	transition: none;
}

.icon {
	text-decoration: none;
}

.icon:before {
	font-family: FontAwesome;
	font-style: normal;
	font-weight: normal;
	text-transform: none !important;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a:hover {
	background: var(--ink);
	color: var(--accent);
}

:focus-visible {
	outline: 3px solid var(--accent-2);
	outline-offset: 3px;
}

strong, b {
	color: var(--ink);
	font-weight: 700;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	text-transform: uppercase;
	letter-spacing: -0.01em;
	line-height: 1.05;
	margin: 0 0 0.6em 0;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
	color: inherit;
	text-decoration: none;
}

h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.35em 0; }

hr {
	border: 0;
	border-top: var(--border) solid var(--ink);
	margin: 2em 0;
}

/* ===== Layout shell ===== */

#header,
#main,
#footer {
	max-width: var(--max);
	margin-left: auto;
	margin-right: auto;
}

#header {
	background: var(--ink);
	color: var(--paper);
	border: var(--border) solid var(--ink);
	margin-top: clamp(1rem, 3vw, 2.5rem);
	padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
	display: flex;
	align-items: center;
	gap: clamp(1.5rem, 4vw, 3rem);
	flex-wrap: wrap;
}

#header .image.avatar {
	flex-shrink: 0;
	width: clamp(96px, 14vw, 150px);
	height: clamp(96px, 14vw, 150px);
	border: var(--border-thin) solid var(--accent);
	box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--accent);
	display: block;
}

#header .image.avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(1) contrast(1.1);
}

#header h1 {
	color: var(--paper);
	font-size: clamp(1.75rem, 5vw, 3rem);
	max-width: 28em;
}

#header h1 strong {
	color: var(--accent);
}

#header h1 i {
	font-style: normal;
	color: var(--accent-2);
	text-decoration: underline solid var(--accent-2);
	text-decoration-thickness: 3px;
	text-underline-offset: 4px;
}

/* ===== Main ===== */

#main {
	background: var(--panel);
	border-left: var(--border) solid var(--ink);
	border-right: var(--border) solid var(--ink);
	counter-reset: section;
}

#main > section {
	position: relative;
	padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
	border-top: var(--border) solid var(--ink);
	counter-increment: section;
	overflow: hidden;
}

#main > section::before {
	content: '0' counter(section);
	position: absolute;
	top: 0.2em;
	right: var(--gutter);
	font-family: var(--font-display);
	font-size: clamp(4rem, 12vw, 9rem);
	line-height: 1;
	color: var(--ink);
	opacity: 0.06;
	pointer-events: none;
	user-select: none;
}

#main > section > h2 {
	display: inline-block;
	background: var(--ink);
	color: var(--accent);
	padding: 0.25em 0.5em;
	margin-bottom: 1em;
}

header.major h2 { margin-bottom: 0; }

/* About */

#one strong { background: var(--accent); padding: 0 0.15em; }

/* Work Experience */

#two > header {
	margin-top: 2.5em;
	padding-top: 2em;
	border-top: var(--border-thin) dashed var(--fg-muted);
}

#two > header:first-of-type {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

#two > header h3 {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5em;
}

#two > header h3::before {
	content: '>';
	color: var(--accent-2);
	font-family: var(--font-mono);
}

#two > header p {
	font-family: var(--font-mono);
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--fg-muted);
	margin-bottom: 1.5em;
}

/* Recent Work grid */

#three .row {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: clamp(1.5rem, 3vw, 2.5rem);
}

.work-item {
	margin: 0;
	border: var(--border-thin) solid var(--ink);
	background: var(--paper);
	box-shadow: 6px 6px 0 var(--ink);
	transition: transform 0.12s steps(2), box-shadow 0.12s steps(2);
}

.work-item:hover,
.work-item:focus-within {
	transform: translate(-4px, -4px);
	box-shadow: 10px 10px 0 var(--accent-2);
}

.work-item .image {
	margin: 0;
	border: 0;
	border-radius: 0;
	overflow: hidden;
}

.work-item .image:before { content: none; }

.work-item .image img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-bottom: var(--border-thin) solid var(--ink);
	filter: grayscale(1);
	transition: filter 0.12s steps(2);
}

.work-item .image:hover img,
.work-item .image:focus img { filter: grayscale(0); }

.work-item .image.thumb:after {
	content: 'VIEW →';
	position: static;
	display: block;
	width: 100%;
	background: var(--accent);
	color: var(--ink);
	font-family: var(--font-mono);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.8em;
	text-align: center;
	line-height: 2.4em;
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0;
	opacity: 0;
	max-height: 0;
	overflow: hidden;
	transition: opacity 0.12s steps(2), max-height 0.12s steps(2);
}

.work-item .image.thumb:hover:after,
.work-item .image.thumb:focus:after {
	opacity: 1;
	max-height: 3em;
}

.work-item h3 {
	font-size: 0.95em;
	margin: 1em 1em 0.4em 1em;
}

.work-item p {
	font-size: 0.82em;
	color: var(--fg-muted);
	margin: 0 1em 1em 1em;
}

/* ===== Footer ===== */

#footer {
	background: var(--ink);
	color: var(--paper);
	border: var(--border) solid var(--ink);
	border-top: 0;
	margin-bottom: clamp(1rem, 3vw, 2.5rem);
	padding: clamp(2rem, 5vw, 3rem) var(--gutter);
	text-align: center;
}

#footer .icons {
	list-style: none;
	margin: 0 0 1.25em 0;
	padding: 0;
	display: flex;
	justify-content: center;
	gap: 0.75em;
	flex-wrap: wrap;
}

#footer .icons li { display: block; }

#footer .icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3em;
	height: 3em;
	border: var(--border-thin) solid var(--paper);
	color: var(--paper);
	text-decoration: none;
}

#footer .icon:before { font-size: 1.2em; }

#footer .icon:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--ink);
}

#footer .icon .label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

#footer .copyright {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.8em;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #b8b6ac;
}

#footer .copyright li { display: inline; }
#footer .copyright a { color: inherit; }

/* ===== Responsive ===== */

@media (max-width: 760px) {
	#three .row {
		grid-template-columns: 1fr;
	}

	#header {
		flex-direction: column;
		text-align: center;
	}

	#header h1 { max-width: none; }

	#main > section::before {
		font-size: clamp(3rem, 20vw, 5rem);
	}
}

@media (max-width: 480px) {
	:root { --gutter: 1rem; }

	body { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
	.work-item,
	.work-item .image img,
	.work-item .image.thumb:after {
		transition: none;
	}

	.work-item:hover,
	.work-item:focus-within {
		transform: none;
	}
}
