:root {
	--bg: #23292c;
	--window: #293033;
	--titlebar: #566a73;
	--tab: #404b50;
	--text: #ffffff;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	background-color: var(--bg);
	color: var(--text);
	font-family: "Inter", system-ui, sans-serif;
}

.sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.desktop {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
	padding: 24px;
}

/* scales the whole page on screens with room for it (1 = the original figma
   size). phones stay at 1 so the windows still fit */
@media (min-width: 740px) {
	.desktop {
		zoom: 1.2;
	}
}

/* windows */

.window {
	max-width: 100%;
	border: 1px solid rgb(255 255 255 / 0.15);
	background-color: var(--window);
}

/* fixed width so switching tabs doesn't resize the window */
.window[data-tabs] {
	width: 554px;
}

/* minimized: only the title bar shows. the rest keeps its width in the
   layout (at zero height) so the window doesn't shrink sideways */
.window.minimized > :not(.titlebar) {
	height: 0;
	padding-block: 0;
	overflow: hidden;
	visibility: hidden;
}

.titlebar {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 6px;
	background-color: var(--titlebar);
}

.titlebar-start {
	align-self: stretch;
	flex: none;
	width: 30px;
	margin-left: -6px;
	border-right: 1px solid var(--text);
}

.tabs {
	display: flex;
	gap: 4px;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.tab {
	display: flex;
	flex: none;
	align-items: center;
	gap: 4px;
	min-width: 128px;
	max-width: 200px;
	height: 27px;
	padding: 0 12px 0 4px;
	border: 0;
	border-radius: 6px;
	background-color: var(--tab);
	color: inherit;
	font: inherit;
	font-size: 10px;
	white-space: nowrap;
}

.tab span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

button.tab {
	cursor: pointer;
}

button.tab:not([aria-selected="true"]) {
	background-color: transparent;
	color: rgb(255 255 255 / 0.7);
}

button.tab:not([aria-selected="true"]):hover {
	background-color: rgb(64 75 80 / 0.5);
}

button.tab:focus-visible {
	outline: 1px solid var(--text);
	outline-offset: -1px;
}

.window-controls {
	display: flex;
	gap: 2px;
	margin-left: auto;
}

.window-controls button {
	display: flex;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: none;
	color: inherit;
	cursor: pointer;
}

.window-controls button:hover {
	background-color: rgb(255 255 255 / 0.15);
}

/* the minus and maximize icons are stacked; minimizing the window
   spins the minus out and the maximize icon in */
.minimize {
	position: relative;
}

.minimize .icon {
	transition:
		opacity 0.2s,
		transform 0.2s;
}

.minimize .icon-maximize {
	position: absolute;
	inset: 0;
}

.window:not(.minimized) .minimize .icon-maximize {
	opacity: 0;
	transform: rotate(-90deg) scale(0.5);
}

.window.minimized .minimize .icon-minus {
	opacity: 0;
	transform: rotate(90deg) scale(0.5);
}

@media (prefers-reduced-motion: reduce) {
	.minimize .icon {
		transition: none;
	}
}

.window-controls button:focus-visible {
	outline: 1px solid var(--text);
}

.toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 33px;
	padding: 0 16px 0 28px;
	background-color: var(--tab);
}

.urlbar {
	display: flex;
	flex: 1;
	align-items: center;
	gap: 6px;
	min-width: 0;
	height: 24px;
	margin-left: 48px;
	padding: 0 6px;
	border-radius: 6px;
	background-color: var(--window);
	font-size: 10px;
}

.urlbar .icon:last-child {
	margin-left: auto;
}

.window-body {
	padding: 16px 36px 24px 16px;
}

/* icons */

.icon,
.favicon {
	flex: none;
	width: 20px;
	height: 20px;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon {
	fill: none;
}

.icon-sm {
	width: 14px;
	height: 14px;
	stroke-width: 2;
}

.favicon {
	color: var(--window);
	fill: var(--titlebar);
}

/* content */

h1 {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 500;
	line-height: 1.2;
}

#image {
	width: 500px;
	max-width: 100%;
	aspect-ratio: 500 / 332;
	background-color: var(--bg);
}

#image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

#stamps {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	width: 473px;
	max-width: 100%;
	background-color: var(--bg);
}

#stamps img {
	display: block;
	height: 56px;
	width: auto;
}

@media (max-width: 600px) {
	.desktop {
		padding: 12px;
	}

	.window-body {
		padding-right: 16px;
	}

	.urlbar {
		margin-left: 16px;
	}
}
