/* Font loading fallback */
@font-face {
  font-family: "Bangers";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/bangers/v24/FeVQS0BTqb0h60ACH5FQ2J5hm25mww.woff2)
    format("woff2");
}

/* CSS Variables */
:root {
  --text-dark: #0b0a0c;
  --text-light: #ffffff;
  --background: #0b0a0c;
  --hero-blue: #0074e4;
  --hero-red: #d91e18;
  --hero-yellow: #ffc300;
  --hero-orange: #ff9100;
  --hero-black: #1a1a1a;
  --hero-gray: #cccccc;
  --hero-white: #ffffff;
  --border: #0b0a0c;
}

html {
  background-color: var(--border);
}

/* Base Styles */
body {
  font-family: "Montserrat", sans-serif;
  color: var(--text-dark);
  text-align: center;
  max-width: 1400px;
  min-width: 320px;
  margin: auto;
  background-color: white;
}

main {
  display: grid;
  grid-template-columns: repeat(16, auto);
  gap: 12px;
  padding: 12px;
}

h2 {
  font-family: "Bangers", cursive;
  text-transform: uppercase;
  font-size: 2rem;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
    1px 1px 0 #fff;
}

a {
  text-decoration: underline;
  color: inherit;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  max-width: 1400px;
  z-index: 100;
  display: flex;
  gap: 16px;
  padding: 8px;
  box-sizing: border-box;
  font-family: "Bangers", cursive;
  font-size: 1.6rem;
  font-weight: 600;
  text-transform: uppercase;
  transition: all 300ms ease, padding 500ms ease;
  border-bottom: 3px solid transparent;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
    1px 1px 0 #fff;
}

nav .background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("images/header-bg.png");
  background-position: top;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0%;
  transition: opacity 1s ease;
}

nav.solid,
.mobile-nav-active nav {
  background-color: var(--hero-orange);
  border-bottom: 3px solid var(--border);
  box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12),
    0 2px 4px -1px rgba(0, 0, 0, 0.3);
  padding: 8px;
}

nav.solid .background-image,
.mobile-nav-active nav .background-image {
  opacity: 100%;
}

nav .nav-links {
  display: none;
  z-index: 100;
}

nav .mobile-nav {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  background-color: var(--hero-orange);
  border-bottom: 2px solid var(--border);
  gap: 6px;
  padding: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

nav .mobile-nav.active {
  display: flex;
}

nav button.nav-toggle {
  position: relative;
  background: none;
  border: none;
  padding: 8px;
  margin: 0;
  cursor: pointer;
  width: 40px;
  height: 40px;
}

nav button.nav-toggle svg path {
  fill: var(--text-dark);
  text-shadow: -1px -1px 0 var(--hero-orange), 1px -1px 0 var(--hero-orange),
    -1px 1px 0 var(--hero-orange), 1px 1px 0 var(--hero-orange);
}

nav button.nav-toggle:hover svg path {
  fill: var(--text-light);
}

nav a,
nav a:visited,
nav a:active {
  color: inherit;
  text-decoration: none;
  margin: auto 6px;
  transition: color 300ms ease-in-out;
}

nav a:hover {
  color: var(--hero-blue);
  animation: bounceText 1s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  transform-origin: center;
}

nav .logo,
nav .logo:active {
  margin-right: auto;
  opacity: 0%;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  pointer-events: initial;
}

nav img {
  position: relative;
  z-index: 1;
}

nav #logo span {
  font-family: "Bangers", cursive;
  font-size: 1.4rem;
  margin-left: 0px;
  position: relative;
  z-index: 2;
  text-shadow: -1px -1px 0 var(--hero-orange), 1px -1px 0 var(--hero-orange),
    -1px 1px 0 var(--hero-orange), 1px 1px 0 var(--hero-orange);
  transition: margin-left 1s ease-out;
}

nav.solid .logo,
nav.solid .logo:active,
.mobile-nav-active nav .logo,
.mobile-nav-active nav .logo:active {
  opacity: 100%;
}

#header nav img.superhero {
  position: absolute;
  bottom: 0;
  left: 0;
  will-change: transform, opacity;
  height: 95%;
  transition: all 1s ease-out;
  opacity: 0%;
  transform: translateX(-100px);
}

#header.mobile-nav-active nav .logo img,
#header nav.solid .logo.slide-in img.superhero {
  transform: translateX(0);
  opacity: 100%;
}

#header.mobile-nav-active nav .logo span,
#header nav.solid .logo.slide-in span {
  margin-left: 64px;
}

/* Header Section */
#header {
  position: relative;
  height: 90vh;
  max-height: 230px;
  overflow: hidden;
  background-color: var(--hero-orange);
  background-image: url("images/header-bg.png");
  background-position: center 45%;
  background-repeat: no-repeat;
  background-size: cover;
  transition: background-position 0.02s ease;
  border-top: none;
}

#header-content {
  width: 100%;
  height: 100%;
  opacity: 1;
}

#header-content-buttons {
  position: absolute;
  right: 0;
  bottom: 5%;
  z-index: 1;
  width: 55%;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: auto;
  gap: 18px;
}

#header #header-content .superhero {
  position: absolute;
  bottom: 0;
  left: 0;
  transform: translate(0%, 0%);
  will-change: transform, opacity;
  height: 95%;
  width: 60%;
  transition: opacity 300ms ease;
  opacity: 100%;
  transition: background-position-y 1s ease, transform 0.2s ease-out;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-position 1s ease, transform 0.2s ease-out;
}

#header .superhero:hover {
  background-position-y: 40%;
}

#header.mobile-nav-active #header-content .superhero {
  opacity: 0% !important;
}

#header div.book-cover {
  display: none;
  position: absolute;
  right: 0%;
  left: 50%;
  bottom: 20%;
  top: 70px;
  background-image: url("../images/book_cover.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.1s ease-out;
}

#header div.book-cover:hover {
  transform: scale(1.05);
}

#header a.calltoaction {
  z-index: 1;
  background-color: var(--border);
  color: var(--text-light);
  font-family: "Bangers", cursive;
  font-size: 1.2rem;
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid var(--border);
  text-decoration: none;
  transition: background-color 300ms ease-in-out;
  cursor: pointer;
}

#header a.calltoaction:hover {
  background-color: var(--hero-blue);
  animation: bounceButton 1s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#header a.calltoaction.secondary {
  background-color: var(--hero-yellow);
  color: var(--text-dark);
}

#header a.calltoaction.secondary:hover {
  background-color: var(--hero-yellow);
}

.scrolled #header {
  box-shadow: 0 8px 17px 2px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);
}

/* Content Sections */
section {
  height: max-content;
  display: flex;
  flex-direction: row;
  background-color: var(--card);
  position: relative;
  overflow: hidden;
}

main section {
  border: 3px solid var(--border);
}

section .image {
  display: none;
}

section .image.bg {
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
  flex: 33%;
}

section .image.fg {
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  width: 100%;
  height: 100%;
  max-width: 400px;
}

section .text {
  flex: 67%;
  padding-left: 18px;
  padding-right: 18px;
}

section.image-right {
  flex-direction: row-reverse;
}

section#contact {
  flex-direction: column;
  padding-left: 8px;
  padding-right: 8px;
  background-color: var(--hero-gray);
}

section#contact #contact-form {
  width: 100%;
  max-width: 450px;
  margin: auto;
}

section .caption {
  position: absolute;
  background-color: white;
  font-family: "Bangers", cursive;
  text-transform: uppercase;
}

section .caption.top-left {
  top: -2px;
  left: -4px;
  padding: 6px 6px 4px 10px;
  border-right: 3px solid var(--border);
  border-bottom: 3px solid var(--border);
  transform: rotate(2deg);
}

section .caption.top-right {
  top: -2px;
  right: -4px;
  padding: 6px 10px 4px 6px;
  border-left: 3px solid var(--border);
  border-bottom: 3px solid var(--border);
  transform: rotate(-1deg);
}

section .caption.bottom-left {
  bottom: -2px;
  left: -4px;
  padding: 4px 6px 6px 10px;
  border-right: 3px solid var(--border);
  border-top: 3px solid var(--border);
  transform: rotate(-2deg);
}

section .caption.bottom-right {
  bottom: -3px;
  right: -4px;
  padding: 4px 10px 6px 6px;
  border-left: 3px solid var(--border);
  border-top: 3px solid var(--border);
  transform: rotate(2deg);
}

/* Blog Section */
#blog {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  background: none;
  border: none;
  padding: 0 12px;
}

#blog article {
  flex: 1 1 calc(33% - 12px);
  max-width: 450px;
  display: flex;
  flex-direction: row;
  text-align: center;
  background-color: var(--article);
  cursor: pointer;
  border: 3px solid var(--border);
  border-radius: 8px;
}

#blog article:hover {
  box-shadow: 0 8px 17px 2px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);
}

#blog article h1 {
  font-size: 1.1rem;
  text-transform: uppercase;
  margin: 0;
  overflow: hidden;
}

#blog article p.date {
  font-size: 0.8rem;
  margin: 0;
}

#blog div.image {
  display: block;
  min-width: 50%;
  max-width: 50%;
  background-position: center;
  background-size: cover;
  position: relative;
  height: 100%;
}

#blog div.content {
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

#blog article.link-to-blog {
  background-color: var(--hero-orange);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#blog article.link-to-blog h1 {
  color: var(--text-light);
  font-size: 1.2rem;
  margin: 32px;
}

#blog article p.read-more {
  border-radius: 8px;
  border: 2px solid var(--border);
  padding: 8px;
  font-weight: 600;
  text-transform: uppercase;
  margin: auto 0 0;
  transition: all 0.3s ease;
}

#blog article:hover p.read-more {
  background-color: var(--border);
  color: var(--text-light);
}

/* Form Styles */
form {
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;
}

form label {
  text-align: left;
  font-size: 0.8rem;
}

form input,
form textarea {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

form button {
  background-color: var(--border);
  color: var(--text-light);
  font-family: "Bangers", cursive;
  font-size: 1.2rem;
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid var(--border);
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 300ms ease-in-out;
  cursor: pointer;
}

form button:hover {
  background-color: var(--hero-blue);
  animation: bounceButton 1s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* Footer */
footer {
  position: relative;
  bottom: 0;
  padding: 16px;
  margin-top: 12px;
  text-align: center;
  color: var(--text-light);
  background-color: var(--hero-orange);
  border-top: 3px solid var(--border);
  background-image: url("images/header-bg.png");
  background-position: bottom;
  background-size: cover;
  background-repeat: no-repeat;
}

footer a {
  margin: 0 8px;
  color: var(--text-light);
  text-decoration: none;
}

footer a:hover {
  color: var(--text-light);
}

.form-message {
  text-align: center;
  padding: 2rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.form-message h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.form-message p {
  margin: 0;
  font-size: 1.1rem;
}

section#contact {
  grid-column: span 8;
}

/* Comic Effects */
.comic-effects {
  display: none;
  position: absolute;
  width: 50%;
  height: 100%;
  pointer-events: none;
  left: 50%;
}

.comic-effects > div {
  position: absolute;
  font-family: "Bangers", cursive;
  text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff,
    2px 2px 0 #fff;
  opacity: 0;
  transform: scale(0.5);
  animation: none; /* Remove default animation */
}

.comic-effects.animate > div {
  animation: comicPop 1s var(--delay) forwards;
}

.pow {
  top: 20%;
  left: 10%;
  font-size: 8rem;
  transform-origin: center;
  rotate: -15deg;
  color: var(--hero-red);
}

.bang {
  top: 60%;
  left: 45%;
  font-size: 8.5rem;
  transform-origin: center;
  rotate: 15deg;
  color: var(--hero-orange);
}

.zoom {
  top: 30%;
  left: 70%;
  font-size: 7rem;
  transform-origin: center;
  rotate: -10deg;
  color: var(--hero-blue);
}

.kapow {
  top: 60%;
  left: 0%;
  font-size: 9rem;
  transform-origin: center;
  rotate: 20deg;
  color: var(--hero-yellow);
}

@keyframes comicPop {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
  }
  20% {
    opacity: 1;
    transform: scale(1.2) rotate(var(--rotation, 0deg));
  }
  40% {
    transform: scale(0.9) rotate(calc(var(--rotation, 0deg) * -0.5));
  }
  60% {
    transform: scale(1.1) rotate(calc(var(--rotation, 0deg) * 0.5));
  }
  80% {
    transform: scale(0.95) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: scale(1) translate(100px, -100px) rotate(0deg);
  }
}

@keyframes bounceText {
  0% {
    transform: scale(1);
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff;
  }
  10% {
    transform: scale(1.1) rotate(2deg);
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.3rem -0.3rem 0 rgba(255, 0, 0, 1),
      0.3rem -0.3rem 0 rgba(255, 255, 0, 1);
  }
  20% {
    transform: scale(1.2) rotate(-2deg);
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.4rem -0.4rem 0 rgba(173, 255, 47, 1),
      0.4rem -0.4rem 0 rgba(128, 0, 128, 1);
  }
  30% {
    transform: scale(0.9) rotate(3deg);
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.2rem -0.2rem 0 rgba(255, 0, 0, 1),
      0.2rem -0.2rem 0 rgba(255, 255, 0, 1);
  }
  40% {
    transform: scale(1.1) rotate(-1deg);
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.35rem -0.35rem 0 rgba(173, 255, 47, 1),
      0.35rem -0.35rem 0 rgba(128, 0, 128, 1);
  }
  50% {
    transform: scale(1) rotate(0);
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.3rem -0.3rem 0 rgba(255, 0, 0, 1),
      0.3rem -0.3rem 0 rgba(255, 255, 0, 1);
  }
  60% {
    transform: scale(1.1) rotate(2deg);
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.4rem -0.4rem 0 rgba(173, 255, 47, 1),
      0.4rem -0.4rem 0 rgba(128, 0, 128, 1);
  }
  70% {
    transform: scale(0.9) rotate(-3deg);
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.2rem -0.2rem 0 rgba(255, 0, 0, 1),
      0.2rem -0.2rem 0 rgba(255, 255, 0, 1);
  }
  80% {
    transform: scale(1.2) rotate(1deg);
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.35rem -0.35rem 0 rgba(173, 255, 47, 1),
      0.35rem -0.35rem 0 rgba(128, 0, 128, 1);
  }
  100% {
    transform: scale(1) rotate(0);
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.3rem -0.3rem 0 rgba(255, 0, 0, 1),
      0.3rem -0.3rem 0 rgba(255, 255, 0, 1);
  }
}

@keyframes bounceButton {
  0% {
    transform: scale(1);
    box-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff;
  }
  10% {
    transform: scale(1.1) rotate(2deg);
    box-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.3rem -0.3rem 0 rgba(255, 0, 0, 1),
      0.3rem -0.3rem 0 rgba(255, 255, 0, 1);
  }
  20% {
    transform: scale(1.2) rotate(-2deg);
    box-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.4rem -0.4rem 0 rgba(173, 255, 47, 1),
      0.4rem -0.4rem 0 rgba(128, 0, 128, 1);
  }
  30% {
    transform: scale(0.9) rotate(3deg);
    box-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.2rem -0.2rem 0 rgba(255, 0, 0, 1),
      0.2rem -0.2rem 0 rgba(255, 255, 0, 1);
  }
  40% {
    transform: scale(1.1) rotate(-1deg);
    box-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.35rem -0.35rem 0 rgba(173, 255, 47, 1),
      0.35rem -0.35rem 0 rgba(128, 0, 128, 1);
  }
  50% {
    transform: scale(1) rotate(0);
    box-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.3rem -0.3rem 0 rgba(255, 0, 0, 1),
      0.3rem -0.3rem 0 rgba(255, 255, 0, 1);
  }
  60% {
    transform: scale(1.1) rotate(2deg);
    box-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.4rem -0.4rem 0 rgba(173, 255, 47, 1),
      0.4rem -0.4rem 0 rgba(128, 0, 128, 1);
  }
  70% {
    transform: scale(0.9) rotate(-3deg);
    box-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.2rem -0.2rem 0 rgba(255, 0, 0, 1),
      0.2rem -0.2rem 0 rgba(255, 255, 0, 1);
  }
  80% {
    transform: scale(1.2) rotate(1deg);
    box-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.35rem -0.35rem 0 rgba(173, 255, 47, 1),
      0.35rem -0.35rem 0 rgba(128, 0, 128, 1);
  }
  100% {
    transform: scale(1) rotate(0);
    box-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
      1px 1px 0 #fff, -0.3rem -0.3rem 0 rgba(255, 0, 0, 1),
      0.3rem -0.3rem 0 rgba(255, 255, 0, 1);
  }
}

/* Media Queries */
/* Small devices (phones, 576px and down) */
@media (max-width: 576px) {
  #blog article {
    min-width: 100%;
  }
}

/* Small devices (phones, 576px and up) */
@media (min-width: 576px) {
  #header {
    max-height: 320px;
  }
  #header-content-buttons {
    display: flex;
  }
  #blog article {
    min-width: 400px;
  }
  nav #logo span {
    font-size: 1.8rem;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  #header {
    max-height: 440px;
  }
  nav button.nav-toggle {
    display: none;
  }
  nav .nav-links {
    display: flex;
  }
  nav .mobile-nav {
    display: none;
  }
  #header-content-buttons {
    flex-direction: row;
    bottom: 5%;
  }
  #header div.book-cover {
    display: block;
  }
  .comic-effects {
    display: block;
  }
  #header a.calltoaction {
    font-size: 2rem;
  }
  section .image {
    display: block;
  }
  nav #logo span {
    font-size: 2rem;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  #header {
    max-height: 640px;
  }
  nav {
    font-size: 2rem;
  }
  nav a,
  nav a:visited,
  nav a:active {
    margin: auto 16px;
  }
  nav #logo span {
    font-size: 2.5rem;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  section .image {
    position: relative;
    height: unset;
    width: unset;
  }
  section .image.bg {
    background-size: contain;
  }
  nav {
    overflow: hidden;
  }
}
