:root {
  --primary-color: rgb(38, 53, 170);
  --text-color: rgb(55, 60, 80);
  --heading-color: var(--primary-color);
  --gradient-light: linear-gradient(0deg, rgba(255, 255, 255, 1) 0%,
    rgba(38, 53, 170, 0.1) 100%);
  --gradient-dark: linear-gradient(155deg, var(--primary-color) 0%,
    var(--primary-color-dark) 100%);
  --bg-dark-size: auto 100rem;
  --primary-color-dark: rgb(calc(38 / 3), calc(53 / 3), calc(170 / 3));
  --width: clamp(20rem, calc(80% - 2rem), 62rem);

  --base-font-size: clamp(16px, 1.2rem, 22px);
  --h1-font-size: clamp(48px, 12vw, 88px);
  --h2-font-size: clamp(32px, 8vw, 44px);
  --h3-font-size: clamp(24px, 6vw, 33px);

  --section-padding-h-normal: clamp(2rem, 3vw, 3rem);
  --section-padding-h-large: clamp(3rem, 5vw, 4rem);

  font-size: 16px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-color);
  font-family: 'Roboto Condensed', sans-serif;
  font-size: var(--base-font-size);
  margin: 0;
  padding: 0;

  main {
    flex: 1;
    padding-bottom: var(--section-padding-h-large);
    display: flow-root;
  }
}

p {
  line-height: 1.45;
  font-weight: 325;
  margin-left: 0;
  margin-right: 0;
}

strong {
  font-weight: 500;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
}

a {
  color: hsl(from var(--primary-color) h calc(s + 50) calc(l + 10));
  text-decoration: underline;
}

a:visited {
  color: hsl(from var(--primary-color) h calc(s - 25) calc(l + 10));
}

a:hover {
  color: hsl(from var(--primary-color) h calc(s + 50) calc(l + 20));
}

main.limited-width > h1,
main.limited-width > h2 {
  text-align: center;
}

/* Consistent top spacing for the first heading on content pages */
main.limited-width > h1,
main.limited-width > :first-child h1 {
  margin-top: var(--section-padding-h-normal);
}

section {
  font-size: var(--base-font-size);
  overflow: auto;
  padding: var(--section-padding-h-normal) 1rem;
  padding-bottom: var(--section-padding-h-large);

  h2, h3 {
    font-weight: 400;
    text-align: center;
  }

  h2 {
    &:first-child {
      margin-top: 0.5vw;
    }

    font-size: var(--h2-font-size);
    margin-bottom: 1.6rem;
  }

  h3 {
    font-size: var(--h3-font-size);
    margin-bottom: 0.5rem;
  }
}

/* --- Hamburger button (shared base) --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;

  svg line {
    stroke-width: 2;
    stroke-linecap: round;
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
  }
}

/* Overlay behind the slide-in panel */
.nav-overlay {
  display: none;
}

/* --- Mobile navigation (shared mechanics) --- */
@media (max-width: 768px) {
  section.header,
  main.home section.nav {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.6rem 1rem;
    position: relative;

    /* Logo link centers */
    a {
      flex: 1;
      justify-content: center;
    }

    .nav-toggle {
      display: block;
      position: absolute;
      right: 1rem;
      top: 50%;
      transform: translateY(-50%);
    }

    /* Animate hamburger to X when open */
    &.nav-open .nav-toggle {
      svg line:nth-child(1) {
        transform: rotate(45deg) translateY(29.2%);
      }
      svg line:nth-child(2) {
        opacity: 0;
      }
      svg line:nth-child(3) {
        transform: rotate(-45deg) translateY(-29.2%);
      }
    }

    .nav-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.4);
      z-index: 999;
    }

    &.nav-open .nav-overlay {
      display: block;
    }

    /* Slide-in panel from the right */
    nav {
      position: fixed;
      top: 0;
      right: 0;
      height: 100vh;
      box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
      padding: 4rem 2rem 2rem;
      z-index: 1000;
      transform: translateX(100%);
      transition: transform 0.3s ease;
      width: min(75vw, 262px);
      box-sizing: border-box;

      ul {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0;
      }

      li a {
        display: block;
        padding: 0.5rem 0;
        text-decoration: none;
        font-weight: 500;
        font-size: 1.25rem;
      }
    }

    &.nav-open nav {
      transform: translateX(0);
    }
  }

  /* Inner page colors: white on blue */
  section.header {
    .nav-toggle svg line {
      stroke: white;
    }

    nav {
      background-color: var(--primary-color);

      li a {
        color: white;
      }
    }
  }
}

section.header {
  background-color: var(--primary-color);
  padding: 0 calc((100% - var(--width)) / 2);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;

  img {
    height: 2.8rem;
  }

  a {
    align-items: center;
    color: white;
    display: inline-flex;
    gap: 0.6rem;
    justify-content: center;
    text-decoration: none;

    h1 {
      color: white;
    }
  }

  nav {
    justify-self: end;

    ul {
      list-style: none;
      display: flex;
      flex-direction: row;
      gap: 1.6rem;
    }
  }
}

footer {
  background-image: linear-gradient(-5deg, rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.9) 100%);
  font-size: 1.25rem;
  font-weight: 325;
  padding: 4rem 0 3rem;
  text-align: center;

  & > div {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 0 auto;
    width: var(--width);
    flex-direction: column;

    div:first-of-type {
      flex: 1;
      margin-bottom: 1rem;
      text-align: center;
      display: flex;
      align-items: center;
      align-self: center;

      img {
        filter: drop-shadow(0px 0px 4rem rgba(255, 255, 255, 0.5));
        display: inline;
        width: 2rem;
        vertical-align: middle;
        margin-right: 0.66rem;
      }

      strong {
        font-size: 1.5rem;
        font-weight: 600;
        color: white;
        display: inline;
        line-height: 2rem;
      }
    }

    div:first-of-type + div {
      flex: 2;
      margin-bottom: 1rem;
    }

    div:last-of-type {
      flex: 1;
      text-align: center;

      ul {
        list-style-type: none;
        padding: 0;
        margin: 0;

        li {
          font-weight: 400;
          line-height: 2;
          margin: 0;
          padding: 0;

          a {
            color: #eee;
            text-decoration: none;
          }
        }
      }
    }
  }

  a,
  a:visited {
    color: #eee;
    text-decoration: none;
  }

  nav {
    display: flex;
    gap: 1rem;
    justify-content: center;

    ul {
      list-style-type: none;
      padding: 0;
      margin: 0;

      li {
        font-weight: 400;
        line-height: 2;
        margin: 0;
        padding: 0;

        a {
          color: #eee;
          text-decoration: none;
        }
      }
    }
  }

  p.copyright {
    border-top: 1px solid #222;
    color: #666;
    font-size: medium;
    width: var(--width);
    margin: 2rem auto 0;
    padding-top: 2rem;
  }
}

:root {
  --width: calc(100% - 2rem);

  .limited-width {
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    width: var(--width);
  }
}

.logotype,
h1.logotype {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 600;
  letter-spacing: -0.05em;
  font-variant: normal;
  line-height: 120%;
}

@media (min-width: 769px) {
  section {
    h2 {
      margin-bottom: 2.2rem;
    }
  }
}

@media (min-width: 992px) {
  :root {
    --width: clamp(20rem, 80%, 62rem);

    .limited-width {
      padding-left: calc((100% - var(--width)) / 2);
      padding-right: calc((100% - var(--width)) / 2);
    }
  }

  section {
    h2 {
      margin-bottom: 2.4rem;
    }
  }

  footer {
    & > div {
      flex-direction: row;
  
      div:first-of-type {
        margin-bottom: 0;
        display: block;
        padding-left: 1rem;
        flex: 3;
        text-align: center;

        img {
          display: block;
          width: clamp(3rem, 6%, 6rem);
          margin: 0 auto;
        }

        strong {
          display: block;
          margin-top: 0.85rem;
        }
      }

      div:first-of-type + div {
        margin-bottom: 0;
        flex: 4;
      }

      div:last-of-type {
        text-align: right;
        align-self: flex-end;
        padding-right: 1rem;
        flex: 3;
      }
    }

    nav ul {
      column-count: 2;
      column-gap: 3rem;
    }
  }
}

@media (min-width: 1022px) {
  section {
    padding-left: 0;
    padding-right: 0;
  }
}