/* VARIABLES */
:root {
  --primary-color: #008d3d;
  --secondary-color: #f90;
  --highlight-color: var(--secondary-color);
  --highlighted-text-color: white;
  --text-color: black;
  --text-color-secondary: #999;
  --ornament-color: #eee;
  --bg-color: #fff;
  --inline-code-color: #f44;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #fff;
    --ornament-color: #666;
    --bg-color: #222;
  }

  .light-mode {
    --text-color: black;
    --ornament-color: #eee;
    --bg-color: #fff;
  }
}

.dark-mode {
  --text-color: #fff;
  --ornament-color: #444;
  --bg-color: #222;
}

/* Gradients */
.blue-grad {
  --primary-color: hsl(210deg, 90%, 80%, 1);
  --secondary-color: hsl(212deg, 93%, 49%, 1);
  --highlight-color: var(--secondary-color);
}

.green-yellow-grad {
  --primary-color: #008d3d;
  --secondary-color: #ffd747;
  --highlight-color: var(--secondary-color);
}

.lime-grad {
  --primary-color: #6eee87;
  --secondary-color: #59d102;
  --highlight-color: var(--secondary-color);
}

.green-grad {
  --primary-color: #12511c;
  --secondary-color: #478151;
  --highlight-color: var(--secondary-color);
}



/**************** Root Element ****************/
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0;
  font: 1em/1.5em "Open Sans", sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  overflow-x: hidden;
}

.container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 90%;
  max-width: 800px;
  min-height: 100vh;
}



/******************* Shared *******************/

/* Links */
a {
  position: relative;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease, font-size 0.2s ease, background-size 0.2s ease;
}

/* Text Links */
a:not(.icon-link) {
  padding: 0 2px;
  background-image: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  background-position: 0% 100%;
  background-size: 100% 0.9px;
  background-repeat: no-repeat;
}

a:not(.icon-link):hover {
  color: var(--highlighted-text-color);
  background-size: 100% 100%;
}

/* Highlight Color */
::selection {
  color: var(--highlighted-text-color);
  background-color: var(--highlight-color);
}

/* Headings */
h1 {
  line-height: 1em;
}

h2, h3 {
  padding-top: 1em;
}

.flex-spacer {
  flex-grow: 1;
}

.observable-link {
  margin-top: 0.5em;
  font-size: 0.9em;
}


/******************* Header *******************/
header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 4rem;
  gap: 1em;
  padding: 0 1em;
  container-type: size;
  background-color: var(--bg-color);
  transition: background-color 0.2s ease;
}

.header__logo {
  width: 2em;
  height: 2em;
}

.header__actions {
  display: flex;
  gap: 1em;
}

.header__links {
  display: flex;
  gap: 1em;
}

header .icon-link {
  width: 1.5em;
  height: 1.5em;
}

header .icon-link:has(.header__logo) {
  width: 2em;
  height: 2em;
}

header .icon-link svg {
  width: 1.5em;
  height: 1.5em;
}
  
header .icon-link svg stop {
  transition: stop-color 0.2s ease;
}

header .icon-link:hover svg .gradient-start { 
  stop-color: var(--primary-color);
}

header .icon-link:hover svg .gradient-end { 
  stop-color: var(--secondary-color);
}

#menu-toggle {
  display: none;
}

#dark-mode-toggle #moon {
  display: none;
}

.dark-mode #dark-mode-toggle #sun {
  display: none;
}

.dark-mode #dark-mode-toggle #moon {
  display: inline;
}

.header__languages {
  position: absolute;
  top: 4rem;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(100% - 2em);
  height: 0;
  padding: 0 1em;
  background-color: var(--bg-color);
  transition: height 0.9s ease, padding 0.9s ease, background-color 0.2s ease;
  overflow: hidden;
  gap: 1em;
}

/* stylelint-disable no-descending-specificity */
.header__languages a {
  font-size: 0;
  transition: opacity 0.5s ease, color 0.2s ease, background-size 0.2s ease, font-size 0.3s ease;
  opacity: 0;
}

.header__languages--open {
  position: absolute;
  height: auto;
  padding: 1em;
  border-bottom: 2px solid var(--ornament-color);
}

.header__languages--open a {
  font-size: 1em;
  opacity: 1;
}
/* stylelint-enable no-descending-specificity */

/* Mobile Styles */
@media screen and (width <= 576px) {
  #menu-toggle {
    display: block;
  }

  .header__links {
    position: absolute;
    top: 4rem;
    right: 0;
    flex-direction: column;
    align-items: center;
    width: calc(100% - 2em);
    height: 0;
    padding: 0 1em;
    background-color: var(--bg-color);
    transition: height 0.3s ease, padding 0.3s ease, background-color 0.2s ease;
    overflow: hidden;
    gap: 1em;
  }

  .header__links a {
    font-size: 0;
    transition: opacity 0.5s ease, color 0.2s ease, background-size 0.2s ease, font-size 0.3s ease;
    opacity: 0;
  }

  .header__links--open {
    position: absolute;
    height: auto;
    padding: 1em;
    border-bottom: 2px solid var(--ornament-color);
  }

  .header__links--open a {
    font-size: 1em;
    opacity: 1;
  }
}


/* TODO: Go throught this section and maybe move into own css file */

/**************** Intro Content ****************/
.intro {
  /* height: 90vh; */
  display: flex;
  flex-direction: row-reverse;
  gap: 10vw;
  justify-content: center;
  align-items: center;
  line-height: 1.5em;
}

.peter__canvas {
  width: 20vw;
  height: 20vw;
  background-color: #e8c547;
  cursor: pointer;
}

.intro__headshot {
  display: block;
  width: 10rem;
  height: 10rem;
  border-radius: 10em;
}

.intro__text {
  padding: 1em;
}

.intro__greeting {
  margin-bottom: 0;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-color-secondary);
}

.intro__name {
  margin-top: 0.15em;
  margin-bottom: 0.15em;
  font-family: Raleway, sans-serif;
  font-size: 4rem;
  line-height: 0.8;
}

.intro__title {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-color-secondary);
  font-style: italic;
}

.intro__links {
  display: flex;
  justify-content: left;
  flex-flow: row wrap;
  gap: 1em;
  list-style: none;
  padding: 0;

  li {
    height: 2em;
  }

  svg {
    width: 2em;
    height: 2em;
  }

  a {
    position: relative;
    display: block;
    width: 32px;
    color: var(--text-color-secondary);

    svg stop {
      transition: stop-color 0.2s ease;
    }
  }

  a::before {
    width: 1em;
    height: 1em;
    color: var(--text-color-secondary);
  }



  a:hover {
    text-decoration: none;
  
    svg {
      .gradient-start { 
        stop-color: var(--primary-color);
      }

      .gradient-end { 
        stop-color: var(--secondary-color);
      }
    }
  }
}


@media screen and (width <= 660px) {
  .intro {
    flex-direction: column;
  }

  .intro__text {
    padding: 1em;
    text-align: center;
  }

  .intro__links {
    justify-content: center;
    padding: 0 4em;
  }
}



/**************** Shared Section ****************/
.section {
  display: flex;
  flex-direction: column;
  justify-content: center;

  /* min-height: calc(100vh - 2em); */

  /* min-height: 50vh; */
  max-width: 768px;
  margin-bottom: 4em;

  /* align-items: center; */
  padding: 1em;
}

.section__sub-title {
  margin-top: 0;
  margin-bottom: 0.5em;
}

.section__item {
  margin-bottom: 1em;
  padding-left: 1em;
  border-left: var(--ornament-color) 2px solid;

  /* display: flex;
  flex-direction: row;
  gap: 0.5em; */

  h4 {
    margin: 0;
    margin-right: 4px;
    font-weight: 500;
  }
}

.section__item:hover {
  /* background-color: #8882; */

  /* outline: black 1px solid; */
}

.section__item-head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;

  /* flex-wrap: wrap; */
}

.section__item-period {
  margin-top: 0.2em;
  margin-bottom: 0;
  font-size: 0.9em;
  font-weight: 600;
  opacity: 0.5;
  text-wrap: nowrap;

  /* text-align: right; */
}

.section__item-content {
  display: flex;
  flex-direction: row;
  padding-top: 0.5em;

  /* gap: 0.5em; */

  > a {
    background-image: none;
  }
}

.section__item-image {
  flex-grow: 0;
  width: auto;
  height: 150px;
  margin-right: 1em;
  margin-bottom: 0.5em;
  border: 1px solid var(--ornament-color);
  border-radius: 4px;
}

@media screen and (width <= 550px) {
  .section__item-content {
    flex-direction: column;
    align-items: center;
  }
}

.section__item-image--dark {
  display: none;
}

.dark-mode .section__item-image--dark {
  display: block;
}

.dark-mode .section__item-image--light {
  display: none;
}

.section__item-description {
  margin-top: 0;
  font-size: 0.85em;
}

.section__item-pills {
  display: flex;
  text-wrap: nowrap;
  gap: 4px;
  flex-wrap: wrap;
}

.skill-pill {
  padding: 2px 8px;
  border-radius: 2em;
  font-size: .8em;
  background-color: var(--ornament-color);
  cursor: default;
}



/**************** Footer ****************/
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2em;
  padding-bottom: 1em;
}

footer p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5em;
  opacity: 0.5;
}



/* Code Highlights */
pre:has(code) {
  padding: 8px;
  border-radius: 8px;
  overflow-y: auto;
}

pre code {
  display: block;
  min-width: fit-content;

  span {
    line-height: 1.5em;
  }
}

p > code {
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 1.1em;
  color: var(--inline-code-color);
  background-color: var(--ornament-color);
}

p > a > code {
  font-size: 1.1em;
}