:root {
  /* if you want to keep it super simple, you can edit these top variables (variables = the things that start with --) to add some style and leave the rest of the code alone! */

  /* colors */
  --text: #dadada;
  --background: #141319;
  --accent: #7b7aa4;

  /* fonts */
  --basefont: "DM Mono", sans-serif;
  --titlefont: "w95fa", monospace;
  --text-size: 16px;

  /* gallery styling */
  --minimum-img-width: 150px;
  --maximum-img-width: 400px;
  --maximum-columns: 3;
  --image-background: #fff;
  --column-gap: var(--spacing);

  /* misc styling */
  --max-width: 600px;
  --spacing: 0.9em;
  --border-radius: 4px;
  --underline: wavy var(--accent-light);
  --border: dashed #7b7aa4 1px;

  /* calculations - don't worry about this */
  --halfspacing: calc(var(--spacing) / 2);
  --doublespacing: calc(var(--spacing) * 2);
}

/* title font - w95fa */
@font-face {
  font-family: "w95fa";
  src:
    url("../fonts/w95fa/w95fa.woff") format("woff"),
    url("../fonts/w95fa/w95fa.woff2") format("woff2"),
    url("../fonts/w95fa/w95fa.otf");
}

/* body font - DM mono */
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  src:
    url("../fonts/DM Mono/dm-mono-v11-latin-regular.woff") format("woff"),
    url("../fonts/DM Mono/dm-mono-v11-latin-regular.woff2") format("woff2"),
    url("../fonts/DM Mono/dm-mono-v11-latin-regular.ttf");
}

@font-face {
  font-family: "DM Mono";
  font-style: italic;
  src:
    url("../fonts/DM Mono/dm-mono-v11-latin-italic.woff") format("woff"),
    url("../fonts/DM Mono/dm-mono-v11-latin-italic.woff2") format("woff2"),
    url("../fonts/DM Mono/dm-mono-v11-latin-italic.ttf");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: bold;
  src:
    url("../fonts/DM Mono/dm-mono-v11-latin-500.woff") format("woff"),
    url("../fonts/DM Mono/dm-mono-v11-latin-500.woff2") format("woff2"),
    url("../fonts/DM Mono/dm-mono-v11-latin-500.ttf");
}

@font-face {
  font-family: "DM Mono";
  font-style: italic;
  font-weight: bold;
  src:
    url("../fonts/DM Mono/dm-mono-v11-latin-500.woff") format("woff"),
    url("../fonts/DM Mono/dm-mono-v11-latin-500.woff2") format("woff2"),
    url("../fonts/DM Mono/dm-mono-v11-latin-500.ttf");
}

* {
  box-sizing: border-box;
  max-width: 100%;
  scrollbar-color: #7b7aa4;
  -ms-overflow-style: none;
  box-decoration-break: clone;
}

body {
  overflow-x: hidden;
  overflow-y: scroll;
  padding: var(--spacing) 5%;
  background-color: var(--background);
  color: var(--text);
  font-family: var(--basefont);
  font-size: var(--text-size);
  line-height: 1.5em;
}

h1:has(+ nav) {
  margin-bottom: var(--halfspacing);
}

header {
  text-align: center;
  padding-bottom: var(--spacing);
}

nav {
  padding-top: var(--spacing);
}

main,
header,
footer {
 max-width: 1200px;
  margin: 0 auto;
}

footer {
  display: block;
  text-align: center;
  font-size: 0.9em;
  margin: var(--spacing) auto;
}

/* element styling */
a {
  color: #7b7aa4;
  text-decoration: underline var(--underline);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-dark);
}

nav a {
  padding: 5px;
  margin: 5px;
}

#to-top a {
  position: fixed;
  right: var(--spacing);
  bottom: var(--spacing);
  font-size: 50px;
  text-decoration: none;
  color: #7b7aa4;
}

b {
  color: #7b7aa4;
}

i {
  color: #7b7aa4;
}

mark {
  background-color: #7b7aa4;
  padding: 1px 2px;
  border-radius: var(--border-radius);
}

code {
  font-size: 0.9em;
  padding: 1px 3px;
  font-family: monospace;
  color: #7b7aa4;
}

u {
  text-decoration-color: #7b7aa4;
}
ol,
ul {
  margin: var(--spacing);
}
li {
  padding-left: var(--halfspacing);
  margin: var(--halfspacing) auto;
}
li > ul {
  padding-left: var(--spacing);
  margin: auto;
  font-size: 0.9em;
}
li::marker {
  color: #7b7aa4;
}
blockquote {
  padding-left: var(--doublespacing);
  margin: var(--doublespacing);
  border-left: var(--border);
  color: #7b7aa4;
}

hr {
  width: 100%;
  border-color: #7b7aa4;
}

img {
  vertical-align: middle;
  max-width: 100%;
}

/* boxes & flex */
.box {
  padding: var(--spacing);
  border: var(--border);
  margin: var(--spacing) auto;
  border-radius: var(--border-radius);
  break-inside: avoid;
}

.flex {
  display: flex;
  flex-flow: row wrap;
  gap: var(--halfspacing) var(--spacing);
}

.flex > * {
  flex: 1 2 200px;
  margin: 0 auto;
}

.center {
  text-align: center;
}

/* dividing lines between areas */
hr::after,
nav::after,
footer::before {
  content: "\a0 \a0";
  text-align-last: justify;
  width: 50%;
  margin: var(--spacing) auto;
  display: none;
  text-decoration: underline var(--underline);
  text-decoration-thickness: 0.1em;
}

/* headers */
h1,
h2,
h3,
h4 {
  font-family: var(--titlefont);
  margin: 1.5em auto;
  text-align: center;
  line-height: 1.3em;
}

h1 {
  font-size: 2em;
}
h1 a {
  text-decoration: none;
  color: #7b7aa4;
}

h2 {
  font-size: 1.5em;
  margin: 1em auto;
  color: #7b7aa4;
}

h3 {
  color: var(--background);
  background: #7b7aa4;
}

h4 {
  color: var(--accent-dark);
  background: var(--accent-light);
  font-weight: normal;
}

/* image gallery */
#gallery {
  margin: var(--doublespacing) auto;
  display: block;
  text-align: center;
  line-height: 1.2em;
  font-size: 0.9em;
}
#gallery.columns {
  columns: var(--minimum-img-width) var(--maximum-columns);
  gap: var(--column-gap);
}

#gallery img {
  margin: var(--spacing) auto;
  max-width: min(var(--maximum-img-width), 100%);
  display: block;
  background-color: var(--image-background);
}

#gallery img:first-of-type {
  margin-top: auto;
}

figure {
  margin: 0 0 0.5em 0;
  break-inside: avoid;
  overflow: hidden;
}

/* lightbox */
#gallery img:hover {
  border-radius: var(--border-radius);
  cursor: pointer;
  outline: var(--border);
}

#lightbox {
  border: none;
  outline: none;
}
#lightbox img {
  max-height: 90vh;
  max-width: 90vw;
}

::backdrop {
  backdrop-filter: blur(2px) brightness(80%);
}

#gallery:has(~ #lightbox:popover-open) {
  pointer-events: none;
}
/* makes the lightbox work on small screens, like phones */
@media only screen and (min-width: 600px) {
  #lightbox button {
    display: none;
  }
}
@media only screen and (max-width: 600px) {
  #lightbox button {
    display: block;
    width: 30px;
    height: 30px;
    margin: 10px auto;
  }
}
