/* CSS Document */

/*  ~~~ CSS RESETS ~~~
  Last updated: 6/21/2025

  Sources: 

  https://blog.logrocket.com/what-should-modern-css-boilerplate-look-like/

  https://css-tricks.com/box-sizing/
*/

@charset "UTF-8";

/* Set current and legacy box model type. */
html {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

/* Pseudo elements inherit their parent's box model. */
*,
*:before,
*:after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
}

/* Manage UI affordance differently by removing all border defaults. */
* {
  border: none;
}

/* Clear default browser padding and margin. */
html,
html * {
  padding: 0;
  margin: 0;
}

/* Prevents images from blowing up their containers for absolutely no reason at all. Why? Because containers should contain! */
img,
picture {
  display: block;
  max-width: 100%;
}

/* --- Reset (most) lists ---

Whether you’re using ordered lists (ol), unordered lists (ul), or menus (<menu>), it’s unlikely that you’ll want the list markers (i.e., bullets, numbers, etc.,) that come with them since they look rather unsightly on user interfaces. The following snippet removes them, but not from those used in articles where it makes sense to use them in their natural form: */
menu:not(article menu),
ol:not(article ol),
ul:not(article ul) {
  list-style: none;
}

/* TIP: Add the role="list" attribute-value to all lists that you’d like screen readers to announce as such, because list-style: none; disables this ability in some web browsers. */

/* Remove lists' default padding-left: */
menu,
ol,
ul {
  padding-left: 0;
}

/* Additionally, since list markers appear on the outside of lists, removing the padding using the snippet above can cause the list markers (the ones used in articles that we’re not resetting) to overlap neighboring content or overflow the viewport, so you’ll want to switch them to the inside instead: */
article ol,
article ul {
  list-style-position: inside;
}

/* QUESTION: Could removing the default list padding have been performed using the :not(article *) method? Would the article list markers still need to be positioned inside, or could the list marker position use its default? */

/* 
---------------------------
- ENHANCE LINK UNDERLINES -
--------------------------- */
a {
  /* text-decoration: none;  Uncomment to remove underlines */

  text-underline-position: under; /* Places underlines below the descenders */

  text-decoration-thickness: 8; /* Sets the thickness as a percentage of the font size */
}

/* Remove underline from footnotes */
sub a,
sup a,
.footnote li a {
  text-decoration: none;
}

/* 
Disable the text inflation algorithm */
html {
  -webkit-text-size-adjust: none; /* for iOS Safari */
  text-size-adjust: none; /* for other mobile browsers */
}

/* Instead of instantly snapping to same-page anchors and text fragments, scroll-behavior: smooth; enables users to scroll to them smoothly. Also, to cater to those that prefer reduced motion for accessibility reasons, the rule is wrapped in a prefers-reduced-motion: no-preference media query. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* We set :focus styles globally by modifying how the outline looks. This means that any element that can receive focus, such as <a> and <button> will have a consistent focus style. The outline-offset pulls the outline away from the content a bit, which in my opinion, makes it more user-friendly. */
:focus {
  outline: 1px dotted currentColor;
  outline-offset: 0.2rem;
}

/* REMOVE FOCUS OUTLINE FOR MOUSE USERS but keep it for keyboard users. */
:focus:not(:focus-visible) {
  outline: none;
}

/* ADD POINTER CURSOR to interactive elements that don’t already have an alternative cursor. */
label,
button,
select,
summary,
[type="radio"],
[type="submit"],
[type="checkbox"] {
  cursor: pointer;
}

/*  
~~~~~~~~~~~~~~~~~~~~~
~~~ GLOBAL STYLES ~~~
~~~~~~~~~~~~~~~~~~~~~  */

/*  
~~~~~~~~~~~~~
~~~ Colors ~~
~~~~~~~~~~~~~  */
:root {
  --color-light: #ffffff;
  --color-light-shade: #eeeeee;
  --color-dark: #231f20;
  --color-primary: dodgerblue;
  --color-primary-shade: rgb(24, 103, 182);
  --color-highlight: dodgerblue;
}

/*  
~~~~~~~~~~~~~
~~~ Fonts ~~~
~~~~~~~~~~~~~  */
:root {
  /* If you prefer using rem units (which are better for accessibility), 1rem is equal to 16px (the default root font size). It’s much easier to convert px to rem when 1rem is equal to 10px (font-size: 62.5%), but this can break third-party packages and user browser plugins.
  
  Instead, create a font design system by declaring variables with a memorable naming convention and call those variables (e.g., font-size: var(--font-size-md);). */
  --font-size-xs: 0.5rem;
  --font-size-sm: 0.75rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 1.75rem;
  --font-size-2-5xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3rem;

  /* Project-specific fonts */
  --font-sans: "Roboto", "Segoe UI", "Hind", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-code: "Source Code Pro", monospace;
  --font-serif: "Source Serif 4", "Times New Roman", serif;
  --font-headings: "Space Grotesk", "DinPro", "Din", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~ HTML Semantic Elements ~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

/*  ~~ Set Default Fonts ~~  */
html {
  font-family: var(--font-sans);
}

body {
  font-weight: 400;
}

/*  ~~ Headings ~~  */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-headings);
  color: var(--color-dark);
  margin-bottom: 0.5rem;
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: 300;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: var(--font-size-3xl);
  font-weight: 500;
}

h3 {
  font-size: var(--font-size-2xl);
  font-weight: 500;
}

h4 {
  font-size: var(--font-size-xl);
  font-weight: 500;
}

h5 {
  font-size: var(--font-size-lg);
  font-weight: 400;
}

h6 {
  font-size: var(--font-size-md);
  font-weight: 400;
  text-transform: uppercase;
}

/*  ~~ Paragraphs and Lists ~~  */
p,
ul,
ol {
  font-family: var(--font-body);
  font-size: var(--font-size-md);
  line-height: 1.6;
  margin-bottom: 1em;
}

/*  ~~ List Items ~~  */
li {
  font-family: var(--font-sans);
}

/*  ~~ Code Blocks & Preformatted Text ~~  */
code {
  font-family: var(--font-code);
  background-color: #f7f7f7;
}

code {
  padding: 0;
  padding-top: 0.2em;
  padding-bottom: 0.2em;
  margin: 0;
  font-size: 85%;
  border-radius: 3px;
}

code:before,
code:after {
  letter-spacing: -0.2em;
  content: "\00a0";
}

pre > code {
  padding: 0;
  margin: 0;
  font-size: 100%;
  word-break: normal;
  white-space: pre;
  background: transparent;
  border: 0;
}

pre {
  padding: 1rem;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  border-radius: 3px;
  background-color: #f7f7f7;
  margin-bottom: 1rem;
  word-break: normal;
  word-wrap: normal;
}

pre code {
  display: inline;
  max-width: initial;
  padding: 0;
  margin: 0;
  overflow: initial;
  line-height: inherit;
  word-wrap: normal;
  background-color: transparent;
  border: 0;
}

pre code:before,
pre code:after {
  content: normal;
}

/*  ~~ Horizontal Rule ~~  */
hr {
  border: 0;
  clear: both;
  display: block;
  width: 96%;
  background-color: black;
  height: 2px;
  margin: 1.75em 0;
}

/*  ~~ Hyperlinks ~~  */
a {
  color: currentColor;
  font-weight: 600;
}

a:hover {
  color: var(--color-highlight);
}

header nav a::after {
  content: "";
  width: 100%;
  opacity: 0;
  height: 2px;
  display: block;
  background: currentColor;
}

header nav a:hover::after {
  background-color: var(--color-highlight);
  opacity: 1;
}

/*  ~~ Highlighted and Selected Text ~~  */

mark.highlight {
  color: var(--color-light);
  background-color: var(--color-highlight);
  font-style: normal;
}

::selection {
  color: var(--color-light);
  background-color: var(--color-highlight);
}

mark.highlight::selection {
  background-color: var(--color-dark);
}

/*  ~~ Blockquotes ~~  */

blockquote {
  background: #ddd;
  border-left: 10px solid #aaa;
  margin: 1.5em 0;
  padding: 1em 2em;
  font-style: italic;
  quotes: "\201C""\201D""\2018""\2019";
}

blockquote:before {
  color: #aaa;
  font-family: var(--font-headings);
  font-style: normal;
  content: "\201C";
  font-size: 12rem;
  line-height: 0.1rem;
  margin-right: 0.25em;
  vertical-align: -0.5em;
}

blockquote:before {
  content: "\201C";
}

blockquote p {
  font-family: var(--font-serif);
  font-size: var(--font-size-lg);
}

/*  ~~ Tables ~~  */

table {
  /* display: table; */
  border-collapse: collapse;
  border-spacing: 0;
  margin-bottom: 1rem;
}

td,
th {
  padding: 0;
}

tr,
td {
  border: 0;
}

/*  ~~ PAGE LAYOUT ~~  */

body {
  margin-left: auto;
  margin-right: auto;
  background: var(--color-light-shade);
  color: var(--color-dark);
  height: 100%;
  height: 100svh;
  height: 100dvh;
}

p,
li,
dl {
  max-width: 64ch;

  /* We set a max-width on headings, paragraphs, lists elements and description lists using a ch unit. This really helps with readability and a ch unit is equal to the width of a 0 character in your chosen font and size. */
}

/* Navigation */

nav ul,
nav menu {
  margin: 0;
  padding: 0;
  list-style: none;
  list-style-type: none;
}

nav ul li,
nav menu li {
  font-size: var(--font-size-2xl);
  margin: 0 0.1rem; /* For browsers that do not support gap, we provide a fallback by adding a tiny, 0.1rem margin on all sides of a list item. */
}

/* Images */

img {
  /* width: 100%;
  height: auto; */
  vertical-align: middle;
}

/* ~~~ HEADER, MAIN, & FOOTER Styles ~~~ */

/* HEADER Styles */

.site-header {
  align-items: center;
  justify-content: space-between;
  padding: 1.5em 2em;
  background-color: var(--color-light);
  box-shadow: 0 8px 32px RGBA(0, 0, 0, 0.25);
  gap: 1em;
}

.site-header :focus {
  outline-color: var(--color-dark);
}

header a:nth-child(2) {
  flex-shrink: 1;
  flex-basis: 300px;
  max-width: 260px;
  height: auto;
  font-size: var(--font-size-3xl);
  font-weight: 500;
  text-transform: uppercase;
}

.burger-menu {
  height: 32px;
}

.nav--list {
  display: flex;
  margin: 0;
  padding: 0;
  gap: 1.6rem;
}

.nav--item {
  display: flex;
}

.nav--item a {
  font-weight: 400;
  text-decoration: none;
  font-size: x-large;
}

/* MAIN Styles */

main {
  height: 100%;
  width: 100%;
  padding: 4em 6em;
  overflow: hidden;
}

main:focus {
  outline: none;

  /* We remove focus styles from the <main> element because when someone activates the skip link from before, it programatically focuses the <main> because it’s the :target. The focus ring is unnecessary though, because making the <main> focusable, programatically, is purely for making tabbing on the keyboard more predictable for users who want to skip navigation. */
}

/* Article */
article {
  gap: 2rem;
}

.article--title {
  display: block;
  text-align: left;
  flex-grow: 0;
  flex-shrink: 1;
}

.article--text {
  display: block;
  max-width: 64ch;
  flex-shrink: 1;
  flex-grow: 1;
  flex-basis: 64ch;
  overflow: scroll;
  padding-bottom: 2em;
}

/* Project Description */

.project {
  gap: 2rem;
}

.project-desc {
  display: block;
  max-width: 64ch;
  flex-shrink: 0;
  flex-grow: 1;
  flex-basis: 64ch;
  overflow: scroll;
  padding-bottom: 2em;
}

/* Canvas area for imagery */

.project-canvas {
  display: block;
  min-width: 16rem;
  padding-top: 4rem;
  overflow: scroll;
  /* border: 2px solid salmon; */
}

figcaption {
  font-family: var(--font-serif);
}

.canvas-figure {
  margin-bottom: 3rem;
}

.canvas-figure:last-child {
  margin-bottom: 0;
}

.canvas-image {
  margin-bottom: 1rem;
}

.canvas-figure img {
  flex-shrink: 0;
  /* min-width: 100%;
  min-height: 100%; */
}

/* FOOTER Styles */

footer {
  padding: 1.5em 2em;
  font-weight: 400;
  font-size: var(--font-size-md);
  background-color: var(--color-light);
  box-shadow: 0 -8px 32px RGBA(0, 0, 0, 0.25);
}

.footer--content {
  display: flex;
  flex-grow: 1;
}

.footer--contact {
  display: flex;
  align-items: flex-end;
  flex-direction: row;
  gap: 2rem;
}

.footer--contact a {
  text-decoration: none;
}

#contact-heading {
  font-size: var(--font-size-2xl);
  line-height: 1;
}

.footer--copyright {
  align-self: flex-end;
  text-align: right;
  font-size: small;
}

/* ~~~ CSS UTILITY CLASSES ~~~ */

/* Flow */

/* 
The flow utility provides flow and rhythm automatically between direct sibling elements. Where --flow-space is not defined: the default value is 1em, which equals the font size of the affected element. */
.flow > * + * {
  margin-block-start: var(--flow-space, 1em);
  margin-top: var(--flow-space, 1em);
}

/* Flex Classes */

.flex {
  display: flex;
  /* border: solid 2px red; */
}

.flex--row {
  flex-direction: row;
}

.flex--column {
  flex-direction: column;
}

.flex--nav {
  justify-content: space-between;
}

.flex--wrap {
  flex-wrap: wrap;
}

.flex--space-between {
  justify-content: space-between;
}

.flex--space-around {
  justify-content: space-around;
}

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

.flex--no-grow {
  flex-grow: 0;
}

.flex--start {
  align-items: flex-start;
}

.flex--end {
  align-items: flex-end;
}

/* ~~~ ACCESSIBILITY CLASSES ~~~ */

/* Skip Link */

.skip-link {
  display: inline-block;
  padding: 0.7rem 1rem 0.5rem 1rem;
  background: var(--color-light);
  color: var(--color-primary-shade);
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.skip-link:hover {
  background: var(--color-dark);
  color: var(--color-light-shade);
}

.skip-link:not(:focus) {
  border: 0;
  clip: rect(0 0 0 0);
  height: auto;
  margin: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;

  /* Visually hides the link when it is not focused. Screen readers can still "see" it. */
}

/* ~~~ CSS FLAIR ~~~ */

/* Scroll Mask Fade Out */

.scroll-mask {
  overflow-y: auto;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    black var(--top-mask-size, 0),
    black calc(100% - var(--bottom-mask-size, 0)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    black var(--top-mask-size, 0),
    black calc(100% - var(--bottom-mask-size, 0)),
    transparent 100%
  );
  --top-mask-size: 0px;
  --bottom-mask-size: 0px;
}

.scroll-mask.is-top-overflowing {
  --top-mask-size: 48px !important;
}

.scroll-mask.is-bottom-overflowing {
  --bottom-mask-size: 48px !important;
}

/* ~~~ ANIMATIONS ~~~ */

.home .site-header {
  animation: slideInFromTop 1.5s ease-in-out;
}

.home main {
  opacity: 0;
  animation: fadeIn 500ms ease-in 1.5s forwards;
}

.home .site-foot {
  animation: slideInFromBottom 1.5s ease-in-out;
}

a {
  -moz-transition: all 0.2s ease-in;
  -o-transition: all 0.2s ease-in;
  -webkit-transition: all 0.2s ease-in;
  transition: all 0.2s ease-in;
}

header nav a::after {
  -moz-transition: all 0.2s ease-in 0.05s;
  -o-transition: all 0.2s ease-in 0.05s;
  -webkit-transition: all 0.2s ease-in 0.05s;
  transition: all 0.2s ease-in 0.05s;
}

@keyframes slideInFromTop {
  0% {
    -webkit-transform: translateY(-100%);
    -moz-transform: translateY(-100%);
    -o-transform: translateY(-100%);
    -ms-transform: translateY(-100%);
    transform: translateY(-100%);
  }
  100% {
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -o-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
  }
}

@keyframes slideInFromBottom {
  0% {
    -webkit-transform: translateY(100%);
    -moz-transform: translateY(100%);
    -o-transform: translateY(100%);
    -ms-transform: translateY(100%);
    transform: translateY(100%);
  }
  100% {
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -o-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  0% {
    -webkit-transform: translateX(-100%);
    -moz-transform: translateX(-100%);
    -o-transform: translateX(-100%);
    -ms-transform: translateX(-100%);
    transform: translateX(-100%);
  }
  100% {
    -webkit-transform: translateX(-100%);
    -moz-transform: translateX(-100%);
    -o-transform: translateX(-100%);
    -ms-transform: translateX(-100%);
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* ~~~ MEDIA QUERIES ~~~ */

/* LARGE Screens */

@media (min-width: 1390px) {
  .hero__text {
    font-size: 2.4rem;
  }

  .hero__btn {
    font-size: 2.4rem;
  }

  .article--title {
    width: 8ch;

    /* FOR DEBUGGING */
    /* border: solid 2px red; */
  }

  /* 
  FOR DEBUGGING */
  /* section {
    border: solid 2px brown;
  } */

  .sidebar {
    flex-direction: column;
  }

  .description > .row {
    display: flex;
    justify-content: space-between;
  }

  .row > .row {
    display: block;
  }

  .sidebar {
    margin-left: 4em;
    width: 40%;
  }

  .sidebar__section.col + .sidebar__section.col {
    margin-top: 2em;
    margin-left: 0;
  }
}

/* MEDIUM Screens */

@media (width < 1390px) {
  body {
    height: 100%;
  }

  main {
    flex-direction: column;
  }

  #main-content {
    padding: 4rem 2rem;
  }

  article {
    flex-direction: column;
    gap: 0;
    max-width: 64ch;
    align-self: center;
  }

  .project {
    flex-wrap: wrap;
  }

  .project-desc {
    width: 100%;
    /* align-items: flex-start; */
    margin-right: 0;
    padding-bottom: 0;
    flex-shrink: 1;
    overflow: visible; /* This is only temporary to ensure description will not be hidden on smaller screens. Currently, it breaks the description heading by masking it. There needs to be javascript that removes the .scroll-mask class to match the media query. */
  }

  .project-canvas {
    flex-grow: 0;
    padding-top: 0;
  }
}

@media (min-width: 900px) {
  /* Flex */
  .row {
    display: flex;
    justify-content: space-between;
  }

  .description > .row {
    display: block;
  }

  .col {
    width: 100%;
  }

  .col + .col {
    margin-left: 2em;
  }
}

@media (width < 900px) {
  .container-main {
    flex-direction: column;
  }

  footer,
  footer > * {
    flex-direction: column;
  }

  .footer--content {
    flex-grow: 1;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .footer--contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .footer--copyright {
    text-align: left;
    align-self: flex-start;
  }
}
