/******************** @UNUSED IMPORTS ********************/
/*Saira Stencil One by Hector Gatti, Omnibus-Type*/
/* @import url('https://fonts.googleapis.com/css2?family=Saira+Stencil+One&display=swap'); */

/*Orbitron by Matt McInerney*/
/* @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400..900&display=swap'); */

/*Kode Mono by Isa Ozler */
/*@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:wght@400..700&display=swap');*/

/******************** @VARIABLES ********************/
:root {
    --mainColour: #bbb; /*Text color, etc.*/
    --mainColourLightTheme: #111;
    --panelColour: #222;
    --clipSize: 24px;
    --linkColour: #00ffd5;
    --linkColourLightTheme: #1100ff;
    --activeLinkColour: #5404bd;
    --activeLinkColourLightTheme: #ae00ff;
    --mainPadding: 1.5em;
    --paragraphPadding: 1em;
    --smallPadding: .8em;

    --panelShadow: drop-shadow(5px 8px 6px rgba(0, 204, 255, 0.5));
    --panelShadowHighlighted: drop-shadow(5px 8px 6px rgba(0, 204, 255, 1));
    --panelGradient: radial-gradient(#333, #111);
    --panelGradientHighlighted: radial-gradient(#555, #333);

    --panelShadowLightTheme: drop-shadow(5px 8px 6px rgba(22, 0, 255, 0.7));
    --panelShadowHighlightedLightTheme: drop-shadow(5px 8px 10px rgb(0, 68, 255));
    --panelGradientLightTheme: radial-gradient(#aaa, #ccc);
    --panelGradientLightThemeHighlighted: radial-gradient(#ddd, #fff);
}

/******************** @RESET ********************/
html, body, div, span, p,
h1, h2, h3, h4, h5, h6, a, img, section, form, fieldset,
legend, label, input, textarea, select, option, button,
nav, ul, ol, li, table {
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  line-height: baseline;
  box-sizing: border-box;
  white-space: 0;
}

p + p {
  margin-top: var(--paragraphPadding);
}

a {
  text-decoration: none;
  color: #000000;
}

img, figure {
  display: block;
  max-width: 100%;
}

a img {
  border: none;
}

html {
  font-size: 62.5%;
}

body {
  font: 1.6rem Helvetica;
}

button:hover {
  cursor: pointer;
}

/******************** @BASICS ********************/
html, body {
    height: 100%;
}

body {
    background: url('../imgs/bg-img.gif');
    background-repeat: repeat;
    color: var(--mainColour);
    font-family: monospace;
    overflow-x: hidden; /*So we can use transform: Translate on the splash page*/
}

#site-wrapper { 
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100%;

    animation-name: background-shader;
    animation-duration: 4s;
    animation-direction: alternate;
    animation-iteration-count: infinite;
}

#site-wrapper-inner {
  background-size: 8em 8em;
  background-image:
    linear-gradient(to right, transparent calc(100% - 2px), rgba(66, 66, 66, 0.5) 2px),
    linear-gradient(to bottom, transparent calc(100% - 2px), rgba(66, 66, 66, 0.5) 2px);
  min-height: 100%;
}

a {
  color: var(--linkColour);
  font-style: italic;
  transition: color .25s;
}

a:hover, a:active {
  color: var(--activeLinkColour);
}

::-moz-selection { /* Code for Firefox */
  color: #000000;
  background: var(--linkColour);
}

::selection {
  color: #000000;
  background: var(--linkColour);
}

/******************** @COMPONENTS ********************/
.clip-path {
  clip-path: polygon(0 var(--clipSize), var(--clipSize) 0, 100% 0,
  100% calc(100% - var(--clipSize)), calc(100% - var(--clipSize)) 100%, 0 100%);
}

/******************** @SPLASH PAGE ********************/
#splash-page {
  height: 100vh;
  text-align: center;
  font-optical-sizing: auto;
  display: grid;
  grid-template-rows: auto 1fr;
}

#splash-page-nav {
  padding: var(--smallPadding)  var(--mainPadding);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

#splash-page-nav .nav-divider {
  margin: auto;
}

/*Nav Light Mode Buttons*/
#splash-page-nav button {
  background-color: transparent;
  color: var(--mainColour);
  font-family: monospace;
  font-size: 1em;
  position: relative;
}

#dark-mode-button, #light-mode-button {
  margin-right: var(--mainPadding);
}

#splash-page-nav button:hover, #splash-page-nav button.active {
  color: var(#ddd);
  font-weight: bold;
}

#splash-page-nav button::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 5px;
  display: block;
  width: 10px;
  height: 10px;
  border: 1px solid var(--mainColour);
}

#splash-page-nav button.active::before {
  background-color: var(--mainColour);
}

#splash-page-content {
  display: grid;
  grid-template-rows: 1fr auto;
}

#splash-page h1 {
  font-family: "Saira Stencil One", sans-serif;
  font-size: 4em;
  font-style: italic;
}

#splash-page h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 2em;
}

#splash-page-top {
  display: flex;
  justify-content: center;
  align-items: center;
}

#splash-page-bottom {
  padding-bottom: 1.2em;
}

#splash-page-bottom span {
  user-select: none;
  font-size: .75em;
  border: solid 1px #ffffff;
  padding: .4em var(--smallPadding);
  border-radius: var(--smallPadding);
  opacity: .75;
  transition: all 1s;
}

#splash-page-bottom span.hidden {
  opacity: 0;
}

/******************** @ABOUT SECTION ********************/
#about-section {
  display: flex;
  align-items: center;
  min-height: 100vh;
}

#about-section-panel {
  width: 100%;
  min-height: 60%;

  background-image: var(--panelGradient);
  border-top: solid 1px var(--mainColour);
  border-bottom: solid 1px var(--mainColour);
}

#about-section-content {
  margin: auto;
  max-width: 1300px;
}

#about-section-title {
  display: block;
  text-align: center;
  font-family: "Orbitron", sans-serif;
  font-size: 1.2em;
  line-height: 3em;
}

#about-section-links {
  display: flex;
  justify-content: center;
  padding: .4em 0;
}

#about-section-links a {
  padding: 0 var(--smallPadding);
}

#about-section-info {
  padding: var(--smallPadding);
  padding-top: 0;
  text-align: center;
  font-family: monospace;
}

/******************** @PROJECT SECTION ********************/
#projects-section {
  padding: var(--mainPadding);
  max-width: 90em;
  margin: auto;
}

.projects-section-header-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/*Based on: https://css-tricks.com/using-box-shadows-and-clip-path-together*/
.projects-section-header {
  filter: var(--panelShadow);
  width: 100%;
  opacity: 1;
  transform: translate(0, 0);
  transition: all 1s;
}

.projects-section-header.hidden {
  width: 0;
  opacity: 0;
  font-size: 0;
  transform: translate(0, 8em);
}

.projects-section-header-inner {
  width: 100%;
  text-align: center;
  background-size: 100% 150%;
  background-image: var(--panelGradient);
}

.projects-section-header-inner h1 {
  font-size: 2em;
  font-family: "Orbitron", sans-serif;
  line-height: 1.8em;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

/******************** @PORTFOLIO STYLES ********************/
.portfolio {
  filter: var(--panelShadow);
  opacity: 1;
  transform: translate(0, 0);
  transition: .5s;
}

.portfolio.hidden {
  opacity: 0;
  transform: translate(0, 8em);
}

.portfolio-inner {
  margin-top: var(--mainPadding);
  background-image: var(--panelGradient);
}

.portfolio-image {
  width: 100%;
  height: 224px;
  background-size: 100% 100%;
  background-position: center;
  transition: all .5s;
}

.portfolio-image:hover {
  opacity: 0.75;
  background-size: 120% 120%;
  cursor: pointer;
}

.portfolio-content {
  padding: var(--smallPadding);
}

.portfolio-title {
  text-align: center;
  font-family: "Kode Mono", monospace;
}

.portfolio-links {
  display: flex;
  justify-content: space-evenly;
  margin: var(--smallPadding);
  font-weight: bold;
}

/*Set compressed styles*/
.portfolio-content-inner.compressed {
  max-height: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 6px 4px 0 rgba(40, 40, 40, 0.8);
  cursor: pointer;
}

.portfolio-content-inner {
  transition: max-height 1s;
  max-height: 9999px; /*Magic number*/
  overflow: hidden; /*To hide scroll bar wheb expanding*/
  box-shadow: none;
  cursor: text;
}

/*Special Styles*/
.portfolio-image-wrapper.rain-blog {
  background-color: rgb(0, 102, 102);
}

.portfolio-image.rain-blog {
  background-image: url('../imgs/rainblogsite-preview.jpg');
}

.portfolio-image-wrapper.harrys-hardware {
  background-image: linear-gradient(140deg, #ddff00 25%, #000 25%, #000 50%, #ddff00 50%, #ddff00 75%, #000 75%, #000 100%);
  background-size: 62.23px 52.22px;
}

.portfolio-image.harrys-hardware {
  background-image: url('../imgs/hardwaresite-preview.jpg');
}

.portfolio-image-wrapper.pathfinding-visualizer {
  background-color: #00ff55;
}

.portfolio-image.pathfinding-visualizer {
  background-image: url('../imgs/pathfinding-preview.jpg');
}

.portfolio-image-wrapper.cyber-form {
  background-color: #073800;
}

.portfolio-image.cyber-form {
  background-image: url('../imgs/cyberform-preview.jpg');
}

.portfolio-image-wrapper.simple-styles {
  background-color: #920000;
}

.portfolio-image.simple-styles {
  background-image: url('../imgs/simplestyles-preview.jpg');
}

/******************** @FOOTER ********************/
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--smallPadding);
  font-family: monospace;
  font-size: var(--smallPadding);
  font-style: italic;
}

/******************** @SCROLL BUTTON ********************/
#scroll-button {
  display: flex;
  align-items: center;
  justify-content: center;
  
  width: 48px;
  height: 48px;
  background: var(--panelGradient);
  border: solid 1px #000;
  
  position: fixed;
  bottom: 12px;
  right: 12px;
  
  opacity: 0;
  transition-property: background-color, opacity;
  transition-duration: .5s;
}

#scroll-button.active {
  opacity: 1;
}

#scroll-button.active:hover, #scroll-button.active:active {
  background: var(--panelGradientHighlighted);
  cursor: pointer;
}

#scroll-button > div {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #000000;
}

/******************** @MODEL ********************/
#model {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9000 !important;
  display: none;
}

#model.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

#model-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80%;
  height: 80%;
  filter: var(--panelShadow);
}

#model-image {
  width: 100%;
  height: 100%;
  clip-path: polygon(0 calc(var(--clipSize) * 1.5), calc(var(--clipSize) * 1.5) 0, 100% 0,
  100% calc(100% - calc(var(--clipSize) * 1.5)), calc(100% - calc(var(--clipSize) * 1.5)) 100%, 0 100%);
}

/******************** @LIGHT THEME ********************/
body.light-theme {
  color: var(--mainColourLightTheme);
}

body.light-theme #site-wrapper { 
  animation-name: background-shader-light;
}

body.light-theme a {
  color: var(--linkColourLightTheme);
}

body.light-theme a:hover, body.light-theme a:active {
  color: var(--activeLinkColourLightTheme);
}

/*Splash Page And About Page*/
body.light-theme #splash-page-nav button::before {
  border: 1px solid #000;
}

body.light-theme #splash-page-nav button.active::before {
  background-color: #000;
}

body.light-theme #about-section-panel {
  background-image: var(--panelGradientLightThemeHighlighted);
  border-top: solid 1px #000000;
  border-bottom: solid 1px #000000;
}

/*Projects and Portfolios*/
body.light-theme .projects-section-header-inner {
  background-image: var(--panelGradientLightThemeHighlighted);
}

body.light-theme #splash-page-nav button {
  color: var(--mainColourLightTheme);
}

body.light-theme #splash-page-bottom span {
  border: solid 1px #000000;
}

body.light-theme .portfolio, body.light-theme .projects-section-header {
  filter: var(--panelShadowLightTheme);
}

body.light-theme .portfolio-inner {
  margin-top: var(--mainPadding);
  background-image: var(--panelGradientLightTheme);
}

/*Scroll Button and Model*/
body.light-theme #scroll-button {
  background: var(--panelGradientLightTheme);
}

body.light-theme #scroll-button.active:hover, body.light-theme #scroll-button.active:active {
  background: var(--panelGradientLightThemeHighlighted);
}

body.light-theme #model-inner {
  filter: var(--panelShadowLightTheme);
}

/******************** @MIXED THEME ********************/
body.mixed-theme {
  color: var(--mainColour);
}

body.mixed-theme #splash-page-nav a {
  color: var(--linkColour);
}

body.mixed-theme #splash-page-nav a:hover {
  color: var(--activeLinkColour);
}

body.mixed-theme #site-wrapper { 
  animation-name: background-shader;
}

body.mixed-theme #about-section-panel {
  color: var(--mainColourLightTheme);
}

body.mixed-theme .projects-section-header {
  color: var(--mainColourLightTheme);
}

body.mixed-theme .portfolio {
  color: var(--mainColourLightTheme);
}

body.mixed-theme .portfolio, body.mixed-theme .projects-section-header {
  filter: var(--panelShadow);
}

body.mixed-theme #model-inner {
  filter: var(--panelShadow);
}

body.mixed-theme #splash-page-nav button {
  color: var(--mainColour);
}

body.mixed-theme #splash-page-nav button::before {
  border: 1px solid var(--mainColour);
}

body.mixed-theme #splash-page-nav button.active::before {
  background-color: var(--mainColour);
}

/******************** @MEDIA QUERIES ********************/
@media only screen and (min-width: 600px) {
  #splash-page-nav .nav-divider {
    margin: 0;
  }

  .projects-contents {
    display: grid;
    grid-template-columns: repeat(2, 50%);
    grid-template-rows: repeat(auto);
    margin: auto;
  }

  .portfolio {
    padding: var(--smallPadding);
  }

  .portfolio-inner {
    height: 100%;
  }

   /*portfolio pieces - Over 'compressed' styles*/
   .portfolio-content-inner, .portfolio-content-inner.compressed {
    transition: max-height 1s;
    max-height: 9999px; /*Magic number*/
    overflow: auto;
    box-shadow: none;
    cursor: text;
  }

  /*Hover styles for portfolios, now that they are laid out together horizontally*/
  .portfolio:hover {
    filter: var(--panelShadowHighlighted);
    transform: translate(0, -1em);
  }

  .portfolio:hover .portfolio-inner {
    background-image: var(--panelGradientHighlighted); /*Can't transition background image?*/
  }

  /*Light theme*/
  body.light-theme .portfolio:hover {
    filter: var(--panelShadowHighlightedLightTheme);
  }

  body.light-theme .portfolio:hover .portfolio-inner {
    background-image: var(--panelGradientLightThemeHighlighted);
  }

  /*Mixed theme*/
  body.mixed-theme .portfolio:hover {
    filter: var(--panelShadowHighlighted);
  }
}

@media only screen and (min-width: 1200px) {
  .projects-contents {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(auto);
    margin: auto;
  }
}

/******************** @ANIMATIONS ********************/
@keyframes background-shader {
    from {
        background-color: rgba(0, 0, 0, 0);
    }
    to {
        background-color: rgba(0, 0, 0, .8);
    }
}

@keyframes background-shader-light {
  from {
      background-color: rgba(228, 228, 228, .5);
  }
  to {
      background-color: rgba(228, 228, 228, 1);
  }
}