/* ---------- Reset ---------- */
*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: "Source Sans 3", sans-serif;
  font-size: 18px;
}

a {
  text-decoration: none;
  color: #333;
}

a:hover {
  color: #777;
}

li {
  list-style-type: none;
}

/* ---------- Layout ---------- */
.site-container {
  width: 100%;
}

.inner {
  padding: 0 20px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-header {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* ---------- Logo ---------- */
.site-logo {
  flex-basis: 70%;
}

.logo-text {
  display: flex;
  flex-flow: column;
  line-height: 1;
  padding: 24px 0;
}

.logo-title {
  font-size: 22px;
  font-weight: 600;
  display: block;
  width: 100%;
}

.logo-description {
  font-size: 15px;
  font-weight: normal;
  display: block;
  width: 100%;
}

/* ---------- Toggle button ---------- */
.toggle-btn {
  flex-basis: 30%;
  display: flex;
  align-items: center;
  justify-content: end;
  cursor: pointer;
  user-select: none;                          /* text cannot be selected */
  -webkit-user-select: none;                  /* same, for Safari / iPhone */
  -webkit-tap-highlight-color: transparent;   /* removes the colored flash when tapping */
}

.toggle-btn-wrapper {
  height: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.toggle-btn-label {
  margin-left: 10px;
}

.toggle-btn-bar {
  display: block;
  height: 2px;
  background-color: #333;
  width: 18px;
  transition: translate 0.1s ease, rotate 0.1s ease, scale 0.1s ease;
}

/* CLOSING (back to hamburger) */
.btn-bar-1,
.btn-bar-3 {
  transition-delay: 0.2s, 0s, 0s; /* translate, rotate, scale */
}

.btn-bar-2 {
  transition-delay: 0s, 0s, 0.1s;
}

/* OPENING (when .active is added) */

/* Top and bottom bars move to the middle, then rotate */
.toggle-btn.active .btn-bar-1 {
  translate: 0 5.5px;
  rotate: 45deg;
  transition-delay: 0s, 0.2s, 0s;
}

.toggle-btn.active .btn-bar-3 {
  translate: 0 -5.5px;
  rotate: -45deg;
  transition-delay: 0s, 0.2s, 0s;
}

/* Middle bar shrinks */
.toggle-btn.active .btn-bar-2 {
  scale: 0 1;
  transition-delay: 0s, 0s, 0.1s;
}

/* ---------- Navigation (mobile first) ---------- */
.header-nav {
  display: grid;
  grid-template-rows: 0fr;   /* height 0 = closed */
  opacity: 0;
  visibility: hidden;
  flex-basis: 100%;
  transition:
    grid-template-rows 0.3s ease,
    opacity 0.3s ease,
    visibility 0s linear 0.3s;   /* hide links after the animation ends */
}

.header-nav.open {
  grid-template-rows: 1fr;   /* full height = open */
  opacity: 1;
  visibility: visible;
  transition:
    grid-template-rows 0.3s ease,
    opacity 0.3s ease,
    visibility 0s linear 0s;
}

.header-nav .nav-menu {
  overflow: hidden;   /* hide the links while the height is small */
  min-height: 0;      /* allow the list to shrink to 0 */
}

.header-nav .menu-item {
  display: block;
  margin: 10px 0;
}

.header-nav .menu-item:last-child {
  margin-bottom: 30px;   /* space under Contact */
}

/* ---------- Desktop (768px and wider) ---------- */
@media screen and (min-width: 768px) {

  .site-logo {
    flex-basis: auto;
  }

  .header-nav {
    display: flex;
    align-items: center;
    flex-basis: auto;
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  .header-nav .nav-menu {
    display: flex;
    overflow: visible;
  }

  .header-nav .menu-item {
    display: inline-block;
    margin: 0 0 0 20px;
  }

  .header-nav .menu-item:last-child {
    margin-bottom: 0;   /* no extra space on desktop */
  }

  .toggle-btn {
    display: none;      /* no button on desktop */
  }
}