/* Windows Georgia lacks a custom ḫ character, so prefer a (metrically compatible) webfont with better Unicode support. */
@font-face {
	font-family: Gelasio;
	src: url("Gelasio-Regular.woff2");
	font-style: normal;
}

@font-face {
	font-family: Gelasio;
	src: url("Gelasio-Italic.woff2");
	font-style: italic;
}

@font-face {
	font-family: Caveat;
	src: url("Caveat-Bold.woff");
}

@font-face {
	font-family: BethEllen;
	src: url("BethEllen-Regular.woff2");
}

@font-face{
	font-family: CuneiPublished;
	src: url("../ishamai/fonts/MittellinienNew.woff2");
}

html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	overflow-x: auto;
	overflow-y: hidden;
}

#scroll-clip {
	position: relative;
	width: max(100vw, 150vh);
	height: 100%;
	overflow: hidden;
	background-image: url("wood.jpg");
	background-repeat: no-repeat;
	background-size: cover;
}

.popup {
	display: none;
	position: absolute;
	margin: auto;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	border: 1px solid #888;
	box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
	z-index: 10;
}

.open {
	display: block;
}

.popup-close {
	position: absolute;
	top: 5px;
	right: 5px;
	width: 1.2em;
	height: 1.2em;
	border: 1px solid rgba(0, 0, 0, 0.5);
	background-color: white;
	font-size: 1.5em;
	text-align: center;
	vertical-align: middle;
	cursor: pointer;
	z-index: 13;
}

.popup-close:hover {
	background-color: #DDD;
}

#map-small {
	position: absolute;
	left: 42%;
	top: 3vw;
	height: 70%;
	aspect-ratio: 1745 / 1080;
	background-image: url("map.png");
	background-size: 100% 100%;
	transform: rotate(15deg);
	border: 1px solid #888;
}

.popup-element:hover {
	box-shadow: inset 0 0 15px 5px rgba(255, 255, 255, 0.5);
	cursor: pointer;
}

#map-large {
	max-width: 90vw;
	max-height: 90vh;
	width: auto;
	height: auto;
	aspect-ratio: 1745 / 1080;
	background-image: url("map.png");
	background-size: 100% 100%;
}

#mug {
	background-image: url("mug.png");
	background-size: 100% 100%;
	position: absolute;
	height: 45%;
	aspect-ratio: 1 / 1;
	left: -31%;
	bottom: 50%;
	filter: drop-shadow(5em 4em 1em rgba(0, 0, 0, 0.35));
	z-index: 6;
}

#steam {
	position: absolute;
	z-index: 7;
	height: 25%;
	aspect-ratio: 1 / 1;
	left: -20%;
	bottom: 65%;
}

#steam span { 
	display: block;
	position: absolute;
	height: 1.5em;
	width: 1.5em;
	border: 1em solid rgba(255, 255, 255, 1.0);
	border-radius: 50%;
	opacity: 0;
	transform: scale(0.0);
	filter: blur(1em);
}

#steam span.steamfilled {
	border: 1em solid rgba(225, 225, 225, 0.8);
	height: 0em;
	width: 0em;
}

#steam span.steamsquare {
	border: 1em solid rgba(192, 192, 192, 0.7);
	border-radius: 0%;
	height: 2em;
	width: 0.5em;
}

#steam span.steam0 { left: 50%; top: 50%; }
#steam span.steam1 { left: 0%;  top: 50%; }
#steam span.steam2 { left: 33%; top: 25%; }
#steam span.steam3 { left: 75%; top: 33%; }
#steam span.steam4 { left: 50%; top: 10%; }
#steam span.steam5 { left: 25%; top: 50%; }
#steam span.steam6 { left: 33%; top: 75%; }
#steam span.steam7 { left: 50%; top: 33%; }
#steam span.steam8 { left: 75%; top: 50%; }
#steam span.steam9 { left: 50%; top: 75%; }

@keyframes steamleft {
	0%   { opacity: 0.00; transform: scale(0)  translate(0, 0); }
	28%  { opacity: 0.01; transform: scale(2)  translate(15%, -5%); }
	55%  { opacity: 0.30; transform: scale(3)  translate(0%, -25%); }
	100% { opacity: 0.00; transform: scale(4)  translate(-25%, -50%); }
}

@keyframes steamright {
	0%   { opacity: 0.00; transform: scale(0)  translate(0, 0); }
	22%  { opacity: 0.01; transform: scale(2)  translate(-15%, 0); }
	45%  { opacity: 0.30; transform: scale(3)  translate(0%, -25%); }
	100% { opacity: 0.00; transform: scale(4)  translate(50%, -75%); }
}

#steam .steam0 { animation: steamleft  8s linear 0s infinite; }
#steam .steam1 { animation: steamright 8s linear 2s infinite; }
#steam .steam2 { animation: steamleft  8s linear 4s infinite; }
#steam .steam3 { animation: steamright 8s linear 6s infinite; }
#steam .steam4 { animation: steamleft  8s linear 8s infinite; }
#steam .steam5 { animation: steamright 8s linear 10s infinite; }
#steam .steam6 { animation: steamleft  8s linear 12s infinite; }
#steam .steam7 { animation: steamright 8s linear 14s infinite; }
#steam .steam8 { animation: steamleft  8s linear 16s infinite; }
#steam .steam9 { animation: steamright 8s linear 18s infinite; }

#tablet {
    background-image: url("tablet.png");
    background-size: 100% 100%;
    position: absolute;
    left: -23%;
    bottom: 5%;
    height: 33%;
    aspect-ratio: 480 / 405;
    transform: rotate(-30deg);
    filter: drop-shadow(0.5em 2em 1em rgba(0, 0, 0, 0.35));
    z-index: 5;
    cursor: pointer;
}

#tablet::after {
	content: "";
	position: absolute;
	width: 100%;
	height: 100%;
	background-image: url("tablet_hover.png");
	background-size: 100% 100%;
	pointer-events: none;
	opacity: 0;
}

#tablet:hover::after {
	opacity: 0.5;
}

#book {
	position: absolute;
	top: 10%;
	left: 0;
	right: 0;
	margin-left: auto;
	margin-right: auto;
	height: 80%;
	aspect-ratio: 3 / 2;
}

#book > svg {
	position: absolute;
	top: -4%;
	width: 111%;
	height: 111%;
	overflow: visible;
	pointer-events: none;
	z-index: 1;
}

#book-right-margin {
	position: absolute;
	top: 0%;
	right: 1%;
	width: 4%;
	height: 100%;
	background: #CCC repeating-linear-gradient(to right, #CCC 0, #CCC 0.1em, #BBB 0.1em, #BBB 0.2em);
	clip-path: polygon(
		0% 0%,
		100% 2%,
		100% 98%,
		0% 100%
	);
}

#book-back-left {
	position: absolute;
	top: -0.5em;
	left: 1%;
	height: 100%;
	width: 46%;
	background-color: #e9dac8;
	padding: 0.5em;
	border-radius: 0.5em;
	box-shadow: inset 0 0 3px 3px rgba(255, 255, 255, 0.25);
	filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.5));
}

#book-back-right {
	position: absolute;
	top: 0%;
	right: 0%;
	height: 100%;
	width: 47%;
	background-color: #e9dac8;
	border-radius: 0.5em;
	box-shadow: inset 0 0 3px 3px rgba(255, 255, 255, 0.25);
	filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.5));
}

.panel {
	position: absolute;
	display: block;
	text-decoration: none;
	color: black;
	width: 8%;
	text-align: center;
	background: linear-gradient(90deg, rgba(171, 210, 0, 1) 0%, rgba(191, 225, 29, 1) 0.5em, rgba(191, 225, 29, 1) 100%);
    transform-style: preserve-3d;
	padding: 0.5em;
	font-family: Caveat;
	font-size: 1.5em;
}

.panel:hover {
	box-shadow: inset 0 0 5px 5px rgba(255, 255, 255, 0.75);
	color: #A50;
	cursor: pointer;
}

#tablet1 {
	top: 20%;
	right: -6%;
}
#tablet1::after {
    content: "";
    position: absolute;
	top: 3px;
    left: 3px;
    right: -3px;
    bottom: 0px;
    background: rgba(0, 0, 0, 0.25);
    transform: skew(0deg, 15deg) translateZ(-1px);
    transform-origin: left top;
	filter: blur(3px);
	z-index: 0;
}

#tablet2 {
	top: 45%;
	right: -7%;
}
#tablet2::after {
    content: "";
    position: absolute;
	top: 3px;
    left: 3px;
    right: -3px;
    bottom: 0px;
    background: rgba(0, 0, 0, 0.25);
    transform: skew(0deg, 10deg) translateZ(-1px);
    transform-origin: left top;
	filter: blur(3px);
	z-index: 0;
}

#tablet3 {
	top: 70%;
	right: -8%;
}
#tablet3::after {
    content: "";
    position: absolute;
	top: 3px;
    left: 3px;
    right: -3px;
    bottom: 0px;
    background: rgba(0, 0, 0, 0.25);
    transform: skew(0deg, 5deg) translateZ(-1px);
    transform-origin: left top;
	filter: blur(3px);
	z-index: 0;
}

#postscript {
	position: absolute;
	z-index: 10;
	height: 75%;
	aspect-ratio: 3 / 4;
	left: 0;
	right: 0;
	margin-left: auto;
	margin-right: auto;
	line-height: 1.2em;
	font-family: Caveat;
	font-size: 1.3em;
	border: 1px solid #DDD;
	filter: drop-shadow(3px 3px 3px rgba(0, 0, 0, 0.25));
}

#postscript::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 11;
	box-sizing: border-box;
	background: white repeating-linear-gradient(to bottom, white 0, white 1.1em, #CEF 1.1em, #CEF 1.2em);
	mask-image:
		radial-gradient(circle at 1em 3em, transparent 0.5em, black 0.52em),
		radial-gradient(circle at 1em 50.2%, transparent 0.5em, black 0.52em),
		radial-gradient(circle at 1em calc(100% - 2.8em), transparent 0.5em, black 0.52em);
	mask-composite: intersect;
}

#postscript-inner {
	position: relative;
	width: calc(100% - 3.75em);
	height: calc(100% - 0.4em);
	z-index: 12;
	padding: 0.2em;
	padding-left: 0.75em;
	padding-right: 1.5em;
	border-left: 0.2em solid rgba(255, 128, 128, 0.5);
	margin-left: 2em;
	background: transparent;
	overflow-y: scroll;
	overflow-x: hidden;
	scrollbar-color: rgba(255, 255, 255, 0) rgba(255, 255, 255, 0);
}

#postscript p {
	position: relative;
	z-index: 5;
	margin-bottom: 1.2em;
	text-align: left;
}

#sticky {
    width: calc(100% - 3.5em);
    padding: 1.5em;
    padding-bottom: 0.5em;
    background: #F8EE99;
    background: linear-gradient(180deg,rgba(250, 242, 170, 1) 0%, rgba(250, 239, 152, 1) 30px, rgba(255, 244, 143, 1) 30px, rgba(255, 244, 143, 1) 100%);
    transform-style: preserve-3d;
	text-align: left;
}

#sticky::after {
    content: "";
    position: absolute;
	top: 3px;
    left: 3px;
    right: -3px;
    bottom: 0px;
    background: rgba(0, 0, 0, 0.4);
    transform: skew(0deg, 2deg) translateZ(-1px);
    transform-origin: left top;
	filter: blur(3px);
	z-index: 0;
}

#sticky-title {
	font-family: Caveat;
	font-size: 2em;
	transform: rotate(-10deg);
	margin-top: -0.5em;
	margin-bottom: -0.5em;
	width: 25%;
}

/* Page-flipping witchcraft */
input {
	display: none;
}

#select-right:checked ~ #book-content .flip {
	transform: rotateY(-180deg);
}

#select-right:checked ~ #book-content .face.back.book-left::after {
	opacity: 0;
}

#book-content {
	display: flex;
	position: absolute;
	width: 90%;
	height: 100%;
	top: 0em;
	right: 5%;
	perspective: 150em;
	z-index: 5;
	font-family: Gelasio, Georgia, serif;
}

.page {
	width: 50%;
	height: 100%;
	background: white;
}

.flip {
	position: absolute;
	width: 50%;
	height: 100%;
	right: 0em;
	transform-origin: left;
	transform-style: preserve-3d;
	transition: transform 1.5s;
}

.face {
	position: absolute;
	display: block;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
	background: white;
}

.back {
	transform: rotateY(180deg);
}

.book-left {
	background: white linear-gradient(90deg, #FFF 0%, #FFF 85%, #EEE 95%, #CCC 100%);
	padding: 3em;
	padding-right: 2em;
	padding-bottom: 1em;
	width: calc(100% - 5em);
	height: calc(100% - 4em);
}

/* subtle shadow on back of page 1 */
.face.back.book-left::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 1;
	pointer-events: none;
	transition: opacity 1.5s;
}

.book-right {
	background: white linear-gradient(90deg, #AAA 0%, #FFF 3%, #FFF 100%);
	padding: 3em;
	padding-right: 2em;
	padding-bottom: 1em;
	width: calc(100% - 5em);
	height: calc(100% - 4em);
}

.header {
	font-family: Helvetica, Arial, sans-serif;
}

.header-right {
	text-align: right;
}

h1, h2 {
	font-family: Helvetica, Arial, sans-serif;
}

.face.book-right, .bleed-left {
	text-align: center;
}

.face.book-right h1, .bleed-left h1 {
	margin-top: calc(50% - 4em);
	padding-bottom: 1em;
	border-bottom: 0.2em solid black;
}

.cuneiform {
	margin-top: 1em;
	font-family: CuneiPublished;
	font-size: 2em;
}

.subtitle {
	margin-top: calc(50% - 4em);
	margin-bottom: 0.8em;
	font-size: 1.6em;
}

.subtitle2 {
	font-size: 1.2em;
}

.author {
	font-size: 1.3em;
	margin: 0px;
	line-height: 1.5em;
}

#book-copyright {
    position: absolute;
    height: auto;
    width: calc(50% - 8em);
    bottom: 5%;
    left: 0em;
    padding-left: 4em;
    padding-right: 4em;
    text-align: center;
    font-family: Gelasio, Georgia, serif;
    font-size: 0.8em;
}

.page-content {
	text-align: justify;
	hyphens: auto;
	height: 100%;
	overflow-y: auto;
	scrollbar-color: rgba(0, 0, 0, 0.05) rgba(0, 0, 0, 0);
	padding-right: 0.5em;
}

@supports (-moz-appearance: none) {
	.page-content {
		scrollbar-width: thin;
	}
}

#book-content a {
	color: black;
	font-weight: bold;
	text-decoration: underline;
	text-decoration-style: dotted;
}

#book-content a:hover {
	color: #444;
}

.dropcap {
	font-size: 3em;
	float: left;
	margin-top: -0.1em;
	padding-right: 0.15em;
}

.page-content li {
	margin-bottom: 1em;
}

