/* Typographic scale based on rems, and the 'Perfect Fifth', 0.667, 1, 1.5, 2.25, 3.375 see: https://type-scale.com/. 4 sizes per interval, i.e. 1, 1.125, 1.25, 1.375 */

:root {
  --base-line-rhythm: 1.375;
  --base-font-size: 1.125;
  --base-type-ratio: 1.5;
  --border: solid 0.125rem rgb(180, 180, 180);
  --border-input: solid 0.0625rem #b4b4b4;
  --border-radius: 0.375rem;
  --shadow-one: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.12), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.24);
  --shadow-two: 0 0.875rem 1.75rem rgba(0, 0, 0, 0.25), 0 0.625rem 0.625rem rgba(0, 0, 0, 0.22);
  --black: #000;
  --deep-teal: rgb(20,80,114);
  --gray-lightest: #EFEFEF;
  /* compliment to teal */
  --red: #b20054;
  --teal: #2ba1bd;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/common-content/styles/fonts/IBMPlexSans-Light-Latin1.woff2")
      format("woff2"),
    url("/common-content/styles/fonts/IBMPlexSans-Light-Latin1.woff")
      format("woff");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/common-content/styles/fonts/IBMPlexMono-Medium-Latin1.woff2")
      format("woff2"),
    url("/common-content/styles/fonts/IBMPlexMono-Medium-Latin1.woff")
      format("woff");
  font-weight: 500;
  font-display: swap;
}

/* normalize */
html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

body, h1, dl {
  margin: 0;
}

main {
  display: block;
}

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

a {
  background-color: transparent;
}

b,
strong {
  font-weight: bold; /* rather than 'bolder' */
}
/* end normalize */

html,
body {
  height: 100%;
  margin: 0;
  padding: 0; /* causes scroll bars */
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 300;
  font-size: 1rem;
  font-size: calc(1rem * var(--base-font-size));

  line-height: 1.25; /* 1 rhythm unit */
  line-height: var(--base-line-rhythm);

  display: flex;
  flex-direction: column;
  align-items: center;
  color: #666;

  background-image: linear-gradient(to bottom, transparent 10%, #fff 10%),
    linear-gradient(to right, #999 10%, #fff 10%);
  background-size: 0.625rem 0.625rem, 0.625rem 0.625rem;
  overflow-wrap: normal;
  word-break: break-word;
}

a {
  border-bottom: solid 0.25rem transparent;
  box-sizing: border-box;
  padding: 0.67rem 1rem;
  transition: 0.25s all ease-in-out;
}

a:link {
  color: var(--black);
}

a:visited {
  color: var(--red);
}

a:focus {
  outline: 0.25rem solid var(--teal);
  border-bottom: none;
}

a:hover {
  background-color: var(--black);
  border-bottom-color: var(--teal);
  color: white;
}

a:active {
  color: #fff;
  background-color: var(--black);
  border-bottom: none;
}

button, input[type="submit"] {
  background: var(--black);
  border: var(--border);
  border-color: var(--black);
  border-top-color: #999;
  border-radius: 0.375rem;
  box-shadow: var(--shadow-one);
  color: #FFF;
  cursor: pointer;  
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  line-height: 1.25;
  padding: 0.66rem;
}

button:hover, input[type="submit"]:hover {
  background-color: #333;
}

button:active, input[type="submit"]:active {
  border-top-color: var(--black);
} 

.card_project {
  aspect-ratio: 1;
  border: var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-one);
  box-sizing: border-box;
  color: #666;

  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow: hidden;

  padding: 1rem;
  text-decoration: none;
}

.card_project:last-child {
  margin-bottom: 0;
}

.card_project > p {
  color: #666;
}

.card_project > p:last-child {
  margin-bottom: 0;
}

.card_project:hover,
.card_project:focus {
  box-shadow: var(--shadow-two);
}

.card_project:hover > h3,
.card_project:active > h3,
.card_project:hover > p,
.card_project:active > p {
  color: #fff;
}

.copyright {
  font-size: 0.6667rem;
  font-size: calc(0.667rem * var(--base-font-size));
  margin-bottom: 0;
  padding: 0 1rem 0 0;
}

.error-box {
  background: black;
  color: white;
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  height: calc(1rem * var(--base-font-size));
  margin: 0 calc(0.5rem * var(--base-font-size)) 0 calc(0.125rem * var(--base-font-size));
  padding: calc(0.125rem * var(--base-font-size));
  text-align: center;
  width: calc(1rem * var(--base-font-size));
}

form {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
  border: var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-one);
  overflow: hidden;
  position: relative;
}

.form-input-x {
  left: -100%;
  position: absolute;
  top: 0;
}

h1,
h2,
h3,
label {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  color: var(--black);
}

h1 {
  position: relative;
  z-index: 2;
  box-sizing: border-box;

  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: calc(2.25rem * var(--base-font-size));

  margin-bottom: 2.25rem;
  line-height: 1.125;

  word-spacing: 0.05rem;
  word-break: keep-all;
  padding: 0;
  text-transform: capitalize;
}

.header_bg {
  display: block;
  position: relative;
  z-index: 1;
  background: white;
  padding: 0.667rem 1rem;
}

header > h1::before,
header > h1::after {
  position: absolute;

  content: "";
  height: 3rem;
  width: 3rem;
  z-index: -1;

  background-color: #2ba1bd;
}

header > h1::before {
  top: -0.5rem;
  left: -1rem;
}

header > h1::after {
  bottom: -0.5rem;
  right: -1rem;
}

header,
section {
  margin-top: 0;
  margin-bottom: 1.5rem;
  margin-bottom: calc(var(--base-line-rhythm) * 2.25rem);
}


h2 {
  font-size: calc(1.35rem * var(--base-font-size));
}

hr {
  margin-top: 0;
  border: 0.0625rem solid #b4b4b4;
}


img {
  display: block;
  max-width: 100%;
  height: auto;
}

input, textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: var(--border-input);
  border-radius: 0.375rem;
  box-shadow: 0 0.0625rem 0.0625rem 0.0875rem rgba(0, 0, 0, 0.12) inset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: calc(2.25rem * var(--base-font-size));
  padding: 0.25rem;
  padding-left: 0.667rem;
}

input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible {
  outline: 0.25rem solid var(--teal);
}

input,
label {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

input[type="radio"] {
  appearance: radio;
}

input, small, textarea {
  font-family: inherit;
  font-weight: 300;
  font-size: 0.833rem;
  font-size: calc(var(--base-font-size) * 0.833rem);
  line-height: 1;
  color: #666;
}

input:user-invalid, textarea:user-invalid {
  border-color: var(--red);
}

/* adding 'focus' avoids all invalid fields flagging */
input:user-invalid:focus, textarea:user-invalid:focus {
  background: var(--teal);
  border: dotted 0.125rem var(--black);
  color: #FFF;
}

input:user-invalid:focus::placeholder, textarea:user-invalid:focus::placeholder {
  color: #FFF;
}

input:user-invalid + .user-invalid, textarea:user-invalid + .user-invalid {
  visibility: visible;
}

input[type='submit']{
    margin: calc(0.75rem * var(--base-line-rhythm)) 0 calc(0.5rem * var(--base-line-rhythm));
}

label {
  /* Inputs MAY/not have error messages, so applying maring to label more robust */
  margin-top: 0.5rem;
  margin-top: calc(0.5rem * var(--base-line-rhythm));
}

label > span {
  display: inline-block;
  font-weight: inherit;
  font-size: 0.833rem;
  font-size: calc(var(--base-font-size) * 0.833rem);
  line-height: 1;
  vertical-align: baseline;
  color: #999;
}

li {
  border-bottom: solid 0.125rem #ddd;
  margin-bottom: 2.25rem;
  padding-bottom: 1rem;
  
}

li > a {
  padding: 0.67rem 0;
}

main {
  display: block;
  max-width: 100%;
  margin: 3rem auto;

  flex-grow: 1;

  box-sizing: border-box;
  padding: 2rem 1rem 1.5rem;

  background-color: #ffffff;
}


p {
  margin-top: 0;
  margin-bottom: 1.5rem;
  margin-bottom: calc(var(--base-line-rhythm) * 1rem);
}

.projects {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0;
}

small {
  display: inline-block;
}

table {
  margin: 0 auto 1rem;
  margin-bottom: calc(var(--base-line-rhythm) * 1rem);
}

td,
th {
  line-height: 1.5;
  box-sizing: border-box;
  padding: 0 0.667rem;
}

td:last-of-type,
th:last-of-type {
  width: 60%;
  text-align: right;
}

thead {
  background: #2ba1bd;
  color: #fff;
}

tr:nth-child(even) {
  background: #efefef;
}

.group-text {
  display: block;
  /* Safari issue */
  overflow: hidden;
  line-height: 1.125;
}

.highlight {
  font-weight: 500;

  line-height: 1;

  box-sizing: border-box;
  padding: 0.2rem 0;

  background: #2ba1bd;
  color: white;
}

.mb-added {
  margin-bottom: 2.25rem;
  margin-bottom: calc(var(--base-line-rhythm) * 2.25rem);
}

footer {
  border-top: var(--border);
  background: #f7f7f7;
  box-sizing: border-box;
  padding: 2rem 1rem 1rem;
  text-align: right;
}

.social-icons {
  font-family: "IBM Plex Mono", monospace;
  margin-bottom: calc(var(--base-line-rhythm) * 1rem);
  padding: 0;
}

.social-icons_white-square {
  font-size: 0.6667rem;
  font-size: calc(0.667rem * var(--base-font-size));
  vertical-align: middle;
}

.submit-response {
  background: #FFF;
  display: block;

}


textarea {
  padding-top: 1rem;
  resize: none;
}

ul {
  list-style-type: square;
}
.user-invalid {
  background: var(--gray-lightest);
  color: var(--red);
  font-size: 0.75rem;
  font-size: calc(0.75rem * var(--base-font-size));
  visibility: hidden;
}


@media only screen and (min-width: 20rem) {
  .card_project {
    aspect-ratio: 1;
    width: 20rem;
  }
}

@media only screen and (min-width: 36rem) {
  :root {
    --base-line-rhythm: 1.5;
    --base-font-size: 1.175;
  }

  form {
    max-width: 24rem;
  }

  main {
    padding: 2rem 1rem 0;
    width: 100%;
    max-width: 34.74rem;
    margin: 6rem auto;
  }

  header h1 {
    font-size: 2.76rem;
  }

  td,th {
    min-width: 9rem;
  }

  td:last-of-type,
  th:last-of-type {
    width: 75%;
  }

  header h1,
  .group-text {
    line-height: 1.3;
  }
}

@media only screen and (min-width: 78rem) {

  .card_project {
    margin-bottom: 0;
  }

  #contact_form {
    grid-area: c;
    /* avoid gap at bottom */
    height: fit-content;
  }

  form {
    margin-bottom: 2.25rem;
    max-width: none;
  }

  main.home-page {
    background: none;
    display: grid;
/* 
    grid-template: 1fr / 1fr 1fr 1fr;
    grid-template-areas: "a b c"; */
    grid-template-columns: 40rem 1fr 1fr;
    grid-template: "a c"
    "a c"
    "b c"
    "- -";
    grid-gap: 4rem;
    max-width: 90%;
    margin-bottom: 0;
  }


  #intro, #projects, #contact_form {
    background: #FFF;
    padding: 0 calc(1rem * var(--base-font-size));
  }

  #intro {
    align-self: start;
    grid-area: a;
    max-width: 38rem;
  }

  #projects {
    grid-area: b;
    margin-bottom: 2.25rem;
  }

  .projects {
    flex-direction: row;
    justify-content: space-around;
  }

  header, section {
    margin-bottom: 0;
  }
  hr.mb-added {
    display: none;
  }
}

@media only screen and (min-width: 98rem) {

  .card_project {
    margin-bottom: 2.25rem;
  }

  h1 {
    margin-bottom: 3.375rem;
  }

  .projects {
    flex-direction: column;
    justify-content: space-around;
  }

  main.home-page {
    grid-template: 1fr / 1fr 1fr 1fr;
    grid-template-areas: "a b c";
    max-width: 98rem;
  }
}