html {
  display: grid;
  justify-content: center;
}

body {
  display: grid;
  grid-template-rows: auto 1fr;
  font-family: monospace;
  font-size: 16px;
  line-height: 1.5;
  min-width: 23rem;
  margin: 0;
  padding: 0;
}

header {
  section {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    margin-left: calc(-50vw + 50%);

    h1 {
      text-align: center;
      font-size: 2rem;
      font-weight: bold;
      margin: 1.5rem 0;
      background: linear-gradient(135deg, #00bcd4, #0097a7);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);

      a {
        text-decoration: none;
        color: inherit;
        background: inherit;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }
    }

    form {
      position: absolute;
      right: 1rem;
      top: 50%;
      transform: translateY(-50%);
    }
  }

  nav {
    ul {
      display: grid;
      list-style: none;
      padding: 0.75rem 0;
      margin: 0;
      grid-template-columns: 1fr 1fr 1fr 1fr;
      gap: 0.5rem;
      font-size: 1rem;
      border-top: 1px solid #808080;
      border-bottom: 1px solid #808080;
      width: 100vw;
      margin-left: calc(-50vw + 50%);

      li {
        display: flex;
        justify-content: center;
      }

      a {
        background-color: aqua;
        color: black;
        padding: 0.5rem 1rem;
        text-decoration: none;
        border-radius: 4px;
        text-align: center;
        min-width: 4rem;
        transition: background-color 0.2s ease;
      }

      a:hover {
        background-color: #00cccc;
      }
    }
  }

  section form {
    display: flex;
    gap: 0.5rem;
    align-items: center;

    a,
    button {
      font-family: monospace;
      border: 1px solid #808080;
      background-color: #f5f5f5;
      font-size: 14px;
      cursor: pointer;
      text-decoration: none;
      color: black;
      padding: 0.4rem 0.8rem;
      border-radius: 4px;
      transition: background-color 0.2s ease;
      min-height: 2.5rem;
      display: flex;
      align-items: center;
    }

    a:hover,
    button:hover {
      background-color: #e5e5e5;
    }
  }
}

@media (max-width: 600px) {
  body {
    min-width: 20rem;
  }

  header section form {
    right: 0.5rem;
  }

  header section h1 {
    font-size: 1.7rem;
    margin: 1rem 0;
  }

  header nav ul {
    padding: 0.5rem 0;
    gap: 0.25rem;
    font-size: 0.9rem;
  }

  header nav ul a {
    padding: 0.4rem 0.6rem;
    min-width: 3rem;
    font-size: 0.85rem;
  }

  header section form {
    gap: 0.25rem;
  }

  header section form a,
  header section form button {
    font-size: 12px;
    padding: 0.3rem 0.6rem;
    min-height: 2.2rem;
  }
}
