:root {
  --color-brand-purple: #322a63;
  --color-active: #11077e;
  --font-family-reading: "Cormorant Garamond", serif;
  --font-family-display: "Amarante", serif;
}

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

html {
  scroll-behavior: smooth;

  :target:not(article) {
    animation: scrollflash 1.75s ease-out 0.1s;
  }
}

body {
  background: var(--color-brand-purple);
  background-image: radial-gradient(rgba(0, 0, 0, 0.1) 66%, rgba(0, 0, 0, 0.5));
  background-attachment: fixed;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-family-reading);
  letter-spacing: 0.5px;
  margin: 0;
  min-height: 100vh;
  padding: 1rem;
}

h1,
h2,
h3,
h4,
h5 {
  color: #fff;
  font-family: var(--font-family-display);
  letter-spacing: 0;
  margin: 1em 0 0.5em;
}

h1 {
  font-size: 3.6rem;
}

h2 {
  font-size: 3rem;
}

h3 {
  font-size: 2rem;
  font-family: var(--font-family-reading);
}

p {
    margin-top: 0;
}

ul {
  padding-left: 1em;
  margin-block: 0 2rem;
  list-style-image: url('../img/icon-world.svg');
  
  li::marker {
    font-size: 1.5em;
  }
  
  li > ul {
    list-style-image: url('../img/icon-star.svg');
    margin-block: 0.5rem 0;
  }
}

li {
  margin-bottom: 0.5em;
}

strong {
  font-weight: 762;
  color: #fff;
}

a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-decoration-skip-ink: none;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.25em;

  &:hover {
    text-decoration-color: rgba(255, 255, 255, 0.8);
    text-decoration-thickness: 4px;
  }
}

figure {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

figcaption {
  font-style: italic;
  font-size: 1rem;
  margin-block: 0.5em 1em;
}

button {
    background-color: rgba(0, 0, 0, 0.25);
    border: solid 2px rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-family: var(--font-family-reading);
    font-size: 1.25rem;
    padding: 0.5rem 1rem;
    transition: all 0.25s;

    &:hover {
      background-color: var(--color-active);
      transform: scale(1.05);
    }
}

header {
  align-items: center;
  display: flex;
  font-size: 1.25rem;
  justify-content: space-between;
  margin-bottom: 4rem;
  padding: 1rem 0;
  position: relative;

  img {
    width: 180px;
    height: auto;
  }

  nav ul {
    align-items: center;
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;

    li {
      margin: 0;
    }
  }

  &::after {
    background: url(../img/hr-line-stretch.svg) no-repeat;
    background-size: 100% 100%;
    content: "";
    display: block;
    height: 4px;
    position: absolute;
    top: 100%;
    width: 100%;
  }
}

@media (max-width: 679px) {
  header {
    flex-direction: column;
    gap: 2rem;

    nav {
      flex-direction: column;
    }
  }
}

footer {
  border-top: solid 1px rgba(255, 255, 255, 0.25);
  padding: 2rem 0;
  margin-top: 8rem;
}

main {
  --font-size-normal: clamp(1rem, 2vw, 1.33rem);

  font-size: var(--font-size-normal);
  line-height: 1.25;
  max-width: 80ch;
  margin: auto;
}

section {
  &:has(+ section) {
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    position: relative;

    &::after {
      background: url(../img/hr-line-stretch.svg) no-repeat;
      background-size: 100% 100%;
      content: "";
      display: block;
      height: 4px;
      position: absolute;
      bottom: 0;
      width: 100%;
    }
  }
}

.page-title {
  text-align: center;
  padding: 0;
  margin: 8rem 0 2rem;
}

.jump-menu {
  display: grid;
  place-content: center;
  margin-bottom: 8rem;

  ul {
    display: flex;
    gap: 1em;
    list-style: none;
    padding: 0;
    width: max-content;
  }
}

.passcode-form {
    border-radius: 8px;
    border: solid 4px rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    height: 20rem;
    margin: 0 auto;
    max-width: 100%;
    opacity: 0;
    padding: 3rem 2rem 1rem;
    text-align: center;
    transition: 
        opacity 1s 1s,
        height 1s 2s;
    width: max-content;

    &.showing {
      opacity: 1;
    }

    &.hidden {
        opacity: 0;
        height: 0;
        margin: 0 auto;
        pointer-events: none;

        &.no-show {
          transition: none;
        }
    }

    .status {
        border-radius: 5px;
        height: 2em;
        margin: 1rem auto 1rem;
        padding: 0.5rem 1rem;
        width: max-content;

        &:not(:empty) {
            background: rgba(255, 255, 255, 0.1);

            &::before {
                display: inline-block;
                margin-right: 5px;
            }
        }

        &[data-type="success"] {
            background-color: rgba(36, 225, 57, 0.25);

            &::before {
                content: '🕸️';
            }
        }

        &[data-type="error"] {
            background-color: rgba(225, 36, 36, 0.25);

            &::before {
                content: '👻';
            }
        }
    }
}

.form-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 1rem auto 0;
    width: max-content;
}


.form-field {
  display: flex;
  flex-direction: column;
  font-family: sans-serif;
  gap: 0.5em;

  label {
    font-size: 1rem;
  }

  input {
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
    border: solid 1px rgba(255, 255, 255, 0.2);
    border-radius: 5px;
  }
}

@media (min-width: 680px) {
  .passcode-form {
    height: 16rem;
  }

  .form-content {
    flex-direction: row;
    align-items: center;
  }

  .form-field {
    align-items: center;
    flex-direction: row;
  }
}

.content-wrapper {
    height: max-content;
    opacity: 1;
    z-index: 100;

    &.hidden {
      display: none;
    }
    
    &.reveal {
      transition: 
        opacity 2s 1s,
        height 2s 1s;
    }

    &.protected {
        height: 0;
        overflow: hidden;
        opacity: 0;
    }
}

.setup-figures {
  display: grid;
  gap: 4rem;
  grid-template-columns: 1fr 1fr;
  margin: 4rem 0;

  figure {
    --backdrop-color: rgba(0, 0, 0, 0.85);

    transition: all 0.25s;

    &:is(:focus, :focus-visible) {
      background: var(--backdrop-color);
      box-shadow: 0 0 0 100vw var(--backdrop-color);
      transform: scale(1.5);
      z-index: 10;      
    }
  }
}

@media (hover: hover) {
  .setup-figures:not(:focus-within) figure:hover {
    cursor: pointer;

    /* background: var(--backdrop-color);
    box-shadow: 0 0 0 100vw var(--backdrop-color);
    transform: scale(1.5);
    z-index: 10; */
  }
}

@media (max-width: 679px) {
  .setup-figures {
    display: flex;
    flex-direction: column;
  }
}

table {
  border-collapse: collapse;
  font-size: var(--font-size-normal);
  margin-block: 2rem 3rem;
  
  td, 
  th {
    padding: 0.25rem 0.5rem;
    border-bottom: solid 2px rgba(255, 255, 255, 0.2);
  }

  td,
  thead th {
    text-align: center;
  }
}

.question {
  margin-bottom: 2rem;
  
  h3 {
    font-size: 1.5rem;
  }
}

@media (min-width: 680px) {
  table {
    td,
    th {
      padding: 0.5rem 1rem;
    }
  }
}


@keyframes scrollflash {
  0% {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px 0 rgba(255, 255, 255, 0.2),
      0 0 0 5px rgba(255, 255, 255, 0.2);
    border-radius: 20px;
  }
  25% {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px 0 rgba(255, 255, 255, 0.2),
      0 0 0 5px rgba(255, 255, 255, 0.1);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 200px 0 transparent, 0 0 0 20px transparent;
    border-radius: 0;
  }
}
