/* CSS Reset */
/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

/* Font */
@font-face {
  font-family: Medieval;
  src: url(../assets/fonts/MedievalSharp/MedievalSharp-Regular.woff2);
}

@font-face {
  font-family: Elven;
  src: url(../assets/fonts/elven-common-speak-font/Elvencommonspeak-0WXz.ttf);
}

@font-face {
  font-family: Montserrat;
  src: url(../assets/fonts/Montserrat/Montserrat-VariableFont_wght.ttf);
}

/* Color */
:root {
  --color-primary: #122500;
  --color-secondary: #e3e7d3;
  --color-accent: #e6e49f;
  --color-grey-1: #bdc2bf;
  --color-grey-2: #989c94;
  --color-grey-3: #212121;
  --color-green-1: #e3e7d3;
  --color-green-2: #55614a;
  --color-green-3: #122500;
  --color-yellow-1: #e6e49f;
  --color-discord: #5865f2;
}

/* Screen Width */
:root {
  --screen-tablet: 768px;
  --screen-sd: 1024px;
  --screen-lg: 1440px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Medieval, Montserrat, sans-serif;
  background-color: var(--color-grey-3);
}

/* Section General */
section.fullscreen {
  min-height: 100vh;
  width: 100vw;
  padding-block: 5em;
}

/* Inner Grid */
inner-grid {
  display: block;
  max-width: var(--screen-lg);
  margin-inline: auto;
}

/* Utilities */
.alert {
  background-color: white;
  color: red;
  position: fixed;
  width: 100%;
}

.no-margin {
  margin: 0;
}

h2 {
  margin-block-end: 1em;
}

/* Navigation */
header {
  position: fixed;
  width: 100%;
  padding-block: 1em;
  background-color: rgba(0, 0, 0, 0.1);
  z-index: 10;
}
nav {
  display: flex;
  justify-content: space-between;

  a {
    color: white;
    text-decoration: none;
    font-size: 1.5em;
  }

  a:hover {
    color: rgba(255, 255, 255, 0.8);
  }

  .nav-links {
    display: flex;
    gap: 1em;
  }
}

/* Hero Section */
#hero {
  width: 100vw;
  height: 100vh;
  color: white;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  font-family: Medieval, sans-serif;

  .hero-background-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0.25) calc(50vw - 400px),
        rgba(0, 0, 0, 0.45) calc(50vw - 250px),
        rgba(0, 0, 0, 0) calc(50vw),
        rgba(0, 0, 0, 0.45) calc(50vw + 250px),
        rgba(0, 0, 0, 0.25) calc(50vw + 400px),
        rgba(0, 0, 0, 0)
      ),
      url("../assets/images/double-door-nobg.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;

    @supports (
      background-image: url("../assets/images/double-door-nobg.webp")
    ) {
      background-image: linear-gradient(
          to right,
          rgba(0, 0, 0, 0),
          rgba(0, 0, 0, 0.25) calc(50vw - 400px),
          rgba(0, 0, 0, 0.45) calc(50vw - 250px),
          rgba(0, 0, 0, 0) calc(50vw),
          rgba(0, 0, 0, 0.45) calc(50vw + 250px),
          rgba(0, 0, 0, 0.25) calc(50vw + 400px),
          rgba(0, 0, 0, 0)
        ),
        url("../assets/images/double-door-nobg.webp");
    }

    @supports (
      background-image: url("../assets/images/double-door-nobg.avif")
    ) {
      background-image: linear-gradient(
          to right,
          rgba(0, 0, 0, 0),
          rgba(0, 0, 0, 0.25) calc(50vw - 400px),
          rgba(0, 0, 0, 0.45) calc(50vw - 250px),
          rgba(0, 0, 0, 0) calc(50vw),
          rgba(0, 0, 0, 0.45) calc(50vw + 250px),
          rgba(0, 0, 0, 0.25) calc(50vw + 400px),
          rgba(0, 0, 0, 0)
        ),
        url("../assets/images/double-door-nobg.avif");
    }
  }

  &.scrolled .hero-background-overlay {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
  }

  .hero-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
  }

  &.scrolled {
    background-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0.25) calc(50vw - 400px),
        rgba(0, 0, 0, 0.45) calc(50vw - 250px),
        rgba(0, 0, 0, 0) calc(50vw),
        rgba(0, 0, 0, 0.45) calc(50vw + 250px),
        rgba(0, 0, 0, 0.25) calc(50vw + 400px),
        rgba(0, 0, 0, 0)
      ),
      url("../assets/images/double-door-open-nobg.png");

    @supports (
      background-image: url("../assets/images/double-door-open-nobg.webp")
    ) {
      background-image: linear-gradient(
          to right,
          rgba(0, 0, 0, 0),
          rgba(0, 0, 0, 0.25) calc(50vw - 400px),
          rgba(0, 0, 0, 0.45) calc(50vw - 250px),
          rgba(0, 0, 0, 0) calc(50vw),
          rgba(0, 0, 0, 0.45) calc(50vw + 250px),
          rgba(0, 0, 0, 0.25) calc(50vw + 400px),
          rgba(0, 0, 0, 0)
        ),
        url("../assets/images/double-door-open-nobg.webp");
    }

    @supports (
      background-image: url("../assets/images/double-door-open-nobg.avif")
    ) {
      background-image: linear-gradient(
          to right,
          rgba(0, 0, 0, 0),
          rgba(0, 0, 0, 0.25) calc(50vw - 400px),
          rgba(0, 0, 0, 0.45) calc(50vw - 250px),
          rgba(0, 0, 0, 0) calc(50vw),
          rgba(0, 0, 0, 0.45) calc(50vw + 250px),
          rgba(0, 0, 0, 0.25) calc(50vw + 400px),
          rgba(0, 0, 0, 0)
        ),
        url("../assets/images/double-door-open-nobg.avif");
    }
  }

  &::after {
    content: "";
    width: 100%;
    height: 100vh;
    background-image: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0) 65%,
        rgba(0, 0, 0, 0.3) 75%,
        rgba(0, 0, 0, 0.95) 100%
      ),
      url("../assets/images/wall.png");
    position: absolute;
    z-index: -1;
    background-size: cover;

    @supports (background-image: url("../assets/images/wall.webp")) {
      background-image: radial-gradient(
          ellipse at center,
          rgba(0, 0, 0, 0) 50%,
          rgba(0, 0, 0, 0.5) 75%,
          rgba(0, 0, 0, 0.95) 100%
        ),
        url("../assets/images/wall.webp");
    }

    @supports (background-image: url("../assets/images/wall.avif")) {
      background-image: radial-gradient(
          ellipse at center,
          rgba(0, 0, 0, 0) 50%,
          rgba(0, 0, 0, 0.5) 75%,
          rgba(0, 0, 0, 0.95) 100%
        ),
        url("../assets/images/wall.avif");
    }
  }

  h2,
  p {
    color: white;
  }

  h2 {
    font-size: 5em;
  }

  p {
    font-size: 2em;
  }

  .ctas {
    display: flex;
    flex-direction: row;
    gap: 2em;
    margin-block-start: 3em;

    .cta {
      color: white;
      text-decoration: none;
      padding: 1em 1em;
      border: 1px solid rgb(241, 255, 227);
      border-radius: 20px;
      min-width: 170px;
      background-color: rgb(18, 37, 0);
      display: flex;
      justify-content: center;
    }

    .cta:hover {
      background-color: rgb(18, 37, 0, 0.5);
    }

    .cta:last-child {
      color: black;
      background-color: white;
    }

    .cta:last-child:hover {
      background-color: rgba(1, 1, 1, 0.5);
      color: white;
    }
  }

  .elven-scripts {
    font-family: "elven", sans-serif;
    position: absolute;
    top: 0;
    left: 0;

    p {
      position: relative;
    }

    p:nth-child(1) {
      top: 200px;
      left: 300px;
      animation: fading 10s ease-in-out infinite;
    }

    p:nth-child(2) {
      top: 500px;
      left: 200px;
      animation: fading 10s 3s ease-in-out infinite;
    }

    p:nth-child(3) {
      top: 300px;
      right: -1200px;
      animation: fading 10s 5s ease-in-out infinite;
    }
  }
}

@keyframes fading {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Partial Section */
.partial {
  width: 100%;
  color: white;
  background-color: var(--darker-grey-color);
  font-size: 2em;
  padding-block: 2em;
}

/* Events Section */
#events {
  color: white;
  padding: 0;

  section:not(.inner-section) {
    background-color: var(--color-secondary);

    &.event-reverse {
      background: var(--color-primary);

      .event-description {
        color: var(--color-grey-1);
        order: -1;
      }
    }
  }

  inner-grid {
    section {
      display: flex;
      font-size: 1.25em;
      line-height: 2em;

      img {
        width: 45%;
      }

      .event-description {
        color: var(--color-grey-3);
        padding: 2em;
        display: flex;
        flex-direction: column;
        width: 100%;
        justify-content: center;
      }
    }
  }
}

/* DM Bio Section */
#dm-bio {
  color: white;

  ul {
    list-style: none;
    padding: 0;
  }

  .dms {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    height: 100%;
    margin-top: 3em;
    gap: 2em;
  }

  .dm {
    border: 1px solid white;
    border-radius: 50px;
    min-width: 300px;
    max-width: 450px;
    height: 100%;

    button {
      all: unset;
    }

    button:hover {
      background-color: rgba(0, 0, 0, 0.2);
      border-radius: 50px;
      cursor: pointer;
    }

    picture {
      height: 30%;
      width: 100%;

      img {
        object-fit: cover;
        object-position: top;
        max-height: 400px;
        height: 100%;
        width: 100%;
        border-radius: 49px 49px 0 0;
      }
    }

    .dm-description {
      height: 70%;
      width: 100%;
      border-block-start: 1px solid white;
      padding: 2em 2em;

      .tags {
        display: flex;
        gap: 1em;
        list-style: none;
        margin: 0;
        padding: 0;
        margin-block-end: 2em;

        li {
          border: 1px solid white;
          border-radius: 10px;
          padding-inline: 10px;
        }
      }

      p {
        text-overflow: ellipsis;
        overflow: hidden;
        max-height: 245px;
        display: -webkit-box;
        display: -webkit-box;
        -webkit-line-clamp: 10;
        -webkit-box-orient: vertical;
      }

      p.clickable {
        color: rgb(76, 76, 255);
      }

      p.clickable:hover {
        color: blue;
      }
    }

    dialog {
      max-width: 1240px;
      margin: auto;
      border: none;
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
      border-radius: 5px;
      width: 80%;
      height: 80%;
      padding: 0;
      background-color: var(--color-green-1);
      color: var(--color-grey-3);

      form {
        position: absolute;
        right: 20px;

        button {
          background: black;
          color: white;
          border-radius: 50px;
          padding: 5px 10px;
        }

        button:hover {
          background-color: var(--color-grey-2);
        }
      }

      .dm-dialog-content {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: 1fr 2fr;
        height: 100%;
        width: 100%;
        gap: 20px;

        h2 {
          grid-row: 1 / 2;
          grid-column: 2 / 3;
          align-self: center;
        }

        .tags {
          display: flex;
          gap: 5px;
          font-size: 0.75em;
          margin-block-start: 20px;
          grid-row: 1 / 2;
          grid-column: 2 / 3;
          height: fit-content;
          align-self: end;

          li {
            background-color: #c0ce85;
            border-radius: 20px;
            padding: 2px 10px;
          }
        }

        picture {
          grid-column: 1 / 2;
          grid-row: 1 / 3;
          width: 100%;
          height: 100%;
        }

        img {
          max-height: 100%;
          border-radius: 0;
          max-width: 500px;
        }
      }
    }

    dialog::backdrop {
      background: rgba(0, 0, 0, 0.1);
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
    }
  }
}

/* Discord Section */
section.discord {
  position: relative;
  background-color: var(--color-discord);

  a {
    position: absolute;
    right: 2em;
    top: 0.7em;
  }
}

/* Contact Us Section */
#contact-us {
  color: white;

  section {
    margin-block-start: 3em;
    border: 1px solid white;
    border-radius: 50px;
    height: 70%;
    padding: 2em;

    form {
      display: flex;
      flex-direction: column;
      gap: 2em;

      label {
        display: flex;
        flex-direction: column;

        input {
          max-width: 200px;
        }
      }

      input[type="submit"] {
        max-width: 200px;
      }

      input[type="submit"]:hover {
        cursor: pointer;
      }
    }
  }

  .social-message {
    margin-block-start: 3em;
  }

  .social {
    display: flex;
    flex-direction: row;
    gap: 1em;
    margin-block-start: 1em;
  }
}

/* Footer */
footer {
  color: white;
  text-align: center;
}

/* Mobile */
@media screen and (width <= 768px) {
  /* Inner Grid */
  inner-grid {
    margin-inline: 1em;
  }

  .partial {
    font-size: 1.25em;
  }

  nav {
    .nav-links {
      display: none;
    }
  }

  /* Hero Section */
  #hero {
    h2,
    p {
      margin-inline: 1em;
    }

    .elven-scripts {
      display: none;
    }

    .ctas {
      flex-direction: column;
      gap: 1em;
    }
  }

  /* Events Section */
  #events {
    .inner-section {
      flex-direction: column;
    }

    section:not(.inner-section).event-reverse {
      .event-description {
        order: 1;
      }
    }

    inner-grid {
      section {
        img {
          width: 100%;
          height: 300px;
          object-fit: contain;
        }

        .event-description {
          padding-inline: 0;
        }
      }
    }
  }

  /* DM Bio Section */
  #dm-bio {
    .dm {
      dialog {
        .dm-dialog-content {
          display: flex;
          flex-direction: column;

          .tags {
            align-self: start;
            margin-inline-start: 1em;
          }

          p {
            margin: 1em;
          }
        }
      }
    }
  }

  /* Discord Section */
  section.discord {
    a {
      position: static;
      margin-block-start: 1em;
      display: block;
    }
  }
}

/* Tablet */
@media screen and (768px < width <= 1024px) {
}

/* SD Screen */
