/* ==========================================================================
   Fonts
   ========================================================================== */

@font-face {
	font-family: 'Subvert';
	src: url('../fonts/HSUBVERT01.otf') format('opentype');
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: 'Subvert';
	src: url('../fonts/HSUBVERT02.otf') format('opentype');
	font-weight: 700;
	font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ==========================================================================
   Reset and base
   ========================================================================== */

* {
	box-sizing: border-box;
}

:root {
	--h74-bg: #ffffff;
	--h74-fg: #0a0a0a;
	--h74-fg-muted: #6b6b6b;
	--h74-border: #e2e2e2;
	--h74-tile-size: 220px;
	--h74-gap: 24px;
}

html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	background: var(--h74-bg);
	color: var(--h74-fg);
	font-family: 'IBM Plex Mono', monospace;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

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

button {
	font-family: inherit;
	background: none;
	border: 1px solid var(--h74-border);
	color: var(--h74-fg);
	cursor: pointer;
}

/* ==========================================================================
   Top bar
   ========================================================================== */

.h74-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid var(--h74-border);
	flex: 0 0 auto;
	background: var(--h74-bg);
}

.h74-logo a {
	font-family: 'Subvert', 'IBM Plex Mono', monospace;
	font-weight: 700;
	font-size: 20px;
	letter-spacing: 0.02em;
}

.h74-nav {
	display: flex;
	gap: 24px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.h74-nav a:hover {
	color: var(--h74-fg-muted);
}

.h74-zoom {
	display: flex;
	gap: 4px;
}

.h74-zoom button {
	width: 28px;
	height: 28px;
	font-size: 16px;
	line-height: 1;
}

/* ==========================================================================
   Intro line
   ========================================================================== */

.h74-intro {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--h74-fg-muted);
	max-width: 420px;
	padding: 24px 24px 0;
	margin: 0;
	flex: 0 0 auto;
}

/* ==========================================================================
   Horizontal masonry grid
   ========================================================================== */

.h74-grid {
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	align-content: flex-start;
	flex: 1 1 auto;
	min-height: 0;
	gap: var(--h74-gap);
	padding: 24px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
}

.h74-tile {
	flex: 0 0 auto;
	width: var(--h74-tile-size);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

.h74-tile--size-small {
	width: calc(var(--h74-tile-size) * 0.7);
}

.h74-tile--size-medium {
	width: var(--h74-tile-size);
}

.h74-tile--size-large {
	width: calc(var(--h74-tile-size) * 1.5);
}

.h74-tile img {
	width: 100%;
	height: auto;
	display: block;
}

.h74-caption {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	line-height: 1.5;
	margin: 6px 0 0;
	color: var(--h74-fg);
}

.h74-tile--type {
	background: var(--h74-fg);
	color: var(--h74-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	min-height: 320px;
}

.h74-type-tile-text {
	font-family: 'Subvert', 'IBM Plex Mono', monospace;
	font-weight: 700;
	font-size: 32px;
	line-height: 1.1;
	text-transform: uppercase;
}

.h74-tile--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--h74-fg-muted);
	font-size: 12px;
	min-height: 200px;
}

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

@media (max-width: 640px) {
	.h74-topbar {
		padding: 16px;
	}

	.h74-nav {
		gap: 14px;
	}

	.h74-grid {
		padding: 16px;
		--h74-tile-size: 180px;
		--h74-gap: 14px;
	}

	.h74-type-tile-text {
		font-size: 20px;
	}
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	.h74-grid {
		scroll-behavior: auto;
	}
}

/* ==========================================================================
   Piece tile interactivity
   ========================================================================== */

.h74-tile--piece {
	cursor: pointer;
}

.h74-tile--piece:focus-visible {
	outline: 2px solid var(--h74-fg);
	outline-offset: 2px;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.h74-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(255, 255, 255, 0.96);
	z-index: 100;
	padding: 40px;
}

.h74-lightbox:not([hidden]) {
	display: flex;
	align-items: center;
	justify-content: center;
}

.h74-lightbox-inner {
	max-width: 900px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

.h74-lightbox-image {
	max-width: 100%;
	max-height: 80vh;
	display: block;
}

.h74-lightbox-caption {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0;
}

.h74-lightbox-close {
	position: absolute;
	top: 20px;
	right: 24px;
	width: 36px;
	height: 36px;
	font-size: 22px;
	line-height: 1;
}

/* ==========================================================================
   Static pages (About, Shop, Contact)
   ========================================================================== */

.h74-page {
	max-width: 640px;
	padding: 48px 24px;
	margin: 0 auto;
}

.h74-page-title {
	font-family: 'Subvert', 'IBM Plex Mono', monospace;
	font-weight: 700;
	font-size: 28px;
	text-transform: uppercase;
	margin: 0 0 24px;
}

.h74-page-content {
	font-size: 14px;
	line-height: 1.7;
}

.h74-page-content p {
	margin: 0 0 16px;
}
