@import 'fonts.css';
@import 'variables.css';

html {
  font-size: 18px;
  letter-spacing: 0.025em;
  line-height: 1.15;
  font-family: 'Oracle';
  background-color: black;
  text-rendering: geometricPrecision;
}

@keyframes fade {
  0% {opacity: 0.1;}
  100% {opacity: 1;}
}

.kern {
  margin-left: 0.05em;
}

/* intro */

#intro {
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  z-index: 1000;
  color: white;
  transition: 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
  opacity: 1;
  text-shadow: 0 0 30px black;
  background-color: rgba(0, 0, 0, 0.35);
  animation-name: fade;
  animation-duration: 1s;
  cursor: pointer;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

#intro h1 {
  font-size: 9vw;
  margin-top: -2vh;
  pointer-events: none;
  margin-bottom: -0.1em;
  text-align: center;
  letter-spacing: -0.02em;
}

#intro h2 {
  font-size: 2.75vw;
  letter-spacing: -0.01em;
  text-align: center;
  pointer-events: none;
  text-wrap: balance!important;

}

#intro.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5rem);
}

/* header */

header {
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  box-sizing: border-box;
  color: white;
  transition: 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
}

header.hidden {
  top: -8rem;
}

.button {
  background-color: rgba(0, 0, 0);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
  border: 1.5px solid rgb(75, 75, 75);
  color: rgb(255, 255, 255);
  box-sizing: border-box;
  font-size: 0.85rem;
  text-align: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 4rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.button:hover {
  transform: scale(1.1);
}

.button.open,
.button.close {
  display: none;
  transition: 0.1s;
}

.button.open.active,
.button.close.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.button:active {
  transform: scale(0.9);
}

.button svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: white;
  margin: auto;
}

/* info */

#info {
  position: fixed;
  top: 0;
  right: -40rem;
  width: 100%;
  max-width: 40rem;
  height: 100%;
  z-index: 30;
  opacity: 0;
  overflow: auto;
  background-color: black;
  scrollbar-color: rgb(50, 50, 50) transparent;
  color: rgb(225, 225, 225);
  transition: right 0.8s, opacity 0.8s, width 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
  hyphens: auto;
  border-left: 1px solid rgb(75, 75, 75);
}

#info.active {
  right: 0;
  opacity: 1;
}

#info section {
  font-size: 1.25em;
  letter-spacing: 0.02em;
  line-height: 1.3;
  padding: 1em;
  box-sizing: border-box;
}

#info article {
  width: 100%;
  max-width: 32em;
  margin: auto;
  margin-bottom: 3rem;
}

#info .first {
  max-width: 35em;
  margin-bottom: 1em;
}

#info .first p {
  font-size: 1.3em;
  line-height: 1.25;
  text-align: center;
}

#info h1 {
  text-align: center;
  font-size: 9vw;
  line-height: calc(1em / 1.25);
  padding-top: 1rem;
  margin-bottom: 0.5em;
  letter-spacing: -0.02em;
}

#info h2 {
  text-align: center;
  font-size: 2em;
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 0.5em;
  background-color: rgb(0, 0, 0);
  position: sticky;
  top: 0px;
  box-shadow: 0 0 20px black;
  padding-top: 0.625rem;
  margin-left: -2px;
}

#info h2 span {
  padding-bottom: 0.3em;
  background-color: rgb(0, 0, 0);
  display: block;
  text-wrap: balance;
}

#info h3 {
  font-size: 1em;
  line-height: 1;
  padding-top: 1rem;
  margin-bottom: 0.25em;
  box-sizing: border-box;
  text-decoration: underline;
}

#info p a {
  font-style: italic;
}

#info a:hover {
  color: rgb(160, 160, 160);
  text-decoration: none;
}

#info p {
  overflow-wrap: break-word;
  word-break: normal;
  line-break: normal;
  margin-bottom: 1em;
  display: inline-block;
}

#info p:not(:last-child) {
  margin-bottom: 1em;
}

#info ul {
  padding-left: 1em;
  box-sizing: border-box;
}

#info li {
  list-style: disc;
}

#info .updated {
  display: inline-block;
  color: grey;
  font-size: 0.75em;
}

#info .key {
  padding: 0em 0.2em;
  border-radius: 2px;
  box-sizing: border-box;
  display: inline-block;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

footer {
  width: 100%;
  max-width: 32em;
  margin: auto;
  margin-bottom: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

footer ul {
  font-size: 1rem;
  padding-left: 0!important;
}

footer li {
  list-style: none!important;
  text-align: center;
}

footer a {
  text-decoration: none!important;
}

/* map */

#map { 
  position: fixed;
  width: 100vw; 
  height: 100vh;
  top: 0;
  left: 0;
  background-color: rgb(0, 0, 0);
  z-index: 0;
  animation-name: fade;
  animation-duration: 1s;
  transition: left 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
}

#map.inactive {
  left: -20rem;
}

/* key */

#key {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgb(75, 75, 75);
  border-radius: 2px;
  color: white;
  padding: 0.75rem;
  box-sizing: border-box;
  font-size: 1rem;
  z-index: 20;
  width: 17rem;
  transition: 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow: hidden;
  white-space: nowrap;
}

#key.hidden {
  left: -25em;
}

#key h2 {
  padding-bottom: 0.5em;
  font-size: 0.85rem;
  color: grey;
  transition: 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
}

/* checkbox input */

#key .toggle {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
}

#key label {
  cursor: pointer;
}

#key .checkbox {
  width: 1em;
  height: 1em;
  display: inline-block;
  border-radius: 1em;
  margin-bottom: -0.1em;
  margin-right: 0.75em;
}

#key label:hover .checkbox {
  outline: 1.5px solid rgb(140, 140, 140)!important;
  outline-offset: -1px;
}

#key .toggle input:not(:checked) + label {
  color: grey;
}

#key .toggle input:not(:checked) + label .checkbox {
  background-color: black!important;
  outline: 1.5px solid rgb(50, 50, 50);
  outline-offset: -1px;
}

#key input[type=checkbox] {
  display: none;
}

/* toggle stories */

#key .context label .checkbox {
  outline: 2.5px dotted!important;
  outline-color: white;
  outline-offset: -1px;
  background-color: black;
  animation-name: story-popup-default;
  animation-timing-function: linear;
  animation-duration: 6s;
  animation-iteration-count: infinite;
}

#key .context input:not(:checked) + label .checkbox {
  outline-color: rgb(150, 150, 150);
  animation: none;
}

#key .context label:hover .checkbox { 
  outline-color: rgb(200, 200, 200)!important;
}


.context {
  margin-top: 0.5em;
}

/* text input */

#key input[type=text] {
  width: 100%;
  padding: 0.2em;
  box-sizing: border-box;
  color: black;
}

/* range input */ 

#key .year-filter {
  transition: 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
  padding-top: 0.5em;
}

#key .date-value {
  transition: 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
}

#key #filter-date {
  display: block;
  padding: 0;
  width: 100%;
  margin-bottom: 0.5rem;
  transition: 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
}

#filter-date {
    -webkit-appearance: none;
    appearance: none;
    height: 2px;
    background: white;
    outline: none;
    cursor: pointer;
    margin-top: 0.5em;
}

#filter-date::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1em;
    height: 1em;
    background: white;
    border-radius: 2em;
    cursor: pointer;
}

#filter-date::-moz-range-thumb {
    appearance: none;
    width: 1em;
    height: 1em;
    background: white;
    border-radius: 2em;
    cursor: pointer;
}

/* status */

#key .status {
  transition: 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
}

input[type=radio] {
  appearance: none;
  display: none;
}

#key .status-filter ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75em;
}

#key .status-filter label {
  text-align: center;
  padding: 0.25em;
  outline: 1px solid grey;
  color: grey;
  border-radius: 1em;
  margin-left: -2px;
  margin-right: -2px;
  font-size: 0.85em;
}

#key .status-filter label:hover {
  outline: 1px solid white;
  color: white;

}

#key .status-filter input:checked + label {
  background-color: rgb(246, 246, 246);
  color: black;
}

#key:has(#planned:checked) .year-filter {
  margin-top: -2.5rem;
  opacity: 0;
  pointer-events: none;
}

/* calculator */

.calculator {
  font-size: 0.8em;
  font-feature-settings: 'tnum';
  color: grey;
  cursor: pointer;
}

.calculator:hover {
  color: white
}

.calculator .count,
.calculator .power {
  display: none;
}

.calculator .count.active,
.calculator .power.active {
  display: block;
}

.toggle-collection {
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  gap: 0.25rem;
}

.toggle-collection.calculate .calculator {
  display: block;
}

/* key version */

.power-filter,
.operator-filter {
  display: none;
}

/* toggle key */

#key .toggle-key {
  position: absolute;
  right: 0;
  top: 0;
  padding: 0.75rem;
  box-sizing: border-box;
  font-size: 0.85rem;
  cursor: pointer;
  color: grey;
  z-index: 100;
  width: 2.35rem;
  text-align: center;
}

#key .toggle-key:hover {
color: white
}

#key .maximize,
#key.minimized .minimize {
  display: none;
}

#key .minimize,
#key.minimized .maximize {
  display: block;
}

#key.minimized {
  width: 2.55rem;
}

#key.minimized h2 {
  opacity: 0;
}

#key.minimized .status {
  pointer-events: none;
}

#key.minimized .status:has(#operating:checked) {
  margin-top: -7rem;
  opacity: 0;
}

#key.minimized .status:has(#planned:checked) {
  margin-top: -4.5rem;
  opacity: 0;
}

/* popups */

.maplibregl-popup {
  font-family: 'Oracle'!important;
}

.maplibregl-popup-close-button {
  display: block;
  padding: 0 0.75rem;
  font-size: 1.5rem;
  color: grey;
}

.maplibregl-popup-close-button:hover {
  color: white;
  transition: 0.2s;
}

@keyframes popup {
  from {margin-top: -16px;}
  to {margin-top: 0;}
}

/* feature popups */

.feature-popup {
  animation-name: popup;
  animation-duration: 0.5s;
  animation-iteration-count: 1;
  min-width: 17rem!important;
  width: 17rem!important;
  max-width: 90vw!important;
  hyphens: auto;
}

.feature-popup .maplibregl-popup-tip {
  align-self: center;
  border-bottom: none;
  border-top-color: rgba(255, 255, 255, 0.65);
}

.feature-popup .maplibregl-popup-content {
  padding: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgb(75, 75, 75);
  border-radius: 2px;
  color: rgb(226, 226, 226);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-info {
  font-size: 1rem!important;
  text-align: left;
  line-height: 1.3;
  padding: 0.5rem;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.feature-info li {
  display: flex;
  flex-direction: column;
}

.feature-info li span {
  font-size: 0.85rem;
  color: grey;
}

.feature-info .circle {
  width: 0.85em;
  height: 0.85em;
  display: inline-block;
  border-radius: 1em;
  margin-bottom: -0.05em;
  margin-right: 0.35em;
}

/* communal popups */

.communal-popup {
  width: max-content;
  max-width: 15rem!important;
  font-feature-settings: 'case';
}

.communal-popup .maplibregl-popup-tip {
  display: none;
}

.communal-popup .maplibregl-popup-content {
  background-color: rgba(255, 255, 255);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  border: none;
  color: rgb(0, 0, 0);
  padding: 0.5rem;
  box-sizing: border-box;
  border-radius: 2px;
  font-size: 0.85rem;
  line-height: 1.25em;
}

.communal-popup a {
  text-decoration: underline;
}

@keyframes api-loading {
  0% {opacity: 0.25}
  50% {opacity: 1;}
  100% {opacity: 0.25}
}

#total.loading {
  animation-name: api-loading;
  animation-duration: 1s;
  animation-iteration-count: infinite;
}

/* story popups */

@keyframes story-popup {
  0% {transform: rotate(0deg)}
  5% {transform: rotate(5deg)}
  10% {transform: rotate(-4deg)}
  15% {transform: rotate(3deg)}
  20% {transform: rotate(-2deg)}
  25% {transform: rotate(1deg)}
  30% {transform: rotate(0deg)}
  100% {transform: rotate(0deg)}
}

@keyframes story-popup-default {
  0% {transform: rotate(0deg)}
  100% {transform: rotate(359deg)}
}

.story-popup {
  transition: opacity 0.3s;
}

.story-popup.hidden {
  opacity: 0;
  pointer-events: none;
}

.story-popup h3 {
  display: none;
  padding: 0.25em 0.6em 0.3em 0.6em;
}

.story-popup:hover h3 {
  display: block;
  outline: none!important;
}

.story-popup .maplibregl-popup-tip {
  border-top-color: rgb(230, 230, 230);
  display: none;
}

.story-popup .maplibregl-popup-content {
  padding: 0.5rem 0.5rem;
  background-color: rgb(0, 0, 0);
  outline: 3px dotted rgb(255, 255, 255);
  box-shadow: 0 0 30px rgb(0, 0, 0);
  color: rgb(255, 255, 255);
  border-radius: 2rem;
  animation-duration: 1.5s;
  animation-iteration-count: infinite;
  text-align: center;
  transition: width 0.2s;
  animation-name: story-popup-default;
  animation-timing-function: linear;
  animation-duration: 6s;
  font-size: 0.7rem;
  min-width: 0.5rem;
  min-height: 0.5rem;
}

.story-popup .maplibregl-popup-content:hover {
  cursor: pointer;
  animation-name: story-popup;
  animation-timing-function: cubic-bezier();
  animation-duration: 1.5s;
  animation-delay: 0.1s;
  font-size: 1rem;
  padding: 0.5em 0.75em;
  outline: 1px solid grey;
  padding: 0;
}

.story-popup .maplibregl-popup-content:active {
  font-size: 0.9rem;
  transition: font-size 0.2s;
}

/* story container */

.story {
  background-image: linear-gradient(transparent, black);
  position: fixed;
  left: 0;
  width: 100vw;
  height: 35vh;
  z-index: 10;
  color: white;
  text-shadow: 0 0 50px black;
  text-align: center;
  justify-content: end;
  scroll-snap-type: y mandatory;
  bottom: -35vh;
  transition: 0.8s;
  transition-timing-function: bottom cubic-bezier(.77, 0, .175, 1);
  overflow: hidden;
  overflow-y: scroll;
  font-size: 5.5vh;
  
  mask-image: linear-gradient(to bottom, transparent, black 35%);
  mask-repeat: no-repeat;
  mask-size: 100% 100%;

  -ms-overflow-style: none;
  scrollbar-width: none;
}

.story::-webkit-scrollbar {
  display: none;
}

.story.active {
  display: block;
  bottom: 0;
  overflow: scroll;
}

.close-story {
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: center;
}

.close-story svg {
  width: 0.85em;
  height: 0.85em;
  fill: white;
}

.scene .close-story {
  margin-top: 1rem;
}

#close-story {
  position: fixed;
  right: -4rem;
  top: 0;
  width: 2rem;
  height: 2rem;
  z-index: 20;
  transition: 0.8s, transform 0.2s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  cursor: pointer;
  padding: 0.5em;
  font-size: 3.5vw;
  letter-spacing: -0.2em;
}

#close-story.active {
  right: 0;
}

#close-story:hover {
  transform: scale(1.1);
}

/* scenes */

@keyframes next-scene {
  0% {transform: translateY(0.1em)}
  50% {transform: translateY(-0.1em)}
  100% {transform: translateY(0.1em)}
}

.scene {
  scroll-snap-align: center;
  width: 100%;
  max-width: 75vw;
  margin: auto;
  height: 35vh;
  display: flex;
  align-items: end;
  justify-content: center;
  text-align: center;
  padding-bottom: 0.5rem;
  box-sizing: border-box;
  transform: scale(0.9);
  transition: 0.5s;
  opacity: 0;
  text-shadow: 0 0 25px black;
}

.scene p {
  text-wrap: balance;
}

.scene.active {
  opacity: 1;
}

.next-scene {
  width: 1em;
  height: 1em;
  font-feature-settings: "tnum";
  display: block;
  text-align: center;
  text-shadow: none;
  animation-name: next-scene;
  animation-duration: 1.5s;
  animation-iteration-count: infinite;
  cursor: pointer;
  width: 100%;
  transition: 0.25s;
}

.next-scene:active {
  opacity: 0.5;
}

.next-scene:hover {
  opacity: 0.75;
}

#scene-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: 0.8s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
  object-fit: cover;
  display: flex;
  justify-content: center;
  padding-top: 1rem;
  box-sizing: border-box;
}

#scene-image.active {
  top: 0;
  opacity: 1;
}

.image-container img {
  width: 63vw;
  height: 63vh;
  box-shadow: 0 0 30px black;
  pointer-events: none;
  object-fit: cover;
}

/* inspector */

#inspector {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 0.2rem;
  box-sizing: border-box;
  font-size: 12px;
  letter-spacing: 0.05em;
  z-index: 200;
  display: none;
  font-family: monospace;
  background-color: white;
  color: black
}

#inspector.active {
  display: block;
}

#inspector ul {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}

#inspector::selection {
  background-color: black;
  color: white;
}

/* custom cursor */

#custom-cursor {
  position: fixed;
  width: 0px;
  height: 0px;
  background-color: rgb(255, 255, 255, 0.85);
  border-radius: 30px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 5;
  border: 0px solid white;
  transition: width 0.8s, height 0.8s, border-radius 0.8s, background-color 0.8s;
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 20px black;
}

#custom-cursor.click {
  width: 0px;
  height: 0px;
}

#custom-cursor.feature {
  background-color: rgb(255, 255, 255, 0);
  width: 28px;
  height: 28px;
  border: 2px solid white;
}

canvas {
  cursor: default!important;
}

/* attribution */

.maplibregl-ctrl-attrib {
  display: none;
}

.maplibregl-ctrl-scale {
  background-color: transparent;
  color: white;
  border: none;
  border-bottom: 3px dotted white;
  text-align: right;
  text-shadow: 0 0 10px black;
  font-family: 'Oracle';
  font-feature-settings: "tnum";
  font-size: 0.75rem;
  transition: opacity 0.8s;
  opacity: 0;
  z-index: 3000;

}

.maplibregl-ctrl-scale.active {
  opacity: 1;
}


/* general */

strong {
  background-color: rgb(200, 200, 200);
  border-radius: 3px;
  display: inline-block;
  padding: 0.01em 0.2em;
  margin-bottom: -0.01em;
}

#key, .story-popup, #intro, .help, .scene, #close-story {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

*::selection {
  background-color: rgb(255, 255, 255);
  color: black;
}




/* controller */

#key.controller {
  position: static;
  overflow: visible;
  padding: 0;
  box-sizing: border-box;
}

#key.controller .layer-toggle {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 25vw;
  background-color: green;
}

#key.controller .toggle-collection {
  display: grid;
  grid-template-rows: repeat(10, 1fr);
  height: 100%;
  gap: 0;
}

#key.controller .checkbox,
#key.controller .toggle-key {
  display: none;
}