@import url(https://fonts.googleapis.com/css2?family=Barlow:wght@400;700&family=Lora&display=swap);
* {
	box-sizing: border-box;
}
body {
	font: 20px Barlow,sans-serif;
	margin: 0;
	padding: 0;
	background: white;
}
h1 {
	font: bold 14vw Barlow;
	text-transform: uppercase;
	text-align: center;
	color: white;
	letter-spacing: -0.02em;
	line-height: 0.65em;
	margin: 0;
	padding-top: 0.2em; /* fix top of letters getting cut off */
	text-shadow: 0 -0.02em 0.02em #0004;
	overflow: hidden;
}
h2 {
	font: bold 3rem Barlow;
	text-transform: uppercase;
	background: linear-gradient(#4210 50%, #421d), url(images/bricks-bg.jpg) center/cover;
	color: white;
	text-shadow: 0 -0.05em 0.05em #0004;
	letter-spacing: -0.03em;
	line-height: 3rem;
	margin: 1rem 0 0 0;
	padding-top: 14rem;
	overflow: hidden;
}
h2 span {
	font-size: 2rem;
}
h3 {
	color: #920;
	margin: 0 1rem -0.5rem 1rem;
}
a {
	color: #920;
}
button {
	-webkit-appearance: none;
	appearance: none;
	font: inherit;
	background: #920;
	color: white;
	border: 0;
	border-radius: 0.5em;
	padding: 0.3em 0.5em;
	cursor: pointer;
	transition: all 0.2s;
}
button:hover {
	background: #b42;
}
img {
	width: 100%;
}
header {
	height: 70vh;
	background: linear-gradient(#3210 50%, #321d), url(images/pontiac-hero-3.JPG) center/cover fixed;
	display: grid;
	align-content: end;
}
#hero-trans {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	object-fit: cover;
	pointer-events: none;
	transition: opacity 1s;
}
#hero {
	opacity: 0; /* at first */
}
#subtitle {
	color: #310;
	text-align: center;
	margin: 0;
	padding: 2em;
	font-size: 1.1em;
	font-weight: bold;
}
#loading {
	/* position: fixed;
	bottom: 10px;
	left: 50vw;
	transform: translatex(-50%);
	width: 100vw;
	height: 100px; */
	color: white;
	text-align: center;
	z-index: 1863;
}
#loading-text {
	position: fixed;
	bottom: 100px;
	left: 50vw;
	transform: translatex(-50%);
}
#progress {
	position: fixed;
	bottom: 60px;
	left: 50vw;
	width: 400px;
	max-width: 90vw;
	height: 12px;
	transform: translatex(-50%);
	background: #ddd4;
	border-radius: 12px;
}
#progress-bar {
	width: 0;
	height: 100%;
	background: white;
	border-radius: 10px;
	transition: width 3.5s ease-in-out;
}
#loading.active #progress-bar {
	width: 100%;
}
#progress-bar-year {
	position: fixed;
	bottom: 30px;
	left: calc(50vw - 180px);
	transform: translatex(-50%);
	transition: left 3.5s ease-in-out;
	font-weight: bold;
}
#loading.active #progress-bar-year {
	left: calc(50vw + 180px);
}
main > p {
	max-width: 1000px;
	margin: auto;
	padding: 2em; 
}
section {
	display: grid;
	clear: both;
}
section p {
	margin: 1rem;
}
section > p:first-of-type::first-letter {
	float: left;
	font-family: 'Lora',serif;
	font-size: 2.8em;
	line-height: 2;
	padding: 0.12em 0.05em 0 0;
}
figure {
	text-align: center;
	margin: 0 0 1rem 0;
	align-self: center;
}
figure img {
	object-fit: cover;
	max-height: 500px;
}
figure.wide img {
	max-height: none;
}
figcaption {
	font-size: 0.8em;
	font-style: italic;
	color: #742;
	margin-top: -0.2em;
}

.double-figure {
	display: grid;
}
.double-figure > figcaption {
	/* not including .double-figure > figure > figcaption! */
	grid-column: span 2;
}

aside {
	background: #9203;
	color: #620;
	margin: 1em 0;
	padding: 1.2em;
	border-radius: 1em;
	align-self: center;
	font-size: 0.9em;
}
aside h3 {
	margin: 0 0 0.3em 0;
}
aside h3::before {
	font-family: "Font Awesome 5 Free";
	margin-right: 0.3em;
}
aside p,
aside q {
	margin: 0.5em 0;
	padding: 0;
}
aside a {
	color: inherit;
}
aside ul {
	margin-bottom: 0;
	padding-left: 1em;
}
aside.wide {
	max-width: 1200px;
	margin: 0 auto;
}
aside.video {
	display: grid;
	grid-gap: 1rem;
}
video {
	width: 100%;
}

aside.past {
	background: #9623;
	color: #741;
}
aside.past h3 {
	color: #741;
}
aside.past h3::before {
	content: "\f1da";
}

aside.money h3::before {
	content: "\f201";
}

aside.construction {
	background: "";
	color: "";
}
aside.construction h3 {
	color: "";
}
aside.construction h3::before {
	content: "\f7d9";
}

aside.danger,
aside.black {
	background: #111;
	color: #dcb;
}
aside.danger h3,
aside.black h3 {
	color: #dcb;
}
aside.danger h3::before {
	content: "\f714";
}

aside.quote {
	background: #eee;
	color: black;
	border-radius: 0;
	box-shadow: 0 3px 4px #0004;
	transform: rotate(2deg);
}

q {
	display: block;
}

#eva-wild q::after {
	display: none;
}
#eva-wild q:last-of-type::after {
	display: inline-block;
}

blockquote {
	font-family: Lora;
	margin: 0 0 0.5em 0.5em;
	position: relative;
}
blockquote::before {
	content: "“";
	font-size: 9em;
	position: absolute;
	top: -0.35em;
	left: -0.18em;
	opacity: 0.1;
}
blockquote::after {
	content: "”";
	font-size: 9em;
	position: absolute;
	bottom: -0.88em;
	right: -0.1em;
	opacity: 0.15;
}
#rise-and-fall {
	display: grid;
	grid-gap: 1rem;
	align-items: center;
}
#rise-and-fall .big-number {
	font-size: 2em;
	font-weight: bold;
	color: #920a;
}
#rise-and-fall .big-number.dark {
	color: #920f;
}
.hidden {
	display: none;
}
.fourgasm {
	display: grid;
	grid: 1fr 1fr / 1fr 1fr;
	margin-bottom: 0.5em;
	overflow: hidden;
}
.fourgasm img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
figure ul {
	text-align: left;
	margin: 0 auto;
	max-width: 50em;
}

#eva-wild {
	display: none;
}
#eva-wild.shown {
	display: block;
}


/* --- INTERACTIVE MAP --- */
#layout {
	background: #eee;
}

/* --- DEFAULT TRANSITIONS --- */
#layout g {
	opacity: 0;
	/* transform: scale(0.9); */
	transform-box: fill-box; /* SVG uses entire viewBox by default */
	transform-origin: center;
	transition: all 0.8s; /* delay so custom growing buildings start first */
	pointer-events: none;
}
#layout g.shown {
	opacity: 1;
	/* transform: scale(1); */
	pointer-events: bounding-box;
}

#layout polygon,
#layout ellipse,
#layout path.building,
#layout path.walls,
#layout path.smokestack {
	fill: #965;
	stroke: #222;
	stroke-width: 0.1;
	stroke-linejoin: bevel;
}
#layout polygon {
	fill: url(#roof);
}
#layout #bs1 polygon:not(.walls),
#layout #b4-orig polygon:not(.walls) {
	fill: url(#peaked-roof);
}
#layout polygon.walls,
#layout path.walls {
	fill: #965;
}

#layout .stucco polygon.walls {
	fill: #cb9;
}
#layout .bridge polygon.walls {
	fill: #dcb;
}
#layout ellipse {
	fill: #532;
}

/* standard "rising" animation */
#layout g:not(.river) polygon:not(.walls),
#layout ellipse,
#layout path.building,
#layout path.smokestack {
	transform: translatey(0.5px);
	transition: transform 0.5s 0.1s;
}
#layout g:not(.river).shown polygon:not(.walls),
#layout g.shown ellipse,
#layout g.shown path.building,
#layout g.shown path.smokestack {
	transform: translatey(0);
}

/* #layout g:has(.description) {
	cursor: pointer;
} */

#layout #race-land {
	fill: #eee;
	stroke-width: 0;
}
#layout text {
	font-size: 1.6px;
	font-weight: bold;
	fill: #fff;
	letter-spacing: -0.03em;
	opacity: 0;
	transition: opacity 0.5s 0.3s;
}
#layout #year-and-owner,
#layout g.shown text,
#layout .river text {
	opacity: 1;
}
#layout #year-and-owner {
	filter: drop-shadow(0.1em 0.1em 0.1em #0006);
}
#layout .river text {
	fill: #149;
}
#layout text.small {
	font-size: 1.2px;
}
#layout .description {
	visibility: hidden;
	box-shadow: 0 1px 1px #0004;
	transition: none;
}
#layout .description polygon {
	fill: white;
	stroke-width: 0;
}
#layout .description text {
	font-size: 1px;
	font-weight: bold;
}
/* #layout g:hover > .description {
	visibility: visible;
} */
#layout #knight-street {
	stroke: #888;
	stroke-width: 2px;
}
#layout #knight-street-lines {
	stroke: #ec0a;
	stroke-width: 0.2px;
	stroke-dasharray: 1px;
}
#layout .river polygon {
	fill: #8ae;
	stroke-width: 0;
}
#layout #dam polygon {
	fill: #ccc;
	stroke: #777;
	stroke-width: 0.1px;
}
#layout #b4-orig-ruin polygon:not(.walls) {
	fill: transparent;
}

/* --- CUSTOM TRANSITIONS --- */
#layout .river,
#b1, #b1.shown,
#b3, #b3.shown,
#b4a, #b4a.shown,
#b7, #b7.shown,
#b8, #b8.shown,
#b8a, #b8a.shown,
#b9-bridge, #b9-bridge.shown,
#b9-extras, #b9-extras.shown,
#b11, #b11.shown,
#b23, #b23.shown,
#b25, #b25.shown,
#b28, #b28.shown,
#b29, #b29.shown,
#b31, #b31.shown,
#bs1a, #bs1a.shown,
#bs2, #bs2.shown {
	transform: none;
	transition: clip-path 0.5s; /* no transform transition AND no delay */
}

/* cancel "rising" animation on polygons when building is just expanding */
#layout #b1 polygon,
#layout #b3 polygon,
#layout #b4a polygon,
#layout #b7 polygon,
#layout #b8 polygon,
#layout #b8a polygon,
#layout #b9-bridge polygon,
#layout #b9-extras polygon,
#layout #b11 polygon,
#layout #b23 polygon,
#layout #b25 polygon,
#layout #b28 polygon,
#layout #b29 polygon,
#layout #b31 polygon,
#layout #bs1a polygon,
#layout #bs2 polygon {
	transform: none; 
}
#b1, #b8a, #b25, #bs1a, #b9-extras { /* wipe right from 50% */
	clip-path: border-box polygon(0 0, 50% 0, 50% 100%, 0 100%)
}
#b3, #bs2 {
	clip-path: border-box polygon(30% 0, 100% 0, 100% 100%, 30% 100%);
}
#b4a, #b23 { /* wipe left from 90% */
	clip-path: border-box polygon(90% 0, 100% 0, 100% 100%, 90% 100%);
}
#b7 {
	clip-path: border-box polygon(0 50%, 100% 0, 100% 100%, 0 100%);
}
#b8 { /* wipe up from 90% */
	clip-path: border-box polygon(0 90%, 100% 0, 100% 100%, 0 100%);
}
#b9-bridge {
	clip-path: border-box polygon(0 40%, 100% 40%, 100% 60%, 0 60%);
}
#b11, #b27-old-thing, #b31 { /* wipe down */
	clip-path: border-box polygon(0 0, 100% 0, 100% 50%, 0 50%);
}
#b28, #b29 {
	clip-path: border-box polygon(0 0, 80% 0, 80% 100%, 0 100%);
}
/* final state for all transitions (fully shown) */
#layout .river.shown,
#b1.shown,
#b3.shown,
#b4a.shown,
#b7.shown,
#b8.shown,
#b8a.shown,
#b9-bridge.shown,
#b9-extras.shown,
#b11.shown,
#b23.shown,
#b25.shown,
#b28.shown,
#b29.shown,
#b31.shown,
#bs1a.shown,
#bs2.shown {
	clip-path: border-box polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

#layout .year-display {
	font-size: 5px;
	font-weight: bold;
}
#years {
	position: relative;
	display: grid;
	grid: auto-flow / auto;
	background: #fffd;
	backdrop-filter: blur(2px);
	width: 100%;
	max-width: 800px;
	margin: -20px auto 0 auto;
	padding: 2em 2em 1em 1em;
	text-align: center;
	border-radius: 0.5em;
	box-shadow: 0 3px 4px #0004;
}
#slider-clickers {
	list-style: none;
	display: grid;
	grid: auto / 22fr 31fr 7fr 10fr 10fr 10fr 10fr 10fr 10fr 78fr 10fr 0.5fr; /* 1fr = 1 year */
	height: 1em;
	margin: 0;
	padding: 0;
	text-align: left;
	font-size: 0.9em;
	font-weight: bold;
	color: #922;
}
#slider-clickers li {
	margin: 0;
	padding: 0;
}
#slider-clickers span {
	position: absolute;
	transform: rotate(-60deg);
	transform-origin: left;
}
#slider-clickers span:hover {
	text-decoration: underline;
	cursor: pointer;
}
#year-slider {
	width: 100%;
	accent-color: #922;
}
#year-slider::-webkit-slider-thumb {
	background: firebrick;
}

#buildings-list {
	/* display: none; */
	border-collapse: collapse;
	width: 98%;
	max-width: 800px;
	margin: 1em auto;
	font-size: 0.8em;
}
#buildings-list thead {
	position: sticky;
	top: 0;
	background: white;
	box-shadow: 0 3px 4px #0004;
}
#buildings-list tbody td:first-child:not(.not-actually-first-child) {
	font: bold 1.5em Barlow;
	color: firebrick;
	text-align: center;
}
#buildings-list tbody td:first-child:not(.not-actually-first-child)::before {
	content: "BLDG";
	color: black;
	font-size: 0.6em;
	display: block;
	line-height: 1;
	margin-bottom: -0.4em;
}
#buildings-list ul {
	margin: 0;
	padding: 0 1em;
}
td {
	border: 1px solid #ddd;
	padding: 0.2em;
}
td.gray {
	color: #aaa;
}
td .descriptor {
	display: block;
	color: gray;
	font-size: 0.8em;
}

footer {
	padding: 1em;
	font-size: 0.8em;
}

@media screen and (min-width: 800px) {
	h2 {
		font-size: 6rem;
		padding-left: 1rem;
		grid-column: span 2;
	}
	h2 span {
		font-size: 4rem;
	}
	section {
		grid: auto-flow / 1fr 1fr;
		grid-gap: 2em;
	}
	.double-figure {
		grid: auto / 1fr 1fr;
	}
	aside {
		margin: 0 1em 1em 1em;
	}
	aside.video {
		grid: auto / auto auto;
	}
	.wide {
		grid-column: span 2;
	}
	#rise-and-fall {
		grid: auto-flow / auto auto;
	}
	.fourgasm { /* Do you even know what that means? */
		grid: auto / auto auto auto auto;
		height: 300px;
	}
}