/* ---------------------------------------------------------
   Will Jorgensen — portfolio clone
   Recreates the layout/typography of willj.cargo.site
--------------------------------------------------------- */

:root {
	--ink: rgba(0, 0, 0, 0.85);
	--ink-2: rgba(0, 0, 0, 0.75);
	--ink-3: rgba(0, 0, 0, 0.6);
	--ink-4: rgba(0, 0, 0, 0.4);
	--ink-5: rgba(0, 0, 0, 0.25);
	--hairline: rgba(0, 0, 0, 0.15);
	--panel-width: 25vw;
	--gap: 0.85rem; /* base spacing unit: the inset from the vertical rules */
}

* {
	box-sizing: border-box;
}

html {
	background: #ffffff;
}

body {
	margin: 0;
	background: #ffffff;
	color: var(--ink);
	font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
		Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 12px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--ink-5);
}

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

a:active {
	opacity: 0.7;
}

hr {
	background: rgba(0, 0, 0, 0.14);
	border: 0;
	height: 1px;
	display: block;
	margin: var(--gap) 0;
}

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

/* -------------------- grid helpers -------------------- */

.row {
	display: flex;
	gap: var(--gap);
	align-items: flex-start;
}

.row.tight {
	gap: 0;
}

.col-2 { flex: 2 1 0; min-width: 0; }
.col-3 { flex: 3 1 0; min-width: 0; }
.col-4 { flex: 4 1 0; min-width: 0; }
.col-7 { flex: 7 1 0; min-width: 0; }
.col-8 { flex: 8 1 0; min-width: 0; }
.col-9 { flex: 9 1 0; min-width: 0; }

.label-col {
	white-space: nowrap;
}

.gap { display: block; }
.gap-1 { height: 1.4em; }
.gap-2 { height: 2.7em; }
.gap-3 { height: 4em; }

/* -------------------- language toggle -------------------- */

.name-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
}

.lang-toggle {
	display: flex;
	align-items: baseline;
	gap: 0.3rem;
	white-space: nowrap;
	font-size: 12px;
}

.lang-toggle span {
	color: var(--ink-5);
}

.lang-btn {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--ink-5);
	cursor: pointer;
}

.lang-btn:hover {
	color: var(--ink-3);
}

.lang-btn.active {
	color: var(--ink-3);
	text-decoration: none;
	cursor: default;
}

/* -------------------- desktop scaffold -------------------- */

.lines {
	position: fixed;
	top: var(--gap);
	bottom: var(--gap);
	left: 25vw;
	right: 25vw;
	border-left: 1px solid var(--hairline);
	border-right: 1px solid var(--hairline);
	pointer-events: none;
	z-index: 1;
}

.panel {
	position: fixed;
	top: 0;
	width: var(--panel-width);
	height: 100vh;
	overflow-y: auto;
	padding: var(--gap);
	padding-bottom: 2.5rem;
	z-index: 5;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* old Edge/IE */
}

.panel::-webkit-scrollbar {
	display: none; /* Chrome, Safari */
}

.panel-left {
	left: 0;
	text-align: left;
}

.panel-right {
	right: 0;
	text-align: left;
}

.site-name {
	text-decoration: none;
}

.clock {
	position: fixed;
	left: 0;
	bottom: 0;
	padding: var(--gap);
	color: var(--ink-4);
	font-variant-numeric: tabular-nums;
	z-index: 5;
}

.center {
	width: 50vw;
	margin: 0 auto;
	padding: var(--gap);
	position: relative;
	z-index: 2;
	min-height: 100vh;
}

.project-hero {
	margin: var(--gap) 0;
}

.project {
	margin-bottom: 0;
}

.project-body p {
	margin: 0 0 1em 0;
}

.project-body p:last-child {
	margin-bottom: 0;
}

/* buttons (Cargo "button-5" style) */

.btn {
	--btn-border: 0.15rem;
	display: inline-block;
	font-family: "JetBrains Mono", "IBM Plex Mono", Menlo, Consolas, monospace;
	font-size: 0.7rem;
	letter-spacing: 0;
	color: var(--ink);
	background: #ffffff;
	border: var(--btn-border) solid var(--ink);
	border-radius: 0;
	padding: 0.4rem 0.6rem;
	text-decoration: none;
	filter: drop-shadow(0.2rem 0.2rem 0 var(--ink));
	margin: 0 0.4rem 0 0;
}

.btn:hover {
	color: var(--ink);
	background: #f3f3f3;
}

.btn:active {
	opacity: 1;
	transform: translate(0.1rem, 0.1rem);
	filter: drop-shadow(0.1rem 0.1rem 0 var(--ink));
}

/* galleries */

.gallery-justify {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gap);
	margin: var(--gap) 0;
}

.gallery-justify img {
	height: 15rem;
	width: auto;
	flex: 1 1 auto;
	object-fit: cover;
}

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--gap);
	margin: var(--gap) 0;
}

.gallery-grid img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gallery-grid-2x2 {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-template-rows: repeat(2, 1fr);
	gap: var(--gap);
	margin: var(--gap) 0;
}

.gallery-grid-2x2 img {
	width: 100%;
	height: 11rem;
	object-fit: cover;
}

.gallery-columnized {
	columns: 4;
	column-gap: var(--gap);
	margin: var(--gap) 0;
}

.gallery-columnized img {
	width: 100%;
	break-inside: avoid;
	margin-bottom: var(--gap);
}

.gallery-triptych {
	--triptych-gap: var(--gap);
	--triptych-half-h: 14rem;
	display: flex;
	align-items: stretch;
	gap: var(--triptych-gap);
	margin: var(--gap) 0;
}

.gallery-triptych > img {
	flex: 1 1 0;
	min-width: 0;
}

.gallery-triptych > .stack {
	flex: 1.1 1 0;
	min-width: 0;
}

.gallery-triptych img {
	width: 100%;
	object-fit: cover;
	object-position: center;
}

.gallery-triptych > img {
	height: calc(var(--triptych-half-h) * 2 + var(--triptych-gap));
}

.gallery-triptych .stack {
	display: flex;
	flex-direction: column;
	gap: var(--triptych-gap);
}

.gallery-triptych .stack img {
	height: var(--triptych-half-h);
}

/* -------------------- CV / profile blocks -------------------- */

.cv-section,
.profile-block {
	margin-bottom: 0;
}

.cv-entry + .cv-entry {
	margin-top: 1.4em;
}

.cv-entry .role {
	font-style: italic;
}

.small {
	color: var(--ink-4);
}

/* -------------------- mobile -------------------- */

.mobile-only { display: none; }

.mobile-screen {
	display: none;
	padding: var(--gap) var(--gap) calc(6rem + env(safe-area-inset-bottom)) var(--gap);
}

.mobile-screen.active {
	display: block;
}

.mobile-nav {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	background: #ffffff;
	border-top: 1px solid var(--hairline);
	padding: var(--gap);
	padding-bottom: calc(var(--gap) + env(safe-area-inset-bottom));
	z-index: 20;
}

.mobile-nav-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.mobile-nav a {
	text-decoration: none;
	margin-right: 1.2rem;
	color: var(--ink);
}

.mobile-nav a:last-child { margin-right: 0; }

.mobile-nav a.active {
	color: var(--ink-4);
}

.mobile-hero {
	width: 100%;
	aspect-ratio: 4 / 5;
	max-height: 60vh;
	object-fit: cover;
	margin-bottom: var(--gap);
}

.mobile-h1 {
	font-size: 15px;
	line-height: 1.5;
	margin: 0 0 1.2rem 0;
	overflow-wrap: anywhere;
}

/* stack project titles above their descriptions */
#mobile-projects-inner .row {
	flex-direction: column;
	gap: 0.5rem;
}

#mobile-projects-inner .row > [class*="col-"] {
	flex: none;
	width: 100%;
}

#mobile-projects-inner .label-col {
	white-space: normal;
	font-weight: 600;
}

#mobile-projects-inner .col-2 img {
	width: 4rem !important;
}

.mobile-h1 > strong + br {
	display: none;
}

.mobile-h1 #top-mobile {
	font-size: 1.75rem;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.1;
	text-decoration: none;
}

.mobile-h1 strong {
	display: block;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--ink-4);
	margin-bottom: 0.35rem;
}

.mobile-h1 .gap-2 {
	height: 1.5em;
}

@media (max-width: 900px) {
	.panel,
	.lines,
	.clock,
	.desktop-only {
		display: none !important;
	}

	.mobile-nav {
		display: block;
	}

	.mobile-screen.active {
		display: block;
	}
}

@media (min-width: 901px) {
	.mobile-only,
	.mobile-nav,
	.mobile-screen {
		display: none !important;
	}
}

/* -------------------- photo lightbox -------------------- */

.center img,
.mobile-screen img {
	cursor: zoom-in;
}

.lightbox {
	position: fixed;
	inset: 0;
	background: rgba(255, 255, 255, 0.96);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 110;
	padding: 1.5rem;
	cursor: zoom-out;
}

.lightbox.open {
	display: flex;
}

.lightbox img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.lightbox.gallery img {
	cursor: pointer;
}

.lightbox-nav {
	appearance: none;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: 0;
	padding: 1rem;
	font: inherit;
	font-size: 22px;
	color: var(--ink);
	cursor: pointer;
	display: none;
}

.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

.lightbox-nav:hover {
	color: var(--ink-3);
}

.lightbox-count {
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(0.6rem + env(safe-area-inset-bottom));
	text-align: center;
	color: var(--ink-4);
	font-variant-numeric: tabular-nums;
	display: none;
}

.lightbox.gallery .lightbox-nav,
.lightbox.gallery .lightbox-count {
	display: block;
}

.lightbox.gallery {
	padding: 2.5rem 3rem;
}

@media (max-width: 900px) {
	.lightbox.gallery {
		padding: 2.5rem var(--gap);
	}

	/* on phones: swipe or tap the photo; arrows sit at the bottom */
	.lightbox-nav {
		top: auto;
		bottom: env(safe-area-inset-bottom);
		transform: none;
	}
}

/* -------------------- contact modal -------------------- */

.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.15);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 100;
	padding: var(--gap);
}

.modal-overlay.open {
	display: flex;
}

.modal {
	background: #ffffff;
	border: 0.2rem solid var(--ink);
	border-radius: 0.5rem;
	filter: drop-shadow(0.3rem 0.3rem 0 var(--ink));
	padding: 1.25rem;
	max-width: 22rem;
	width: 100%;
}

.modal h2 {
	font-size: 1rem;
	font-weight: 600;
	margin: 0 0 0.85rem 0;
}

.modal p {
	margin: 0 0 0.35rem 0;
}

.modal .close-btn {
	margin-top: 1rem;
}
