@font-face {
  font-family: "Fira Math";
  src: url('/fira-math-regular.otf') format('opentype');
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

:root {
  color-scheme: dark;
  --bg-color: hsl(190 40% 10%);
  --p-bg-color: hsl(190 10% 20%);
  --text-color: hsl(10 10% 90%);
  --text-accent-color: hsl(10 0% 100%);
  --link-color: hsl(250 60% 80%);
  --link-visited-color: hsl(290 60% 80%);
  --spoiler-color: hsl(10 20% 80%);
}

:root[theme="light"] {
  color-scheme: light;
  --bg-color: hsl(10 30% 90%);
  --p-bg-color: hsl(10 10% 70%);
  --text-color: hsl(190 30% 20%);
  --text-accent-color: hsl(190 0% 0%);
  --link-color: hsl(250 60% 40%);
  --link-visited-color: hsl(290 60% 40%);
  --spoiler-color: hsl(190 40% 30%);
}

.preload,
.preload * {
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -ms-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

@view-transition {
  navigation: auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* a { */
/*   background-color: var(--text-color); */
/*   padding: .25rem; */
/*   border-radius: .25rem; */
/* } */

a:link {
  color: var(--link-color);
  transition: color .5s;
}

a:visited {
  color: var(--link-visited-color);
  transition: color .5s;
}

body {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-family: "Fira Math", sans-serif;
  font-size: var(--font-size);
  background-color: var(--bg-color);
  /* background-image: url('/noise.svg'); */
  /* background-blend-mode: multiply; */
  /* background-size: cover; */
  /* background-position: center; */
  /* background-repeat: no-repeat; */
  color: var(--text-color);
  transition: background .5s, color .5s, font .5s;
}

b,
strong {
  color: var(--text-accent-color);
  transition: color .5s;
}

.spoiler {
  background-color: var(--spoiler-color);
  color: transparent;
  cursor: pointer;
  transition: background-color .25s, color .25s;
}

.spoiler:active,
.spoiler:hover {
  background-color: transparent;
  color: inherit;
}

:root[sticky="true"] body,
body:has(.full-page.horizontal) {
  height: 100dvh;
  max-height: 100dvh;
}

:root[sticky="false"] body {
  min-height: 100dvh;
}

header,
footer {
  padding: 0 2em;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

main {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  align-items: center;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 48em;
  max-width: 100%;
  min-height: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 2em;
  transition: background .5s;
}

.full-page {
  background: var(--p-bg-color);
  transition: background .5s;
  flex: 1;
  display: flex;
  min-width: 0;
  width: 100%;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: 2em;
  gap: 1em;
}

.full-page.vertical {
  flex-direction: column;
}

.full-page.horizontal {
  flex-direction: row;
  max-height: 100%;
}

.full-page.vertical .description {
  min-height: 25%;
  max-height: 50%;
}

.full-page.horizontal .description {
  min-width: 25%;
  max-width: 50%;
}

.full-page.vertical .photo {
  max-height: 75%;
  margin: auto 0;
  width: 100%;
  height: auto;
}

.full-page.horizontal .photo {
  max-width: 75%;
  margin: 0 auto;
  height: 100%;
  width: auto;
}

blockquote {
  float: right;
  margin-left: auto;
  margin-right: 1em;
  padding-left: 1em;
  text-align: right;
}

hr {
  width: 50%;
  border: none;
  border-top: .25em dashed;
  color: var(--text-color);
  transition: color .5s;
}

.metadata {
  display: grid;
  flex: 1;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  margin: 0;
  white-space: nowrap;
  overflow-x: auto;
}

.metadata dt {
  font-weight: bold;
}

.metadata dt::after {
  content: ":";
}

.pair {
  display: grid;
  flex: 1;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  margin: 0;
  white-space: nowrap;
}

.pair dt::after {
  content: ": ";
}

.item {
  padding: 1em;
  border-radius: 1em;
  border: .25em dashed;
  margin-top: 1em;
  overflow-y: hidden;
}

.item-inner {
  max-height: 16lh;
  overflow: auto;
}

.photo {
  display: flex;
  flex: 0 1 auto;
  justify-content: center;
  align-items: center;
  object-fit: contain;
}

.photo-item {
  align-self: center;
  background: var(--p-bg-color);
  transition: background .5s;
  padding: 1em;
  padding-bottom: 0;
  min-width: 0;
  flex-direction: column;
  width: fit-content;
  margin-top: 1em;
  margin-bottom: 0;
  border-radius: 1em;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.photo-item img,
.photo img {
  border-radius: 1em;
  border: .25em dashed;
  object-fit: contain;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.hidden {
  display: none;
}
