/***  FONTS ***/
@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Rubik+Glitch&display=swap");

/***  VARIABLES & THEMES ***/

:root {
  --primary-color: #cf0f0f;
  --primary-color-contrast: #ffffff;
  --field-background-color: #000;
}

.light-theme {
  --page-background: linear-gradient(
    180deg,
    #ffffff 0%,
    #ffffff 65%,
    rgba(255, 255, 255, 0.75) 100%
  );
  --header-background-color: #e3e3e3;
  --highlight-color: #000000;
  --featured-font-family: "Archivo", sans-serif;
  --character-top-image-src: url("../images/characters/kids-on-the-bike.svg");
  --character-top-image-color: #ffffff;
  --character-bottom-image-src: url("../images/characters/inverted-world-monster.svg");
  --character-bottom-image-color: #e5e5e5;
  --background-lamp-image: url("../images/backgrounds/lamps.png");
  --footer-background-color: #b5bbbf;
}

.dark-theme {
  --page-background: linear-gradient(
    180deg,
    #050000 0%,
    #130404 65%,
    rgba(19, 1, 1, 0.75) 100%
  );
  --header-background-color: #220f0f;
  --highlight-color: #ffffff;
  --featured-font-family: "Rubik Glitch", sans-serif;
  --character-bottom-image-src: url("../images/characters/kids-on-the-bike.svg");
  --character-bottom-image-color: rgba(255, 255, 255, 0.1);
  --character-top-image-src: url("../images/characters/inverted-world-monster.svg");
  --character-top-image-color: #000;
  --background-lamp-image: url("../images/backgrounds/lamps-inverted.png");
  --footer-background-color: #000;
}

.dark-theme button,
.dark-theme h1,
.dark-theme h2,
.dark-theme h3 {
  letter-spacing: 5px;
  font-weight: normal;
}

.dark-theme .invert-element {
  transform: rotateZ(180deg) scaleX(-1);
}

/***  GENERIC STYLES ***/

* {
  margin: 0;
  box-sizing: border-box;
  transition: 1s;
}

body {
  background: var(--page-background);
}

h1,
h2,
h3 {
  font-family: var(--featured-font-family);
  font-size: 3rem;
  color: var(--primary-color);
  text-transform: uppercase;
  margin-bottom: 40px;
}

p {
  color: var(--highlight-color);
}

p,
input,
textarea,
label {
  font-family: "Libre Baskerville", serif;
}

button {
  padding: 16px 32px;
  background-color: transparent;
  font-weight: 900;
  font-family: var(--featured-font-family);
  font-size: 1.25rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 1s;
}

main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

main::before {
  content: "";
  width: 100%;
  height: 100%;
  position: absolute;
  background: var(--page-background) no-repeat,
    url("../images/backgrounds/florest.png") no-repeat;
  background-size: cover;
  z-index: -1;
}

input,
textarea {
  border: 2px solid var(--primary-color-contrast);
  background-color: var(--field-background-color);
  color: var(--primary-color-contrast);
  padding: 8px;
}

input,
textarea {
  margin-bottom: 24px;
}

label {
  margin-bottom: 8px;
}

input:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: black;
}

/*** HEADER STYLES ***/

header {
  background-color: var(--header-background-color);
  min-height: 850px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

header::before {
  content: "";
  width: 100%;
  height: 100%;
  position: absolute;
  background-image: url("../images/banner/florest.webp");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 90%;
  filter: saturate(0);
  opacity: 0.2;
}

.header-content {
  max-width: 700px;
  padding: 80px 20px;
  text-align: center;
  z-index: 2;
}

.header-content img {
  width: 80%;
}

.header-content p {
  margin: 30px 0 50px;
}

.header-content button {
  border: 3px solid var(--primary-color);
  color: var(--primary-color);
}

.header-content button:hover {
  background-color: var(--primary-color);
  color: var(--primary-color-contrast);
}

/*** WORLD CHARACTERS STYLES ***/

.world-characters {
  width: 100%;
  max-width: 900px;
  position: absolute;
}

.world-characters#top-characters {
  height: 100%;
  background-color: var(--character-top-image-color);
  bottom: -3px;

  mask: var(--character-top-image-src) bottom / contain no-repeat;
  -webkit-mask: var(--character-top-image-src) bottom / 100% no-repeat;
}

.world-characters#bottom-characters {
  height: 500px;
  background-color: var(--character-bottom-image-color);
  top: 3px;
  transform: rotateZ(180deg) scaleX(-1);
  position: relative;

  mask: var(--character-bottom-image-src) bottom / contain no-repeat;
  -webkit-mask: var(--character-bottom-image-src) bottom / 100% no-repeat;
}

/*** SECTIONS STYLES ***/

section {
  display: flex;
  justify-content: space-between;
  margin-bottom: 95px;
}

/* Section 01 - Inverted World */

.container {
  max-width: 1200px;
}

#section-inverted-world {
  align-items: center;
}

#section-inverted-world .section-texts {
  width: 50%;
}

#section-inverted-world .section-texts h2 {
  max-width: 300px;
}

/* Section 02 - Stranger Things Trailer */

#section-stranger-things-trailer .section-texts {
  width: 50%;
  text-align: right;
}

#section-stranger-things-trailer .section-texts h2 {
  max-width: 425px;
  display: inline-block;
}

#section-stranger-things-trailer .video-frame {
  background-color: var(--primary-color);
}

#section-stranger-things-trailer .video-frame iframe {
  position: relative;
  bottom: 24px;
  left: 24px;
  border: 2px solid;
  border-image: linear-gradient(
    var(--primary-color),
    var(--primary-color-contrast)
  );
  border-image-slice: 10;
}

/* Section 03 - Stranger Things Gallery */

#section-stranger-things-gallery {
  width: 100%;
  background: var(--background-lamp-image) 120% / 50% no-repeat;
  justify-content: center;
}

#section-stranger-things-gallery .container {
  width: 100%;
}

#section-stranger-things-gallery .container h2 {
  width: 800px;
}

#section-stranger-things-gallery .gallery-container {
  display: flex;
  gap: 50px;
  padding-left: 20px;
}

#section-stranger-things-gallery .gallery-image {
  width: 250px;
  height: 250px;
  outline: 20px solid var(--highlight-color);
  border: 3px solid var(--primary-color);
  box-sizing: initial;
}

#section-stranger-things-gallery .gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 10px solid var(--highlight-color);
}

/* Section 04 - Dungeons & Dragons Form */

#section-form {
  flex-direction: column;
  align-items: center;
  gap: 40px;
  text-align: center;
}

#section-form h2 {
  width: 600px;
}

#section-form .form-content h3 {
  color: var(--highlight-color);
}

#section-form .form-content h3 span {
  color: var(--primary-color);
}

#section-form .form-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#section-form .form-content h3 {
  flex-basis: 30%;
  text-align: left;
  margin: 0;
}

#section-form .form-container {
  flex-basis: 50%;
  position: relative;
}

#section-form .form-container::after {
  content: "";
  background-color: var(--highlight-color);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: -1;
}

#section-form .form-container form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  background-color: var(--primary-color);
  color: var(--primary-color-contrast);
  text-align: left;
}

#section-form .form-container form button {
  border: none;
  background-color: var(--field-background-color);
  color: var(--primary-color-contrast);
  max-width: 300px;
  align-self: center;
}

#section-form .form-container form button:hover {
  background-color: var(--primary-color-contrast);
  color: var(--field-background-color);
}

/*** FOOTER STYLES ***/

footer {
  padding: 60px 0;
  background-color: var(--footer-background-color);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

footer p {
  max-width: 700px;
  margin-bottom: 24px;
}

footer::before,
footer::after {
  content: "";
  width: 300px;
  height: 200px;
  background: url("../images/footer/tape.svg") no-repeat;
  background-size: contain;
  position: absolute;
  bottom: -30px;
}

footer::before {
  left: -50px;
  transform: rotateZ(-10deg);
}

footer::after {
  right: -50px;
  transform: rotateZ(10deg);
}

/*** PARTICLES BACKGROUND ***/
#particles-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.7;
  animation: float 6s ease-in-out infinite;
}

.light-theme .particle {
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(200,200,200,0.3) 100%);
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.dark-theme .particle {
  background: radial-gradient(circle, rgba(207,15,15,0.8) 0%, rgba(50,0,0,0.3) 100%);
  box-shadow: 0 0 15px rgba(207,15,15,0.7);
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) translateX(10px) rotate(90deg);
  }
  50% {
    transform: translateY(-10px) translateX(-10px) rotate(180deg);
  }
  75% {
    transform: translateY(-30px) translateX(5px) rotate(270deg);
  }
}

/*** GLITCH EFFECT ***/
.glitch {
  position: relative;
  color: var(--highlight-color);
  animation: glitch 2s infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  animation: glitch-1 0.5s infinite;
  color: #ff0000;
  z-index: -1;
}

.glitch::after {
  animation: glitch-2 0.5s infinite;
  color: #00ffff;
  z-index: -2;
}

@keyframes glitch {
  0%, 100% {
    text-shadow: 0 0 5px var(--primary-color);
  }
  25% {
    text-shadow: -2px 0 5px var(--primary-color), 2px 0 5px #00ffff;
  }
  50% {
    text-shadow: 2px -2px 5px var(--primary-color), -2px 2px 5px #00ffff;
  }
  75% {
    text-shadow: -2px -2px 5px var(--primary-color), 2px 2px 5px #00ffff;
  }
}

@keyframes glitch-1 {
  0% {
    clip: rect(7px, 9999px, 13px, 0);
  }
  5% {
    clip: rect(33px, 9999px, 39px, 0);
  }
  10% {
    clip: rect(53px, 9999px, 59px, 0);
  }
  15% {
    clip: rect(91px, 9999px, 97px, 0);
  }
  20% {
    clip: rect(131px, 9999px, 137px, 0);
  }
  25% {
    clip: rect(7px, 9999px, 13px, 0);
  }
  30% {
    clip: rect(121px, 9999px, 127px, 0);
  }
  35% {
    clip: rect(10px, 9999px, 16px, 0);
  }
  40% {
    clip: rect(85px, 9999px, 91px, 0);
  }
  45% {
    clip: rect(60px, 9999px, 66px, 0);
  }
  50% {
    clip: rect(119px, 9999px, 125px, 0);
  }
  55% {
    clip: rect(10px, 9999px, 16px, 0);
  }
  60% {
    clip: rect(85px, 9999px, 91px, 0);
  }
  65% {
    clip: rect(60px, 9999px, 66px, 0);
  }
  70% {
    clip: rect(11px, 9999px, 17px, 0);
  }
  75% {
    clip: rect(86px, 9999px, 92px, 0);
  }
  80% {
    clip: rect(61px, 9999px, 67px, 0);
  }
  85% {
    clip: rect(12px, 9999px, 18px, 0);
  }
  90% {
    clip: rect(87px, 9999px, 93px, 0);
  }
  95% {
    clip: rect(62px, 9999px, 68px, 0);
  }
  100% {
    clip: rect(7px, 9999px, 13px, 0);
  }
}

@keyframes glitch-2 {
  0% {
    clip: rect(65px, 9999px, 119px, 0);
  }
  5% {
    clip: rect(66px, 9999px, 120px, 0);
  }
  10% {
    clip: rect(67px, 9999px, 121px, 0);
  }
  15% {
    clip: rect(68px, 9999px, 122px, 0);
  }
  20% {
    clip: rect(69px, 9999px, 123px, 0);
  }
  25% {
    clip: rect(70px, 9999px, 124px, 0);
  }
  30% {
    clip: rect(71px, 9999px, 125px, 0);
  }
  35% {
    clip: rect(72px, 9999px, 126px, 0);
  }
  40% {
    clip: rect(73px, 9999px, 127px, 0);
  }
  45% {
    clip: rect(74px, 9999px, 128px, 0);
  }
  50% {
    clip: rect(75px, 9999px, 129px, 0);
  }
  55% {
    clip: rect(76px, 9999px, 130px, 0);
  }
  60% {
    clip: rect(77px, 9999px, 131px, 0);
  }
  65% {
    clip: rect(78px, 9999px, 132px, 0);
  }
  70% {
    clip: rect(79px, 9999px, 133px, 0);
  }
  75% {
    clip: rect(80px, 9999px, 134px, 0);
  }
  80% {
    clip: rect(81px, 9999px, 135px, 0);
  }
  85% {
    clip: rect(82px, 9999px, 136px, 0);
  }
  90% {
    clip: rect(83px, 9999px, 137px, 0);
  }
  95% {
    clip: rect(84px, 9999px, 138px, 0);
  }
  100% {
    clip: rect(65px, 9999px, 119px, 0);
  }
}

/*** TYPEWRITER EFFECT ***/
.typewriter {
  border-right: 3px solid var(--primary-color);
  animation: blink-caret 0.75s step-end infinite;
  animation-delay: 4s;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: normal;
  min-height: 2.4em;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-color);
  }
}

/*** SCROLL REVEAL ANIMATIONS ***/
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 1s ease;
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 1s ease;
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

/*** CUSTOM CURSOR ***/
.light-theme {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="8" fill="%23ffffff" stroke="%23000000" stroke-width="2"/><circle cx="10" cy="10" r="3" fill="%23ffff00"/></svg>'), auto;
}

.dark-theme {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path d="M10 2 L12 8 L18 8 L13 12 L15 18 L10 14 L5 18 L7 12 L2 8 L8 8 Z" fill="%23cf0f0f" stroke="%23000000" stroke-width="1"/></svg>'), auto;
}

/*** LOADING SCREEN ***/
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-lights {
  display: flex;
  gap: 10px;
}

.loading-light {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  animation: blink 1.5s infinite;
}

.loading-light:nth-child(2) {
  animation-delay: 0.3s;
}

.loading-light:nth-child(3) {
  animation-delay: 0.6s;
}

.loading-light:nth-child(4) {
  animation-delay: 0.9s;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
    transform: scale(1);
  }
  25% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  75% {
    opacity: 0.7;
    transform: scale(1.2);
  }
}

/*** ENHANCED FORM STYLES ***/
.form-container input:focus,
.form-container textarea:focus {
  outline: none;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 10px rgba(207, 15, 15, 0.3);
  transform: scale(1.02);
  transition: all 0.3s ease;
}

.form-container input.error,
.form-container textarea.error {
  border: 2px solid #ff4444;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.form-container .success-message {
  color: #4CAF50;
  font-size: 0.9em;
  margin-top: 5px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.form-container .success-message.show {
  opacity: 1;
}

/*** MODAL ***/
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--header-background-color);
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  max-width: 500px;
  margin: 0 20px;
  position: relative;
  animation: slideIn 0.5s ease;
}

.modal-content h2 {
  color: var(--highlight-color);
  margin-bottom: 1rem;
}

.modal-content p {
  color: var(--highlight-color);
  margin-bottom: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--highlight-color);
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
