/* Fonts by Dinamo Typefaces */

/* - Source: abcdinamo.com */

@font-face {
	font-family: "Gaisyr Light";
	src: url("ABCGaisyrEdu-Light.woff") format("woff");
}

@font-face {
	font-family: "Camera";
	src: url("ABCCameraPlainVariableEdu-Regular.woff") format("woff");
}

/* Root variables */

:root {
	--fatigue: 0;
	--fem-fatigue: 0;
}

/* Base */

html, body {
	margin: 0;
	min-height: 100vh;
}

body {
	background: black;
	overflow-x: hidden;
	padding-top: 8rem;
	padding-bottom: 0;
	letter-spacing: 0.006em;
	font-family: Gaisyr Light, serif;
	font-weight: 400;
	transition: background 0.6s ease;
	color: rgba(0, 0, 0, 0.7);
}

/* Headers */

h1, h2 {
	font-family: inherit;
	font-weight: 300;
	text-align: left;
	padding-left: 2.3rem;
	line-height: 1.5;
	margin: 0;
}

h1 {
	font-size: 1.4rem;
	padding-top: 0;
	padding-bottom: 10rem;
}

h2 {
	font-size: 1.4rem;
	opacity: 0.6;
	margin-bottom: 7rem;
}

/* The "Paper" */

.page-sheet {
	background: #FCFAEF;
	background-image: url('Smudge.png');
	background-size: cover;
	box-sizing: border-box;
	width: min(70vw, 75ch);
	margin: 0 auto;
	padding: 3rem 0 3.4rem 0;
	position: relative;
}

/* Corner image */

/* - Source: www.metmuseum.org/art/collection/search/547137 */

.corner-image {
	position: absolute;
	mix-blend-mode: multiply;
	right: 2rem;
	top: 2.5rem;
	width: 168px;
	height: auto;
	z-index: 10;
}

/* Sections of the Poem */

.poem-start,
.poem-end {
	opacity: 0.7;
	line-height: 2.2;
	font-size: 1.4rem;
	font-family: inherit;
}

.poem-start { margin-bottom: 2em; }

.poem-end {
	margin-top: 2em;
	pointer-events: none;
}

/* Poem word hover interactions */

.poem-word {
	display: inline-block;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
	cursor: default;
}

[data-drift="down"]:hover        { transform: translateY(2.8rem); }
[data-drift="apart"]:hover       { transform: translateX(-1.2rem); }
[data-drift="apart-right"]:hover { transform: translateX(1.2rem); }

/* Writing surface */

.writing-surface {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.editor-wrapper {
	width: 90%;
	max-width: 45ch;
	padding-top: 7rem;
	padding-left: 3.5rem;
	padding-right: 0;
	margin: 0;
	text-align: left;
	background: transparent;
	box-sizing: border-box;
}

/* Editor */

#editor {
	display: block;
	margin: 0;
	word-spacing: 0.1em;
	padding: 0;
}

.editable {
	display: block;
	font-size: 1.4rem;
	padding: 0;
	outline: none;
	white-space: preserve-spaces;
	text-align: left;
	font-family: inherit;
	cursor: text;
	opacity: 0.64;
	box-sizing: border-box;
}

/* Blinking cursor */

/* - Known error: Duplicate cursors after initial type in some browsers - */

.cursor-blink {
	display: inline-block;
	animation: blink 1s step-end infinite;
	font-weight: 300;
}

.editable:focus .cursor-blink {
	display: none;
}

@keyframes blink {
	0%, 100% { opacity: 0.5; }
	50%       { opacity: 0; }
}

/* Prediction container */

#prediction-suggestion {
	font-family: inherit;
	font-size: 1.4rem;
	display: inline;
}

/* Committed words */

.editable .word.committed {
	animation: none !important;
	filter: none !important;
	line-height: 1.5;
}

.editable .word.committed.masc {
	color: black !important;
	display: inline-block;
	opacity: 1 !important;
	transition: transform 0.3s ease;
}

.editable .word.committed.masc:hover {
	transform: scale(1.15);
}

.editable .word.committed.fem {
	color: #95948E;
	font-family: inherit !important;
	display: inline-block;
	opacity: calc(1 - (var(--fem-fatigue) * 0.15)) !important;
	transition: opacity 1.4s ease, transform 1.4s ease;
	transform: rotate(calc(var(--fem-fatigue) * 1.5deg)) translateY(calc(var(--fem-fatigue) * 0.2em));
}

/* A dedicated block to constrain width of text for feminine language */

.fem-block {
	display: inline-block;
	max-width: 10ch;
	vertical-align: top;
	white-space: normal;
	color: #95948E;
	font-family: inherit;
	line-height: 1.5;
	opacity: calc(1 - (var(--fem-fatigue) * 0.15));
	filter: blur(0);
	transform: rotate(calc(var(--fem-fatigue) * 1.5deg)) translateY(calc(var(--fem-fatigue) * 0.2em));
	transition: opacity 1.4s ease, transform 1.4s ease, filter 0.4s ease;
}

.fem-block:hover {
	filter: blur(3px);
	cursor: not-allowed;
}

/* Ghost */

.ghost {
	display: inline;
	opacity: 0;
	filter: blur(6px);
	animation: ghostIn 0.5s ease forwards;
	white-space: pre-wrap;
	pointer-events: none;
}

.ghost-word {
	opacity: 0;
	filter: blur(6px);
	animation: wordIn 0.45s ease forwards;
}

.ghost-word:nth-child(n) {
	animation-delay: calc(var(--i, 0) * 40ms);
}

#prediction-suggestion .ghost {
	display: inline !important;
	opacity: 0;
	filter: blur(6px);
	animation: wordIn 0.45s ease forwards;
}

/* Masculine lagnuage appears promptly and with some more prominence */

.ghost-word.masc {
	display: inline-block;
	animation: ghostIn 0.3s ease forwards;
	color: black;
	opacity: 1;
}

.ghost-word.masc:nth-child(n) {
	animation-delay: calc(var(--i, 0) * 30ms);
}

.ghost.masc .ghost-word.masc,
.ghost.masc {
	color: black !important;
}

.ghost.intense.masc {
	filter: contrast(1.1) brightness(1.05);
}

/* Feminine language appears slowly and recedes */

.ghost-word.fem {
	display: inline-block;
	animation: ghostInGentle 1.2s ease-out forwards;
	font-family: inherit;
	color: #95948E;
}

.ghost-word.fem:nth-child(n) {
	animation-delay: calc(var(--i, 0) * 120ms);
}

#prediction-suggestion .ghost.fem .ghost-word.fem,
#prediction-suggestion .ghost.fem,
.ghost.fem .ghost-word.fem {
	font-family: inherit;
	color: #95948E;
}

/* Keyframes */

@keyframes ghostIn {
	from {
		opacity: 0;
		filter: blur(4px);
	}
	to {
		opacity: 1;
		filter: blur(0);
		transform: translateY(0) scale(1);
	}
}

@keyframes ghostInGentle {
	from {
		opacity: 0;
		filter: blur(8px);
		transform: translateY(0.3em);
	}
	to {
		opacity: 0.7;
		filter: blur(0);
		transform: translateY(0);
	}
}

@keyframes wordIn {
	to {
		opacity: 0.7;
		filter: blur(0);
		transform: translateY(0);
	}
}

/* Links */

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

a:link {
	padding-bottom: var(--s);
	background:
		linear-gradient(90deg, var(--c) 50%, #000 0) calc(100% - var(--_p, 0%)) / 200% 100%,
		linear-gradient(var(--c) 0 0) 0% 100% / var(--_p, 0%) var(--s) no-repeat;
	-webkit-background-clip: text, padding-box;
	background-clip: text, padding-box;
	transition: 0.5s;
}

a:visited { color: black; }
a:hover   { opacity: 0.25; }
a:active  { opacity: 0.6; }

/* Small text */

.instruction {
	font-family: Camera, serif;
	font-size: 0.85rem;
	font-weight: 150;
	opacity: 0.7;
	color: #383632;
	margin-top: 1.8rem;
	padding-top: 5rem;
	padding-bottom: 1.2rem;
	padding-left: 3.5rem;
	text-align: left;
}

.note {
	font-family: Camera, serif;
	padding-bottom: 18rem;
	padding-left: 3.5rem;
	font-size: 0.85rem;
	opacity: 0.5;
	text-align: left;
}

.no-wrap {
	float: none !important;
	shape-outside: none !important;
}

/* Colophon */

.colophon {
	position: absolute;
	bottom: 4em;
	right: 3.5em;
	width: 250px;
	font-family: Camera, serif;
	font-size: 0.7rem;
	line-height: 1.4;
	color: black;
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
}


.colophon span {
    opacity: 0.4;
}

.colophon-icon {
  width: 17px;
  height: auto;
  flex-shrink: 0;
  margin-top: 0.1em;
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation: none !important;
	}
}

/* Mobile */

@media (max-width: 650px) {

	html { font-size: 14px; }

	body {
		font-size: 1em !important;
		background: #FCFAEF !important;
		padding-top: 0;
		padding-bottom: 0;
	}

	.page-sheet {
		border: 0 !important;
		width: 100% !important;
		background-image: none !important;
		max-width: 100% !important;
		margin: 0 !important;
		box-sizing: border-box;
	}

	.corner-image {
		max-width: 80px;
		right: 1.7rem;
		top: 2rem;
	}

	.editor-wrapper {
		width: 100% !important;
		padding-left: 2em !important;
		padding-right: 0.5em;
		margin: 0;
	}

	.editable {
		padding: 0 !important;
		margin: 0 !important;
		min-height: auto;
	}

	h1, h2 {
		padding-left: 1.4em !important;
		margin-left: 0 !important;
		width: 100%;
	}

	h2 { font-size: 1.3em; }

	.instruction,
	.note {
		padding-left: 2.5em !important;
		margin-left: 0 !important;
	}

	.colophon {
		padding-left: 0 !important;
		margin-left: 0 !important;
    margin-left: 0 !important;

	}

  .colophon-icon {
  width: 14.5px;
  }
	
}

/* Menu */

.menu {
  position: fixed;
  top: 20px;
  right: 20px;
  height: 46px;
  width: 46px;
  z-index: 100;
}

.menu-link {
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 2;
}

.hamburger-icon {
  position: absolute;
  width: 20px;
  height: 14px;
  margin: auto;
  left: 0;
  top: 0;
  right: 0;
  bottom: 1px;
}

.hamburger-bar {
  background-color: black;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.25s ease-in-out;
}

.hamburger-bar-2 {
  top: 0;
  bottom: 0;
  margin: auto;
}

.hamburger-bar-3 {
  bottom: 0;
}

.menu.open .hamburger-bar-1 {
  transform: translateY(7px) translateY(-50%) rotate(45deg);
}

.menu.open .hamburger-bar-2 {
  opacity: 0;
}

.menu.open .hamburger-bar-3 {
  transform: translateY(-7px) translateY(50%) rotate(-45deg);
}

/* Menu overlay */

.menu-overlay {
  background-color: #EED6B9;
  height: 100%;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  text-align: center;
  transition: opacity 0.2s ease-in-out;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.prompt {
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

nav {
  position: absolute;
  height: 80%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  font-family: Gaisyr Light, serif;
  text-align: center;
}

ul {
  list-style: none;
  padding: 0;
  display: inline-block;
  position: relative;
  margin: 25px;
}

ul.one {
  width: 87.563%;
}

li {
  display: block;
  padding: 5px;
  position: relative;
  opacity: 1;
  margin: 5px;
}

/* Override the global link colour inside the overlay */

.menu-overlay a,
.menu-overlay a:link,
.menu-overlay a:visited {
  display: block;
  position: relative;
  color: black;	
  text-decoration: none;
  overflow: hidden;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.sub-menu {
  display: none;
  font-size: 30px;
  margin: 0;
  padding: 0;
  width: 100%;
}

.sub-menu.open {
  display: block;
}

.sub-menu a {
  opacity: 0.6;
  font-size: 0.6em;
}

.sub-menu a:hover {
  opacity: 1;
}
