/** variables to use: no magic numbers here */
:root {
  --font-size-h1: 2.5rem;
  --font-size-h2: 2rem;
  --font-size-h3: 1.6rem;
  --font-size-big: 1.25rem;

  --spacing-size: 1.5rem;
  --gutter-size: 3rem;
  --corner-rounding: 1.25rem;

  --footer-height: 4.5rem;
  --max-subheading-width: 40rem;
  --home-img-min-width: 250px;
  --home-img-max-width: 28rem;
  --blob-min-width: 17.5rem;
  --blob-min-height: 18rem;

  --card-ratio: 3 / 2;
  --project-card-width: 25rem;
  --project-label-height: 3rem;
  --tag-padding: 0.25rem;
  --tag-rounding: 10px;

  --shape-fill-gradient: linear-gradient(180deg, #fcf4e9 0%, #90c6f0 100%);
  --pale-blue: #90c6f0;
  --pale-peach: #fcf4e9;
  --accent-1: #0163d2;
  --accent-2: #ffe0b6;
  --white-outline: #fff;
}

/** uploading custom font */
@font-face {
  font-family: "KoPub Batang";
  src: url("assets/fonts/kopubbatang-regular.woff2") format("woff2"),
    url("assets/fonts/kopubbatang-regular.woff") format("woff");
}

/** universal styling */
body {
  margin: 0;
  width: 100%;
  padding: var(--spacing-size) 0 var(--footer-height) 0;
  display: grid;
  row-gap: var(--spacing-size);
  font-family: "KoPub Batang", serif;
}
header {
  display: flex;
  flex-direction: column;
  row-gap: var(--spacing-size);
  margin: 0 var(--gutter-size);
}
main {
  margin: var(--spacing-size) var(--gutter-size);
}
h1 {
  margin: 0;
  font-size: var(--font-size-h1);
}
footer {
  height: var(--footer-height);
  padding: 0 var(--gutter-size) 0 var(--gutter-size);
  position: fixed;
  inset: auto 0 0 0;
  background-color: var(--accent-1);
  color: white;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
nav {
  font-size: var(--font-size-big);
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-left: var(--gutter-size);
  padding: 0 var(--gutter-size);
  column-gap: var(--spacing-size);
  position: relative;
  width: fit-content;
  height: 2.5rem;
  border-radius: var(--corner-rounding);
  border-bottom-left-radius: 0;
  background-color: white;
  a {
    align-content: center;
    height: 100%;
    transition: color 0.3s ease;
  }
  a:visited {
    color: black;
  }
  a:hover {
    background-color: var(--accent-2);
  }
}
nav > img {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
}
a[data-current] {
  background-color: var(--accent-2);
}
main img {
  min-width: var(--home-img-min-width);
  max-width: var(--home-img-max-width);
}
.imgfirst-section {
  display: flex;
  justify-content: center;
  align-items: center;
}
.imgfirst-section picture,
.textfirst-section {
  img,
  source {
    height: auto;
    width: 100%;
  }
}

/** media queries for smaller screen sizes */
@media screen and (max-width: 767px) {
  header,
  main,
  footer {
    box-sizing: border-box;
  }
  h2 {
    font-size: var(--font-size-big);
  }
  .imgfirst-section {
    display: flex;
    flex-direction: column;
    row-gap: var(--spacing-size);
  }
  #additional-img {
    display: none;
  }
  #projects-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: var(--spacing-size);
  }
  project-card {
    width: 80%;
  }
}
@media screen and (min-width: 768px) {
  .imgfirst-section {
    display: flex;
    flex-direction: row;
    column-gap: var(--spacing-size);
    h1 {
      width: 100%;
    }
  }
  .textfirst-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    place-items: center;
    gap: var(--spacing-size);
  }
  #projects-main {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: var(--spacing-size);
    row-gap: var(--spacing-size);
    justify-content: center;
    align-items: center;
  }
  project-card {
    width: var(--project-card-width);
  }
}

/** homepage specific styling*/
.imgfirst-section hgroup {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 80%;
  p {
    display: flex;
    max-width: var(--max-subheading-width);
    align-self: flex-start;
  }
}
#landing-main {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: var(--spacing-size);
  a {
    width: 33%;
    min-height: var(--blob-min-height);
    min-width: var(--blob-min-width);
  }
}
/** styling the site map blobs */
.landing-blob {
  text {
    font-size: var(--font-size-h1);
  }
}
.gradient-top {
  stop-color: var(--pale-peach);
}
.gradient-bottom {
  stop-color: var(--pale-blue);
}

/** styling title-picture overlays */
.image-text-header {
  position: relative;
  text-align: center;
  h1 {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff,
      -1px 1px 0 #fff, 1px 1px 0 #fff;
  }
  img,
  source {
    width: 80%;
    height: auto;
  }
}

/** projects page-specific styling */
/** custom component styling */
project-card {
  background-color: gray;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: var(--card-ratio);
  min-width: var(--home-img-min-width);
  a {
    height: var(--project-label-height);
    align-content: center;
    box-sizing: border-box;
    padding: 0 var(--spacing-size);
    background-color: white;
  }
  .projectdisplay {
    padding: var(--spacing-size);
    height: 100%;
    background-position: center;
    background-size: cover;
  }
}
#chat-feature {
  background-image: image-set(
    url(assets/library-with-chat.avif),
    url(assets/library-with-chat.webp),
    url(assets/library-with-chat.png)
  );
}
#endowments {
  background-image: image-set(
    url(assets/endowments-display.avif),
    url(assets/endowments-display.webp),
    url(assets/endowments-display.png)
  );
}
#asteria {
  background-image: image-set(
    url(assets/asteria.avif),
    url(assets/asteria.webp),
    url(assets/asteria.png)
  );
}
subject-tag {
  border-radius: var(--tag-rounding);
  padding: var(--tag-padding);
}
.fullstack {
  background-color: var(--accent-2);
}
.ai {
  background-color: var(--pale-blue);
}

/** fallbacks if browser doesn't support color - trying out 2 of my fave colors in hsl */
.frontend {
  background-color: hsl(16, 100%, 66%);
}
.ui {
  background-color: hsl(300, 26%, 71%);
}
/** experimenting with higher gamut colors */
@supports (color: color(display-p3 1 1 1)) {
  .frontend {
    background-color: color(display-p3 1 0.4 0.1);
  }
  .ui {
    background-color: color(display-p3 0.784 0.635 0.784);
  }
}
