html { line-height: 1.25; -webkit-text-size-adjust: 100% }
* { margin: 0; padding: 0; }

@font-face { font-family: poppins-bold; src: url("../fonts/Poppins-Bold.otf") format("opentype"); }
@font-face { font-family: poppins-semi; src: url("../fonts/Poppins-SemiBold.otf") format("opentype"); }
@font-face { font-family: poppins-reg; src: url("../fonts/Poppins-Regular.otf") format("opentype"); }

:root {
  --site-theme: "light";
  --gutter: 2.4rem;
  --space: .8rem;
  --color-background: rgb(254,254,254);
  --color-primary: rgb(225,225,225);
  --color-secondary: rgb(245,245,245);
  --color-text: #111;
  --color-texthover: #444;
  --color-line: rgb(215,215,215);
  --color-shadow: #ccc;
  --color-link: #0062b7;
  --color-activelink: rgb(205,205,205);;
  --color-darklink: #555;
}

[data-site-theme="dark"] {
    font-weight: 350;
    --color-background: rgb(20,20,20);
    --color-primary: rgb(70,70,70);
    --color-secondary: rgb(38,38,38);
    --color-text: rgb(245,245,245);
    --color-texthover: rgb(220,220,220);
    --color-activelink: #005095;
}

[data-site-theme="dark"] form input { border: none; }
[data-site-theme="dark"] form button,
[data-site-theme="dark"] a.button { background-color: var(--color-link); }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-weight: 400;
  background-color: var(--color-background);
  color: var(--color-text);
  transition: background-color .1s linear;
}

h1 { font-size: 2rem; }
h2 { font-size: 2.4rem; letter-spacing: 2px; font-family: 'poppins-bold','Arial Black', sans-serif; text-transform: uppercase; }
h3 { font-size: 1.6rem; }

.item, .item a, .item figure, .item figcaption, footer, #contact { display: flex; flex-flow: column nowrap; }
footer div, header, nav, nav ul { display: flex; flex-flow: row nowrap; }

header, nav ul { align-items: center; }

header {
  position: sticky;
  width: 100%;
  top: 0;
  margin: 0 auto;
  z-index: 100;
  flex-flow: row wrap;
  justify-content: center;
  background-color: var(--color-background);
  font-family: 'poppins-bold', 'Arial Black', sans-serif;
}

nav {
  padding: var(--space);
  justify-content: center;
  flex: 1;
  font-family: 'poppins-semi', 'Helvetica', system-ui, Roboto, sans-serif;
}

nav a {
  padding: var(--space) 0;
  margin: 0 var(--space);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 18px;
  color: var(--color-text);
  list-style: none;
}

nav a.active { color: var(--color-link); }

.logo { padding: var(--space) var(--gutter); margin-top: var(--space); flex-basis: 100%; text-align: center; }
.logo a { text-decoration: none; }
.logo h1 { text-transform: uppercase; color: var(--color-text); font-size: 22px; }
a:hover h1, a:hover { color: var(--color-texthover); }

main, header, footer { max-width: 1920px; }
main { margin-top: -6rem; }

section {
  margin: 0 auto;
  padding: 9rem var(--gutter) 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-gap: var(--gutter);
}

section h1, section h2, .description { grid-column: 1 / -1; }

.item {
  min-height: 400px;
  margin-bottom: var(--gutter);
  background-color: var(--color-secondary);
  transition: all .1s linear;
  cursor: pointer;
}

.item:hover img { opacity: 1; }
.item:hover figcaption span { background-color: var(--color-link) }

.item a, .item figure, .item figcaption { flex: 1; }
.item a { text-decoration: none; color: var(--color-text); }

.item h3 {
  margin-bottom: var(--space);
  font-size: 16px;
  background-color: var(--color-primary);
  border-top: 12px solid var(--color-link);
  color: color: var(--color-text);
  transition: color .1s linear;
}

.item p { line-height: 1.6; font-size: 15px; }

figcaption > * { padding: var(--space); }

figcaption span {
  display: block;
  margin-top: auto;
  background-color: var(--color-darklink);
  text-align: center;
  color: #f6f6f6;
  transition: background-color .1s linear;
}

#contact p, #contact span { padding-top: 0; display: block; }
#contact a:not(.button) { color: var(--color-link); text-decoration: none; }
#contact a:hover:not(.button) { color: var(--color-activelink); }
#contact img {
    max-width: 200px;
    border-radius: 10px;
    margin-top: 2rem;
}

form { font-family: 'poppins-semi', 'Helvetica', system-ui, Roboto, sans-serif; }

form button,
a.button {
  width: 100%;
  height: auto;
  margin-top: 0;
  padding: var(--space) 0;
  font-size: 1.4rem;
  border-radius: 0;
  font-size: 18px;
  font-family: 'poppins-semi', 'Helvetica', system-ui, Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background-color 0.1s linear;
  text-decoration: none;
}
.form-as { display: none; }

form button:hover,
a.button:hover { background-color: var(--color-activelink); }

label {
  padding: var(--space) 0 0;
  margin-top: var(--space);
  text-transform: uppercase;
}

label, input, textarea {
  display: block;
  width: 100%;
  font-size: 1.2rem;
}

input[type="text"], textarea {
  height: 40px;
  margin-bottom: var(--space);
  padding: var(--space);
  -webkit-appearance: none;
  box-sizing: border-box;
  border: 3px solid var(--color-primary);
  background-color: #fff;
}

#contact-notes { height: 200px; }

figure img {
  width: 100%;
  height: 130px;
  opacity: .7;
  object-fit: cover;
  object-position: top center;
  vertical-align: middle;
  transition: opacity 0.1s linear;
}

footer {
  padding: var(--gutter);
  margin: calc(2 * var(--gutter)) 0;
  justify-content: space-between;
}

footer div { flex: 1; justify-content: center; }

footer div a {
  text-decoration: none;
  padding: var(--space);
  color: var(--color-text);
  font-family: 'poppins-semi', 'Helvetica', system-ui, Roboto, sans-serif;
}

button,
a.button {
  height: 35px;
  -webkit-appearance: none;
  background-color: var(--color-primary);
  color: var(--color-text);
  border-radius: 0.4em;
  border: none;
  cursor: pointer;
  padding: 2px var(--space);
  transition: background-color 0.1s, color 0.1s;
  order: 2;
  margin: var(--gutter) auto auto;
}

@media (min-width: 40em) {
  :root { --gutter: 5.8rem; }
  header { padding: 0 0 var(--space) ; }
  nav a { margin: 0 calc(2* var(--space)); }
  nav a:last-child { margin-right: 0; }
  section h2 { margin-bottom: calc(-2 * var(--gutter)); line-height: 2; }
  .item { min-height: 380px; margin: 0;}
  figure img { height: 140px; }
  #contact p { padding-top: var(--gutter); margin-bottom: -2rem; }
  footer { flex-flow: row nowrap; margin: var(--gutter) 0 0; }
  footer div { justify-content: flex-end; }
  button { order: 1; margin: 0; }
  footer div { order: 2; }
}

@media (min-width: 50em) {
  header { flex-flow: row nowrap; justify-content: space-between; }
  main { margin: 0 auto; padding: 0; }
  section { padding: var(--gutter) var(--gutter) 0 var(--gutter); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  section + section { margin-top: var(--gutter); }
  .logo { flex-basis: auto; }
  .logo h1 { font-size: 24px; }
  nav { padding: var(--space) var(--gutter) 0 var(--space); justify-content: flex-end; }
}

@media not all and (min-resolution:.001dpcm) { @supports (-webkit-appearance:none) and (stroke-color:transparent) {
    section h2 { margin-bottom: 0; }
    #contact p { margin-bottom: 1rem; }
} }