/* Welcome to the Sitewide Stylesheet for saltedslug.net       *
* Please note this sheet only applies to what you see outside the frame *
* Authored by Salty P. Slug using VSCodium from 2024 A.D.- FOREVER *
* Free to use, destroy, tear apart, and use as you like. */

/* Normalizations */
/* Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

/* --------------------- *
* Import/Declare Font(s) *
* ---------------------- */
@font-face {
  font-family: "sh-pinscher";
  src:
    url("/fonts/sh-pinscher.otf") format("opentype"),
    url("/fonts/sh-pinscher.woff") format(".woff"),
    url("/fonts/sh-pinscher.woff2") format(".woff2");
}

@font-face {
  font-family: "nk-airlines";
  src: url("/fonts/north_korea_airlines.otf") format("opentype");
}

/* ---------------- *
*  Global Variables *
* ----------------- */
:root {
  /* Set font details */
  --font: "sh-pinscher", Consolas, Menlo, Monaco, "Ubuntu Mono", monospace;
  --border-radius: 8px;
  --font-size-reg: 1.25rem;
  --font-size-small: 1rem;
  --font-size-xsmall: 0.75rem;

  /* Set all color variables */
  --bg: #373737;
  --bg-accent: #3d3d3d;
  --marked: #ffdc2e;
  --status-critical: #df3b1e;
  --status-critical-shadow: #b63f2a;
  --status-warning: #eca528;
  --status-warning-shadow: #c98f2b;
  --status-good: #c5ea33;
  --status-good-shadow: #89ad12;
}

html {
  font-family: var(--font); /* Set primary font globally */
  font-size: var(--font-size-reg);
  color: var(--text);
  cursor: url("/img/cursor_bio_red.cur"), auto;
}

/* Link formatting */
a {
  color: var(--accent);
  &:hover {
    color: var(--accent-shadow);
  }
}
a:hover,
button:hover,
.float-menu:hover {
  cursor: url("/img/cursor_bio_green.cur"), pointer;
}

/* -------- */
/*  Layout  */
/* -------- */
body {
  -webkit-font-smoothing: antialiased; /* Improve text rendering on macOS browsers */
  width: 100vw;
  height: 100vh;
  background-image: url("/img/ui/bg/bos.png");
  background-size: cover;
  display: flex;
  justify-content: center;
}

/* This container wraps the immediate child elements to keep them from spilling outside of the frame boundaries */
.container {
  width: 1150px;
  height: 700px;
  display: flex;
  align-self: center;
  justify-content: center;
}
.container > main,
.container > nav {
  align-self: center;
  border-radius: var(--border-radius);
  z-index: 0;
  height: inherit;
}

/* This styles the frame overlay. */
img.container--frame {
  image-rendering: optimizeQuality;
  width: 1150px;
  height: 700px;
  position: fixed;
  z-index: 2;
  pointer-events: none;
}

/* This element holds the iframe */
main {
  width: 767px;
  max-height: 620px;
  /* Hide scrollbars */
  overflow: -moz-scrollbars-none;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
  /* Hide scrollbar for Chrome, Safari and Opera */
  &&::-webkit-scrollbar {
    display: none;
  }
  iframe {
    /* Force iframe to fit in parent container */
    height: 100%;
    width: 100%;
  }
}

/* This element holds the navigation buttons */
nav {
  background-color: var(--bg);
  background: linear-gradient(
    180deg,
    var(--bg-accent) 0%,
    var(--bg) 50%,
    rgb(28, 25, 29) 100%
  );
  background-image: url("/img/ui/bg/tech_dither.png");
  background-size: 375px;
  margin-left: 35px;
  width: 250px;
  max-height: 600px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  > div {
    max-width: inherit;
  }
}

/* This next bit is a doozie.. best CSS animation I've ever done, though. */
/* shoutout out "HankTheTank" on YouTube for the code that inspired this nav menu/button setup: https://www.youtube.com/watch?v=EPhN1UKN1Dk  */
.nav-container {
  background: transparent;
  will-change: height;
  max-height: 100%;
  &:hover {
    border-bottom: 5px solid #292922;
  }
}

/* This is the menu that says "hover_nav" */
.float-menu {
  background: linear-gradient(
    180deg,
    #3a233c 0%,
    #5c5075 50%,
    #818fcb 92.5%,
    #392369f5 100%
  );
  color: hsla(341, 100%, 72%, 0.6);
  height: min-content;
  width: inherit;
  text-transform: uppercase;
  text-shadow: -1px 1px 8px #d4406f8a;
  font-size: 1.25rem;
  font-weight: bolder;
  text-align: center;
  padding: 25px 1em 10px 1em;
  line-height: 1.25;
  box-shadow: 2px 0px 35px #29163f;
  will-change: transform;
  transition: ease 250ms;
}

.nav-container:hover .float-menu {
  /* Moves the float menu off screen*/
  box-shadow: 0 0 25px 0 #cccccc32;
  transform: translateY(-5%);
  transition: ease-in 500ms;
  color: hsla(341, 100%, 72%, 0.75);
  text-shadow: -1px 1px 8px #e7668f8a;
}

.element-container {
  /* Hide button container by default */
  display: none;
  will-change: display;
  transition: display 200ms;
}

.nav-container:hover .element-container {
  /* Expand button container on hover */
  display: contents;
  position: absolute;
}

.float-element {
  /* Applied to span elements that hold each float-button */
  width: 82.5%;
  font-size: 1.2rem;
  line-height: 50px;
  margin: 1em auto;
  display: grid;
  place-items: center; /* Everything is slightly off if you forget this! Learned this the hard way :)*/
  z-index: 0;
  opacity: 0;
  background-color: transparent;
}

a.float-button {
  /* Style buttons */
  width: inherit;
  height: 50px;
  z-index: 0;
  text-align: center;
  border-radius: var(--border-radius);
  text-transform: uppercase;
  text-decoration: none;
  transition: ease 150ms;
  opacity: 0.85;
  &.btn-status-good {
    box-shadow: 2px 3px 35px var(--status-good-shadow);
    background: var(--status-good);
    background: linear-gradient(
      180deg,
      var(--status-good) 37.5%,
      var(--status-good-shadow) 100%
    );
    border-color: var(--status-good-shadow);
    color: rgba(0, 100, 0, 0.6);
    text-shadow: -2px 1px 8px var(--status-good-shadow);
  }
  &.btn-status-warn {
    background: darkorange;
    background: linear-gradient(
      180deg,
      var(--marked) 25%,
      var(--status-warning) 75%
    );
    text-shadow: -2px 2px 4px darkorange;
    border-color: var(--marked);
    box-shadow: 0 10px 20px 0px rgba(255, 140, 0, 0.55);
    color: rgba(255, 68, 0, 0.85);
  }
  &.btn-status-crit {
    background: var(--status-critical-shadow);
    background: linear-gradient(
      180deg,
      var(--status-critical) 35%,
      var(--status-critical-shadow) 85%
    );
    text-shadow: -2px 1px 12px red;
    border-color: var(--status-critical-shadow);
    box-shadow: 0 10px 20px 1px rgba(220, 20, 60, 0.6);
    color: rgba(139, 0, 0, 0.75);
  }
}

.float-element .material-icons {
  /* Prevent flashing before icon slide-in animation */
  line-height: 50px;
  opacity: 0;
  transition: ease 50ms;
}

a.float-button:hover {
  animation: phase 2s ease-in-out infinite;
  -webkit-animation: phase 2s ease-in-out infinite;
  -moz-animation: phase 2s ease-in-out infinite;
  transform: scale(0.975);
  transition: ease-in-out 300ms;
}

a.float-button:active {
  opacity: 0.75;
  transform: scale(0.95);
  transition: ease-in 250ms;
}

@keyframes bounce-in {
  0% {
    opacity: 0;
  }
  30% {
    transform: translateX(50px) scale(0.4);
  }
  70% {
    transform: translateX(0px) scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bounce-in-reverse {
  0% {
    opacity: 0;
  }
  30% {
    transform: translateX(-50px) scale(0.4);
  }
  70% {
    transform: translateX(0px) scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.nav-container:hover .element-container .float-element:nth-child(1) {
  animation: bounce-in 0.4s forwards 0.2s;
}
.nav-container:hover .element-container .float-element:nth-child(2) {
  animation: bounce-in 0.4s forwards 0.4s;
}
.nav-container:hover .element-container .float-element:nth-child(3) {
  animation: bounce-in 0.4s forwards 0.6s;
}
.nav-container:hover .element-container .float-element:nth-child(4) {
  animation: bounce-in 0.4s forwards 0.8s;
}
.nav-container:hover .element-container .float-element:nth-child(5) {
  animation: bounce-in 0.4s forwards 1s;
}
.nav-container:hover .element-container .float-element:nth-child(6) {
  animation: bounce-in 0.4s forwards 1.2s;
}
.nav-container:hover
  .element-container
  .float-element:nth-child(1)
  a
  i.material-icons {
  animation: bounce-in-reverse 0.4s forwards 0.4s;
}
.nav-container:hover
  .element-container
  .float-element:nth-child(2)
  a
  i.material-icons {
  animation: bounce-in-reverse 0.4s forwards 0.6s;
}
.nav-container:hover
  .element-container
  .float-element:nth-child(3)
  a
  i.material-icons {
  animation: bounce-in-reverse 0.4s forwards 0.8s;
}
.nav-container:hover
  .element-container
  .float-element:nth-child(4)
  a
  i.material-icons {
  animation: bounce-in-reverse 0.4s forwards 1s;
}
.nav-container:hover
  .element-container
  .float-element:nth-child(5)
  a
  i.material-icons {
  animation: bounce-in-reverse 0.4s forwards 1.2s;
}
.nav-container:hover
  .element-container
  .float-element:nth-child(6)
  a
  i.material-icons {
  animation: bounce-in-reverse 0.4s forwards 1.4s;
}

@keyframes slide-in {
  0% {
    opacity: 0;
  }
  30% {
    transform: translateX(50%) scale(0.4);
  }
  70% {
    transform: translateX(0px) scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.float-hide {
  /* Hide button text by default */
  opacity: 0;
  display: none;
}
.float-button:hover .float-hide {
  /* Reveals the text when hovering over the button */
  display: inline-flex;
  animation: slide-in 0.35s forwards 100ms;
  white-space: nowrap; /* This prevents any overflow text from breaking into the next line */
}
.float-button:hover i.material-icons {
  /* Prevents flashing of icons on hover */
  display: none;
  transition: ease 300ms;
}

/*----------------------- /
/ Stuff not in hover menu /
/ -----------------------*/
/* .nav-btn-wrapper::before {
  content: "";
  background-image: url('/img/ui/overlay_scanlines.png');
  opacity: 0.05;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
} */

.nav-btn-wrapper {
  max-width: 100%;
  max-height: inherit;
  overflow-y: scroll;
  padding: 15px 0 0 0;
  text-align: center;
  margin: 0;
  p {
    font-size: large;
    text-align: center;
    letter-spacing: 1.5px;
    text-align: center;
  }
  p.animEnabled {
    display: none;
  }
  p.animDisabled {
    display: contents;
    color: var(--status-critical);
    text-shadow: -2px 2px 6px var(--status-critical-shadow);
  }
  img {
    max-width: 80%;
  }
}

.nav-btn-wrapper a {
  text-decoration: none;
  width: 100%;
  max-height: 17.5%;
  > img {
    opacity: 0.925;
    max-width: 80%;
    max-height: inherit;
    will-change: transform;
    transition: ease 500ms;
    /* The following code fixes anti-aliasing/sizing snap issues on transforms */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -ms-transform: translateZ(0); /* IE 9 */
    -webkit-transform: translateZ(0); /* Chrome, Safari, Opera */
    transform: translateZ(0);
  }
  &:hover img {
    opacity: 1;
    transition: ease 250ms;
    transform: scale(0.975);
  }
}

.nav-btn-wrapper a:active {
  opacity: 0.9;
  transition: ease-in-out 100ms;
  > img {
    transform: scale(0.925) rotate(-0.5deg);
    transition: ease 150ms;
  }
}

/* ----------------------------------------- *
/* Absolutely-Positioned Items Around Frame *
/ ------------------------------------------ */
img.absolute {
  will-change: transform;
  transition: ease 50ms;
  position: absolute;
  z-index: -5;
  pointer-events: none;
}

img.slug-doll {
  animation-delay: 650ms;
  left: 60;
  bottom: 50;
  height: 350px;
}

img.roach {
  right: 25px;
  bottom: 10px;
  height: 125px;
}

#cbox {
  position: absolute;
  bottom: 25%;
  right: 4%;
  width: 14vw;
  height: 22vh;
  filter: drop-shadow(0 0 0.15rem var(--slugorange-sh));
  -webkit-filter: drop-shadow(0 0 0.15rem var(--slugorange-sh));
}

#cbox-title {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: center;
}

#cbox-title p {
  font-family: "nk-airlines", "Times New Roman", Times, serif;
  line-height: 1;
  margin: 0;
  margin-bottom: -5%;
  filter: sepia(30%);
  -webkit-filter: sepia(30%);
  font-size: 3em;
  animation: glow-text 5.5s ease-in-out infinite;
  -moz-animation: glow-text 5.5s ease-in-out infinite;
  -webkit-animation: glow-text 5.5s ease-in-out infinite;
  color: var(--sluggreen);
  opacity: 0.925;
}

#cbox-title img {
  position: relative;
  margin-left: 0.5em;
  max-width: 32.5%;
  height: auto;
}

iframe.cbox {
  width: 100%;
  height: 100%;
  border-radius: 1%;
  border: ridge 2px #bdb33b;
  background-color: var(--slugblack);
  -ms-overflow-style: none;
  scrollbar-width: none;
  z-index: 1;
  margin: 0;
  padding: 0;
  background-color: #373737;
}

/* ---------------------- *
/ Accessibility & Theming *
/ ----------------------- */
button.btn-toggle {
  font-weight: bolder;
  width: 45px;
  height: 45px;
  z-index: 0;
  will-change: transform;
  transition: transform 1s;
  border: 2px outset var(--status-good-shadow);
  border-radius: var(--border-radius);
}

/* This only applies when animations are toggled off by clicking the button named "toggleAnim" */
button.btn-toggleAnim {
  margin: 6px 0;
  transition: ease 500ms;
  transform: rotate(-6deg) scale(1);
  -webkit-transform: rotate(-6deg) scale(1);
  -moz-transform: rotate(-6deg) scale(1);
  background: var(--status-critical-shadow);
  background: linear-gradient(
    180deg,
    var(--status-critical) 35%,
    var(--status-critical-shadow) 85%
  );
  color: wheat;
  text-shadow: -2px 1px 12px whitesmoke;
  border: outset 2px var(--status-critical-shadow);
  box-shadow: 1px 0px 16px var(--status-critical);
}

button.btn-toggleAnim:hover {
  transform: rotate(-8deg) scale(1.05);
  -webkit-transform: rotate(-8deg) scale(1.05);
  -moz-transform: rotate(-8deg) scale(1.05);
  transition: 350ms ease-in-out;
  color: darkred;
  border-color: var(--status-critical-shadow);
  background: var(--status-critical);
  background: linear-gradient(180deg, var(--status-critical) 30%, darkred 100%);
  text-shadow: -1px 1px 4px var(--status-critical-shadow);
  box-shadow: 1px 0px 15px var(--status-critical-shadow);
}

button.btn-toggleAnim:active {
  transform: rotate(-5deg) scale(0.95);
  -webkit-transform: rotate(-5deg) scale(0.95);
  -moz-transform: rotate(-5deg) scale(0.95);
  transition: ease 250ms;
  box-shadow: 0px 1px 18px var(--status-warning);
  background: var(--status-critical-shadow);
  background: linear-gradient(
    var(--status-warning-shadow) 35%,
    darkorange 100%
  );
  color: var(--status-warning);
  border-color: var(--status-warning);
}

/* Hide flashing images when animations are toggled off */
img.flash {
  display: none;
}

.mobile-show {
  display: none;
}

/* ------------  /
/ Media Queries  / (bans mobile-heads from the cool version of the site)
/ ------------- */
@media only screen and (max-width: 904px) {
  /* Tablets in portrait */
  .mobile-hide {
    display: none;
  }
  .mobile-show {
    display: contents;
  }
}
/* Tablets in landscape 
@media only screen and (max-width: 1239px) {
}
/* Laptops
@media screen and (max-width: 1439px) {
} */

/* Disclaimer Pop-up */
#overlay {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  place-content: center;
}

#overlay > * {
  rotate: -3.5deg;
  display: block;
  margin: auto;
}

img.post-it {
  width: 500px;
}

button.post-it {
  width: 100px;
  transform: translateY(-50px);
}
